A method, apparatus, device, and storage medium for generating a signed distance field image

By determining effective line segments for pixel points in have-oriented distance field images using a sorted line segment array, the method addresses inefficiencies in existing pixel position determination, enhancing the generation efficiency of these images.

CN114820875BActive Publication Date: 2025-07-15BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110121052.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-28
Publication Date
2025-07-15
Estimated Expiration
2041-01-28

AI Technical Summary

Technical Problem

When generating directed distance field images, the prior art requires a full traversal of all curve segments of each pixel point, resulting in low efficiency and affecting the overall generation efficiency.

Method used

By determining the effective line segment set corresponding to the pixel points to be processed, the internal and external position information of the pixel points is determined using the effective line segment set, avoiding full traversal of all curve segments, and using the CPU to generate a directed distance field image.

Benefits of technology

The efficiency of determining position information inside and outside pixel points is improved, thereby improving the overall generation efficiency of directed distance field images, and ensuring the consistency of images generated by different device models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114820875B_ABST
    Figure CN114820875B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method, apparatus, device, and storage medium for generating a directed distance field image. The method includes: first, determining a set of effective line segments corresponding to a pixel point to be processed; then, based on the set of effective line segments of the pixel point to be processed, determining the internal and external position information of the pixel point to be processed; and finally, after the internal and external position information of each pixel point on the undirected distance field image of the target text is determined, generating the directed distance field image of the target text. In the embodiments of the present disclosure, the internal and external position information is determined based on the set of effective line segments corresponding to the pixel point to be processed, without performing a full traversal of all curve segments of the target text. Therefore, the embodiments of the present disclosure improve the determination efficiency of the internal and external position information of the pixel point, and further improve the generation efficiency of the directed distance field image of the target text as a whole.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing, and in particular, to a method, apparatus, device, and storage medium for generating a signed distance field image. Background Art

[0002] Since the distance field image does not distort at a relatively large scale compared to ordinary bitmap text, the distance field image is more suitable for text effect processing.

[0003] Among them, the distance field image of text records the shortest distance value (also called the distance field value) of each pixel point inside and around the text to the text contour (also called the boundary); and the signed distance field image refers to a distance field image in which the distance field value of the pixel points inside the text is set to a positive number, and the distance field value of the pixel points outside the text is set to a negative number.

[0004] The method for generating a signed distance field image of text includes a line drawing stage, a shape drawing stage, and an inverse signed orientation stage of the distance field image. Among them, the line drawing stage is used to draw an unsigned distance field image of text. In the shape drawing stage, it is necessary to determine whether each pixel point in the unsigned distance field image is in the internal area or the external area of the text. Then, based on the position information of the internal and external areas of each determined pixel point, the internal area of the unsigned distance field image is subjected to inverse color processing in the inverse signed orientation stage, and finally, the signed distance field image of the text is obtained.

[0005] Specifically, in the shape drawing stage, when determining whether each pixel point in the unsigned distance field image is in the internal area or the external area of the text, it is necessary to traverse all the curve segments that make up the text to determine the curve segments that intersect with the ray emitted from the pixel point, and then determine whether the pixel point is in the internal area or the external area of the text based on the odd-even rule or the non-zero winding number rule, etc.

[0006] Since the order of magnitude of the pixel points in the unsigned distance field image that need to determine the position information of the internal and external areas is relatively large, if it is necessary to perform a full traversal of all the curve segments of the text for each pixel point to determine its internal and external position information, the processing efficiency is obviously low, and ultimately the overall generation efficiency of the signed distance field image of the text is low. Summary of the Invention

[0007] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a method, apparatus, device, and storage medium for generating a signed distance field image, which can improve the determination efficiency of whether a pixel point is in the internal area of the text, thereby improving the overall generation efficiency of the signed distance field image of the text.

[0008] In a first aspect, the present disclosure provides a method for generating a directed distance field image, the method comprising:

[0009] Determine a set of effective line segments corresponding to a pixel point to be processed; wherein, the set of effective line segments is composed of curve segments in a line segment array that intersect a ray in a preset first direction corresponding to the pixel point to be processed, the curve segments in the line segment array are obtained by splitting based on the vector contour information of the target text, and the pixel point to be processed belongs to a pixel point on the undirected distance field image of the target text;

[0010] Based on the set of effective line segments corresponding to the pixel point to be processed, determine the internal and external position information of the pixel point to be processed; wherein, the internal and external position information is used to indicate whether the pixel point to be processed is in the internal area or the external area of the target text;

[0011] Based on the internal and external position information of the pixel point to be processed, generate the directed distance field image of the target text from the undirected distance field image of the target text.

[0012] In an optional implementation manner, before determining the set of effective line segments corresponding to the pixel point to be processed, further comprising:

[0013] Based on the coordinate data of the curve segments in the line segment array in a preset second direction, sort the curve segments in the line segment array to obtain a sorted line segment array; wherein, the coordinate data in the preset second direction is the maximum value or the minimum value of the curve segments in the preset second direction, and the preset second direction is perpendicular to the preset first direction;

[0014] Correspondingly, determining the set of effective line segments corresponding to the pixel point to be processed includes:

[0015] Based on the sorted line segment array, determine the set of effective line segments corresponding to the pixel point to be processed; wherein, the set of effective line segments includes curve segments whose coordinate data in the preset second direction meet the preset effective conditions of the pixel point to be processed.

[0016] In an optional implementation manner, before determining the set of effective line segments corresponding to the pixel point to be processed, further comprising:

[0017] Determine the pixel point to be processed from the pixel points on the undirected distance field image of the target text according to a preset traversal manner; wherein, the preset traversal manner has a corresponding relationship with the preset second direction;

[0018] Correspondingly, determining the set of effective line segments corresponding to the pixel point to be processed includes:

[0019] Determine the current line segment set corresponding to the pixel point to be processed; wherein, the current line segment set is the effective line segment set corresponding to the previous pixel point to be processed of the pixel point to be processed or a line segment set initialized to be empty;

[0020] Based on the sorted line segment array and the current line segment set, determine the effective line segment set corresponding to the pixel point to be processed, and update the current line segment set by using the effective line segment set;

