CN112528596A - Rendering method and device for special effect of characters, electronic equipment and storage medium - Google Patents

Rendering method and device for special effect of characters, electronic equipment and storage medium Download PDF

Info

Publication number
CN112528596A
CN112528596A CN202011400052.XA CN202011400052A CN112528596A CN 112528596 A CN112528596 A CN 112528596A CN 202011400052 A CN202011400052 A CN 202011400052A CN 112528596 A CN112528596 A CN 112528596A
Authority
CN
China
Prior art keywords
contour line
rendering
rendered
line segment
sequence
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011400052.XA
Other languages
Chinese (zh)
Inventor
胡俊霄
李珅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202011400052.XA priority Critical patent/CN112528596A/en
Publication of CN112528596A publication Critical patent/CN112528596A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/109Font handling; Temporal or kinetic typography
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/117Tagging; Marking up; Designating a block; Setting of attributes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/50Lighting effects

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

The disclosure relates to a rendering method, a rendering device, electronic equipment and a storage medium for a special character effect, wherein the method comprises the following steps: the method comprises the steps of performing font analysis on a character to be rendered to obtain the sequence of each feature point in a closed contour line of the character to be rendered and the coordinates of each feature point in a page, determining a first rendering sequence of each first contour line segment in a contour line according to the sequence of each feature point, and sequentially rendering each first contour line segment in the contour line of the character to be rendered at a preset frequency based on the first rendering sequence and the coordinates of the end point of each first contour line segment in the page. Therefore, the contour line segments are sequentially rendered according to the rendering sequence of the contour line segments in the contour line of the character to be rendered and the coordinates of the end points of the contour line segments in the page, so that the character is periodically rendered, and the character has a rich streamer effect.

Description

