Display method and device, equipment, medium and program product
By obtaining character pattern information and describing pixel points based on linear equations, the problem of poor expansion and display in the underlying environment in the prior art character set library is solved, and the flexibility and scalability are improved.
Patent Information
- Application Number
- CN202411082845.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-12-03
AI Technical Summary
The prior art is difficult to expand the character set library in video or image display, and the character set library cannot be used in the underlying software environment, resulting in inflexible character pattern display.
By obtaining character pattern information, determine the endpoint coordinates of line segments in the preset pattern frame in the line segment set, and depict pixel points based on the straight line equation to realize the display of non-preset line segments, improving the flexibility and scalability of character pattern display. .
It does not need to rely on the existing character set library, and it realizes the display of non-preset line segments, improves the flexibility and versatility of character pattern display, and has high scalability.
Smart Images

Figure CN119065625A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of image display technology, and in particular, relates to a display method, device, equipment, computer storage medium and computer program product. Background Art
[0002] In video or image display application scenarios, it is sometimes necessary to annotate the information in the video or image on the display. For example, facial recognition information is annotated to mark the name, number, facial status, gesture status, etc. of the face for users to read intuitively.
[0003] At present, when annotation is required, the character pattern in the character set library is usually imported into the specified position of the image through the specified interface of the character set library, and displayed on the display. However, on the one hand, this method can only display the existing characters in the character set library, which is not convenient for character expansion; on the other hand, for some low-level software operating environments, the character set library may not be used, so the character pattern cannot be displayed. Summary of the invention
[0004] The embodiments of the present application provide a display method, apparatus, device, computer storage medium and computer program product, which can improve the flexibility of character pattern display.
[0005] In a first aspect, an embodiment of the present application provides a display method, including:
[0006] Acquire character pattern information, where the character pattern information includes a set of line segments included in the target character pattern;
[0007] In a case where the line segment set includes a first line segment, determining endpoint coordinates of two endpoints corresponding to the first line segment in a preset pattern frame, the preset pattern frame includes a preset number of endpoint control points and a plurality of preset line segments formed by connecting the endpoint control points, and the first line segment includes a line segment that does not correspond to the preset line segment;
[0008] Determine the straight line equation of the first line segment in the pattern frame according to the endpoint coordinates of the two endpoints;
[0009] Based on the straight line equation, the pixel points between the two end points in the first line segment are depicted to display the first line segment.
[0010] In an optional implementation, after acquiring the character pattern information, the method further includes:
[0011] In the case where the line segment set includes a second line segment, obtaining a target code corresponding to the target character pattern from a preset code set, the second line segment includes a line segment corresponding to the preset line segment, and the target code is used to represent a target preset line segment corresponding to the second line segment among the plurality of preset line segments;
[0012] Decoding the target code through the display interface to determine the target preset line segment in the pattern frame;
[0013] The pixel points corresponding to the target preset line segment are depicted to display the second line segment.
[0014] In an optional implementation, the character pattern information further includes size information of the target character pattern;
[0015] Before determining the endpoint coordinates of two endpoints corresponding to the first line segment in the preset pattern frame, the method further includes:
[0016] The size of the preset pattern frame is adjusted according to the size information of the target character pattern.
[0017] In an optional implementation, determining the endpoint coordinates of two endpoints corresponding to the first line segment in a preset pattern frame includes:
[0018] Determine the endpoint positions of two corresponding endpoints of the first line segment of the target character pattern in the preset pattern frame according to a preset mapping rule between the character pattern and the endpoint position of the first line segment;
[0019] According to the endpoint positions of the two endpoints, the endpoint coordinates of the two endpoints are determined in a preset rectangular coordinate system.
[0020] In an optional implementation, the two endpoints corresponding to the first line segment in the preset pattern frame include a first endpoint and a second endpoint; and according to the endpoint positions of the two endpoints, determining the endpoint coordinates of the two endpoints in a preset rectangular coordinate system includes:
[0021] Determine the offset of the first endpoint and the second endpoint relative to a reference point according to the endpoint positions of the two endpoints, the reference point being one of a preset number of endpoint control points, and the reference point being the origin of a rectangular coordinate system;
[0022] Based on the offsets of the first endpoint and the second endpoint relative to the reference point, the first endpoint coordinates (x1, y1) corresponding to the first endpoint and the second endpoint coordinates (x2, y2) corresponding to the second endpoint are determined.
[0023] In an optional implementation, based on the straight line equation, depicting the pixel points between the two endpoints in the first line segment includes:
[0024] When x1 and x2 are not equal, and y1 and y2 are not equal, based on the straight line equation and according to the preset horizontal coordinate change gradient, determine the first pixel point whose horizontal coordinate is between x1 and x2;
[0025] Based on the straight line equation and according to the preset vertical coordinate change gradient, determine a second pixel point whose vertical coordinate is between y1 and y2;
[0026] The first pixel point and the second pixel point are depicted.
[0027] In an optional implementation, based on the straight line equation, depicting the pixel points between the two endpoints in the first line segment includes:
[0028] Based on the straight line equation, the pixel component values of the pixels located between the two endpoints in the first line segment are modified to be the target values.
[0029] In an optional embodiment, the preset pattern frame is a rectangular frame, and the preset number of endpoint control points include the vertices of the rectangular frame, the midpoints of each side of the rectangular frame, and the intersection of two diagonals of the rectangular frame; the multiple preset line segments formed by the endpoint control points include line segments formed by connecting the intersection point and the remaining endpoint control points, and line segments formed by connecting the vertex and the adjacent midpoint.
[0030] In a second aspect, an embodiment of the present application provides a display device, including:
[0031] An acquisition module, used for acquiring character pattern information, where the character pattern information includes a set of line segments contained in the character pattern;
[0032] a determination module, configured to determine, when the line segment set includes a first line segment, endpoint coordinates of two endpoints corresponding to the first line segment in a preset pattern frame, the preset pattern frame including a preset number of endpoint control points and a plurality of preset line segments formed by connecting the endpoint control points, and the first line segment including a line segment that does not correspond to the preset line segment;
[0033] The determination module is further used to determine the straight line equation of the first line segment in the pattern frame according to the endpoint coordinates of the two endpoints;
[0034] The drawing module is used to draw the pixel points between the two end points in the first line segment based on the straight line equation to display the first line segment.
[0035] In a third aspect, an embodiment of the present application provides a display device, the device comprising:
[0036] A processor and a memory storing computer program instructions; when the processor executes the computer program instructions, any one of the above display methods is implemented.
[0037] In a fourth aspect, an embodiment of the present application provides a computer storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, any one of the above-mentioned display methods is implemented.
[0038] In a fifth aspect, an embodiment of the present application provides a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device can execute any one of the above-mentioned display methods.
[0039] The display method, device, equipment, computer storage medium and computer program product of the embodiment of the present application can obtain character pattern information, which includes a set of line segments contained in the target character pattern. Then, when the line segment set includes a first line segment, the endpoint coordinates of the two endpoints corresponding to the first line segment in the preset pattern frame are determined, and the straight line equation of the first line segment in the pattern frame is determined according to the endpoint coordinates of the two endpoints. The preset pattern frame includes a preset number of endpoint control points and a plurality of preset line segments formed by connecting the endpoint control points, and the first line segment includes a line segment that does not correspond to the preset line segment. In this way, the non-preset line segment can be mapped to the position corresponding to the pattern frame. Then, the pixel points located between the two endpoints in the first line segment can be depicted based on the straight line equation to display the first line segment. In this way, the pixel points can be depicted based on the straight line equation to realize the display of the non-preset line segment, thereby improving the flexibility of character pattern display. In addition, the embodiment of the present application does not need to rely on the existing character set library, and has high scalability and versatility. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0041] Figure 1 It is a flowchart of a display method provided by an embodiment of the present application;
[0042] Figure 2 is a schematic diagram of a pattern frame provided by another embodiment of the present application;
[0043] Figure 3 is a schematic diagram of a pattern frame provided by yet another embodiment of the present application;
[0044] Figure 4 is a schematic diagram of a pattern frame provided in yet another embodiment of the present application;
[0045] Figure 5 is a schematic diagram of a pattern frame provided in yet another embodiment of the present application;
[0046] Figure 6 is a schematic diagram of a display method provided in yet another embodiment of the present application;
[0047] Figure 7 is a schematic diagram of a display method provided in yet another embodiment of the present application;
[0048] Figure 8 is a schematic diagram of a pattern frame provided in yet another embodiment of the present application;
[0049] Fig. 9 is a schematic diagram of a pattern frame provided in yet another embodiment of the present application;
[0050] Fig.10 is a schematic diagram of a pattern frame provided in yet another embodiment of the present application;
[0051] Fig.11 is a schematic diagram of a pattern frame provided in yet another embodiment of the present application;
[0052] Fig.12 is a schematic diagram of a pattern frame provided in yet another embodiment of the present application;
[0053] Fig.13 is a schematic diagram of a pattern frame provided in yet another embodiment of the present application;
[0054] Fig.14 is a schematic diagram of a pattern frame provided in yet another embodiment of the present application;
[0055] Fig.15 is a structural schematic diagram of a display device provided in yet another embodiment of the present application;
[0056] Fig.16 It is a structural schematic diagram of a display device provided in yet another embodiment of the present application. DETAILED DESCRIPTION
[0057] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0058] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0059] Currently, when annotation is required, character patterns in a character set library are usually imported into a designated position of an image through a designated interface of the character set library and displayed on a display.
[0060] However, on the one hand, this method can only display the existing characters in the character set library, which is not convenient for character expansion and cannot display some specifically designed characters; on the other hand, for some low-level software operating environments, the character set library may not be used, and thus character patterns cannot be displayed.
[0061] In order to improve the flexibility of character pattern display, the inventor, after in-depth thinking, cleverly proposed a display method, device, equipment, computer storage medium and computer program product.
[0062] The following is an introduction to the display method provided in the embodiment of the present application through specific embodiments and their application scenarios in conjunction with the accompanying drawings. The display method provided in the embodiment of the present application, the device for executing the method may be a display device, or a partial module in the display device for executing the display method. In the embodiment of the present application, the display method provided in the embodiment of the present application is described in detail by taking the display device executing the display method as an example.
[0063] Figure 1 FIG. 1 is a flow chart of a display method provided by an embodiment of the present application. Figure 1 As shown, the display method may specifically include the following steps S110 to S140.
[0064] S110, acquiring character pattern information, where the character pattern information includes a set of line segments included in the target character pattern.
[0065] In step S110, the character pattern information may be pattern information corresponding to a target character pattern obtained from a preset character set. The preset character set may be stored in a memory of a display device. Those skilled in the art may set and expand the character pattern information in the character pattern set as needed. The target character pattern may include text and / or symbols composed of arbitrary line segments. Exemplarily, the target character pattern may include a character pattern input by a user terminal, for example, it may include a character pattern input by a user. Exemplarily, the target character pattern may also include a character pattern determined by a preset algorithm, for example, in a face recognition scenario, the face recognition result may be determined by a face recognition algorithm, and the annotation information determined according to the face recognition result is the target character pattern. The set of line segments contained in the target character pattern may represent a set of multiple line segments constituting the target character pattern.
[0066] S120, when the line segment set includes a first line segment, determining the endpoint coordinates of two endpoints corresponding to the first line segment in a preset pattern frame, the preset pattern frame includes a preset number of endpoint control points and a plurality of preset line segments formed by connecting the endpoint control points, and the first line segment includes a line segment that does not correspond to the preset line segment.
[0067] In step S120, the pattern frame may include a frame for determining the display range of the character pattern, and the pattern frame may include a plurality of pixel points, and the line segments of the character pattern need to be displayed within the pattern frame. Figure 2 As shown, the pattern frame can be a rectangular frame, and the preset number of endpoint control points can include vertices 0 to 3 of the rectangular frame, midpoints 4 to 7 of each side of the rectangular frame, and the intersection 8 of two diagonals of the rectangular frame. The multiple preset line segments formed by the endpoint control points can include a line segment formed by the intersection 8 and the remaining endpoint control points 0 to 7, and a line segment formed by connecting vertices 0 to 3 with adjacent midpoints respectively. The line segments formed by connecting vertices 0 to 3 with adjacent midpoints can constitute a rectangular frame. The display range determined according to the pattern frame can include pixel points corresponding to the line segments constituting the rectangular frame, and pixel points located inside the rectangular frame.
[0068] In step S120, a pattern frame can be used to display a preset number of character patterns. For example, a pattern frame can be used to display a single character pattern. In this way, the complexity of character pattern display can be reduced and the efficiency of character display can be improved. The above-mentioned pattern frame can be of any shape, such as a rectangle, a square, a rhombus, a parallelogram, etc., which is not limited in the embodiment of the present application.
[0069] S130, determining a straight line equation of the first line segment in the pattern frame according to the endpoint coordinates of the two endpoints.
[0070] S140: Based on the straight line equation, depict the pixel points between the two end points in the first line segment to display the first line segment.
[0071] The display method of the embodiment of the present application can obtain character pattern information, which includes a set of line segments contained in the target character pattern. Then, when the line segment set includes a first line segment, the endpoint coordinates of the two endpoints corresponding to the first line segment in a preset pattern frame are determined, and the straight line equation of the first line segment in the pattern frame is determined according to the endpoint coordinates of the two endpoints. The preset pattern frame includes a preset number of endpoint control points and a plurality of preset line segments formed by connecting the endpoint control points, and the first line segment includes a line segment that does not correspond to the preset line segment. In this way, the non-preset line segment can be mapped to the position corresponding to the pattern frame. Then, the pixel points located between the two endpoints in the first line segment can be depicted based on the straight line equation to display the first line segment. In this way, the pixel points can be depicted based on the straight line equation to realize the display of the non-preset line segment, thereby improving the flexibility of the character pattern display. In addition, the embodiment of the present application does not need to rely on the existing character set library, and has high scalability and versatility.
[0072] In one embodiment, the character pattern information may further include size information of the target character pattern.
[0073] Before determining the endpoint coordinates of two endpoints corresponding to the first line segment in the preset pattern frame, the method may further include:
[0074] The size of the preset pattern frame is adjusted according to the size information of the target character pattern.
[0075] According to the above embodiment, the size of the preset pattern frame can be adjusted according to the size information of the target character pattern. By adjusting the size of the pattern frame, the endpoint coordinates of the two endpoints corresponding to the first line segment in the preset pattern frame will also change accordingly, and then the size of the displayed first line segment can be adjusted. In this way, the size of the displayed target character pattern can be adjusted, and the flexibility of character pattern display can be improved.
[0076] In one embodiment, when the line segment set includes the first line segment, determining the endpoint coordinates of two endpoints corresponding to the first line segment in the preset pattern frame may include:
[0077] According to a preset mapping rule between the character pattern and the first line segment endpoint position, the endpoint positions of two corresponding endpoints of the first line segment of the target character pattern in the preset pattern frame are determined.
[0078] According to the endpoint positions of the two endpoints, the endpoint coordinates of the two endpoints are determined in a preset rectangular coordinate system.
[0079] In one example, the mapping rules between the preset character pattern and the first line segment endpoint position can be obtained from a preset character set. Specifically, the preset character set can store the set of line segments contained in the character pattern and the display rules of each line segment. For non-preset line segments, the display rules may include the display positions of the endpoints of the non-preset line segments in the pattern frame, that is, the above-mentioned endpoint positions. It is easy to understand that in the line segment set of the target character pattern, the number of first line segments can be one or more. When the number of first line segments is multiple, the multiple first line segments can be depicted separately according to the method of the embodiment of the present application.
[0080] In the above-mentioned embodiment, the preset rectangular coordinate system may include an absolute coordinate system established with any pixel point of the display interface as a fixed origin, such as a rectangular coordinate system established with the reference point position of the image displayed in the display interface as the origin. When the rectangular coordinate system is an absolute coordinate system, the endpoint coordinates of the two endpoints can be determined based on the endpoint positions of the two endpoints corresponding to the first line segment in the preset pattern frame, and the position of the pattern frame in the absolute coordinate system. The preset rectangular coordinate system may also include a relative coordinate system established with a certain point in the preset pattern frame as the origin. When the rectangular coordinate system is a relative coordinate system, the endpoint coordinates of the two endpoints can be determined based on the endpoint positions of the two endpoints corresponding to the first line segment in the preset pattern frame.
[0081] According to the above implementation, the endpoints can be mapped to the pattern frame according to the preset mapping rule, and then the endpoint coordinates of the two endpoints can be determined. In this way, the efficiency of determining the endpoint coordinates can be improved, thereby improving the efficiency of character pattern display.
[0082] For ease of understanding, refer to Figure 2 and Figure 3 The above-mentioned embodiment is described.
[0083] like Figure 2 As shown, the pattern frame may be a rectangular frame, and the preset number of endpoint control points may include vertices 0 to 3 of the rectangular frame, midpoints 4 to 7 of the sides of the rectangular frame, and an intersection point 8 of two diagonals of the rectangular frame. The plurality of preset line segments formed by the endpoint control points may include a line segment formed by the intersection point 8 and the remaining endpoint control points 0 to 7, and a line segment formed by connecting vertices 0 to 3 with adjacent midpoints, respectively.
[0084] Take the letter "A" as an example. All strokes of the letter "A" cannot be represented by preset line segments. According to the mapping rule between the preset character pattern and the first line segment endpoint position, the endpoint positions of the two corresponding endpoints of each first line segment in the letter "A" in the pattern frame can be determined respectively. Figure 3As shown, the two endpoints of the first stroke “ / ” of the letter “A” can be located at endpoint control point 1 and endpoint control point 5 respectively; the two endpoints of the second stroke “\” can be located at endpoint control point 3 and endpoint control point 5 respectively; the endpoint 9 of the third stroke “-” can be located at the intersection of the line segment formed by endpoint control points 4 and 8 and the first stroke, and the endpoint 10 can be located at the intersection of the line segment formed by endpoint control points 8 and 7 and the second stroke.
[0085] For the first stroke, the endpoint coordinates of the two corresponding endpoints are the coordinates of endpoint control point 1 and the coordinates of endpoint control point 5. For the second stroke, the endpoint coordinates of the two corresponding endpoints are the coordinates of endpoint control point 3 and the coordinates of endpoint control point 5. For the third stroke, it is necessary to further calculate the endpoint coordinates based on the positions of the two corresponding endpoints in the pattern frame. Specifically, endpoint control point 5, endpoint 9 and endpoint control point 8 can be connected in sequence to obtain triangle 1. Endpoint control point 5, endpoint control point 1 and endpoint control point 6 can be connected in sequence to obtain triangle 2. It is easy to understand that triangle 1 is similar to triangle 2. According to the principle of similar triangles, L 58 / L 56 =L 98 / L 16 , where L 58 Indicates the length of the line segment formed by endpoint control point 5 and endpoint control point 8; L 56 Indicates the length of the line segment formed by endpoint control point 5 and endpoint control point 6; L 98 Indicates the length of the line segment formed by endpoint 9 and endpoint control point 8; L 16 represents the length of the line segment formed by endpoint control point 1 and endpoint control point 6. Since endpoint control point 8 is the intersection of the diagonal lines of the rectangular frame, it is easy to get L 58 / L 56 =0.5, so L 98 =0.5L 16 The length of the line segment formed by the endpoint control point 4 and the endpoint control point 8 is equal to L 16 are equal, so it can be determined that endpoint 9 is located at the midpoint of the line connecting endpoint control point 4 and endpoint control point 8. Further, the coordinates of endpoint 9 can be determined to be the average of the coordinates of endpoint control point 4 and endpoint control point 8. Similarly, the coordinates of endpoint 10 can be determined to be the average of the coordinates of endpoint control point 7 and endpoint control point 8.
[0086] It should be noted that the pattern frame of the embodiment of the present application is not limited to Figure 2 The pattern frame shown. The endpoint control points of the pattern frame can be adjusted according to actual needs. For example, the pattern frame can also include Figure 4 The pattern frame shown. Figure 4As shown, the pattern frame may include endpoint control points 0-8, and multiple preset line segments of the pattern frame may form a field shape. The pattern frame is not limited to a rectangular frame, as long as it can meet the needs of character pattern display, and the embodiment of the present application does not limit this.
[0087] In one embodiment, the two endpoints corresponding to the first line segment in the preset pattern frame may include a first endpoint and a second endpoint.
[0088] According to the endpoint positions of the two endpoints, determining the endpoint coordinates of the two endpoints in a preset rectangular coordinate system may specifically include:
[0089] According to the endpoint positions of the two endpoints, the offsets of the first endpoint and the second endpoint relative to the reference point are determined respectively. The reference point is one of a preset number of endpoint control points, and the reference point is the origin of the rectangular coordinate system.
[0090] Based on the offsets of the first endpoint and the second endpoint relative to the reference point, the first endpoint coordinates (x1, y1) corresponding to the first endpoint and the second endpoint coordinates (x2, y2) corresponding to the second endpoint are determined.
[0091] For the display interface, a fixed origin can be set to establish an absolute coordinate system, and the pixels in the pattern frame can correspond to the coordinate points of the absolute coordinate system. In the embodiment of the present application, the size of the pattern frame can be set according to the size information. Therefore, the size of the pattern frame can be changed, and the coordinates of the pixels contained in the pattern frame will also change with the change of the size. If the first endpoint coordinates and the second endpoint coordinates are expressed in absolute coordinates, a complex calculation process is required. In the above embodiment, a relative coordinate system can be established with the endpoint control point of the pattern frame as the origin. In this way, even if the size of the pattern frame changes, the first endpoint coordinates and the second endpoint coordinates can be calculated relatively easily.
[0092] According to the above embodiment, the offset of the first endpoint and the second endpoint relative to the reference point can be determined based on the endpoint positions of the first endpoint and the second endpoint, so as to accurately and quickly determine the coordinates of the first endpoint and the second endpoint in the relative coordinate system. In this way, the accuracy and efficiency of character pattern display can be improved.
[0093] For ease of understanding, refer to Figure 2 and Figure 5 The above-mentioned embodiment is described.
[0094] Exemplarily, the pattern frame is a rectangular frame, and the width of the rectangle (the line connecting the endpoint control point 0 and the endpoint control point 2, or the line connecting the endpoint control point 1 and the endpoint control point 3) and the height of the rectangle (the line connecting the endpoint control point 0 and the endpoint control point 1, or the line connecting the endpoint control point 2 and the endpoint control point 3) can be a preset ratio, for example, 1:2. In this case, the width of the rectangle is set to 2s, and the height is 4s. When displaying a character pattern, the value of s can be determined according to the size information of the target character pattern.
[0095] Take the endpoint control point (assuming it is endpoint control point 0) with the smallest high pixel point coordinates and wide pixel point coordinates in the pattern frame as the reference point, and set the reference point coordinates to (0, 0). Figure 5 As shown, based on the offset of each endpoint control point relative to the reference point, the coordinates of each endpoint control point can be determined as: endpoint control point 0 (0, 0); endpoint control point 5 (s, 0); endpoint control point 2 (2s, 0); endpoint control point 4 (0, 2s); endpoint control point 8 (s, 2s); endpoint control point 7 (2s, 2s); endpoint control point 1 (0, 4s); endpoint control point 6 (s, 4s); endpoint control point 3 (2s, 4s). Based on the position of endpoint 9, it can be determined that the offset of endpoint 9 relative to the reference point in the width direction is 0.5s, and the offset in the height direction is 2s, and then the coordinates of endpoint 9 are determined to be (0.5s, 2s); based on the position of endpoint 10, it can be determined that the offset of endpoint 10 relative to the reference point in the width direction is 1.5s, and the offset in the height direction is 2s, and then the coordinates of endpoint 10 are determined to be (1.5s, 2s).
[0096] In one embodiment, determining the straight line equation of the first line segment in the pattern frame according to the endpoint coordinate values may specifically include:
[0097] When x1 and x2 are equal, the linear equation of the first line segment in the pattern frame is determined to be x=x i , i is 1 or 2.
[0098] When y1 and y2 are equal, the linear equation of the first line segment in the pattern frame is determined to be y=y k , k is 1 or 2.
[0099] When x1 is not equal to x2, and y1 is not equal to y2, the straight line equation of the first line segment in the pattern frame is determined to be y=(x-x1)(y2-y1) / (x2-x1)+y1.
[0100] According to the above embodiment, the non-preset line segments can be divided into vertical lines (line segments parallel to the y-axis), horizontal lines (line segments parallel to the x-axis) and oblique lines (line segments not parallel to both the x-axis and the y-axis), and then the line equations corresponding to the non-preset line segments can be determined. In this way, based on the corresponding line equations, multiple pixel points corresponding to the non-preset line segments can be determined for depiction. In this way, the non-preset line segments can be accurately displayed, and the accuracy of character pattern display can be improved.
[0101] In one embodiment, when x1 and x2 are equal, the pixel points between the two endpoints in the first line segment are depicted based on the straight line equation, which may specifically include: depicting the pixel points between y1 and y2 along the y-axis direction.
[0102] In one embodiment, when y1 and y2 are equal, the pixel points between the two endpoints in the first line segment are depicted based on the straight line equation, which may specifically include: depicting the pixel points between x1 and x2 along the x-axis direction.
[0103] In one embodiment, based on the straight line equation, depicting the pixel points between the two endpoints in the first line segment may specifically include:
[0104] When x1 is not equal to x2, and y1 is not equal to y2, based on the straight line equation and according to the preset gradient of the horizontal coordinate change, the first pixel point with the horizontal coordinate between x1 and x2 is determined.
[0105] Based on the straight line equation and according to the preset vertical coordinate change gradient, a second pixel point whose vertical coordinate is between y1 and y2 is determined.
[0106] The first pixel point and the second pixel point are depicted.
[0107] According to the above embodiment, when the non-preset line segment is a diagonal line, the pixel points determined based on the straight line equation can be depicted along the x-axis and the y-axis respectively.
[0108] Exemplarily, the first line segment is an oblique line. The coordinates of the first endpoint are (x1, y1), the coordinates of the second endpoint are (x2, y2), x1<x2, y1<y2.
[0109] Assume that the preset horizontal coordinate change gradient is 1. Based on the straight line equation, we can get y = (x-x1) × (y2-y1) / (x2-x1) + y1. Figure 6 As shown, according to y=(x-x1)×(y2-y1) / (x2-x1)+y1, the first pixel points corresponding to when x is x1+1, x1+2, x1+3, etc. can be determined along the x-axis direction. By drawing the first pixel points, a line segment composed of multiple first pixel points can be displayed.
[0110] Assume that the preset vertical coordinate change gradient is 1. Based on the straight line equation, we can get x = (y-y1) × (x2-x1) / (y2-y1) + x1. Figure 7 As shown, according to x=(y-y1)×(x2-x1) / (y2-y1)+x1, the corresponding second pixel points when y is y1+1, y1+2, y1+3, etc. can be determined along the y-axis direction. By drawing the second pixel points, a line segment composed of multiple second pixel points can be displayed.
[0111] The first pixel point and the second pixel point are both pixel points included in the first line segment. According to the above embodiment, the pixel points are depicted along the x-axis and y-axis directions respectively, so that the number of pixel points used to display the first line segment can be increased. In this way, the displayed first line segment can be made clearer, thereby improving the quality of the character pattern display.
[0112] It should be noted that the embodiment of the present application does not specifically limit the order of depicting the first pixel point and the second pixel point. The first pixel point can be depicted first, or the second pixel point can be depicted first, or the first pixel point and the second pixel point can be depicted at the same time.
[0113] In one embodiment, based on the straight line equation, depicting the pixel points between the two endpoints in the first line segment may specifically include:
[0114] Based on the straight line equation, the pixel component values of the pixels located between the two endpoints in the first line segment are modified to be the target values.
[0115] In an embodiment of the present application, before displaying, the pixel point can be defaulted to not being displayed. In the above implementation, the pixel component value may include a color channel component value (RGB) or a color encoding value (yuv). The target value may include a value set based on the color of the character pattern to be displayed, or a value set based on the configuration of the display. After the pixel component value of the pixel point is modified to the target value, the pixel point can be displayed in the corresponding color.
[0116] According to the above embodiment, the pixel component values are modified to depict the pixels, thereby displaying the first line segment, so that the display can be performed simply and directly, thereby improving the operating efficiency of the character pattern display.
[0117] In one embodiment, after acquiring the character pattern information, the method may further include:
[0118] When the line segment set includes a second line segment, a target code corresponding to the target character pattern is obtained from a preset code set, and the second line segment includes a line segment corresponding to the preset line segment. The target code is used to represent a target preset line segment corresponding to the second line segment among multiple preset line segments.
[0119] The target code is decoded through the display interface to determine the target preset line segment in the pattern frame.
[0120] The pixel points corresponding to the target preset line segment are depicted to display the second line segment.
[0121] In the above implementation, the preset code set may include pre-set codes corresponding to the character patterns in a one-to-one correspondence.
[0122] In the above implementation, when the line segments included in the target character pattern can be displayed using preset line segments, the target code corresponding to the target character pattern can be obtained from the preset code set. The display interface can determine the target preset line segment in the pattern frame by decoding the target code, and then depict and display the second line segment. In this way, the efficiency of displaying the preset line segments can be improved.
[0123] According to the embodiment of the present application, when the target character pattern includes non-preset line segments and preset line segments, the non-preset line segments and the preset line segments can be drawn in different ways, respectively, so that the display of the character pattern can be both flexible and efficient.
[0124] In one embodiment, the preset pattern frame may be a rectangular frame, and the preset number of endpoint control points may include the vertices of the rectangular frame, the midpoints of the sides of the rectangular frame, and the intersections of two diagonals of the rectangular frame. The plurality of preset line segments formed by the endpoint control points may include a line segment formed by the intersection point and the remaining endpoint control points, and a line segment formed by the vertex and the adjacent midpoint.
[0125] In the above implementation, the line segments formed by connecting the intersection point with the other endpoint control points can form a cross shape, and the line segments formed by connecting the vertex with the adjacent midpoint can form a rectangle. In the pattern frame thus obtained, multiple preset line segments can be combined into multiple character patterns in different combinations, thereby improving the efficiency of character pattern display.
[0126] In an embodiment of the present application, the method of depicting the pixel points corresponding to the target preset line segment is similar to the method of depicting the pixel points corresponding to the first preset line segment, except that the endpoint coordinates of the target preset line segment in the pattern frame can be directly obtained.
[0127] In one embodiment, the plurality of preset line segments may include a horizontal line and a vertical line. The two endpoints of the target preset line segment may include a third endpoint with coordinates (x3, y3) and a fourth endpoint with coordinates (x4, y4). Describing the pixel points corresponding to the target preset line segment may include:
[0128] When x3 and x4 are equal, the pixel points between y3 and y4 are drawn along the y-axis direction.
[0129] When y3 and y4 are equal, the pixel points between x3 and x4 are drawn along the x-axis direction.
[0130] In one embodiment, the preset coding set may include coding results obtained by encoding a plurality of preset line segments according to preset coding rules according to the line segment sets included in each character pattern.
[0131] Exemplarily, the encoding rules may include:
[0132] The encoding bit corresponding to the target preset line segment is set to a target value, where the target preset line segment includes a line segment corresponding to the second line segment of the line segment set from among the plurality of preset line segments.
[0133] The coding bit corresponding to the non-target preset line segment is set to a non-target value, and the non-target preset line segment includes a line segment in the plurality of preset line segments that does not correspond to the second line segment in the line segment set.
[0134] According to the encoding rule of the above embodiment, the obtained encoding result can more intuitively represent the target preset line segment corresponding to the second line segment among the plurality of preset line segments. In this way, the processing efficiency of character pattern display can be improved.
[0135] In one embodiment, the above encoding may be binary encoding.
[0136] For example, Figure 8 As shown, the pattern frame can be a rectangular frame, and the preset number of endpoint control points can include the vertices of the rectangular frame, the midpoints of each side of the rectangular frame, and the intersection of two diagonals of the rectangular frame. The multiple preset line segments 00 to 15 formed by the endpoint control points can include line segments formed by connecting the intersection points with the remaining endpoint control points, and line segments formed by connecting the vertices with adjacent midpoints. Exemplarily, a 16-bit binary code can be designed, and each encoding bit of the code corresponds to a preset line segment. If the line segment set of the character pattern includes a second line segment corresponding to the preset line segment, the preset line segment needs to be displayed, and the encoding bit corresponding to the preset line segment can be set to the target value 1, otherwise it is set to the non-target value 0.
[0137] As an example, when none of the preset line segments 00 to 15 need to be displayed, the binary codes of the multiple preset line segments may be 0b0000000000000000. 0b represents a binary number flag, and the code bits after 0b correspond to line segments 00 to 15 from right to left. In some embodiments, after the binary codes of the multiple preset line segments are obtained, the binary codes may be converted into other forms of codes, such as hexadecimal codes, according to actual needs. For example, the above binary code 0b0000000000000000 may be converted into a hexadecimal code 0x0000, where 0x represents a hexadecimal number flag.
[0138] As another example, when the Arabic numeral 1 needs to be displayed, that is, when only the line segment 05 and the line segment 06 need to be displayed, the corresponding binary code may be 0b0000000001100000. Converting to the hexadecimal code may yield 0x0060. The binary code or the hexadecimal code is sent to the display interface, and the display interface may control the image to display the Arabic numeral 1 at the specified position.
[0139] Based on the above encoding rules, the codes corresponding to different character patterns can be obtained. Accordingly, by decoding different binary codes and drawing pixels according to the decoding results, the display results corresponding to different character patterns can be obtained. Some examples can be shown as follows: Figures 9 to 14 shown.
[0140] See also Fig. 9 , when the binary code is 0b0000000001110111, after decoding and drawing, the corresponding character pattern "0" can be displayed. Fig.10 , when the binary code is 0b0000000001100000, it can be decoded and drawn to display the character pattern "1". Fig.11 , when the binary code is 0b0000000000111110, after decoding and drawing, it can display the character pattern "2". Fig.12 , when the binary code is 0b0000111110011111, it can be decoded and drawn to display the character pattern "B". Fig.13 , when the binary code is 0b0000001010010111, it can be decoded and drawn to display the character pattern "C". Fig.14 When the binary code is 0b0101000001000000, it can be decoded and drawn to display the corresponding character pattern "Y".
[0141] In one embodiment, decoding the target code through the display interface to determine the target preset line segment in the pattern frame may specifically include:
[0142] The values of a plurality of coding bits in the target code are polled through the display interface, and the plurality of coding bits include coding bits corresponding to a plurality of preset line segments one by one.
[0143] When the value of the coding bit is the target value, the corresponding preset line segment in the pattern frame is determined to be the target preset line segment.
[0144] Exemplarily, continuing to refer to the binary encoding method described above, when decoding, it is assumed that the value of the counter is i, and the encoding value is recorded as code. i starts from 00 and increases by 1 each time until i is equal to 15. Every time the counter i increases by 1, the code value moves one binary bit to the lower end as a whole (that is, the binary bit corresponding to the counter value is moved to the lowest bit), and then the value of the lowest bit is detected. If it is the target value 1, the preset line segment numbered i is determined to be the target preset line segment. This cycle is repeated 16 times. All preset line segments can be polled once, and all target preset line segments contained in the target character pattern are determined and drawn. For example, for the encoding value code = 0b0000000011100100, decoding can be performed through the following steps:
[0145] Step 1: code does not move, i=00; code=0b0000000011100100, the lowest bit is detected to be 0, and segment 00 is not the target preset segment.
[0146] Step 2: code is shifted right by 1 bit, i=01; code=0b000000001110010, the lowest bit is detected to be 0, and line segment 01 is not the target preset line segment.
[0147] Step 3: code is shifted right by 1 bit, i=02; code=0b00000000111001, the lowest bit is detected to be 1, and line segment 02 is the target preset line segment.
[0148] Execute to step 16 in this way to complete the decoding.
[0149] The above implementation method can quickly determine the target preset line segment corresponding to the second line segment among the multiple preset line segments by polling the values of multiple encoding bits in the encoding result through the display interface, thereby improving the processing efficiency of character pattern display.
[0150] Based on the same inventive concept, an embodiment of the present application also provides a display device.
[0151] like Fig.15 As shown, the display device 200 may include an acquisition module 201 , a determination module 202 and a depiction module 203 .
[0152] The acquisition module 201 is used to acquire character pattern information, where the character pattern information includes a set of line segments included in the target character pattern.
[0153] The determination module 202 is used to determine the endpoint coordinates of the two endpoints corresponding to the first line segment in a preset pattern frame when the line segment set includes the first line segment, the preset pattern frame includes a preset number of endpoint control points and a plurality of preset line segments formed by connecting the endpoint control points, and the first line segment includes a line segment that does not correspond to the preset line segment.
[0154] The determination module 202 is further used to determine the straight line equation of the first line segment in the pattern frame according to the endpoint coordinates of the two endpoints.
[0155] The drawing module 203 is used to draw the pixel points between the two end points in the first line segment based on the straight line equation to display the first line segment.
[0156] The display device of the embodiment of the present application can obtain character pattern information, which includes a set of line segments contained in the target character pattern. Then, when the line segment set includes a first line segment, the endpoint coordinates of the two endpoints corresponding to the first line segment in the preset pattern frame are determined, and the straight line equation of the first line segment in the pattern frame is determined according to the endpoint coordinates of the two endpoints. The preset pattern frame includes a preset number of endpoint control points and a plurality of preset line segments formed by connecting the endpoint control points, and the first line segment includes a line segment that does not correspond to the preset line segment. In this way, the non-preset line segment can be mapped to the position corresponding to the pattern frame. Then, the pixel points located between the two endpoints in the first line segment can be depicted based on the straight line equation to display the first line segment. In this way, the pixel points can be depicted based on the straight line equation to realize the display of the non-preset line segment, thereby improving the flexibility of the character pattern display. In addition, the embodiment of the present application does not need to rely on the existing character set library, and has high scalability and versatility.
[0157] In one embodiment, the apparatus may further include:
[0158] The acquisition module is also used to obtain the target code corresponding to the target character pattern from the preset code set when the line segment set includes the second line segment, and the second line segment includes the line segment corresponding to the preset line segment, and the target code is used to represent the target preset line segment corresponding to the second line segment among multiple preset line segments.
[0159] The determination module is used to decode the target code through the display interface to determine the target preset line segment in the pattern frame.
[0160] The drawing module is used to draw the pixel points corresponding to the target preset line segment to display the second line segment.
[0161] In one embodiment, the character pattern information may further include size information of the target character pattern.
[0162] The device may also include:
[0163] The adjustment module is used to adjust the size of the preset pattern frame according to the size information of the target character pattern before determining the endpoint coordinates of the two endpoints corresponding to the first line segment in the preset pattern frame.
[0164] In one embodiment, the determination module may be specifically used to:
[0165] Determine the endpoint positions of two corresponding endpoints of the first line segment of the target character pattern in the preset pattern frame according to a preset mapping rule between the character pattern and the endpoint position of the first line segment;
[0166] According to the endpoint positions of the two endpoints, the endpoint coordinates of the two endpoints are determined in a preset rectangular coordinate system.
[0167] In one embodiment, the two endpoints corresponding to the first line segment in the preset pattern frame may include a first endpoint and a second endpoint. The determination module may be specifically used to:
[0168] According to the endpoint positions of the two endpoints, the offsets of the first endpoint and the second endpoint relative to the reference point are determined respectively. The reference point is one of a preset number of endpoint control points, and the reference point is the origin of the rectangular coordinate system.
[0169] Based on the offsets of the first endpoint and the second endpoint relative to the reference point, the first endpoint coordinates (x1, y1) corresponding to the first endpoint and the second endpoint coordinates (x2, y2) corresponding to the second endpoint are determined.
[0170] In one embodiment, the drawing module is used to draw the pixel points between the two endpoints in the first line segment based on the straight line equation, which may specifically include:
[0171] The determination module is used to determine the first pixel point with a horizontal coordinate between x1 and x2 based on the straight line equation and according to a preset horizontal coordinate change gradient when x1 and x2 are not equal and y1 and y2 are not equal.
[0172] The determination module is further used to determine a second pixel point whose ordinate is between y1 and y2 based on the straight line equation and according to a preset ordinate change gradient.
[0173] The drawing module is used to draw the first pixel point and the second pixel point.
[0174] In one embodiment, the drawing module is used to draw the pixel points between the two endpoints in the first line segment based on the straight line equation, which may specifically include:
[0175] The modification module is used to modify the pixel component value of the pixel point located between the two endpoints in the first line segment to a target value based on the straight line equation.
[0176] In one embodiment, the preset pattern frame may be a rectangular frame, and the preset number of endpoint control points may include the vertices of the rectangular frame, the midpoints of the sides of the rectangular frame, and the intersections of two diagonals of the rectangular frame. The plurality of preset line segments formed by the endpoint control points may include a line segment formed by the intersection point and the remaining endpoint control points, and a line segment formed by the vertex and the adjacent midpoint.
[0177] The display device provided in the embodiment of the present application can achieve Figure 1 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0178] Fig.16 A schematic diagram of the hardware structure of a display device provided in an embodiment of the present application is shown.
[0179] The display device may include a processor 301 and a memory 302 storing computer program instructions.
[0180] Specifically, the processor 301 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0181] The memory 302 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 302 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 302 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 302 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 302 is a non-volatile solid-state memory.
[0182] The memory may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.
[0183] The processor 301 implements any one of the display methods in the above embodiments by reading and executing the computer program instructions stored in the memory 302 .
[0184] As an example, the display device may further include a communication interface 303 and a bus 310. Fig.16 As shown, the processor 301, the memory 302, and the communication interface 303 are connected via a bus 310 and communicate with each other.
[0185] The communication interface 303 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0186] Bus 310 includes hardware, software or both, and the parts of online data flow billing equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front-end bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 310 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.
[0187] The display device can execute the display method in the embodiment of the present application, thereby realizing the combination Figure 1 and Fig.15 The display method and device described.
[0188] In addition, in combination with the data processing method in the above embodiments, the present application embodiment can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the data processing methods in the above embodiments is implemented.
[0189] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0190] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0191] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0192] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0193] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A display method, It is characterized in that include: Acquire character pattern information, wherein the character pattern information includes a set of line segments included in the target character pattern; In a case where the line segment set includes a first line segment, determining endpoint coordinates of two endpoints corresponding to the first line segment in a preset pattern frame, the preset pattern frame includes a preset number of endpoint control points and a plurality of preset line segments formed by connecting the endpoint control points, and the first line segment includes a line segment that does not correspond to the preset line segment; Determine a straight line equation of the first line segment in the pattern frame according to the endpoint coordinates of the two endpoints; Based on the straight line equation, pixel points in the first line segment located between the two endpoints are depicted to display the first line segment.
2. The method according to claim 1, It is characterized in that After acquiring the character pattern information, the method further includes: In a case where the line segment set includes a second line segment, obtaining a target code corresponding to the target character pattern from a preset code set, the second line segment includes a line segment corresponding to the preset line segment, and the target code is used to represent a target preset line segment corresponding to the second line segment among the plurality of preset line segments; Decoding the target code through a display interface to determine the target preset line segment in the pattern frame; The pixel points corresponding to the target preset line segment are depicted to display the second line segment.
3. The method according to claim 1, It is characterized in that The character pattern information also includes size information of the target character pattern; Before determining the endpoint coordinates of two endpoints corresponding to the first line segment in the preset pattern frame, the method further includes: The size of the preset pattern frame is adjusted according to the size information of the target character pattern.
4. The method according to claim 1, It is characterized in that The step of determining the endpoint coordinates of two endpoints corresponding to the first line segment in a preset pattern frame includes: Determining the endpoint positions of two corresponding endpoints of the first line segment of the target character pattern in a preset pattern frame according to a preset mapping rule between the character pattern and the endpoint position of the first line segment; According to the endpoint positions of the two endpoints, the endpoint coordinates of the two endpoints are determined in a preset rectangular coordinate system.
5. The method according to claim 4, It is characterized in that The two endpoints corresponding to the first line segment in the preset pattern frame include a first endpoint and a second endpoint; Determining the endpoint coordinates of the two endpoints in a preset rectangular coordinate system according to the endpoint positions of the two endpoints includes: Determine, according to the endpoint positions of the two endpoints, the offsets of the first endpoint and the second endpoint relative to a reference point, respectively, wherein the reference point is one of the preset number of endpoint control points, and the reference point is the origin of the rectangular coordinate system; Based on the offsets of the first endpoint and the second endpoint relative to the reference point, the first endpoint coordinate (x 1 ,y 1 ), and the second endpoint coordinates (x 2 ,y 2 ).
6. The method according to claim 5, It is characterized in that Describing the pixel points between the two endpoints in the first line segment based on the straight line equation includes: In the x 1 With the x 2 are not equal, and the y 1 With the y 2 If they are not equal, based on the straight line equation, the horizontal coordinate is determined at x according to the preset horizontal coordinate change gradient. 1 to x 2 The first pixel between ; Based on the straight line equation, according to the preset vertical coordinate change gradient, determine the vertical coordinate at y 1 To 2 The second pixel between The first pixel point and the second pixel point are depicted.
7. The method according to claim 1, It is characterized in that Describing the pixel points between the two endpoints in the first line segment based on the straight line equation includes: Based on the straight line equation, pixel component values of pixels located between the two endpoints in the first line segment are modified to target values.
8. The method according to any one of claims 1 to 7, It is characterized in that The preset pattern frame is a rectangular frame, and the preset number of endpoint control points include the vertices of the rectangular frame, the midpoints of each side of the rectangular frame, and the intersections of two diagonals of the rectangular frame; the multiple preset line segments formed by connecting the endpoint control points include line segments formed by connecting the intersections and the remaining endpoint control points, and line segments formed by connecting the vertices and the adjacent midpoints.
9. A display device, It is characterized in that include: An acquisition module, used for acquiring character pattern information, wherein the character pattern information includes a set of line segments included in the target character pattern; a determination module, configured to determine, when the line segment set includes a first line segment, endpoint coordinates of two endpoints corresponding to the first line segment in a preset pattern frame, the preset pattern frame including a preset number of endpoint control points and a plurality of preset line segments formed by connecting the endpoint control points, and the first line segment including a line segment that does not correspond to the preset line segment; The determination module is further used to determine a straight line equation of the first line segment in the pattern frame according to the endpoint coordinates of the two endpoints; A drawing module is used to draw the pixel points located between the two endpoints in the first line segment based on the straight line equation to display the first line segment.
10. An electronic device, It is characterized in that The device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the display method according to any one of claims 1 to 8 is implemented.
11. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the display method according to any one of claims 1 to 8 is implemented.
12. A computer program product, It is characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the display method as described in any one of claims 1 to 8.