[0021] After determining the inside and outside position information of the pixel point to be processed based on the effective line segment set corresponding to the pixel point to be processed, it further includes:

[0022] Judge whether the determination of the inside and outside position information of all pixel points on the unsigned distance field image of the target text is completed. If not, execute the step of determining the pixel point to be processed from the pixel points on the unsigned distance field image of the target text according to the preset traversal method.

[0023] In an optional implementation manner, before determining the effective line segment set corresponding to the pixel point to be processed, it further includes:

[0024] Store the curve segments in the line segment array with a radian value less than a preset radian threshold or a length less than a preset length threshold as straight line segments;

[0025] Generate an unsigned distance field image of the target text based on the line segment array; wherein, the distance field value of each pixel point on the unsigned distance field image is the shortest distance from the pixel point to the curve segment or straight line segment in the line segment array.

[0026] In an optional implementation manner, before generating the unsigned distance field image of the target text based on the line segment array, it further includes:

[0027] Convert the curve segments belonging to the cubic Bezier curve in the line segment array into quadratic Bezier curves.

[0028] In an optional implementation manner, before determining the effective line segment set corresponding to the pixel point to be processed, it further includes:

[0029] Determine whether the pixel point to be processed is in the internal area of the already drawn text;

[0030] If not, execute the step of determining the effective line segment set corresponding to the pixel point to be processed.

[0031] In an alternative embodiment, the preset first direction is the x-axis direction in a pre-constructed two-dimensional coordinate system, and the preset second direction is the y-axis direction in the two-dimensional coordinate system; the preset traversal method is a traversal method along the x-axis direction first and then along the y-axis direction; the preset valid condition is that the y-axis coordinate value of the pixel point to be processed is included between the maximum value and the minimum value in the preset second direction.

[0032] In a second aspect, the present disclosure provides a generating device for a directed distance field image, the device comprising:

[0033] A first determination module, configured to determine a set of valid line segments corresponding to a pixel point to be processed; wherein, the set of valid line segments includes curve segments in a line segment array that intersect a ray emitted from the pixel point to be processed along a preset first direction, the pixel point to be processed belongs to an undirected distance field image of a target character, and the curve segments in the line segment array are obtained by splitting based on vector contour information of the target character;

[0034] A second determination module, configured to determine internal and external position information of the pixel point to be processed based on the set of valid line segments corresponding to the pixel point to be processed; wherein, the internal and external position information is used to indicate that the pixel point to be processed is in an internal area or an external area of the target character;

[0035] A generating module, configured to generate a directed distance field image of the target character from the undirected distance field image of the target character based on the internal and external position information of the pixel point to be processed.

[0036] In a third aspect, the present disclosure provides a computer-readable storage medium, in which instructions are stored, and when the instructions are run on a terminal device, the terminal device is enabled to implement the above method.

[0037] In a fourth aspect, the present disclosure provides a device, comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the above method is implemented.

[0038] In a fifth aspect, the present disclosure provides a computer program product, the computer program product comprising a computer program / instructions, and when the computer program / instructions are executed by a processor, the above method is implemented.

[0039] The technical solutions provided in the embodiments of the present disclosure have at least the following advantages compared with the prior art:

[0040] The embodiments of the present disclosure provide a method for generating a directed distance field image. Specifically, first, an effective line segment set corresponding to a pixel point to be processed is determined. Then, based on the effective line segment set of the pixel point to be processed, the internal and external position information of the pixel point to be processed is determined. Finally, after the internal and external position information of each pixel point on the undirected distance field image of the target text is determined, the directed distance field image of the target text is generated. The embodiments of the present disclosure determine the internal and external position information based on the effective line segment set corresponding to the pixel point to be processed, without performing a full traversal of all curve segments of the target text. Therefore, the embodiments of the present disclosure improve the determination efficiency of the internal and external position information of the pixel point, and thus improve the generation efficiency of the directed distance field image of the target text as a whole. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The accompanying drawings are incorporated herein and constitute a part of this specification, showing embodiments consistent with the present disclosure and, together with the specification, are used to explain the principles of the present disclosure.

[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative efforts.

[0043] Figure 1 It is a flowchart of a method for generating a directed distance field image provided by an embodiment of the present disclosure;

[0044] Figure 2 It is a schematic diagram for determining an effective line segment set provided by an embodiment of the present disclosure;

[0045] Figure 3 It is a flowchart of another method for generating a directed distance field image provided by an embodiment of the present disclosure;

[0046] Figure 4 It is a schematic structural diagram of a device for generating a directed distance field image provided by an embodiment of the present disclosure;

[0047] Figure 5 It is a schematic structural diagram of a device for generating a directed distance field image provided by an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0048] In order to be able to more clearly understand the above objects, features, and advantages of the present disclosure, the following will further describe the solutions of the present disclosure. It should be noted that, without conflict, the embodiments of the present disclosure and the features in the embodiments can be combined with each other.

[0049] Numerous specific details are set forth in the following description to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only a part of the embodiments of the present disclosure, rather than all of the embodiments.

[0050] A distance field image of text records the shortest distance value of each pixel inside and around the text from the text contour (also referred to as the boundary), which is also called the distance field value. Among them, the distance field value in the signed distance field image of text can distinguish whether each pixel is in the internal area of the text or in the external area around the text. Specifically, the distance field value of the pixel in the internal area of the text is set to a negative number, while the distance field value of the pixel in the external area around the text is set to a positive number.

[0051] Currently, the generation method of the signed distance field image of text includes a line drawing stage, a shape drawing stage, and an inverse signed conversion stage. Among them, the line drawing stage is used to draw the unsigned distance field image of text. In the shape drawing stage, it is necessary to determine whether each pixel in the unsigned distance field image is in the internal area of the text or in the external area around the text. Then, in the inverse signed stage, the internal area of the text in the unsigned distance field image is subjected to inverse color processing, and finally the signed distance field image of text is obtained.

[0052] In the shape drawing stage, among the methods for determining whether each pixel in the unsigned distance field image is in the internal area of the text or in the external area around the text, currently, it is necessary to traverse all the curve segments that make up the text to determine whether they intersect with the ray emitted by the pixel. Then, based on the odd-even rule or the non-zero winding number rule, etc., it is determined whether the pixel is in the internal area of the text or in the external area around the text.