Rendering method and device for special effect of characters, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to a method and an apparatus for rendering a special character effect, an electronic device, and a storage medium.
Background
In practical application, in order to display certain characters in an attractive or prominent manner, the characters need to be rendered, the character rendering is an important direction for 3D graphic rendering, and the character rendering can be applied to various scenes such as web pages, short video applications and the like. Wherein, making the characters present the streamer effect is a way of character rendering.
At present, characters are mostly divided into one or more character blocks, and each character block of the characters is rendered during rendering, so that the characters show a streamer effect. Because the block is used as the whole for rendering, the streamer effect presented by the whole character is single.
Disclosure of Invention
The present disclosure provides a rendering method, an apparatus, an electronic device, and a storage medium for special effects of characters, so as to at least solve the problems of a rendering method of characters, a streamer effect of characters, and a single presentation effect in the related art. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, a rendering method for a text special effect is provided, including:
performing font analysis on the character to be rendered to obtain the sequence of each characteristic point in the closed contour line of the character to be rendered and the coordinate of each characteristic point in the page;
determining a first rendering sequence of each first contour line segment in the contour line according to the sequence of each feature point, wherein each first contour line segment is a line segment taking two sequentially adjacent feature points as end points;
and sequentially rendering each first contour line segment in the contour lines of the characters to be rendered at a preset frequency based on the first rendering sequence and the coordinates of the end points of each first contour line segment in the page.
In a possible implementation manner of the embodiment of the first aspect of the present disclosure, after the obtaining the sequence of each feature point in the closed contour line of the text to be rendered and the coordinates of each feature point in the page, the method further includes:
performing interpolation processing on every two adjacent feature points to obtain coordinates of interpolation points between every two adjacent feature points in the page;
determining a second rendering sequence of each second contour line segment in the contour line according to the sequence of each feature point, the coordinate of each feature point in the page and the coordinate of the interpolation point in the page, wherein each second contour line segment is a line segment with two sequentially adjacent interpolation points and/or feature points as end points;
and rendering each second contour line segment in the closed contour line of the character to be processed in sequence at a preset frequency based on the second rendering sequence and the coordinates of the end point of each second contour line segment in the page.
In a possible implementation manner of the embodiment of the first aspect of the present disclosure, the sequentially rendering each of the first contour line segments in the contour line of the text to be rendered includes:
determining the normal direction of each point in each first contour line segment according to the coordinate of the endpoint of each first contour line segment in the page;
determining the color and/or texture distribution mode of a rendering image block corresponding to each point in each first contour line segment according to the normal direction of each point in each first contour line segment, wherein the rendering image block corresponding to each point is an extended area which takes the point as a central point and symmetrically extends along the direction vertical to the first contour line segment;
and sequentially performing color and/or texture rendering on each first contour line segment in the contour line of the character to be rendered according to the color and/or texture distribution mode of the rendering image block corresponding to each first contour line segment.
In a possible implementation manner of the embodiment of the first aspect of the present disclosure, after the rendering is performed on each of the first contour line segments in the contour line of the text to be rendered in sequence, the method further includes:
acquiring a rendered image frame corresponding to each first contour line segment;
grouping the image frames corresponding to the first contour line segments according to the first rendering sequence of the first contour line segments to obtain a plurality of groups of image frames and a display sequence corresponding to the image frames;
synthesizing each group of image frames to generate each group of image frames to be displayed;
and circularly displaying each group of image frames to be displayed according to the display sequence corresponding to each group of image frames.
In a possible implementation manner of the embodiment of the first aspect of the present disclosure, after rendering each of the first contour line segments in the contour line of the text to be rendered in sequence, the method further includes:
acquiring a rendered image frame corresponding to each first contour line segment;
sequentially extracting a display area with the brightness larger than a threshold value from each image frame;
blurring the display area with the brightness larger than the threshold value to generate a blurred image;
superimposing the blurred image with the corresponding rendered image frame to generate an updated image frame;
and circularly displaying the updated image frame corresponding to each first contour line segment in the contour lines according to the first rendering sequence of each first contour line segment.
In a possible implementation manner of the embodiment of the first aspect of the present disclosure, the sequentially rendering each of the first contour line segments in the contour line of the text to be rendered includes:
sequentially extracting target rendering elements corresponding to the first contour line segments in the contour lines of the characters to be rendered from the reference image at the preset frequency;
and rendering each first contour line segment in the contour line of the character to be rendered by sequentially using the target rendering element corresponding to each first contour line segment.
In a possible implementation manner of the embodiment of the first aspect of the present disclosure, the to-be-rendered text is multiple, and the sequentially rendering, with a preset frequency, each of the first contour line segments in the contour line of the to-be-rendered text includes:
and rendering the contour line of each character to be rendered according to the frequency corresponding to each character to be rendered.
In a possible implementation manner of the embodiment of the first aspect of the present disclosure, the to-be-rendered text is multiple, and rendering frequencies corresponding to each to-be-rendered text are the same, and the rendering is performed on each of the first contour line segments in the contour lines of the to-be-rendered text sequentially at a preset frequency, including:
determining each contour line segment group contained in a plurality of contour lines corresponding to the characters to be rendered according to a first rendering sequence of each first contour line segment in the contour line of each character to be rendered, wherein the rendering sequences of each first contour line segment in each contour line segment group are the same;
sequentially extracting a target rendering element corresponding to each contour line segment group from the reference image;
and sequentially rendering each contour line segment group in a plurality of contour lines corresponding to the characters to be rendered by using the target rendering elements corresponding to each contour line segment group at the preset frequency.
In a possible implementation manner of the embodiment of the first aspect of the present disclosure, the to-be-rendered text is multiple, and the sequentially rendering, with a preset frequency, each of the first contour line segments in the contour line of the to-be-rendered text includes:
determining a rendering sequence of the plurality of characters to be rendered;
and rendering each first contour line segment in the contour line of each character to be rendered in sequence according to the rendering sequence of the characters to be rendered.
According to a second aspect of the embodiments of the present disclosure, there is provided a rendering apparatus for a text special effect, including:
the analysis module is configured to perform font analysis on the character to be rendered so as to obtain the sequence of each characteristic point in the closed contour line of the character to be rendered and the coordinate of each characteristic point in the page;
a determining module configured to determine a first rendering order of first contour line segments in the contour lines according to the order of the feature points, wherein each first contour line segment is a line segment with two sequentially adjacent feature points as end points;
and the rendering module is configured to sequentially render each first contour line segment in the contour lines of the characters to be rendered at a preset frequency based on the first rendering sequence and the coordinates of the end points of each first contour line segment in the page.
In one possible implementation manner of the embodiment of the second aspect of the present disclosure, the apparatus further includes:
the interpolation module is configured to perform interpolation processing on every two adjacent feature points to acquire coordinates of an interpolation point between every two adjacent feature points in the page;
the determining module is further configured to determine a second rendering order of second contour line segments in the contour lines according to the order of the feature points, the coordinates of the feature points in the page, and the coordinates of the interpolation points in the page, wherein each second contour line segment is a line segment with two sequentially adjacent interpolation points and/or feature points as end points;
the rendering module is further configured to sequentially render each second contour line segment in the closed contour line of the word to be processed at a preset frequency based on the second rendering order and the coordinates of the end point of each second contour line segment in the page.
In a possible implementation manner of the embodiment of the second aspect of the present disclosure, the rendering module includes:
a first determining unit, configured to determine a normal direction of each point in each first contour line segment according to the coordinate of the endpoint of each first contour line segment in the page;
the second determining unit is configured to determine a color and/or texture distribution mode of a rendering pattern block corresponding to each point in each first contour line segment according to a normal direction of each point in each first contour line segment, wherein the rendering pattern block corresponding to each point is an extended area which takes the point as a central point and symmetrically extends along a direction perpendicular to the first contour line segment;
and the first rendering unit is configured to sequentially perform color and/or texture rendering on each first contour line segment in the contour line of the character to be rendered according to the color and/or texture distribution mode of the rendering image block corresponding to each first contour line segment.
In one possible implementation manner of the embodiment of the second aspect of the present disclosure, the apparatus may further include:
a first obtaining module configured to obtain a rendered image frame corresponding to each of the first contour line segments;
the second obtaining module is configured to group the image frames corresponding to the first contour line segments according to the first rendering sequence of the first contour line segments so as to obtain a plurality of groups of image frames and a display sequence corresponding to the image frames;
the first generation module is configured to synthesize each group of image frames to generate each group of image frames to be displayed;
and the first display module is configured to circularly display each group of image frames to be displayed according to the display sequence corresponding to each group of image frames.
In one possible implementation manner of the embodiment of the second aspect of the present disclosure, the apparatus may further include:
a first obtaining module configured to obtain a rendered image frame corresponding to each of the first contour line segments;
an extraction module configured to extract a display area having a brightness greater than a threshold value from each of the image frames in turn;
a blurring processing module configured to blur the display area of which the brightness is greater than a threshold value to generate a blurred image;
a second generation module to superimpose the blurred image with the corresponding rendered image frame to generate an updated image frame;
and the second display module is configured to circularly display the updated image frames corresponding to the first contour line segments in the contour lines according to the first rendering sequence of the first contour line segments.
In a possible implementation manner of the embodiment of the second aspect of the present disclosure, the rendering module includes:
a first extraction unit, configured to sequentially extract, from a reference map, target rendering elements corresponding to the first contour line segments in the contour lines of the text to be rendered at the preset frequency;
and the second rendering unit is configured to sequentially use the target rendering element corresponding to each first contour line segment to render each first contour line segment in the contour line of the character to be rendered.
In one possible implementation manner of the embodiment of the second aspect of the present disclosure, there are a plurality of the texts to be rendered, and the rendering module is configured to:
and rendering the contour line of each character to be rendered according to the frequency corresponding to each character to be rendered.
In a possible implementation manner of the embodiment of the second aspect of the present disclosure, there are a plurality of the texts to be rendered, and rendering frequencies corresponding to the texts to be rendered are the same, where the rendering module includes:
a third determining unit, configured to determine, according to a first rendering order of each first contour line segment in the contour line of each character to be rendered, each contour line segment group included in a plurality of contour lines corresponding to the plurality of characters to be rendered, where the rendering orders of each first contour line segment in each contour line segment group are the same;
a second extraction unit configured to sequentially extract a target rendering element corresponding to each of the contour line segment groups from the reference map;
and the third rendering unit is configured to sequentially use the target rendering element corresponding to each contour line segment group to render each contour line segment group in a plurality of contour lines corresponding to the characters to be rendered according to the preset frequency.
In a possible implementation manner of the embodiment of the second aspect of the present disclosure, there are a plurality of the texts to be rendered, and the rendering module includes:
a fourth determination unit configured to determine a rendering order of the plurality of texts to be rendered;
and the fourth rendering unit is configured to sequentially render each first contour line segment in the contour line of each character to be rendered according to the rendering sequence of the characters to be rendered.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including: a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method for rendering text effects as described above.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a storage medium, wherein instructions of the storage medium, when executed by a processor of an electronic device, enable the electronic device to execute the text effect rendering method as described above.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product, which, when executed by a processor of an electronic device, enables the electronic device to perform the method for rendering text effects as described above.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects: the method comprises the steps of performing font analysis on characters to be rendered to obtain the sequence of each feature point in a closed contour line of the characters to be rendered and the coordinates of each feature point in a page, and determining a first rendering sequence of each first contour line segment in the contour line according to the sequence of each feature point, wherein each first contour line segment is a line segment with two sequentially adjacent feature points as end points, and rendering each contour line segment in the contour line of the characters to be rendered in sequence at a preset frequency based on the first rendering sequence and the coordinates of the end points of each first contour line segment in the page. Therefore, the contour line segments are sequentially rendered according to the rendering sequence of the contour line segments in the contour line of the character to be rendered and the coordinates of the end points of the contour line segments in the page, so that the character is periodically rendered, and the character has a rich streamer effect.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
Fig. 1 is a flowchart illustrating a rendering method of a text special effect according to an exemplary embodiment.
Fig. 2 is a flowchart illustrating another text effect rendering method according to an exemplary embodiment.
Fig. 3 is a flowchart illustrating another text effect rendering method according to an exemplary embodiment.
FIG. 4 is a diagram illustrating normal directions to points and rendering tiles corresponding to the points, according to an example embodiment.
Fig. 5 is a flowchart illustrating another text effect rendering method according to an exemplary embodiment.
Fig. 6 is a flowchart illustrating another method for rendering text special effects according to an example embodiment.
Fig. 7 is a flowchart illustrating another method for rendering text special effects according to an example embodiment.
Fig. 8 is a flowchart illustrating another method for rendering text special effects according to an example embodiment.
Fig. 9 is a block diagram illustrating an apparatus for rendering text effects according to an example embodiment.
FIG. 10 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Fig. 1 is a flowchart illustrating a rendering method of a text special effect according to an exemplary embodiment, where the rendering method of the text special effect includes the following steps, as shown in fig. 1.
In step 101, performing font analysis on the text to be rendered to obtain the sequence of each feature point in the closed contour line of the text to be rendered and the coordinates of each feature point in the page.
In this embodiment, the text to be rendered is text to be displayed in a page, and the text to be rendered may be subjected to real-type font analysis, for example, TTF (font name) font analysis is used to extract a closed contour line of the text to be rendered, and an order of each feature point in a closed line of the text to be rendered and a coordinate of each feature point in the page are obtained. The text to be rendered may have one contour line or a plurality of contour lines.
The sequence of the characteristic points in the closed contour line may refer to the sequence of the characteristic points on the contour line from the starting point to the end point of the contour line, and may be represented by 0, 1, 2, and so on, for example. Here, the start point and the end point of the closed contour line may be specified in advance when the character to be rendered is parsed.
When the sequence of each feature point in the closed contour line of the character to be rendered and the coordinate of each feature point in the page are obtained, uv coordinate calculation can be performed on the contour line, specifically, the ratio of the length from the starting point of the contour line to the current point to the total length is calculated, and the coordinate of the point on the contour line is determined.
In step 102, a first rendering order of first contour line segments in the contour line is determined according to the order of the feature points, wherein each first contour line segment is a line segment with two sequentially adjacent feature points as endpoints.
In this embodiment, after the sequence of each feature point on the closed contour line of the text to be rendered is obtained, a contour line between two feature points adjacent in sequence may be used as a contour line segment, which is referred to as a first contour line segment for convenience of description. Thus, the contour line can be divided into a plurality of first contour line segments, wherein each first contour line segment is a line segment with two sequentially adjacent feature points as end points.
Since the two endpoints of the first contour line segment are two feature points that are adjacent in sequence, the sequence of each contour line segment in the contour line can be determined according to the sequence of each feature point in the contour line, the sequence of each first contour line segment in the contour line can be used as the rendering sequence of each first contour line segment in the contour line, and the rendering sequence corresponding to each first contour line segment is referred to as the first rendering sequence.
For example, the order of 5 feature points in a contour line is p1, p2, p3, p4, and p5, where p1 and p2 are used as endpoints to obtain a contour line segment L1, p2 and p3 are used as endpoints to obtain a contour line segment L2, p3 and p4 are used as endpoints to obtain a contour line segment L3, and p4 and p5 are used as endpoints to obtain a contour line segment L4. Then, from the order of 5 feature points, the rendering order of the 4 contour line segments may be determined to be L1, L2, L3, L4.
In step 103, rendering is performed on each first contour line segment in the contour line of the text to be rendered in sequence at a preset frequency based on the first rendering order and the coordinates of the end point of each first contour line segment in the page.
In this embodiment, the position of each first contour line segment may be determined according to the coordinates of the end point of each first contour line segment in the page, and each first contour line segment in the contour lines of the characters to be rendered is sequentially rendered at a preset frequency according to the first rendering sequence of each first contour line segment in the contour lines.
The preset frequency is the reciprocal of the time interval between two adjacent first contour line segments to be rendered, and can be set according to requirements.
In this embodiment, when rendering each first contour line segment, the rendering effect of each first contour line segment may be the same or different. For example, the color or texture rendered by two adjacent first contour line segments is different.
The rendering method of the character special effect can be applied to rendering of the character scene special effect in the short video, and by the aid of the rendering method of the character special effect, various character streamer effects can be presented, abundant streamer character materials are provided for the short video character special effect, and abundant visual experience is provided for users.
In the embodiment of the disclosure, through performing font analysis on a character to be rendered, the sequence of each feature point in a closed contour line of the character to be rendered and the coordinates of each feature point in a page are obtained, and according to the sequence of each feature point, a first rendering sequence of each first contour line segment in the contour line is determined, wherein each first contour line segment is a line segment using two feature points adjacent in sequence as end points, and each first contour line segment in the contour line of the character to be rendered is rendered in sequence at a preset frequency based on the first rendering sequence and the coordinates of the end points of each first contour line segment in the page. Therefore, the contour line segments are sequentially rendered according to the rendering sequence of the contour line segments in the contour line of the character to be rendered and the coordinates of the end points of the contour line segments in the page, so that the character is periodically rendered, and the character has a rich streamer effect.
In order to further enrich the rendering effect of the characters, in one embodiment of the disclosure, after the sequence of the feature points in the contour line and the coordinates of each feature point in the page are obtained, an interpolation point may be added between every two adjacent feature points to increase the number of contour line segments in the contour line, the rendering sequence of each contour line segment is determined based on the sequence of the feature points and the interpolation points, and each contour line segment is rendered based on the determined rendering sequence. Fig. 2 is a flowchart illustrating another text effect rendering method according to an exemplary embodiment, and is described in conjunction with fig. 2.
As shown in fig. 2, the rendering method of the text special effect includes:
step 201, performing font analysis on the character to be rendered to obtain the sequence of each feature point in the closed contour line of the character to be rendered and the coordinates of each feature point in the page.
In this embodiment, TTF font analysis may be performed on the text to be rendered, the closed contour line of the text to be rendered is extracted, and the sequence of each feature point in the closed line of the text to be rendered and the coordinates of each feature point in the page are obtained. The feature points can be understood as points obtained by analyzing the characters to be rendered by using TTF font analysis.
Step 202, performing interpolation processing on every two adjacent feature points to obtain coordinates of an interpolation point between every two adjacent feature points in the page.
Because the number of the feature points is limited, in order to enrich the rendering effect, after the sequence of each feature point in the contour line and the coordinates of each feature point in the page are obtained, interpolation processing can be carried out on every two adjacent feature points so as to obtain the coordinates of the interpolation point between every two adjacent feature points in the page. The number of interpolation points between two adjacent feature points may be one or more.
Specifically, the coordinates of the interpolation points between two adjacent feature points may be calculated by using an OpenGL (Open Graphics Library) pipeline interpolation method, and the order of the interpolation points between two adjacent feature points may be determined according to the order of the two adjacent feature points.
The sequence of the interpolation points between two adjacent feature points can be represented by a sequence identifier, and the sequence identifier is used for representing the sequence between each interpolation point. For example, 1 and 2 are sequential identifications of two adjacent feature points, then the sequential identifications of interpolation points between the two adjacent feature points may be 121, 122, 123, and so on.
Step 203, determining a second rendering sequence of each second contour line segment in the contour line according to the sequence of each feature point, the coordinate of each feature point in the page and the coordinate of the interpolation point in the page.
In this embodiment, the contour line between two sequentially adjacent feature points and/or interpolation points may be used as the second contour line segment. In this way, the contour line can be divided into a plurality of second contour line segments, wherein each second contour line segment is a line segment with two sequentially adjacent feature points and/or interpolation points as end points.
Since the two end points of the second contour line segments are sequentially adjacent, the order of each second contour line segment in the contour line can be determined according to the order of the respective feature points and interpolation points in the contour line, and the order of the respective second contour line segments in the contour line can be used as the second rendering order of the respective second contour line segments in the contour line.
For example, if the order of interpolation points between two feature points p1 and p2 that are adjacent in sequence is c1 and c2, the contour line segment d1 can be obtained by using the feature point p1 and the interpolation point c1 as end points, the contour line segment d2 can be obtained by using the interpolation point c1 and the interpolation point c2 as end points, and the contour line segment d3 can be obtained by using the interpolation point c2 and the feature point p2 as end points. Wherein the sequence of the 3 contour line segments is d1, d2 and d 3.
And step 204, rendering each second contour line segment in the closed contour line of the character to be processed in sequence at a preset frequency based on the second rendering sequence and the coordinates of the end point of each second contour line segment in the page.
In this embodiment, step 204 is similar to step 103 described above and therefore will not be described herein again.
In the embodiment of the disclosure, after the sequence of each feature point in the closed contour line of the character to be rendered and the coordinates of each feature point in the page are obtained, and also can make interpolation treatment for every two adjacent characteristic points to obtain the coordinate of interpolation point between every two adjacent characteristic points in the page, determining a second rendering sequence of each second contour line segment in the contour line according to the sequence of each feature point, the coordinates of each feature point in the page and the coordinates of the interpolation points in the page, wherein each second contour line segment is a line segment with two sequentially adjacent interpolation points and/or feature points as end points, and based on the second rendering sequence and the coordinates of the end points of each second contour line segment in the page, with a preset frequency, and rendering each second contour line segment in the closed contour line of the character to be processed in sequence. Therefore, interpolation processing is carried out on the basis of every two adjacent feature points, a plurality of interpolation points are obtained, the number of contour line segments in the contour lines is increased by adding the interpolation points, the contour lines are divided more finely, and the character rendering effect is further enriched.
In an embodiment of the present disclosure, when the first contour line segments in the contour line of the text to be rendered are rendered in sequence, a color and/or texture distribution manner of a rendering pattern block corresponding to each point in each first contour line segment may be determined according to a normal direction of each point in each first contour line segment, and the rendering is performed according to the color and/or texture distribution manner. Fig. 3 is a flowchart illustrating another text effect rendering method according to an exemplary embodiment.
As shown in fig. 3, the rendering method of the text special effect includes:
in step 301, the normal direction of each point in each first contour line segment is determined according to the coordinates of the end point of each first contour line segment in the page.
In this embodiment, for each first contour line segment, a tangent line of a contour line where each point in the first contour line segment is located is determined according to a coordinate of an end point of the first contour line segment in the page, and a normal direction of each point in the first contour line segment is determined according to the tangent line of the contour line where each point is located. Wherein, the normal line of the contour line of the same point is perpendicular to the tangent line.
In step 302, according to the normal direction of each point in each first contour line segment, the color and/or texture distribution mode of the rendering image block corresponding to each point in each first contour line segment is determined.
In order to make the color or texture of a text richer, the embodiments of the present disclosure may regard the outline of a text as an area having a certain width and a change in the color or texture in the width direction when rendering the text.
Specifically, each point in each first contour line segment corresponds to one rendering segment, and the rendering segment corresponding to each point is an extended region which takes the point as a central point and symmetrically extends along the direction perpendicular to the contour line segment.
FIG. 4 is a diagram illustrating normal directions to points and rendering tiles corresponding to the points, according to an example embodiment. In fig. 4, the character to be rendered is C, the arrow direction in fig. 4 indicates the normal direction of the contour line where the point a1 is located, and the rendering segment is an extended region that extends symmetrically in the direction perpendicular to the contour line segment with the point a1 as the center point.
In this embodiment, the color distribution mode of the rendering pattern block corresponding to each point, or the texture distribution mode of the rendering pattern block, or the color distribution mode and the texture distribution mode of the rendering pattern block may be determined according to the normal direction of each point in each first contour line segment. The color distribution manner may be that the color of the rendering tile gradually changes along the normal direction, for example, the color of the rendering tile gradually increases or gradually decreases along the normal direction.
Since the normal directions of the respective points are mostly different, and the normal directions are different, the color and/or texture distribution modes of rendering tiles at different points are also different.
In step 303, color and/or texture rendering is sequentially performed on each first contour line segment in the contour line of the character to be rendered according to the color and/or texture distribution mode of the rendering image block corresponding to each first contour line segment.
After the color and/or texture distribution mode of the rendering pattern block corresponding to each point in each first contour line segment is determined, color and/or texture rendering can be sequentially performed on each first contour line segment in the contour line of the character to be rendered at a preset frequency according to the color and/or texture distribution mode of the rendering pattern block corresponding to each first contour line segment.
When each first contour line segment is rendered, rendering is carried out on the rendering image blocks corresponding to each point according to the distributed color and/or texture of the rendering image blocks corresponding to each point in the first contour line segment, and therefore the first contour line segment is rendered in color and/or texture.
It can be understood that, during rendering, the color of the first contour line segment may be rendered according to the color distribution manner of the rendering pattern blocks corresponding to each point in the first contour line segment, the texture of the first contour line segment may also be rendered according to the texture distribution manner of the rendering pattern blocks corresponding to each point in the first contour line segment, and both the color and the texture of the first contour line segment may also be rendered according to the color distribution manner and the texture distribution manner of the rendering pattern blocks corresponding to each point in the first contour line segment.
It should be noted that, if interpolation processing is performed between every two adjacent feature points to obtain an interpolation point, and each second contour line segment in the contour line is obtained based on the interpolation point and the feature point, the rendering method of this embodiment is also applicable to each second contour line segment.
In the embodiment of the disclosure, when rendering is performed in sequence on each first contour line segment in the contour line of the character to be rendered, the normal direction of each point in each first contour line segment may be determined according to the coordinate of the endpoint of each first contour line segment in the page, the color and/or texture distribution mode of the rendering image block corresponding to each point in each first contour line segment may be determined according to the normal direction of each point in each first contour line segment, and the color and/or texture rendering is performed in sequence on each first contour line segment in the contour line of the character to be rendered according to the color and/or texture distribution mode of the rendering image block corresponding to each first contour line segment. Therefore, the contour lines of the characters can be regarded as areas with certain width and changed colors or textures in the width direction, and the characters to be rendered are rendered according to the color and/or texture distribution mode of the rendering image blocks corresponding to each point in each contour line segment, so that the colors and/or textures of the characters are richer.
In order to further enrich the display effect of the characters, in an embodiment of the disclosure, after each first contour line segment in the contour line of the characters to be rendered is rendered in sequence, a plurality of image frames can be synthesized and displayed, so that the display effect with richer colors or textures is achieved. Fig. 5 is a flowchart illustrating another text effect rendering method according to an exemplary embodiment, and is described in conjunction with fig. 5.
As shown in fig. 5, after rendering each first contour line segment in the contour line of the text to be rendered in sequence, the method further includes:
in step 501, a rendered image frame corresponding to each first contour line segment is obtained.
In this embodiment, rendering each first contour line segment in the contour line of the text to be rendered may generate one or more image frames for each first contour line segment. Wherein each image frame contains an image of the corresponding first contour line segment as it is rendered.
In step 502, according to the first rendering order of each first contour line segment, the image frames corresponding to each first contour line segment are grouped to obtain a plurality of groups of image frames and a display order corresponding to each group of image frames.
In this embodiment, according to the first rendering order of each first contour line segment, the image frames corresponding to the adjacent first contour line segments are divided into one group, and a plurality of groups of image frames and a display order corresponding to each group of image frames can be obtained.
When grouping, the number of groups and the number of image frames contained in each group can be determined according to needs, so that the grouping mode can be enriched.
For example, there are 6 first contour line segments in the contour line, and the rendering order of the first contour line segments is a, b, c, d, e, f, g. When grouping, the image frames corresponding to the first contour segments a and b may be grouped into a group, referred to as group g 1; dividing the image frames corresponding to the first contour line segments c, d and e into a group, namely a group g 2; the image frames corresponding to the first contour segments f, g, respectively, are grouped into a group, referred to as group g 3. Thus, 3 groups of image frames can be acquired, wherein the display order of the 3 groups of image frames is g1, g2 and g 3.
In step 503, each set of image frames is synthesized to generate each set of image frames to be displayed.
After acquiring a plurality of groups of image frames, each group of image frames can be synthesized to obtain each group of image frames to be displayed. When each group of image frames is synthesized, a plurality of image frames may be superimposed, or one image frame to be displayed may be extracted from the plurality of image frames.
In step 504, each group of image frames to be displayed is displayed in a loop according to the display sequence corresponding to each group of image frames.
Because each group of image frames to be displayed is synthesized from each group of image frames, the display sequence corresponding to each group of image frames is the display sequence of each group of image frames to be displayed. After each group of image frames to be displayed is generated, each group of image frames to be displayed can be circularly displayed at a preset frequency according to the display sequence corresponding to each group of image frames.
In this embodiment, during the display, a plurality of image frames in each group of image frames may be displayed in an overlapping manner, or a plurality of image frames may be displayed in a frame-extracting manner, specifically determined by a combination manner of each group of image frames.
It should be noted that, if interpolation processing is performed between every two adjacent feature points to obtain an interpolation point, and each second contour line segment in the contour line is obtained based on the interpolation point and the feature point, the rendering method of this embodiment is also applicable to each second contour line segment.
In the embodiment of the disclosure, after the first contour line segments in the contour lines of the characters to be rendered are rendered in sequence, rendered image frames corresponding to each first contour line segment may be obtained, the image frames corresponding to each first contour line segment are grouped according to the first rendering sequence of each first contour line segment to obtain a plurality of groups of image frames and display sequences corresponding to each group of image frames, each group of image frames is synthesized to generate each group of image frames to be displayed, and each group of image frames to be displayed is displayed in a circulating manner according to the display sequence corresponding to each group of image frames. Therefore, when the contour lines are split to be thin enough, enough contour line segments can be obtained, after rendering, the image frames corresponding to the adjacent contour line segments are synthesized and then are displayed in a circulating mode, and therefore the character can achieve the display effect of being rich in color or texture.
In order to further enrich the display effect of the characters, in an embodiment of the present disclosure, after each first contour line segment in the contour line of the characters to be rendered is rendered in sequence, a rendered image frame corresponding to each first contour line segment may be further subjected to a blurring process to generate a blurred image, the blurred image and the rendered image frame are superimposed to generate an updated image frame with a halo effect, and the updated image frame corresponding to each first contour line segment is cyclically displayed to enable the characters to present the halo effect. Fig. 6 is a flowchart illustrating another text effect rendering method according to an exemplary embodiment, and is described in conjunction with fig. 6.
As shown in fig. 6, after rendering each first contour line segment in the contour line of the text to be rendered in sequence, the method further includes:
in step 601, a rendered image frame corresponding to each first contour line segment is obtained.
In this embodiment, step 601 is similar to step 501, and therefore is not described herein again.
In step 602, display regions having a brightness greater than a threshold are sequentially extracted from each image frame.
In this embodiment, the brightness value of each pixel point in each image frame is sequentially obtained, and the display area with the brightness greater than the threshold value in each image frame is extracted according to the brightness value of each pixel point.
In step 603, a display region having a luminance greater than a threshold value is subjected to blurring processing to generate a blurred image.
For each image frame, a display area having a brightness greater than a threshold may be blurred with a blur filter to generate a blurred image. The fuzzy filter can adopt Gaussian blur, and the Gaussian blur processing is carried out on the display area with the brightness larger than the threshold value based on a Gaussian curve.
In this embodiment, a corresponding blurred image may be generated for the rendered image frame corresponding to each first contour line segment in the contour lines.
In step 604, the blurred image is superimposed with the corresponding rendered image frame to generate an updated image frame.
After the blurred image is obtained, the blurred image and the corresponding rendered image frame may be superimposed, specifically, a weighted sum of luminance values of pixels at the same position in the blurred image and the corresponding rendered image frame may be used as a luminance value of the superimposed pixel, so as to obtain an updated image frame corresponding to the first contour line segment, where the weight may be set according to actual needs. Then, an updated image frame corresponding to each first contour line segment may be generated according to the rendered image frame corresponding to each first contour line segment and the blurred image corresponding to the rendered image frame.
In this embodiment, the display area with brightness greater than the threshold value in the updated image frame exhibits a halo effect.
In step 605, the updated image frame corresponding to each first contour line segment in the contour lines is cyclically displayed according to the first rendering order of each first contour line segment.
And after the updated image frame corresponding to each first contour line segment is obtained, sequentially displaying the updated image frames corresponding to the first contour line segments in the contour lines according to the first rendering sequence of the first contour line segments, and circularly displaying.
It should be noted that the rendering method of this embodiment is also applicable to each second contour line segment, and the updated image frames corresponding to each second contour line segment in the contour lines are sequentially displayed according to the second rendering order of each second contour line segment, and are displayed in a loop.
In the embodiment of the disclosure, after the first contour line segments in the contour lines of the characters to be rendered are rendered in sequence, the rendered image frame corresponding to each first contour line segment can be obtained, the display area with the brightness larger than the threshold value is extracted from each image frame in sequence, the display area with the brightness larger than the threshold value is subjected to blurring processing to generate a blurred image, and the blurred image and the corresponding rendered image frame are overlapped to generate an updated image frame; and circularly displaying the updated image frames corresponding to the first contour line segments in the contour lines according to the first rendering sequence of the first contour line segments. Therefore, a fuzzy image is generated by blurring the display area with the brightness larger than the threshold value in the rendered image frame corresponding to each contour line segment, and the fuzzy image and the rendered image frame are overlapped to enable the display area with the brightness larger than the threshold value in the generated updated image frame to present a halo effect, so that the updated image frame corresponding to each contour line segment is rendered and displayed circularly, characters present the halo effect, and the display effect of the characters is further enriched.
In an embodiment of the present disclosure, when rendering each first contour line segment in the contour line of the text to be rendered in sequence, the method shown in fig. 7 may be adopted, and fig. 7 is a flowchart illustrating another rendering method for a special effect of the text according to an exemplary embodiment.
As shown in fig. 7, the rendering of each first contour line segment in the contour line of the text to be rendered in sequence includes:
in step 701, sequentially extracting, at a preset frequency, target rendering elements corresponding to each first contour line segment in the contour lines of the text to be rendered from the reference map.
In this embodiment, the reference map may be preset, and the reference map may include various available colors, textures, and the like. When rendering is performed, according to the rendering sequence of each first contour line segment, a preset frequency may be used to sequentially extract a target rendering element corresponding to each first contour line segment from the reference map, where the target rendering element may be a target color, a target texture, a target color and a target texture, or other elements.
For example, if the contour line of a certain character has 10 first contour line segments, the color corresponding to the 1 st first contour line segment, the color corresponding to the 2 nd first contour line segment, and the color corresponding to the 3 rd first contour line segment may be sequentially extracted from the gradient color bar at a preset frequency until the color corresponding to the 10 th first contour line segment is extracted. The colors corresponding to the first contour line segments may be the same or different.
In step 702, the target rendering element corresponding to each first contour line segment is used to render each first contour line segment in the contour line of the character to be rendered.
In this embodiment, each first contour line segment in the contour line of the text to be rendered may be rendered sequentially with the target rendering element corresponding to each first contour line segment according to the first rendering order of each first contour line segment.
For example, the target rendering element is a target color, after a target color corresponding to a first contour line segment to be currently rendered is extracted from the reference map, the target color is used to render the first contour line segment to be currently rendered, a target color corresponding to a next first contour line segment is extracted from the reference map at a preset frequency, and the extracted target color is used to render the next first contour line segment until rendering of a color of the last first contour line segment is completed.
It should be noted that the rendering method of the present embodiment is also applicable to each second contour line segment.
In the embodiment of the disclosure, when the first contour line segments in the contour line of the character to be rendered are rendered in sequence, the target rendering elements corresponding to the first contour line segments in the contour line of the character to be rendered may be sequentially extracted from the reference map at a preset frequency, and the target rendering elements corresponding to each first contour line segment are sequentially used to render the first contour line segments in the contour line of the character to be rendered. Therefore, the target rendering elements corresponding to the contour line segments are extracted from the reference picture at the preset frequency, and the target rendering elements corresponding to the contour line segments are utilized to sequentially render the contour line segments in the contour line of the character to be rendered, so that the character is subjected to circulating streamer rendering.
In an embodiment of the present disclosure, when there are a plurality of characters to be rendered, the contour line of each character to be rendered may be rendered according to a frequency corresponding to each character to be rendered.
Specifically, each first contour line segment in the contour line of each character to be rendered may be rendered in sequence according to the first rendering order of each first contour line segment in the contour line of each character to be rendered, at a frequency corresponding to each character to be rendered. For a specific rendering manner, reference may be made to the above embodiments, and therefore, detailed description thereof is omitted here.
Or, each second contour line segment of the contour line segments may also be acquired, and each second contour line segment in the contour line of each character to be rendered is rendered in sequence according to the second rendering sequence of each second contour line segment in the contour line of each character to be rendered.
In this embodiment, each character to be rendered corresponds to a frequency, the frequency is a rendering frequency of each contour line segment in the contour line of the character to be rendered, and the frequencies corresponding to each character to be rendered may be the same or different. That is to say, when there are a plurality of characters to be rendered, each contour line segment in the contour line of each character to be rendered may be rendered at different frequencies, or each contour line segment in the contour line of each character to be rendered may be rendered at the same frequency.
It should be noted that the frequency corresponding to each character to be rendered may be set according to actual needs, and this embodiment does not limit this.
In the embodiment of the disclosure, there are a plurality of characters to be rendered, and when the first contour line segments in the contour lines of the characters to be rendered are sequentially rendered at a preset frequency, the contour lines of the characters to be rendered can be rendered according to the frequency corresponding to each character to be rendered. Therefore, the method and the device can realize the streamer rendering of a plurality of characters to be rendered, and can perform rendering at different frequencies and the same frequency, thereby enriching the rendering effect of the characters.
In order to further enrich the rendering effect of the text, in an embodiment of the present disclosure, when there are a plurality of texts to be rendered and the rendering frequency corresponding to each text to be rendered is the same, the plurality of texts to be rendered may be synchronously rendered. Fig. 8 is a flowchart illustrating another text effect rendering method according to an exemplary embodiment, and is described with reference to fig. 8.
As shown in fig. 8, the sequentially rendering, at the preset frequency, each first contour line segment in the contour line of the text to be rendered includes:
step 801, determining each contour line segment group included in a plurality of contour lines corresponding to a plurality of characters to be rendered according to a first rendering sequence of each first contour line segment in the contour line of each character to be rendered, wherein the rendering sequences of each first contour line segment in each contour line segment group are the same.
In practical application, each character has a certain sequence when written, that is, each first contour line segment in the contour line of each character to be rendered has a certain sequence. In this embodiment, when there are a plurality of texts to be rendered and the rendering frequency of each text to be rendered is the same, the plurality of texts to be rendered can be rendered synchronously. The rendering frequency refers to the frequency adopted when each first contour line segment in the contour line of the character to be rendered is rendered in sequence.
Specifically, the first contour line segments with the same rendering sequence in the contour lines of the characters to be rendered can be determined according to the first rendering sequence of each first contour line segment in the contour line of each character to be rendered, and the first contour line segments with the same rendering sequence are used as a group to obtain each contour line segment group, wherein the rendering sequence of each first contour line segment in each contour line segment group is the same.
Specifically, the first contour line segments in the first order in the contour lines of the characters to be rendered are used as a group, the first contour line segments in the second order are used as a group, the first contour line segments in the third order are used as a group, and the like, so that the contour line segment groups are obtained.
Step 802, sequentially extracting the target rendering element corresponding to each contour line segment group from the reference image.
Specifically, the target rendering element corresponding to each contour line segment group may be sequentially extracted from the reference map according to the rendering order of each contour line segment group. The target rendering element may be a color, a texture, or other elements.
In this embodiment, the extracted target rendering element corresponding to each contour line segment group may be one, that is, each first contour line segment in the same contour line segment group has the same target rendering element, or the corresponding target rendering element may be extracted for each first contour line segment, for example, the color corresponding to each first contour line segment in the contour line segment group is different.
And 803, rendering each contour line segment group in a plurality of contour lines corresponding to a plurality of characters to be rendered by sequentially using the target rendering element corresponding to each contour line segment group at a preset frequency.
In this embodiment, the preset frequency may be used to synchronously render each contour line segment belonging to each contour line segment group in the contour lines of the plurality of characters to be rendered, in sequence, by using the target rendering element corresponding to each contour line segment group according to the rendering order of each contour line segment group. The preset frequency may refer to a rendering frequency of a plurality of texts to be rendered.
Specifically, a first contour line segment in the contour lines of the characters to be rendered is rendered simultaneously by using a target rendering element corresponding to a first group of contour line segments, a second contour line segment in the contour lines of the characters to be rendered is rendered simultaneously by using a target rendering element corresponding to a second group of contour line segments, and a third contour line segment in the contour lines of the characters to be rendered is rendered simultaneously by using a target rendering element corresponding to a third group of contour line segments until the synchronous rendering of the last contour line segment in the contour lines of the characters to be rendered is completed.
It should be noted that the rendering method of the present embodiment is also applicable to each second contour line segment.
In the embodiment of the disclosure, a plurality of characters to be rendered are provided, rendering frequency corresponding to each of the characters to be rendered is the same, when first contour line segments in contour lines of the characters to be rendered are sequentially rendered at a preset frequency, each contour line segment group included in a plurality of contour lines corresponding to the plurality of characters to be rendered can be determined according to a first rendering sequence of each first contour line segment in the contour lines of the characters to be rendered, a target rendering element corresponding to each contour line segment group is sequentially extracted from a reference image, and the target rendering element corresponding to each contour line segment group is sequentially used at the preset frequency to render each contour line segment group in the plurality of contour lines corresponding to the plurality of characters to be rendered. Therefore, when the characters to be rendered are multiple and the rendering frequency corresponding to each character to be rendered is the same, the contour line segments with the same sequence in the contour lines corresponding to the characters to be rendered are grouped to obtain each contour line segment group, and each contour line segment with the same sequence in the contour lines of the characters to be rendered is synchronously rendered by utilizing each contour line segment group, so that the synchronous rendering of the characters to be rendered is realized, and the rendering effect of the characters is further enriched.
In order to enrich the rendering effect of the characters, in an embodiment of the disclosure, when there are a plurality of characters to be rendered, the rendering sequence of the plurality of characters to be rendered may also be determined, and each character to be rendered is rendered in sequence according to the rendering sequence of the plurality of characters to be rendered.
Specifically, the rendering sequence of the multiple texts to be rendered may be determined according to the display positions of the multiple texts to be rendered in the page, or also according to a preset rendering sequence of the multiple texts to be rendered. For example, the rendering order of the plurality of characters to be rendered may be determined according to the display positions of the plurality of characters to be rendered from left to right and from top to bottom in the page.
After the rendering sequence of the plurality of characters to be rendered is determined, rendering can be performed on each contour line segment in the contour line of each character to be rendered in sequence according to the rendering sequence of the plurality of characters to be rendered and the frequency corresponding to each character to be rendered. In the rendering, the colors or textures, or the colors and textures, etc. of a plurality of texts to be rendered may be rendered.
For rendering each first contour line segment in the contour line of each character to be rendered, refer to the above embodiments, which are not described herein again.
It should be noted that the rendering method of the present embodiment is also applicable to each second contour line segment.
In the embodiment of the disclosure, the number of the characters to be rendered is multiple, when the contour line segments in the contour line of the characters to be rendered are rendered in sequence at a preset frequency, the rendering sequence of the characters to be rendered can be determined, and according to the rendering sequence of the characters to be rendered, the first contour line segments in the contour line of each character to be rendered are rendered in sequence. Therefore, when the characters to be rendered are multiple, the rendering sequence of the multiple characters to be rendered can be determined, the multiple characters to be rendered are sequentially rendered according to the rendering sequence of the multiple characters to be rendered, and the rendering effect of the characters is enriched.
Fig. 9 is a block diagram illustrating an apparatus for rendering text effects according to an example embodiment. Referring to fig. 9, the text special effect rendering apparatus 900 includes: parsing module 910, determining module 920, rendering module 930.
The analysis module 910 is configured to perform font analysis on the text to be rendered to obtain the sequence of each feature point in the closed contour line of the text to be rendered and the coordinates of each feature point in the page;
a determining module 920, configured to determine a first rendering order of first contour line segments in the contour line according to the order of the feature points, where each first contour line segment is a line segment with two sequentially adjacent feature points as end points;
the rendering module 930 is configured to sequentially render each first contour line segment in the contour line of the text to be rendered at a preset frequency based on the first rendering order and the coordinates of the endpoint of each first contour line segment in the page.
In a possible implementation manner of the embodiment of the present disclosure, the apparatus may further include:
the interpolation module is configured to perform interpolation processing on every two adjacent feature points so as to acquire coordinates of interpolation points between every two adjacent feature points in the page;
the determining module 920 is further configured to determine a second rendering order of second contour line segments in the contour line according to the order of the feature points, the coordinates of each feature point in the page, and the coordinates of the interpolation points in the page, where each second contour line segment is a line segment with two sequentially adjacent interpolation points and/or feature points as end points;
the rendering module 930 is further configured to sequentially render each second contour line segment in the closed contour line of the to-be-processed text at a preset frequency based on the second rendering order and the coordinates of the endpoint of each second contour line segment in the page.
In a possible implementation manner of this disclosure, the rendering module 930 includes:
a first determining unit configured to determine a normal direction of each point in each first contour line segment according to coordinates of an end point of each first contour line segment in the page;
the second determining unit is configured to determine a color and/or texture distribution mode of a rendering block corresponding to each point in each first contour line segment according to the normal direction of each point in each first contour line segment, wherein the rendering block corresponding to each point is an extended area which takes the point as a central point and symmetrically extends along the direction vertical to the first contour line segment;
and the first rendering unit is configured to sequentially perform color and/or texture rendering on each first contour line segment in the contour line of the character to be rendered according to the color and/or texture distribution mode of the rendering image block corresponding to each first contour line segment.
In a possible implementation manner of the embodiment of the present disclosure, the apparatus may further include:
a first obtaining module configured to obtain a rendered image frame corresponding to each first contour line segment;
the second obtaining module is configured to group the image frames corresponding to the first contour line segments according to the first rendering sequence of the first contour line segments so as to obtain a plurality of groups of image frames and a display sequence corresponding to the image frames;
the first generation module is configured to synthesize each group of image frames to generate each group of image frames to be displayed;
and the first display module is configured to circularly display each group of image frames to be displayed according to the display sequence corresponding to each group of image frames.
In a possible implementation manner of the embodiment of the present disclosure, the apparatus may further include:
a first obtaining module configured to obtain a rendered image frame corresponding to each first contour line segment;
an extraction module configured to extract a display area having a brightness greater than a threshold value from each image frame in turn;
a blurring processing module configured to blur a display area having a brightness greater than a threshold value to generate a blurred image;
a second generation module to superimpose the blurred image with the corresponding rendered image frame to generate an updated image frame;
and the second display module is configured to circularly display the updated image frames corresponding to the first contour line segments in the contour lines according to the first rendering sequence of the first contour line segments.
In a possible implementation manner of the embodiment of the present disclosure, the rendering module 930 includes:
the first extraction unit is configured to sequentially extract target rendering elements corresponding to the first contour line segments in the contour lines of the characters to be rendered from the reference image at a preset frequency;
and the second rendering unit is configured to render each first contour line segment in the contour line of the character to be rendered by sequentially using the target rendering element corresponding to each first contour line segment.
In a possible implementation manner of this disclosure, there are a plurality of the texts to be rendered, and the rendering module 930 is configured to:
and rendering the contour line of each character to be rendered according to the frequency corresponding to each character to be rendered.
In a possible implementation manner of the embodiment of the present disclosure, there are a plurality of texts to be rendered, and rendering frequency corresponding to each text to be rendered is the same, where the rendering module 930 includes:
a third determining unit, configured to determine, according to a first rendering order of each first contour line segment in the contour line of each character to be rendered, each contour line segment group included in a plurality of contour lines corresponding to a plurality of characters to be rendered, where the rendering orders of each first contour line segment in each contour line segment group are the same;
a second extraction unit configured to sequentially extract a target rendering element corresponding to each of the contour line segment groups from the reference map;
and the third rendering unit is configured to sequentially render each contour line segment group in a plurality of contour lines corresponding to the plurality of characters to be rendered by using the target rendering element corresponding to each contour line segment group at a preset frequency.
In a possible implementation manner of this disclosure, there are a plurality of texts to be rendered, and the rendering module 930 includes:
a fourth determination unit configured to determine a rendering order of the plurality of texts to be rendered;
and the fourth rendering unit is configured to sequentially render each first contour line segment in the contour line of each character to be rendered according to the rendering sequence of the characters to be rendered.
It should be noted that the main execution body of the rendering method for special text effects of the present disclosure is an electronic device. The rendering device for the text special effects in the embodiments of the present disclosure may be configured in any electronic device to execute the rendering method for the text special effects in the embodiments of the present disclosure. Therefore, with regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated herein.
The rendering device for the special effect of the characters, provided by the embodiment of the disclosure, performs font analysis on the characters to be rendered to obtain the sequence of each feature point in a closed contour line of the characters to be rendered and the coordinate of each feature point in a page, and determines a first rendering sequence of each first contour line segment in the contour line according to the sequence of each feature point, wherein each first contour line segment is a line segment using two feature points adjacent in sequence as end points, and renders each first contour line segment in the contour line of the characters to be rendered in sequence at a preset frequency based on the first rendering sequence and the coordinate of the end point of each first contour line segment in the page. Therefore, the contour line segments are sequentially rendered according to the rendering sequence of the contour line segments in the contour line of the character to be rendered and the coordinates of the end points of the contour line segments in the page, so that the character is periodically rendered, and the character has a rich streamer effect.
FIG. 10 is a block diagram illustrating an electronic device 1000 for rendering of text effects, according to an example embodiment.
As shown in fig. 10, the electronic device 1000 includes:
a memory 1010 and a processor 1020, a bus 1030 connecting different components (including the memory 1010 and the processor 1020), wherein the memory 1010 stores a computer program, and when the processor 1020 executes the computer program, the method for rendering the text special effect according to the embodiment of the disclosure is implemented.
Bus 1030 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
The electronic device 1000 typically includes a variety of electronic device readable media. Such media may be any available media that is accessible by electronic device 1000 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 1010 may also include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)1040 and/or cache memory 1050. The electronic device 1000 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 1060 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 10, commonly referred to as a "hard disk drive"). Although not shown in FIG. 10, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be connected to bus 1030 by one or more data media interfaces. Memory 1010 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the disclosure.
Program/utility 1080 having a set (at least one) of program modules 1070 may be stored, for example, in memory 1010, such program modules 1070 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 1070 generally perform the functions and/or methods of the embodiments described in this disclosure.
The electronic device 1000 may also communicate with one or more external devices 1090 (e.g., keyboard, pointing device, display 1091, etc.), with one or more devices that enable a user to interact with the electronic device 1000, and/or with any devices (e.g., network card, modem, etc.) that enable the electronic device 1000 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 1092. Also, the electronic device 800 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the internet) via the network adapter 1093. As shown, the network adapter 1093 communicates with the other modules of the electronic device 1000 via the bus 1030. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the electronic device 1000, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processor 1020 executes various functional applications and data processing by executing programs stored in the memory 1010.
The electronic device provided by the embodiment of the disclosure can execute the rendering method of the special effect of the character, and perform font analysis on the character to be rendered to obtain the sequence of each feature point in the closed contour line of the character to be rendered and the coordinate of each feature point in the page, and determine the first rendering sequence of each first contour line segment in the contour line according to the sequence of each feature point, wherein each first contour line segment is a line segment with two feature points adjacent in sequence as end points, and each first contour line segment in the contour line of the character to be rendered is sequentially rendered at a preset frequency based on the first rendering sequence and the coordinate of the end point of each first contour line segment in the page. Therefore, the contour line segments are sequentially rendered according to the rendering sequence of the contour line segments in the contour line of the character to be rendered and the coordinates of the end points of the contour line segments in the page, so that the character is periodically rendered, and the character has a rich streamer effect.
In order to implement the above embodiments, the present disclosure also provides a storage medium.
Wherein the instructions in the storage medium, when executed by a processor of the electronic device, enable the electronic device to perform the method for rendering text effects as described above.
To implement the foregoing embodiments, the present disclosure also provides a computer program product, which when executed by a processor of an electronic device, enables the electronic device to execute the rendering method of text special effects as described above.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A rendering method of a character special effect is characterized by comprising the following steps:
performing font analysis on the character to be rendered to obtain the sequence of each characteristic point in the closed contour line of the character to be rendered and the coordinate of each characteristic point in the page;
determining a first rendering sequence of each first contour line segment in the contour line according to the sequence of each feature point, wherein each first contour line segment is a line segment taking two sequentially adjacent feature points as end points;
and sequentially rendering each first contour line segment in the contour lines of the characters to be rendered at a preset frequency based on the first rendering sequence and the coordinates of the end points of each first contour line segment in the page.
2. The method of claim 1, wherein after the obtaining the sequence of the feature points in the closed contour line of the text to be rendered and the coordinates of each feature point in the page, the method further comprises:
performing interpolation processing on every two adjacent feature points to obtain coordinates of interpolation points between every two adjacent feature points in the page;
determining a second rendering sequence of each second contour line segment in the contour line according to the sequence of each feature point, the coordinate of each feature point in the page and the coordinate of the interpolation point in the page, wherein each second contour line segment is a line segment with two sequentially adjacent interpolation points and/or feature points as end points;
and rendering each second contour line segment in the closed contour line of the character to be processed in sequence at a preset frequency based on the second rendering sequence and the coordinates of the end point of each second contour line segment in the page.
3. The method of claim 1, wherein the rendering of each of the first contour line segments in the contour line of the text to be rendered in sequence comprises:
determining the normal direction of each point in each first contour line segment according to the coordinate of the endpoint of each first contour line segment in the page;
determining the color and/or texture distribution mode of a rendering image block corresponding to each point in each first contour line segment according to the normal direction of each point in each first contour line segment, wherein the rendering image block corresponding to each point is an extended area which takes the point as a central point and symmetrically extends along the direction vertical to the first contour line segment;
and sequentially performing color and/or texture rendering on each first contour line segment in the contour line of the character to be rendered according to the color and/or texture distribution mode of the rendering image block corresponding to each first contour line segment.
4. The method of claim 1, wherein after the sequentially rendering each of the first contour line segments in the contour line of the text to be rendered, further comprising:
acquiring a rendered image frame corresponding to each first contour line segment;
grouping the image frames corresponding to the first contour line segments according to the first rendering sequence of the first contour line segments to obtain a plurality of groups of image frames and a display sequence corresponding to the image frames;
synthesizing each group of image frames to generate each group of image frames to be displayed;
and circularly displaying each group of image frames to be displayed according to the display sequence corresponding to each group of image frames.
5. The method of claim 1, wherein after the sequentially rendering each of the first contour line segments in the contour line of the text to be rendered, further comprising:
acquiring a rendered image frame corresponding to each first contour line segment;
sequentially extracting a display area with the brightness larger than a threshold value from each image frame;
blurring the display area with the brightness larger than the threshold value to generate a blurred image;
superimposing the blurred image with the corresponding rendered image frame to generate an updated image frame;
and circularly displaying the updated image frame corresponding to each first contour line segment in the contour lines according to the first rendering sequence of each first contour line segment.
6. The method according to any one of claims 1 to 5, wherein said rendering each of said first contour line segments in the contour line of said text to be rendered in sequence comprises:
sequentially extracting target rendering elements corresponding to the first contour line segments in the contour lines of the characters to be rendered from the reference image at the preset frequency;
and rendering each first contour line segment in the contour line of the character to be rendered by sequentially using the target rendering element corresponding to each first contour line segment.
7. The method according to any one of claims 1 to 5, wherein there are a plurality of the characters to be rendered, and the step of sequentially rendering each of the first contour line segments in the contour line of the characters to be rendered at a predetermined frequency comprises:
and rendering the contour line of each character to be rendered according to the frequency corresponding to each character to be rendered.
8. A rendering apparatus for a special effect of a character, comprising:
the analysis module is configured to perform font analysis on the character to be rendered so as to obtain the sequence of each characteristic point in the closed contour line of the character to be rendered and the coordinate of each characteristic point in the page;
a determining module configured to determine a first rendering order of first contour line segments in the contour lines according to the order of the feature points, wherein each first contour line segment is a line segment with two sequentially adjacent feature points as end points;
and the rendering module is configured to sequentially render each first contour line segment in the contour lines of the characters to be rendered at a preset frequency based on the first rendering sequence and the coordinates of the end points of each first contour line segment in the page.
9. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method of rendering text effects of any of claims 1-7.
10. A storage medium in which instructions, when executed by a processor of an electronic device, enable the electronic device to perform a method of rendering a text effect according to any one of claims 1-7.
CN202011400052.XA 2020-12-01 2020-12-01 Rendering method and device for special effect of characters, electronic equipment and storage medium Pending CN112528596A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011400052.XA CN112528596A (en) 2020-12-01 2020-12-01 Rendering method and device for special effect of characters, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011400052.XA CN112528596A (en) 2020-12-01 2020-12-01 Rendering method and device for special effect of characters, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112528596A true CN112528596A (en) 2021-03-19

Family

ID=74996693

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011400052.XA Pending CN112528596A (en) 2020-12-01 2020-12-01 Rendering method and device for special effect of characters, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112528596A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113392268A (en) * 2021-03-31 2021-09-14 百果园技术(新加坡)有限公司 Special effect text rendering method and device, electronic equipment and storage medium
CN114895992A (en) * 2021-12-29 2022-08-12 厦门安胜网络科技有限公司 Component data rendering method based on data slicing and related equipment

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140098117A1 (en) * 2012-10-09 2014-04-10 Qualcomm Incorporated Multi-primitive graphics rendering pipeline
CN103810739A (en) * 2014-02-20 2014-05-21 南京师范大学 Image character morphing animation generating method
CN106204702A (en) * 2016-06-23 2016-12-07 广州视睿电子科技有限公司 3D effect generation method and system for input characters and 3D display method and system for input characters
CN109224448A (en) * 2018-09-25 2019-01-18 北京天马时空网络技术有限公司 A kind of method and apparatus of streamer rendering
CN111210486A (en) * 2020-01-07 2020-05-29 北京赤金智娱科技有限公司 Method and device for realizing streamer effect
CN111402366A (en) * 2020-03-18 2020-07-10 北京奇艺世纪科技有限公司 Character rendering method and device, electronic equipment and storage medium
CN111508041A (en) * 2019-01-31 2020-08-07 上海欧菲智能车联科技有限公司 HMI character compression and rendering method and device and electronic equipment
CN111523531A (en) * 2020-04-14 2020-08-11 北京奇艺世纪科技有限公司 Word processing method and device, electronic equipment and computer readable storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140098117A1 (en) * 2012-10-09 2014-04-10 Qualcomm Incorporated Multi-primitive graphics rendering pipeline
CN103810739A (en) * 2014-02-20 2014-05-21 南京师范大学 Image character morphing animation generating method
CN106204702A (en) * 2016-06-23 2016-12-07 广州视睿电子科技有限公司 3D effect generation method and system for input characters and 3D display method and system for input characters
CN109224448A (en) * 2018-09-25 2019-01-18 北京天马时空网络技术有限公司 A kind of method and apparatus of streamer rendering
CN111508041A (en) * 2019-01-31 2020-08-07 上海欧菲智能车联科技有限公司 HMI character compression and rendering method and device and electronic equipment
CN111210486A (en) * 2020-01-07 2020-05-29 北京赤金智娱科技有限公司 Method and device for realizing streamer effect
CN111402366A (en) * 2020-03-18 2020-07-10 北京奇艺世纪科技有限公司 Character rendering method and device, electronic equipment and storage medium
CN111523531A (en) * 2020-04-14 2020-08-11 北京奇艺世纪科技有限公司 Word processing method and device, electronic equipment and computer readable storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113392268A (en) * 2021-03-31 2021-09-14 百果园技术(新加坡)有限公司 Special effect text rendering method and device, electronic equipment and storage medium
CN114895992A (en) * 2021-12-29 2022-08-12 厦门安胜网络科技有限公司 Component data rendering method based on data slicing and related equipment