[0053] However, for each pixel in the unsigned distance field image, the method of determining the internal and external position information by fully traversing all the curve segments of the text obviously takes a long time and has low determination efficiency, ultimately resulting in low overall generation efficiency of the signed distance field image of text.

[0054] To this end, the present disclosure provides a method for generating a signed distance field image, which improves the accuracy of determining the internal and external positions of pixels in the overlapping area of closed curves in text by changing the counting method of pixels in the shape drawing stage and the method of determining whether a pixel is in the internal area of the text based on the counting result, thereby improving the accuracy of generating the signed distance field image.

[0055] Specifically, the method for generating a directed distance field image provided by the embodiments of the present disclosure can be applied to a central processing unit (CPU). First, an effective line segment set corresponding to a pixel point to be processed is determined. The effective line segment set is composed of curve segments in a line segment array that intersect with a ray in a preset first direction corresponding to the pixel point to be processed. The curve segments in the line segment array are obtained by splitting based on the vector contour information of the target text, and the pixel point to be processed belongs to a pixel point on the undirected distance field image of the target text. Then, based on the effective line segment set corresponding to the pixel point to be processed, the internal and external position information of the pixel point to be processed is determined. Finally, after the internal and external position information of each pixel point on the undirected distance field image is determined, a directed distance field image of the target text is generated.

[0056] The method for generating a directed distance field image provided by the embodiments of the present disclosure can be applied to various device models. Compared with the method in the prior art where some device models use a GPU to generate a directed distance field image and other device models use a CPU to generate a directed distance field image, the embodiments of the present disclosure will not have the situation where the displayed directed distance field images of the same target text generated by different device models are different.

[0057] In addition, for the method for generating a directed distance field image applied to a CPU provided by the embodiments of the present disclosure, the internal and external position information is determined based on the effective line segment set corresponding to the pixel point to be processed. Compared with the method for generating a directed distance field image using a CPU in the prior art, the embodiments of the present disclosure do not need to perform a full traversal of all curve segments of the target text. Therefore, the embodiments of the present disclosure improve the determination efficiency of the internal and external position information of the pixel point, and thus improve the overall generation efficiency of the directed distance field image of the target text.

[0058] Based on this, the embodiments of the present disclosure provide a method for generating a directed distance field image. Refer to Figure 1 , which is a flowchart of a method for generating a directed distance field image provided by the embodiments of the present disclosure. The method includes:

[0059] S101: Determine an effective line segment set corresponding to a pixel point to be processed; wherein, the effective line segment set is composed of curve segments in a line segment array that intersect with a ray in a preset first direction corresponding to the pixel point to be processed, the curve segments in the line segment array are obtained by splitting based on the vector contour information of the target text, and the pixel point to be processed belongs to a pixel point on the undirected distance field image of the target text.

[0060] In the embodiments of the present disclosure, first, the vector contour information of the target text is obtained. The vector contour information of the target text may include the vector graph or bitmap of the target text, etc. In the line drawing stage of generating the signed distance field image of the target text, based on the vector contour information of the target text, the target text is split into a large number of curve segments. For each curve segment obtained by splitting the target text, a cuboid (also called a bounding box) of a preset size containing the curve segment itself is drawn. Then, for each pixel point in the cuboid, the distance value from the pixel point to the curve segment is calculated by methods such as analytic geometry. After calculating the distance values from the pixel point to each curve segment, the shortest distance value is used as the distance field value of the pixel point, and the distance field value is used as color information (the larger the distance value, the darker the color) for drawing, and finally, the unsigned distance field image of the target text is obtained.

[0061] In the embodiments of the present disclosure, in the shape drawing stage, the curve segments obtained by splitting based on the vector contour information of the target text are used to determine the set of effective line segments corresponding to the pixel points to be processed. For this purpose, in the embodiments of the present disclosure, after obtaining the curve segments obtained by splitting based on the vector contour information of the target text, they can be stored in a line segment array for subsequent use. Specifically, the position information of each curve segment, such as the coordinate information for describing the position of the curve segment, etc., is also stored in the line segment array.

[0062] In practical applications, after obtaining the line segment array storing the curve segments and the position information of the curve segments, the set of effective line segments corresponding to the pixel points to be processed is determined based on the line segment array. The pixel point to be processed belongs to the pixel points on the unsigned distance field image of the target text. Specifically, the pixel point to be processed can be any pixel point on the unsigned distance field image.

[0063] Since the curve segments for determining the internal and external position information of the pixel point need to intersect with the rays emitted by the pixel point, and other curve segments are invalid line segments in the process of determining the internal and external position information of the pixel point. For this purpose, in the embodiments of the present disclosure, before determining the internal and external position information of the pixel point to be processed, a set of effective line segments is first determined for the pixel point to be processed, and then the internal and external position information can be determined based on the curve segments in the set of effective line segments. The invalid line segments do not need to participate. Therefore, the embodiments of the present disclosure can improve the determination efficiency of the internal and external position information of the pixel point.

[0064] Such as Figure 2As shown in the figure, it is a schematic diagram for determining an effective line segment set provided by an embodiment of the present disclosure. Among them, the curve segments numbered 1-5 are obtained by splitting based on the vector contour information of the target text. The pixel point P is any pixel point in the unsigned distance field image of the target text. The ray emitted along the x-axis direction with the pixel point P as the origin intersects the curve segments 2 and 3. Therefore, the effective line segment set corresponding to the pixel point P includes the curve segments 2 and 3, while the curve segments 1, 4, and 5 belong to the invalid line segments of the pixel point P.

[0065] It can be understood that, assuming Figure 2 the positive direction of the y-axis is downward in Figure 2 , the maximum y-axis value of the curve segment 2 intersecting with the ray in

[0066] S102: Determine the internal and external position information of the to-be-processed pixel point based on the effective line segment set corresponding to the to-be-processed pixel point; wherein, the internal and external position information is used to indicate whether the to-be-processed pixel point is in the internal area or the external area of the target text.

[0067] In the embodiment of the present disclosure, after determining the effective line segment set corresponding to the to-be-processed pixel point, the internal and external position information of the to-be-processed pixel point is determined based on the curve segments in the effective line segment set.

[0068] In an optional implementation manner, the internal and external position information of the to-be-processed pixel point can be determined based on rules such as the odd-even rule or the non-zero winding number rule, etc., based on the curve segments in the effective line segment set. Specifically, taking the non-zero winding number rule as an example, first count based on the intersection situations of the respective curve segments in the effective line segment set with the ray emitted from the to-be-processed pixel point along a preset first direction. For example, the counting method is that when passing through the ray from right to left, the winding number is incremented by 1, and when passing through the ray from left to right, the winding number is decremented by 1. As Figure 2 shown in the figure, first determine the directions of the curve segments 2 and 3. Assume that the direction of the curve segment 2 is from left to right, while the direction of the curve segment 3 is from right to left. The curve segment 2 passes through the ray from left to right, so the winding number of the pixel point P is incremented by 1, and the curve segment 3 passes through the ray from right to left, so the winding number of the pixel point P is decremented by 1. Finally, the winding number of the pixel point P is 0. In the non-zero winding number rule, if the winding number is non-zero, the pixel point P is located in the internal area of the target text, otherwise, the pixel point P is in the external area of the target text, that is, the internal and external position information of the to-be-processed pixel point is determined by determining the winding number of the to-be-processed pixel point.

[0069] S103: Generate a directed distance field image of the target text from the undirected distance field image of the target text based on the internal and external position information of the pixel to be processed.

[0070] In the embodiments of the present disclosure, after determining the internal and external position information of each pixel in the undirected distance field image of the target text, it can be determined whether each pixel is in the internal area or the external area of the target text. Then, in the directed inversion stage, the pixels in the internal area of the target text in the undirected distance field image are inverted, and finally, the directed distance field image of the target text is obtained.

[0071] In the method for generating a directed distance field image provided by the embodiments of the present disclosure, the internal and external position information is determined based on the effective line segment set corresponding to the pixel to be processed, and it is not necessary to perform a full traversal of all the curve segments of the target text. Therefore, the embodiments of the present disclosure can improve the determination efficiency of the internal and external position information of the pixels, and thus improve the generation efficiency of the directed distance field image of the target text as a whole.

[0072] To improve the determination efficiency of the effective line segment set corresponding to the pixel to be processed, the embodiments of the present disclosure can sort the curve segments in the line segment array to obtain a sorted line segment array, and then determine the effective line segment set corresponding to the pixel to be processed based on the sorted line segment array.

[0073] Specifically, the embodiments of the present disclosure can sort the curve segments in the line segment array based on the coordinate data of the curve segments in the line segment array in a preset second direction to obtain a sorted line segment array. The line segment array includes curve segments split from the vector contour information of the target text, and the coordinate data in the preset second direction is the maximum or minimum value of the curve segment in the preset second direction, and the preset second direction is perpendicular to the preset first direction.

[0074] In an alternative embodiment, a two-dimensional coordinate system is pre-constructed, with the positive direction of the y-axis downward, the preset second direction is the y-axis direction in this two-dimensional coordinate system, and the above-mentioned first preset direction is the x-axis direction perpendicular to the y-axis direction.

[0075] The minimum value of each curve segment in the y-axis direction is stored in the line segment array. Based on the minimum value in the y-axis direction, each curve segment in the line segment array is sorted to obtain a sorted line segment array.

[0076] Take Figure 2 as an example. After sorting in ascending order based on the minimum value of each curve segment in the y-axis direction, the order of the curve segments in the sorted line segment array is curve segments 1, 2, 3, 4, and 5 in sequence.

[0077] In the embodiments of the present disclosure, after obtaining the sorted line segment array, an effective line segment set corresponding to the pixel points to be processed is determined based on the sorted line segment array. Among them, the sorted line segment array stores not only the minimum value of each curve segment in the y-axis direction, but also the maximum value of each curve segment in the y-axis direction. For the pixel points corresponding to the y-axis coordinate values between the maximum value and the minimum value of a certain curve segment in the y-axis direction, the ray emitted from it as the origin must pass through this curve segment. Therefore, in the embodiments of the present disclosure, an effective line segment set corresponding to the pixel points to be processed can be determined based on the maximum value, minimum value of each curve segment in the y-axis direction, and the sorting of each curve segment based on the minimum value. Among them, the curve segments in the effective line segment set refer to the curve segments that the ray emitted from the pixel points to be processed as the origin can pass through. The effective line segment set includes curve segments whose coordinate data in the preset second direction meet the preset effective conditions of the pixel points to be processed. Taking the second direction as the y-axis direction as an example, meeting the preset effective conditions of the pixel points to be processed may mean that the y-axis coordinate value of the pixel points to be processed is included between the maximum value and the minimum value in the y-axis direction.

[0078] As Figure 2 shown, based on the y-axis coordinate of the pixel point P, determine which curve segment it is between the maximum value and the minimum value in the y-axis direction, then determine this curve segment as the effective line segment of the pixel point P and add it to the effective line segment set of the pixel point P.

[0079] In accordance with the above method, it can be determined in turn that curve segment 1 does not belong to the effective line segment of the pixel point P, while curve segments 2 and 3 both belong to the effective line segment of the pixel point P. Since the minimum value of curve segment 4 in the y-axis direction is greater than the y-axis coordinate value of the pixel point P, curve segment 4 does not belong to the effective line segment of the pixel point P. And because the sorting position of curve segment 5 is after curve segment 4, and the minimum value of curve segment 4 in the y-axis direction is greater than the y-axis coordinate value of the pixel point P, obviously, the minimum value of each curve segment after curve segment 4 in the y-axis direction must be greater than the y-axis coordinate value of the pixel point P. Therefore, based on the sorting relationship, it is not necessary to traverse each curve segment after curve segment 4, and it can also be determined that the effective line segment set corresponding to the pixel point P includes curve segments 2 and 3. It can be seen that the efficiency of determining the pixel point P to be processed in the embodiments of the present disclosure is improved.

[0080] It should be noted that in the above embodiments, the curve segments in the line segment array can also be sorted based on the maximum value in the y-axis direction to obtain the sorted line segment array. Then, an effective line segment set corresponding to the pixel points to be processed is determined based on the sorted line segment array.

[0081] In another alternative embodiment, the preset second direction may also be the x-axis direction in a pre-constructed two-dimensional coordinate system. Based on the maximum or minimum value in the x-axis direction, each curve segment in the line segment array is sorted to obtain a sorted line segment group. Then, based on the x-axis coordinate value of the pixel point to be processed, its corresponding effective line segment set is determined. The specific implementation method can refer to the above description and will not be elaborated here.

[0082] Based on the sorted line segment array, the embodiments of the present disclosure determine the effective line segment set, which can improve the determination efficiency of the effective line segment set corresponding to each pixel point, and ultimately improve the overall generation efficiency of the directed distance field image of the target text.

[0083] Based on the above embodiments, the embodiments of the present disclosure also provide a method for generating a directed distance field image, referring to Figure 3 , which is a flowchart of another method for generating a directed distance field image provided by the embodiments of the present disclosure. The method includes:

[0084] S301: Sort the curve segments in the line segment array based on the coordinate data of the curve segments in the preset second direction to obtain a sorted line segment array.

[0085] Among them, the line segment array includes curve segments obtained by splitting the vector contour information of the target text. The coordinate data of the preset second direction is the maximum or minimum value of the curve segment in the preset second direction, and the preset second direction is perpendicular to the preset first direction.

[0086] In the embodiments of the present disclosure, in the online drawing stage, after splitting the target text into a large number of curve segments based on the vector contour information of the target text, each curve segment and its position information are stored in the line segment array. Among them, the coordinate data of each curve segment in the preset second direction is stored in the line segment array, for example, the minimum value in the y-axis direction.

[0087] Based on the coordinate data of the preset second direction, each curve segment in the line segment array is sorted to obtain a sorted line segment array, which is used to determine the effective line segment set corresponding to each pixel point in the undirected distance field image of the target text. Assuming that the preset second direction is the y-axis direction, the curve segments stored in the sorted line segment array can be sorted from small to large based on the minimum value in the y-axis direction.

[0088] S302: Determine the pixel point to be processed from the pixel points on the undirected distance field image of the target text according to the preset traversal method; wherein, the preset traversal method has a corresponding relationship with the preset second direction.

[0089] In the embodiments of the present disclosure, to generate a directed distance field image for the target text, it is necessary to determine the inside and outside position information of each pixel on the undirected distance field image of the target text, that is, to determine whether each pixel is in the internal area or the external area of the target text. Therefore, it is necessary to determine each pixel on the undirected distance field image of the target text as a pixel to be processed respectively.

[0090] In the embodiments of the present disclosure, based on the sorting method in the sorted line segment array, the traversal method of the pixels on the undirected distance field image of the target text is determined. Assuming that the curve segments in the sorted line segment array are sorted based on the minimum or maximum value in the y-axis direction, the pixels on the undirected distance field image of the target text can be traversed row by row according to the traversal method in the x-axis direction, and each is used as the pixel to be processed in the embodiments of the present disclosure in turn. Assuming that the curve segments in the sorted line segment array are sorted based on the maximum or minimum value in the x-axis direction, the pixels on the undirected distance field image of the target text can be traversed column by column according to the traversal method in the y-axis direction. Specifically, if the preset second direction is the y-axis direction, the preset traversal method is to traverse along the x-axis, that is, row by row; and if the preset second direction is the x-axis direction, the preset traversal method is to traverse along the y-axis, that is, column by column.

[0091] In the embodiments of the present disclosure, according to the preset traversal method, such as row by row traversal, etc., based on the position information of the previous pixel to be processed, the pixel to be processed in the current iteration can be determined, so as to determine the inside and outside position information of the pixel to be processed.

[0092] S303: Determine the current line segment set corresponding to the pixel to be processed.

[0093] Wherein, the current line segment set is the effective line segment set corresponding to the previous pixel to be processed of the pixel to be processed or a line segment set initialized to be empty.

[0094] In the embodiments of the present disclosure, the current line segment set can be initialized to be empty. For the first pixel to be processed in the undirected distance field image of the target text, also called the initial pixel, the line segment set initialized to be empty can be used as the current line segment set of the initial pixel.

[0095] For other pixels to be processed except the initial pixel, the corresponding current line segment set is the effective line segment set corresponding to the previous pixel to be processed of the pixel to be processed.

[0096] S304: Based on the sorted line segment array and the current line segment set, determine the effective line segment set corresponding to the pixel to be processed, and update the current line segment set by using the effective line segment set corresponding to the pixel to be processed.

[0097] Among them, the set of effective line segments is composed of the curve segments in the line segment array that intersect with the rays in the preset first direction corresponding to the pixel points to be processed. The curve segments in the line segment array are obtained by splitting based on the vector contour information of the target text, and the pixel points to be processed belong to the pixel points on the unsigned distance field image of the target text; among them, the set of effective line segments includes the curve segments whose coordinate data in the preset second direction meet the effective conditions of the pixel points to be processed.

[0098] In the embodiments of the present disclosure, the current line segment set can be initialized to be empty. For the first pixel point to be processed in the unsigned distance field image of the target text, also known as the initial pixel point, the set of effective line segments can be determined based on the sorted line segment array. The specific determination method has been introduced in the above embodiments and will not be elaborated here. After determining the set of effective line segments of the initial pixel point, use this set of effective line segments as the current line segment set for the next pixel point to be processed.

[0099] For non-initial pixel points, the current line segment set is the set of effective line segments corresponding to the previous pixel point to be processed of this pixel point. Then, based on the sorted line segment array and the current line segment set, determine the corresponding set of effective line segments. Specifically, since the pixel points to be processed are determined according to a preset traversal method, such as row-by-row traversal, and the y-axis coordinate values of the pixel points to be processed in the same row are the same, the sets of effective line segments corresponding to the pixel points to be processed in the same row are the same. Therefore, the current line segment set can be directly determined as the set of effective line segments corresponding to the pixel points to be processed.

[0100] Take Figure 2 as an example. Suppose the pixel point to be processed is pixel point H in the same row as pixel point P. Then, it can be determined that the set of effective line segments of pixel point H is the same as that of pixel point P, that is, the set of effective line segments including curve segments 2 and 3.

[0101] Still assume that the preset traversal method is row-by-row traversal. After determining the set of effective line segments corresponding to the last pixel point in the previous row, update it as the current line segment set. After taking the pixel points in the adjacent next row as the pixel points to be processed, determine the set of effective line segments of this pixel point to be processed based on the current line segment set and the sorted line segment array. Specifically, judge whether the next curve segment of the effective line segment in the current line segment set in the sorted line segment array is the effective line segment of the pixel point to be processed. If so, add this curve segment to the current line segment set, and then continue to judge the next curve segment according to the sorting until a curve segment that does not belong to the effective line segment of the pixel point to be processed is found. At this time, determine the current line segment set as the set of effective line segments of this pixel point to be processed.

[0102] Such as Figure 2As shown, assume that the current line segment set is curve segments 2 and 3. When determining the effective line segment set of the pixel point to be processed based on the current line segment set and the sorted line segment array, it is necessary to determine whether curve segment 4 located after curve segments 2 and 3 is an effective line segment of the pixel point to be processed, that is, to determine whether the y-axis coordinate value of the pixel point to be processed is included between the maximum value and the minimum value of curve segment 4 in the y-axis direction. If so, it means that curve segment 4 also belongs to the effective line segment of the pixel point to be processed, and it is added to the current line segment set, and then continue to determine whether curve segment 5 located after curve segment 4 is an effective line segment of the pixel point to be processed. If not, the current line segment set is determined as the effective line segment set of the pixel point to be processed. In fact, since each curve segment has a sorting relationship, after determining that curve segment 5 does not belong to the effective line segment of the pixel point to be processed, it can be determined that other curve segments located after curve segment 5 also do not belong to the effective line segment of the pixel point to be processed.

[0103] It can be seen that the embodiments of the present disclosure update and determine the current line segment set based on the sorted curve segments, and determine the effective line segment set of the pixel point to be processed based on the current line segment set, which can greatly improve the determination efficiency of the effective line segment set and ultimately improve the generation efficiency of the oriented distance field image of the target text as a whole.

[0104] S305: Based on the effective line segment set corresponding to the pixel point to be processed, determine the internal and external position information of the pixel point to be processed.

[0105] Wherein, the internal and external position information is used to indicate that the pixel point to be processed is in the internal area or the external area of the target text.

[0106] S305 in the embodiments of the present disclosure is the same as S102 in the above embodiments, and will not be elaborated here and can be understood by reference.

[0107] S306: Determine whether the internal and external position information of all pixel points on the undirected distance field image of the target text has been determined. If so, execute S307; otherwise, execute S302.

[0108] In the embodiments of the present disclosure, after determining the internal and external position information of the pixel point to be processed in this iteration, it is necessary to determine whether the internal and external position information of all pixel points on the undirected distance field image of the target text has been determined. If not, continue the next iteration and execute S302 to re-determine the pixel point to be processed; if so, S307 can be executed to generate the oriented distance field image of the target text.

[0109] S307: Generate an oriented distance field image from the undirected distance field image of the target text based on the internal and external position information of the pixel point to be processed.

[0110] In an embodiment of the present disclosure, after determining the internal and external position information of each pixel point on the undirected distance field image of the target text, a directed distance field image is generated from the undirected distance field image of the target text based on the internal and external position information of each pixel point.

[0111] Specifically, after determining that each pixel point on the undirected distance field image of the target text is in the internal region or the external region of the target text, in the reverse-color directed stage, the pixel points in the internal region of the target text in the undirected distance field image are subjected to reverse-color processing, and finally the directed distance field image of the target text is obtained.

[0112] The method for generating a directed distance field image provided by the embodiment of the present disclosure is applied to a CPU, and determines internal and external position information based on the effective line segment set corresponding to the pixel point to be processed. Compared with other methods for generating a directed distance field image using a CPU, the embodiment of the present disclosure does not need to perform a full traversal of all curve segments of the target text, and improves the determination efficiency of the internal and external position information of the pixel point.

[0113] In addition, on this basis, the embodiment of the present disclosure can also update and determine the current line segment set based on the sorted curve segments, and determine the effective line segment set of the pixel point to be processed based on the current line segment set, improving the determination efficiency of the effective line segment set, thereby further improving the determination efficiency of the internal and external position information of the pixel point, and finally improving the generation efficiency of the directed distance field image of the target text as a whole.

[0114] In an optional implementation manner, curve segments in the line segment array with a radian less than a preset radian threshold or a length less than a preset length threshold can be stored as straight line segments, and then the undirected distance field image of the target text is generated based on the line segment array.

[0115] In practical applications, the distance field value of each pixel point on the undirected distance field image is the shortest distance from the pixel point to the target text. Therefore, it is necessary to calculate the distance from the pixel point to the curve segments into which the target text is split, and calculating the distance from the pixel point to a straight line segment is obviously more efficient than calculating the distance from the pixel point to a curve segment. Therefore, the calculation efficiency of the distance field value of the pixel point is improved. Therefore, if curve segments in the line segment array with a radian value less than a preset radian threshold or a length less than a preset length threshold are stored as straight line segments, the calculation efficiency of the distance field value can be improved without affecting the calculation accuracy of the distance field value of each pixel point, thereby improving the generation efficiency of the undirected distance field image of the target text, and finally improving the efficiency of generating a directed distance field image based on the undirected distance field image.

[0116] In practical applications, storing curve segments in the line segment array with a radian value less than a preset radian threshold or a length less than a preset length threshold as straight line segments means setting the radian value of the curve segment to 0, that is, obtaining the straight line segment corresponding to the curve segment.

[0117] In another alternative embodiment, since the curve array obtained after splitting the target text of some fonts (such as otf fonts and ttc fonts) contains curve segments belonging to cubic Bézier curves, while the curves used to generate the signed distance field image in the embodiments of the present disclosure need to be quadratic Bézier curves. Therefore, in the embodiments of the present disclosure, the curve segments belonging to cubic Bézier curves in the line segment array are converted into quadratic Bézier curves so that the signed distance field image of the target text can be generated based on the curve segments in the line segment array.

[0118] In addition, during the process of drawing the distance field image, there may be overlap between adjacent texts. For the pixel points in the internal area of the drawn text, the embodiments of the present disclosure may no longer re-determine the internal and external position information of the pixel points.

[0119] Specifically, after determining the pixel point to be processed, first determine whether the pixel point to be processed is in the internal area of the drawn text. If not, continue to determine the effective line segment set corresponding to the pixel point to be processed, so as to determine the internal and external position information of the pixel point to be processed. Otherwise, there is no need to determine the effective line segment set of the pixel point to be processed.

[0120] The embodiments of the present disclosure do not need to redundantly determine the internal and external position information of the pixel points to be processed in the internal area of the drawn text, improving the determination efficiency of the signed distance field image of the target text.

[0121] Based on the above method embodiments, the present disclosure provides a device for generating a signed distance field image. Refer to Figure 4 , which is a schematic structural diagram of a device for generating a signed distance field image provided by the embodiments of the present disclosure. The device includes:

[0122] A first determination module 401, configured to determine an effective line segment set corresponding to a pixel point to be processed; wherein, the effective line segment set includes curve segments in the line segment array that intersect with a ray emitted from the pixel point to be processed along a preset first direction. The pixel point to be processed belongs to the unsigned distance field image of the target text, and the curve segments in the line segment array are obtained by splitting based on the vector contour information of the target text;

[0123] A second determination module 402, configured to determine the internal and external position information of the pixel point to be processed based on the effective line segment set corresponding to the pixel point to be processed; wherein, the internal and external position information is used to indicate whether the pixel point to be processed is in the internal area or the external area of the target text;

[0124] A first generation module 403, configured to generate the signed distance field image of the target text from the unsigned distance field image of the target text based on the internal and external position information of the pixel point to be processed.

[0125] In an alternative embodiment, the device further comprises:

[0126] A sorting module, configured to sort the curve segments in the line segment array based on the coordinate data of the curve segments in the preset second direction, so as to obtain a sorted line segment array; wherein, the line segment array includes curve segments obtained by splitting the vector contour information of the target text, and the coordinate data in the preset second direction is the maximum or minimum value of the curve segments in the preset second direction, and the preset second direction is perpendicular to the preset first direction;

[0127] Correspondingly, the first determination module is specifically configured to:

[0128] Determine an effective line segment set corresponding to the pixel point to be processed based on the sorted line segment array; wherein, the effective line segment set includes curve segments whose coordinate data in the preset second direction meets the preset effective condition of the pixel point to be processed.

[0129] In an alternative embodiment, the device further comprises:

[0130] A third determination module, configured to determine the pixel point to be processed from the pixel points on the undirected distance field image of the target text according to a preset traversal method; wherein, the preset traversal method has a corresponding relationship with the preset second direction;

[0131] Correspondingly, the first determination module includes:

[0132] A first determination sub-module, configured to determine the current line segment set corresponding to the pixel point to be processed; wherein, the current line segment set is the effective line segment set corresponding to the previous pixel point to be processed of the pixel point to be processed or an initially empty line segment set;

[0133] A second determination sub-module, configured to determine the effective line segment set corresponding to the pixel point to be processed based on the sorted line segment array and the current line segment set, and update the current line segment set by using the effective line segment set;

[0134] The device further comprises:

[0135] A judgment module, configured to judge whether the determination of the internal and external position information of all the pixel points on the undirected distance field image of the target text is completed, and if not, trigger the third determination module.

[0136] In an alternative embodiment, the device further comprises:

[0137] A storage module, configured to store the curve segments in the line segment array with a radian value less than a preset radian threshold or a length less than a preset length threshold as straight line segments;

[0138] A second generation module for generating an undirected distance field image of the target text based on the line segment array; wherein, the distance field value of each pixel point on the undirected distance field image is the shortest distance from the pixel point to the curve segment or straight line segment in the line segment array.

[0139] In an alternative embodiment, the apparatus further includes:

[0140] A conversion module for converting the curve segments belonging to the cubic Bezier curve in the line segment array into quadratic Bezier curves.

[0141] In an alternative embodiment, the apparatus further includes:

[0142] A fourth determination module for determining whether the pixel point to be processed is within the internal area of the drawn text;

[0143] A trigger module for triggering the first determination module when the result of the fourth determination module is negative.

[0144] In an alternative embodiment, the preset first direction is the x-axis direction in a pre-constructed two-dimensional coordinate system, and the preset second direction is the y-axis direction in the two-dimensional coordinate system; the preset traversal method is a traversal method along the x-axis direction first and then along the y-axis direction; the preset valid condition is that the y-axis coordinate value of the pixel point to be processed is included between the maximum value and the minimum value in the preset second direction.

[0145] In the apparatus for generating a directed distance field image provided by the embodiments of the present disclosure, the internal and external position information is determined based on the effective line segment set corresponding to the pixel point to be processed, without performing a full traversal of all the curve segments of the target text, thereby improving the determination efficiency of the internal and external position information of the pixel point.

[0146] In addition, on this basis, the embodiments of the present disclosure can further update and determine the current line segment set based on the sorted curve segments, and determine the effective line segment set of the pixel point to be processed based on the current line segment set, thereby improving the determination efficiency of the effective line segment set, and further improving the determination efficiency of the internal and external position information of the pixel point, and ultimately improving the generation efficiency of the directed distance field image of the target text as a whole.

[0147] In addition to the above methods and apparatuses, the embodiments of the present disclosure further provide a computer-readable storage medium storing instructions that, when run on a terminal device, cause the terminal device to implement the method for generating a directed distance field image described in the embodiments of the present disclosure.

[0148] An embodiment of the present disclosure also provides a computer program product, including computer programs / instructions, characterized in that when the computer programs / instructions are executed by a processor, the method for generating a directed distance field image described in the embodiments of the present disclosure is implemented.

[0149] In addition, an embodiment of the present disclosure also provides a device for generating a directed distance field image. Refer to Figure 5 as shown, it may include:

[0150] A processor 501, a memory 502, an input device 503, and an output device 504. The number of processors 501 in the device for generating a directed distance field image may be one or more. Figure 5 Here, one processor is taken as an example. In some embodiments of the present disclosure, the processor 501, the memory 502, the input device 503, and the output device 504 may be connected by a bus or other means. Among them, Figure 5 here, being connected by a bus is taken as an example.

[0151] The memory 502 can be used to store software programs and modules. The processor 501 runs the software programs and modules stored in the memory 502, thereby implementing various functional applications and data processing of the device for generating a directed distance field image. The memory 502 mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function, etc. In addition, the memory 502 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices. The input device 503 can be used to receive input digital or character information, and generate signal inputs related to user settings and function controls of the device for generating a directed distance field image.

[0152] Specifically in this embodiment, the processor 501 will load the executable files corresponding to the processes of one or more application programs into the memory 502 according to the following instructions, and the processor 501 will run the application programs stored in the memory 502, thereby implementing various functions of the above-mentioned device for generating a directed distance field image.

[0153] It should be noted that in this document, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising said element.

[0154] The above are only specific embodiments of the present disclosure, enabling those skilled in the art to understand or implement the present disclosure. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but rather to the broadest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for generating a signed distance field image, characterized in that The method includes: Determining a set of effective line segments corresponding to a pixel point to be processed; wherein, the set of effective line segments is composed of curve segments in the line segment array that intersect with a ray in a preset first direction corresponding to the pixel point to be processed, the curve segments in the line segment array are obtained by splitting based on the vector contour information of the target text, and the pixel point to be processed belongs to a pixel point on the unsigned distance field image of the target text; Based on the set of effective line segments corresponding to the pixel point to be processed, determining the internal and external position information of the pixel point to be processed; wherein, the internal and external position information is used to indicate whether the pixel point to be processed is in the internal area or the external area of the target text; Based on the internal and external position information of the pixel point to be processed, generating a signed distance field image of the target text from the unsigned distance field image of the target text.

2. The method according to claim 1, characterized in that, Before determining the set of effective line segments corresponding to the pixel point to be processed, it further includes: Sorting the curve segments in the line segment array based on the coordinate data of the curve segments in a preset second direction to obtain a sorted line segment array; wherein, the coordinate data in the preset second direction is the maximum or minimum value of the curve segments in the preset second direction, and the preset second direction is perpendicular to the preset first direction; Correspondingly, determining the set of effective line segments corresponding to the pixel point to be processed includes: Based on the sorted line segment array, determining the set of effective line segments corresponding to the pixel point to be processed; wherein, the set of effective line segments includes curve segments whose coordinate data in the preset second direction meet the preset effective conditions of the pixel point to be processed.

3. The method according to claim 2, wherein Before determining the set of effective line segments corresponding to the pixel point to be processed, it further includes: Determining the pixel point to be processed from the pixel points on the unsigned distance field image of the target text according to a preset traversal method; wherein, the preset traversal method has a corresponding relationship with the preset second direction; Correspondingly, determining the set of effective line segments corresponding to the pixel point to be processed includes: Determining the current line segment set corresponding to the pixel point to be processed; wherein, the current line segment set is the set of effective line segments corresponding to the previous pixel point to be processed of the pixel point to be processed or an initially empty line segment set; Based on the sorted line segment array and the current line segment set, determining the set of effective line segments corresponding to the pixel point to be processed, and updating the current line segment set with the set of effective line segments; After determining the internal and external position information of the pixel point to be processed based on the set of effective line segments corresponding to the pixel point to be processed, it further includes: Judging whether the internal and external position information of all pixel points on the unsigned distance field image of the target text has been determined. If not, execute the step of determining the pixel point to be processed from the pixel points on the unsigned distance field image of the target text according to the preset traversal method.

4. The method according to claim 1, wherein Before determining the set of effective line segments corresponding to the pixel point to be processed, it further includes: Storing curve segments in the line segment array with a radian value less than a preset radian threshold or a length less than a preset length threshold as straight line segments; Generate an undirected distance field image of the target text based on the line segment array; wherein, the distance field value of each pixel point on the undirected distance field image is the shortest distance from the pixel point to the curve segment or straight line segment in the line segment array.

5. The method according to claim 4, wherein Before generating the undirected distance field image of the target text based on the line segment array, it further includes: Convert the curve segments belonging to the third-order Bezier curve in the line segment array into second-order Bezier curves.

6. The method according to claim 1, characterized in that, Before determining the effective line segment set corresponding to the pixel point to be processed, it further includes: Determine whether the pixel point to be processed is in the internal area of the drawn text; If not, execute the step of determining the effective line segment set corresponding to the pixel point to be processed.

7. The method according to claim 3, wherein The preset first direction is the x-axis direction in the pre-constructed two-dimensional coordinate system, and the preset second direction is the y-axis direction in the two-dimensional coordinate system; The preset traversal method is a traversal method along the x-axis direction first and then along the y-axis direction; the preset effective condition is that the y-axis coordinate value of the pixel point to be processed is included between the maximum value and the minimum value in the preset second direction.

8. A generating device for a directed distance field image, characterized in that, The device includes: A first determination module, configured to determine an effective line segment set corresponding to a pixel point to be processed; wherein, the effective line segment set includes curve segments in the line segment array that intersect with a ray emitted from the pixel point to be processed along the preset first direction, the pixel point to be processed belongs to the undirected distance field image of the target text, and the curve segments in the line segment array are obtained by splitting based on the vector contour information of the target text; A second determination module, configured to determine the internal and external position information of the pixel point to be processed based on the effective line segment set corresponding to the pixel point to be processed; wherein, the internal and external position information is used to indicate whether the pixel point to be processed is in the internal area or the external area of the target text; A generation module, configured to generate a directed distance field image of the target text from the undirected distance field image of the target text based on the internal and external position information of the pixel point to be processed.

9. A computer-readable storage medium, characterized in that, Instructions are stored in the computer-readable storage medium, and when the instructions are run on the terminal device, the terminal device is enabled to implement the method according to any one of claims 1-7.

10. A device, characterized in that, It includes: A memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the method according to any one of claims 1-7 is implemented.

11. A computer program product, characterized in that, The computer program product includes computer programs / instructions, and when the computer programs / instructions are executed by the processor, the method according to any one of claims 1-7 is implemented.

Citation Information

Patent Citations

  • Efficiently Computed Distance Fields

    US20200279415A1

  • Producing glyph distance fields

    WO2014025363A1