Similar Documents

Publication Publication Date Title
US7463261B1 (en) Three-dimensional image compositing on a GPU utilizing multiple transformations
US20210350601A1 (en) Animation rendering method and apparatus, computer-readable storage medium, and computer device
US20050041872A1 (en) Method for converting PowerPoint presentation files into compressed image files
WO2000013147A1 (en) System and method for combining multiple video streams
CN111221596B (en) Font rendering method, apparatus and computer readable storage medium
CN112528596A (en) Rendering method and device for special effect of characters, electronic equipment and storage medium
CN108322722B (en) Image processing method and device based on augmented reality and electronic equipment
RU2598802C2 (en) Animation playing method, device and apparatus
US20140125686A1 (en) Image rendering method and system
CN112070863A (en) Animation file processing method and device, computer readable storage medium and computer equipment
CN111681177A (en) Video processing method and device, computer readable storage medium and electronic equipment
CN104658030A (en) Secondary image mixing method and apparatus
US20230136022A1 (en) Virtual reality display device and control method thereof
CN112711729A (en) Rendering method and device based on page animation, electronic equipment and storage medium
US20200020068A1 (en) Method for viewing graphic elements from an encoded composite video stream
US9299389B2 (en) Interpretation of free-form timelines into compositing instructions
CN106709965B (en) Text display method and device based on shared surface
CN113220909B (en) Chart data processing method, device, electronic equipment and storage medium
CN115834930A (en) Video frame transmission method and device, electronic equipment and storage medium
CN113691835A (en) Video implantation method, device, equipment and computer readable storage medium
CN114374872A (en) Video generation method and device, electronic equipment and storage medium
CN106488314A (en) A kind of barrage rendering intent
CN108389208B (en) Intelligent image adaptive display method based on semantic segmentation
CN111143018A (en) Front-end image rendering method and device and electronic equipment
US11182932B2 (en) Color gradient capture from source image content

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination