Drawing method and device for highlight primitives and storage medium
Through pixel-level concurrent computing and multi-style presentation mechanism, the problems of resource consumption and single effect of existing highlight display technology in complex graphic processing are solved, efficient and diversified highlight display effects are achieved, and user experience and drawing refresh efficiency are improved.
Patent Information
- Application Number
- CN202510849518.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-24
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2045-06-24
AI Technical Summary
Existing highlight display technology consumes a lot of hardware resources and computing time when processing large or complex graphics elements, affecting user experience and work efficiency. In addition, the highlight effect is single and it is difficult to meet users' needs for interface aesthetics and information differentiation.
A multi-style presentation mechanism based on pixel-level concurrent computing is adopted. Through a one-to-one correspondence between texels and pixels, each texel contains a counting unit to record the number of responses of the highlight style. The highlight effect is optimized by combining design parameters and mixing order to achieve diversified highlight display.
The drawing refresh efficiency has been optimized, the highlight effect has been refined, the user operation efficiency and visual effects have been improved, visual confusion has been avoided, and the highlight requirements of different graphic types and function types have been adapted.
Smart Images

Figure CN120726166A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer graphics, and in particular to a method, device, and storage medium for drawing highlight primitives. Background Art
[0002] In modern computer graphics and interactive visualization systems, users are increasingly demanding more efficient information acquisition and more accurate operations. Whether in architectural design, mechanical manufacturing, or urban planning, designers and engineers need to quickly identify key objects within complex drawings. To this end, highlighting primitives has become a key interactive tool. By changing visual attributes like color and line thickness to emphasize specific elements, highlighting them improves user efficiency and accuracy.
[0003] For example, the invention patent application with patent application publication number CN113204296A discloses a method, device, equipment and storage medium for highlighting graphic elements. The method includes: determining the unique identifier of the graphic element corresponding to the mouse click position in the target drawing; obtaining each element with the unique identifier of the graphic element in the target drawing, wherein one element corresponds to one unique identifier of the graphic element, and the unique identifiers of the elements in the same graphic element are consistent; rendering the obtained elements and highlighting them.
[0004] For example, the invention patent application with patent application publication number CN118314007A discloses a drawing review method based on the building information model. By using the same identification information in three-dimensional components and two-dimensional graphic elements, the building information design model data can be associated with the two-dimensional drawings. Based on the association relationship, when the two-dimensional graphic element is selected, the corresponding three-dimensional model component can be quickly navigated and located, providing accurate two- and three-dimensional spatial relationships, and a corresponding drawing review system is constructed to provide a review environment.
[0005] However, existing highlight display technology not only has a single highlight effect, but also consumes a lot of hardware resources and computing time when processing a large number of or complex graphics elements, seriously affecting user experience and work efficiency. Summary of the Invention
[0006] The main purpose of this application is to provide a method, device and storage medium for drawing highlight primitives. In order to solve the above-mentioned technical problems, this application specifically adopts the following technical solutions: A first aspect of the present application is to provide a method for drawing a highlight primitive, the method comprising: S101, obtaining a basic drawing and creating a plurality of texels based on the basic drawing, wherein the texels correspond one-to-one to pixels in the basic drawing; wherein each texel includes a plurality of counting units, and different counting units are used to record the number of responses of different highlight styles; S102, in response to an element highlighting operation, determining at least one highlighted element and a highlighting style corresponding to each highlighted element from a plurality of elements in the base drawing; S103, determining a target texel according to the pixels covered by the highlight primitive; determining a target counting unit in the target texel according to a highlight pattern corresponding to the highlight primitive, and updating the number of responses recorded by the target counting unit; S104, determining highlight display characteristics of each texel based on design parameters of different highlight styles and the number of responses recorded in the counting unit of each texel; S105 , obtaining the main body display feature of each pixel, and mixing the main body display feature and the highlight display feature according to the correspondence between texels and pixels to obtain a target drawing.
[0007] In some embodiments, the design parameters include filling element parameters and display area parameters, and the display area parameters include overlay display. S104 includes: reading the counting unit in the first texel to determine the first highlight style to be responded to; if the display area parameter of the first highlight style is overlay display, determining the overlay highlight display feature of the first texel according to the corresponding filling element parameter and the number of responses; mixing several of the overlay highlight display features to obtain the first highlight display feature of the first texel.
[0008] In some embodiments, the display area parameters include outward expansion display, and S104 also includes: based on a preset position relationship, obtaining several second texels corresponding to the first texel, reading the counting unit in the second texel, and determining the second highlight style to be responded to; if the display area parameters of the second highlight style are outward expansion display, determining the outward expansion highlight display characteristics of the first texel according to the corresponding filling element parameters and the number of responses; mixing several of the outward expansion highlight display characteristics to obtain the second highlight display characteristics of the first texel.
[0009] In some embodiments, the highlighting style is divided based on primitive type and / or function type.
[0010] In some embodiments, S104 also includes: determining a first display priority between highlight styles based on the functional type of the highlight primitive; determining a second display priority between highlight styles within the same first display priority based on the primitive type of the highlight primitive; and determining a mixing order of highlight display features of each highlight style based on the first display priority and the second display priority between the highlight styles.
[0011] In some embodiments, the function type includes selected highlight and preview highlight; S104 also includes: when the function type is selected highlight, the lower the visibility of the graphic element type, the higher the second display priority; when the function type is preview highlight, the higher the visibility of the graphic element type, the higher the second display priority.
[0012] In some embodiments, when the highlight style is divided based on the primitive type and the function type, the method further includes: dividing the counting units according to the primitive type; and dividing sub-counting units within each counting unit according to the function type.
[0013] In some embodiments, the method further includes: when the highlight style is divided based on the primitive type, allocating data bits of the texel according to the visibility of the primitive type, wherein the counting unit corresponding to the primitive type with higher visibility occupies more data bits.
[0014] A second aspect of the present application is to provide a computer device, the device comprising: memory for storing computer programs; A processor is used to execute the computer program and implement the steps of the method for drawing a highlighted graphic element as provided in any embodiment of the present application when executing the computer program.
[0015] The third aspect of the present application is to provide a corresponding computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor performs the steps of the method for drawing a highlighted graphic element as provided in any embodiment of the present application.
[0016] Beneficial effects: The embodiments of the present application provide a method, device, and storage medium for drawing highlight primitives, specifically providing a highlight effect drawing mechanism based on pixel-level concurrent computing and multi-style presentation. Each texel acts as an independent pixel-level processing unit, and its built-in counting unit accurately records the superposition intensity of different highlight styles on the corresponding pixel. During the drawing process, the highlight effects of multiple highlight styles are blended based on the blending order constraints of the counting unit, and the display characteristics of the primitives are also blended and drawn. This optimizes the drawing refresh efficiency while also presenting a refined highlight effect.
[0017] Specifically, texels correspond one-to-one to pixels in the drawing. By dividing the counting units in the texels, different highlight styles can be counted independently, and a corresponding response number manifestation strategy is provided to form a highlight effect, meeting the use requirements of diverse highlight styles; combined with the data bit differentiation allocation strategy, more storage resources are allocated to the counting units of high-visibility highlight styles, so that they have sufficient counting upper limits when multiple layers of highlights are superimposed, thereby making the subsequently generated highlight display effects have clearer and more delicate layered performance, while the counting units of low-visibility highlight styles are relatively streamlined, reducing storage overhead and improving drawing efficiency.
[0018] For highlighted primitives, a lightweight update is performed to count the response times of the corresponding counter units within the target texels covered by the primitive. Based on the response times and the blending order, the highlight display features of each texel can be determined in parallel, improving drawing refresh efficiency. The blending and rendering of the base primitive's main display features and the highlight display features are completed in a single rendering pass, eliminating the need for secondary primitive traversal or drawing overhead, further improving drawing refresh efficiency.
[0019] Furthermore, in the process of generating highlight effects, the mixing order of various highlight styles is constrained to avoid visual confusion caused by the superposition of multiple styles, so that key elements in complex drawings can be highlighted in an intuitive way, improving the visual effect of highlighting and thus improving user operation efficiency. For example, different display priorities are given to the two types of highlight functions, selected highlight and preview highlight, so that the highlighted object corresponding to the selected highlight is always in the visual focus position, while the preview highlight is set to a low priority to avoid interfering with the main view. For example, for different types of elements, intelligent adjustments are made according to the scene. Under selected highlighting, the display priority of low-visibility elements is increased to avoid occlusion, and under preview highlighting, the display priority of high-visibility elements is increased to maintain the integrity of the area. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following is a brief introduction to the drawings required for the embodiments or the description of the prior art. In all drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the various elements or parts are not necessarily drawn according to the actual scale. Obviously, the drawings described below are some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without paying any creative work.
[0021] Figure 1 This is a schematic flow chart of a method for drawing a highlighted graphic element provided in an embodiment of the present application; Figure 2 is a schematic diagram of a texel data structure provided in an embodiment of the present application; Figure 3is a schematic diagram of a different highlight style provided in an embodiment of the present application; Figure 4 This is a schematic diagram of a counting unit division provided in an embodiment of the present application; Figure 5 This is a schematic diagram of a highlight display effect provided by an embodiment of the present application; Figure 6 This is another schematic diagram of a highlight display effect provided by an embodiment of the present application; Figure 7 is a schematic diagram of another texel data structure provided in an embodiment of the present application; Figure 8 It is a schematic diagram of a preset position relationship provided by the implementation of this application; Figure 9 This is another schematic diagram of a highlight display effect provided by an embodiment of the present application; Figure 10 This is a schematic block diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] To make the purpose, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0023] Herein, suffixes such as "module," "component," or "unit" used to represent elements are only used to facilitate the description of the present application and have no specific meaning. Therefore, "module," "component," or "unit" can be used interchangeably.
[0024] As used herein, terms such as "upper," "lower," "inner," "outer," "front," "back," "one end," and "the other end" indicate positions or locations based on those shown in the accompanying drawings. These terms are intended solely to facilitate the description of this application and simplify the description. They are not intended to indicate or imply that the devices or components referred to must have, be constructed, or operate in a specific orientation. Therefore, they should not be construed as limitations on this application. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0025] As used herein, unless otherwise expressly specified or limited, the terms "installed," "provided with," "connected," etc., should be understood broadly. For example, "connected" may refer to a fixed connection, a detachable connection, or an integral connection; it may refer to a mechanical connection, a direct connection, an indirect connection through an intermediate medium, or internal communication between two components. Those skilled in the art will understand the specific meanings of the above terms in this application.
[0026] As used herein, "and / or" includes any and all combinations of one or more of the associated listed items.
[0027] Herein, "plurality" means two or more than two, ie, it includes two, three, four, five, etc.
[0028] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0029] In this context, a drawing is a technical document used to express design intent, engineering plans, or manufacturing requirements. It accurately and in detail depicts the shape, dimensions, construction, and components of an object through a combination of graphic elements. Drawings can be two-dimensional, such as plans, sections, and elevations, or three-dimensional, such as isometrics or perspectives. Furthermore, drawings can be CAD drawings, in formats such as dwg, dxf, or dwt. They can also be ProE drawings, SolidWorks drawings, and so on, without limitation.
[0030] In this article, graphic units refer to the basic components in drawings, which can also be called graphic elements, primitives, and entities. They are used to convey design intent, structural details, and dimensional information. They include but are not limited to geometric shapes such as points, lines, circles, arcs, polygons, as well as dimension annotations, text descriptions, and user-defined primitives. There is no limitation on this.
[0031] Highlighting in this article refers to enhancing the visual recognition of specific graphic elements through various highlight styles, making specific graphic elements more eye-catching, emphasizing important information, improving readability, or facilitating interactive operations. Among them, the highlight style is a pre-set display effect, including but not limited to changing color, changing outline style, adjusting fill effect or transparency, texture overlay, etc. The specific highlight style can be flexibly set according to needs and is not limited here. For example, in Computer Aided Design (CAD) software or other drawing tools, in response to a user's selection or hover operation, a certain graphic element will be temporarily highlighted with a pre-set highlight style to view detailed information or edit it.
[0032] Currently, traditional highlighting solutions require first drawing the primitive itself and then applying the highlighting effect, resulting in the overhead of two full-image renderings. To create a highlighting effect, the coverage area of the primitive to be highlighted (such as a graphic, object, or specific area) is generally identified and determined. This coverage area is then divided into several triangular facets using a triangulation algorithm and filled with a semi-transparent color to achieve visual emphasis.
[0033] In actual applications, since its highlighting style relies primarily on fixed semi-transparent color fills and lacks diverse visual expressions, the highlighting effect is relatively simple and fails to meet users' demands for interface aesthetics and information differentiation. On the other hand, when faced with a large number of primitives or complex graphics, two full-image renderings and triangulation often require high computing resources and time overhead. Especially in large-scale data interaction or real-time rendering scenarios, this performance bottleneck can lead to slow interface response and decreased frame rate, seriously affecting the smoothness of rendering and the user's operational experience.
[0034] Based on this, the embodiments of the present application provide a method, device, and storage medium for drawing highlight primitives, specifically providing a highlight effect drawing mechanism based on pixel-level concurrent calculation and multi-style presentation. Each texel acts as an independent processing unit at the pixel level, and its built-in counting unit accurately records the superposition intensity of different highlight styles on the corresponding pixel. During the drawing process, the highlight effects of multiple types of highlight styles are mixed based on the mixing order constraints of the counting unit, and the display characteristics of the primitives are also mixed and drawn. In this way, while optimizing the drawing refresh efficiency, the highlight effect is presented in a refined manner.
[0035] The following describes some embodiments of the present application in detail with reference to the accompanying drawings. In the absence of conflict, the following embodiments and features of the embodiments can be combined with each other. Figure 1 , Figure 1 This is a schematic flow chart of a method for drawing a highlighted graphic element provided in an embodiment of the present application. Figure 1As shown, an embodiment of the present application provides a method for drawing a highlight primitive, which includes S101 to S105.
[0036] S101, obtaining a basic drawing, and creating a plurality of texels according to the basic drawing, wherein the texels correspond one-to-one to pixels in the basic drawing; wherein each texel includes a plurality of counting units, and different counting units are used to record the number of responses of different highlight styles.
[0037] The basic drawing may be the entire original design drawing, or may be only a portion of the original design drawing presented in the display window, which includes several graphics elements to be drawn and their spatial coordinate information.
[0038] A texel is an independent processing unit that precisely corresponds to each pixel in the base drawing. Each texel is associated with a unique pixel through coordinate mapping. For example, an equal number of texels are created based on the total number of pixels in the base drawing, and a one-to-one coordinate mapping relationship is established between each texel and each pixel.
[0039] In some embodiments, the positional relationship between texels is determined based on the positional relationship between pixels and the correspondence between texels and pixels, so that the distribution relationship between pixels and the distribution relationship between texels also have a one-to-one correspondence. For example, if pixel A is adjacent to pixel B and is located on the right side, then texel A corresponding to pixel A is adjacent to texel B corresponding to pixel B and is located on the right side.
[0040] Exemplarily, a texture of a display window with a size equal to that of the base drawing is initialized. For example, if the display window is a pixel rectangle of 1960×1080, the size of the initialized texture is also a texel rectangle of 1960×1080. A unit in the texture is called a texel. The size of the texel is equal to the size of the pixel in the display window. The distribution relationship of the texels in the texture is equal to the distribution relationship of the pixels in the display window. At this time, a one-to-one mapping relationship is established between the pixels and texels with the same coordinates in the pixel rectangle and the texel rectangle, and the positional relationship between the pixels corresponds to the positional relationship between the texels. It should be understood that in the process of drawing the primitives, a texture corresponding to the highlight style is maintained. Based on the texture, the highlight color value and transparency of each texel can be calculated, and then superimposed and mixed with the corresponding pixels in the display window to obtain an image with a highlight effect.
[0041] The counting unit is a storage structure within the texel that records the number of responses to various highlight patterns. Different counting units independently record the number of responses to different highlight patterns. The response count refers to the cumulative number of times a highlight pattern has been applied to a single pixel. The higher this value, the more pronounced the highlight effect on that pixel.
[0042] For example, each texel is divided into multiple independent counting units, the number of which is the number of different highlight styles. During initialization, all counting units are cleared or set to a unified initial value to record the number of responses corresponding to the highlight style. The response number is correlated with the transparency and color value of the highlight feature in the final blending. For example, when a primitive is highlighted, the value of the counting unit corresponding to the highlight style in the texel corresponding to the pixel it covers is incremented.
[0043] See also Figure 2 , Figure 2 This is a schematic diagram of a data structure of a texel provided in an embodiment of the present application. The texels are arranged according to the distribution relationship between the pixels. Figure 2 As shown on the left, each square represents a texel. The data structure for any texel is as follows Figure 2 As shown in the black dashed box on the right, a texel can be divided into multiple counting units, where each color represents the data bit of a counting unit. Different counting units are represented by different colors. The number of responses to highlight pattern a corresponds to the yellow counting unit a; the number of responses to highlight pattern b corresponds to the red counting unit b; the number of responses to highlight pattern c corresponds to the green counting unit c; and the number of responses to highlight pattern d corresponds to the blue counting unit d. It should be understood that the one-to-one mapping between texels and pixels, combined with the independent recording of different patterns by the counting units, provides the data foundation for the subsequent superposition and blending of highlight effects.
[0044] In some embodiments, the highlighting style is divided based on primitive type and / or function type.
[0045] The "element type" refers to the type of each graphic element in the base drawing. It should be noted that element classification rules can include conventional basic element type classifications, such as points, lines (e.g., paths between two points), text (e.g., elements that carry character information), and surfaces (e.g., closed, filled areas). User-defined classification rules are also possible, such as points, lines with a pixel width equal to 1, lines with a pixel width greater than 1, text, and surfaces. Users can customize element classification rules based on different dimensions, such as geometric characteristics and functional purposes, and these are not limited here.
[0046] Among them, the function type refers to the type of information that the highlight display expects to convey to the user, including but not limited to: preview highlight, such as dynamic feedback when the mouse hovers, the information type is a preview prompt; selection highlight, such as the user actively clicks to select the element, the information type is a selection prompt; warning highlight, such as abnormal element data is detected, the information type is an error prompt.
[0047] Specifically, the highlight style can be divided based on the primitive type, and the same or different highlight styles can be customized in advance for different primitive types. For example, the highlight style of a point is to expand the outline and the expanded part is green; the highlight style of a line is to expand the outline and the expanded part is yellow; the highlight style of a surface primitive is to adjust the filling effect, such as superimposing a blue block with a transparency of 30% on the surface.
[0048] Specifically, the highlight style can be divided based on the function type, and the same or different highlight styles can be customized for different function types in advance. For example, the selected highlight uses a red outline plus a semi-transparent color block, and the preview highlight uses a low-saturation yellow edge dotted line.
[0049] Furthermore, highlight styles can also be divided based on graphic element types and function types. Correspondingly, the same or different highlight styles can be customized in advance for different graphic element types and function types to present richer highlight effects and meet the use needs of diverse highlight styles.
[0050] See also Figure 3 , Figure 3 This is a schematic diagram of a different highlight style provided by the embodiment of the present application. Figure 3 As shown, each square represents a pixel, and black squares represent undrawn primitives and highlighted pixels. For primitives with a point type and a line width of 1 pixel, when the function type is preview highlight, the highlight style is to expand the outline by 1 pixel, and the expanded part is gray. The display effect for points is shown in 10a, and the display effect for lines with a width of 1 pixel is shown in 20a. When the function type is selected highlight, the highlight style is to expand the outline by 1 pixel, and the expanded part is blue. The display effect for points is shown in 10b, and the display effect for lines with a width of 1 pixel is shown in 20b.
[0051] For a graphic element whose graphic element type is a line with a pixel width greater than 1, when the function type is preview highlight, the highlight style is to expand the outline by 1 pixel and the expanded part is gray, and at the same time, a blue block with a transparency of 90% is superimposed on the surface of the graphic element, as shown in the display effect 30a; when the function type is selected highlight, the highlight style is to expand the outline by 1 pixel and the expanded part is blue, and at the same time, a blue block with a transparency of 70% is superimposed on the surface of the graphic element, as shown in the display effect 30b.
[0052] For graphics elements with face and text types, when the function type is preview highlight, the highlight style is to superimpose a blue block with a transparency of 90% on the surface of the graphics element. The display effect of the face is shown in 40a, and the display effect of the text "C" is shown in 50a; when the function type is selected highlight, the highlight style is to superimpose a blue block with a transparency of 70% on the surface of the graphics element. The display effect of the face is shown in 40b, and the display effect of the text "A" is shown in 50b.
[0053] In some embodiments, when the highlight style is divided based on the primitive type and the function type, the method further includes: dividing the counting units according to the primitive type; and dividing sub-counting units within each counting unit according to the function type.
[0054] Specifically, when the user sets different highlight styles based on the two dimensions of primitive type and function type, a two-level counting structure is used to achieve refined classification. Among them, the counting units are divided according to the primitive type, such as point, line, text, surface, etc. Each primitive type occupies a counting unit, and each counting unit is further divided into multiple sub-counting units, corresponding to preview highlight, selected highlight, warning highlight, etc., and the divisions are such as "preview highlight point", "selected highlight point", "warning highlight point", "preview highlight surface", "selected highlight surface", "warning highlight surface" and other highlight styles. Each sub-counting unit independently records the number of responses of the corresponding primitive type under the function type. For example, when the user selects a surface primitive, the target texel corresponding to the pixel covered by the surface primitive is determined, and only the response number of the "selected highlight surface" sub-counting unit in the target texel is increased.
[0055] See also Figure 4 , Figure 4 This is a schematic diagram of a counting unit division provided in an embodiment of the present application. Figure 4 As shown, each color represents the data bit of a counting unit. Each counting unit is divided into two sub-units, and each square corresponds to the data bit of a different sub-unit. This enables independent storage of multi-dimensional highlight data for functions and primitives, distinguishing the number of highlight responses for different primitive types under different function types, and improving the visual effect when multiple highlight styles are superimposed.
[0056] In some embodiments, the method further includes: when the highlight style is divided based on the primitive type, allocating data bits of the texel according to the visibility of the primitive type, wherein the counting unit corresponding to the primitive type with higher visibility occupies more data bits.
[0057] Among them, the visibility of the primitive type refers to the prominence of the primitive in the visual presentation, which can be determined based on the geometric size and coverage density. High-visibility primitives are larger in size or are continuous areas, such as faces; while low-visibility primitives are smaller in size or are discrete elements, such as dots, thin lines or small text.
[0058] Among them, the data bit is the number of binary bits occupied by the counting unit, which is used to store the number of responses. For example, n bits support counting from 0 to 2ⁿ-1 times. Therefore, the more data bits allocated to the counting unit, the larger the numerical range of the number of responses that can be recorded, and the more refined the corresponding highlight style effect.
[0059] Specifically, more data bits are allocated to the counting units of highly visible primitive types to provide a higher counting upper limit. Figure 5 , Figure 5 This is a schematic diagram of a highlight display effect provided by an embodiment of the present application, such as Figure 5 As shown, the effect of multi-layer highlight superposition of surface elements can show rich transparency levels and be distinguished from non-highlight elements with black background and white. Therefore, more data bits are allocated to high-visibility elements, which can achieve delicate blending effects and optimize the visual perception of highlight display.
[0060] Furthermore, for low-visibility primitive types, more compact data bits are allocated. Figure 6 , Figure 6 This is another schematic diagram of a highlight display effect provided by an embodiment of the present application, such as Figure 6 As shown, the effect of multi-layer highlight superposition of line elements is shown. The yellow wireframe is a partial enlarged view of the multi-layer highlight superposition of line elements. It can be seen that for low-visibility element types, even if they have higher transparency accuracy, the human eye cannot perceive the difference. Therefore, the data bit ratio is reduced, the overall storage and processing efficiency is improved, and the storage resource allocation is optimized.
[0061] S102 : In response to a graphic element highlighting operation, determining at least one highlighted graphic element and a highlighting style corresponding to each highlighted graphic element from a plurality of graphic elements in the basic drawing.
[0062] Among them, the element highlighting operation is used to trigger the highlighting of specific elements. It can be a user's interactive behavior, such as clicking, hovering, selecting, parameter modification, etc., or it can be a highlighting behavior automatically triggered by the software, such as abnormal loading of element data. The specific operation can be determined according to the functional design of the software and is not limited here.
[0063] Specifically, after receiving the element highlighting operation, the element that should be highlighted and is directly affected by the operation (i.e., the highlighted element) is located from the basic drawing. There can be one or more highlighted elements, and the corresponding highlight styles are dynamically matched from the highlight style library pre-set by the user according to the element type and / or function type of the highlighted element.
[0064] For example, when the element highlighting operation is a hover operation, the element corresponding to the hovering position coordinates is obtained as the highlighted element; when the element highlighting operation is an area selection operation, the elements within the area are obtained as the highlighted elements; when the element highlighting operation is a parameter modification operation, the element with the modified parameters is obtained as the highlighted element; for example, when the software detects an abnormality in element data (such as a rule verification failure or a logic conflict), the element with the abnormal data is highlighted. In other words, the highlighted element is the element selected by the user or temporarily highlighted in the base drawing.
[0065] S103, determining a target texel according to the pixels covered by the highlight primitive; determining a target counting unit in the target texel according to a highlight pattern corresponding to the highlight primitive, and updating the number of responses recorded by the target counting unit.
[0066] Specifically, the set of pixels covered by the highlight primitive is detected, and each pixel is mapped to the corresponding texel to determine several target texels. For example, when the highlight primitive is a straight line, all pixels on its path are traversed and the corresponding texels are marked as target texels. Furthermore, based on the highlight pattern matched by the highlight primitive, the target counting unit corresponding to the highlight pattern in the target texel is retrieved, the response count value recorded by the target counting unit is increased by 1, and the response count of the highlight pattern at the pixel position is updated in real time. This process only modifies the value of the specific counting unit within the affected texel, performing a lightweight update and avoiding full image traversal, thereby improving the efficiency of highlight display.
[0067] See also Figure 7 , Figure 7 This is a schematic diagram of another texel data structure provided by an embodiment of the present application. The texels are arranged according to the distribution relationship between the pixels. Figure 7 As shown on the left, each square represents a texel. The user selects two surface primitives in the basic drawing. The pixel range covered by the first surface primitive is the range selected by the purple dotted line frame, and the pixel range covered by the second surface primitive is the range selected by the blue dotted line frame. If there is an overlapping area between the two surface primitives, the texels within the purple and blue dotted line frames are the target texels.
[0068] The data structure of the texels in the overlapping area is as follows Figure 7 As shown in the black dashed box on the right, each color represents the data bit of a counting unit. The number of responses for the highlighted pattern of the surface is recorded in the green counting unit g. The corresponding target counting unit g can then be located in the target texel. Since the texels in the overlapping area are covered by two surface primitives respectively, a total of two times, the number of responses in the target counting unit g is 2. The corresponding target texels in the non-overlapping area have a response number of 1 in the target counting unit g, and the counting unit of the non-target texels is 0.
[0069] Furthermore, if the counting unit g is a counting unit classified based on the primitive type, in which each square corresponds to the data bit of a different sub-counting unit, when the data bit of the second green square in the counting unit g is assigned to the sub-counting unit with the function type selected and highlighted, the number of responses recorded in the second green square is 2.
[0070] It should be understood that for highlighted primitives, the response times of the corresponding counting units in the target texels covered by them are lightweight updated. According to the response times and the mixing order, the highlight display features of each texel can be determined in parallel, thereby improving the efficiency of drawing refresh.
[0071] S104 , based on design parameters of different highlight styles and according to the number of responses recorded in the counting unit of each texel, determining the highlight display feature of each texel.
[0072] Specifically, the counting units of each texel are traversed to extract the number of responses of each counting unit; for the counting units whose response times are valid values, the design parameters of the highlight style corresponding to the counting units are obtained, and then the highlight display features of the highlight style are determined based on the response times and the design parameters of the highlight style; if there are highlight display features of multiple highlight styles, the highlight display features of the multiple highlight styles are mixed into the highlight display features of a single texel, and then the highlight display features of each texel are obtained.
[0073] For example, if the number of responses of the highlight style "selected highlight point" in the texel is 3, and the number of responses of the highlight style "preview highlight line" is 2, then according to the design parameters and response times of the highlight style, the highlight display features of the "selected highlight point" when there are 3 responses and the highlight display features of the "selected highlight point" when there are 2 responses are calculated respectively, and then the two highlight display features are mixed to obtain the highlight display features of the texel.
[0074] The highlight display feature is a visual attribute corresponding to the highlight effect generated by the response times and the design parameters, such as color, brightness, transparency, etc. For example, the highlight display feature of each texel is the highlight effect that each texel needs to present in the end.
[0075] The design parameters of a highlight style refer to the configuration properties that predefine the highlight visual effect, such as the color value, transparency, and highlight range of the color at different response times. Different highlight styles can have different design parameters. For example, the design parameters include fill element parameters and display area parameters. Fill element parameters refer to the properties of the color blocks used for highlighting, such as the color value, transparency, and texture of the color blocks; display area parameters refer to the area within which the highlight effect is applied.
[0076] In some embodiments, the display area parameter includes at least one of overlay display and extended display. Overlay display means that the highlight effect is applied to the original geometric area of the primitive, for example, by overlaying a color block with color or texture on the primitive; extended display means that the highlight effect is applied to the area on or outside the boundary of the primitive, for example, by generating a visual effect such as a stroke, shadow, or halo at the primitive boundary.
[0077] In some embodiments, the fill element parameters and display area parameters can be set to different parameter values based on different response times. For example, the fill element parameters can be set to adjust the transparency based on the response time, for example, the higher the response time, the lower the cumulative transparency of the overlay color; the display area parameters can be set to adjust the area range of the highlight effect based on the response time, for example, the higher the response time, the wider the stroke.
[0078] In some embodiments, a preset calculation rule for transparency in fill element parameters is provided, wherein the number of responses of each counting unit is used as a weighting factor to adjust the final performance intensity of the highlight style within the design parameter range. Exemplarily, after traversing the counting units of each texel and extracting the number of responses of each counting unit, the following steps are further included: obtaining the highest number of responses for each type of highlight style; using the number of responses within the highest number of responses as a selectable value; calculating the transparency difference between different response times based on the selectable values; and calculating and updating the transparency value of the selectable value based on the transparency difference.
[0079] For example, when the maximum response number of a certain highlight style is 3 times, the selectable values include 0, 1, 2, and 3 times, that is, there are 4 selectable values. It is necessary to present a richer layered highlight effect and distinguish different response times at the same time. The transparency of the fill element parameters under different response times can be set according to a linear or nonlinear ratio only for the 4 selectable values. For example, when the selectable value is 0, it corresponds to the highest transparency of 100%; when the selectable value is 1, it corresponds to a higher transparency of 80%; when it gradually decreases to a selectable value of 3, the lowest transparency is 10%. In this way, a layered highlight effect is achieved by dynamically mapping the number of responses and transparency, adapting to highlight displays under different number of responses, making a differential distinction between low and high response times, especially in scenarios with a high number of responses, which can further enhance the layered sense of the highlight effect.
[0080] In some embodiments, whether the number of responses in the counting unit is a valid value is determined based on the display area parameters; if the display area parameters of the highlight style are overlay display, the number of responses is a valid value when it is a non-zero value or a non-empty value; if the display area parameters of the highlight style are expanded display, the number of responses is an invalid value when it is a non-zero value or a non-empty value.
[0081] It should be understood that the determination of valid values for the number of responses is based on the configuration properties of the highlight style. The rules for determining valid values can be flexibly determined based on the user-designed configuration properties of the highlight style and are not limited here. For example, a non-zero or non-empty number of responses indicates that the corresponding pixel is covered by the primitive. The area affected by the expanded highlight effect is on or outside the primitive's boundary. The primitive itself does not generate a highlight effect, so a non-zero or non-empty value is considered invalid.
[0082] In some embodiments, the display area parameters include overlay display, and S104 includes: reading the counting unit in the first texel to determine the first highlight style to be responded to; if the display area parameter of the first highlight style is overlay display, determining the overlay highlight display feature of the first texel according to the corresponding filling element parameter and the number of responses; mixing several of the overlay highlight display features to obtain the first highlight display feature of the first texel.
[0083] Specifically, all counting units in the first texel are traversed to obtain a counting unit whose response times are non-zero or non-empty values, and the highlight style corresponding to the counting unit is used as the first highlight style to be responded to. If the display area parameter of the first highlight style is an overlay display, the response times are determined to be a valid value, and the filling element parameters of the first highlight style are further extracted. Based on the mapping rules between the response times recorded by the counting unit and the design parameters, an overlay highlight display feature is generated according to the filling element parameters and the response times of the first highlight style, and a plurality of overlay highlight display features are mixed to obtain the first highlight display feature of the first texel.
[0084] If the display area parameter of the first highlight style is expanded display, the response number is non-zero or non-empty for the first texel, which is invalid and not processed. Therefore, the response number of the highlight style of the overlay display is converted into a highlight display feature.
[0085] In some embodiments, the display area parameters include outward expansion display, and S104 also includes: based on a preset position relationship, obtaining several second texels corresponding to the first texel, reading the counting unit in the second texel, and determining the second highlight style to be responded to; if the display area parameters of the second highlight style are outward expansion display, determining the outward expansion highlight display characteristics of the first texel according to the corresponding filling element parameters and the number of responses; mixing several of the outward expansion highlight display characteristics to obtain the second highlight display characteristics of the first texel.
[0086] Preset position relationships refer to pre-set relationships based on the extended display range (e.g., stroke width, shadow radius) and the positional relationships between texels in the highlight style. By setting multiple preset position relationships, we can support the extended display requirements of different highlight styles and preserve the design intent of the highlight style. The specific position relationships are not limited here.
[0087] For example, when the highlighted primitive is a line primitive and the highlight style of the line primitive is to expand and display a 2-pixel-wide bottom shadow, a preset positional relationship is established between the texel and other texels within a 2-pixel range below it.
[0088] For another example, see Figure 8 , Figure 8 This is a schematic diagram of a preset position relationship provided by the present application, such as Figure 8 As shown, each square represents a pixel, the black square represents the pixel of the undrawn primitive, and the yellow square represents the pixel covered by the highlighted primitive. It can be seen that the highlighted primitive is a point primitive. When the highlight style of the point primitive is to expand and display a 1-pixel wide stroke, the expanded display range is the 3*3 adjacent range selected by the blue dotted line, establishing a preset position relationship between the texel of the yellow square and other texels within the range selected by the blue dotted line.
[0089] Specifically, a set of second texels associated with the first texel is obtained according to a preset position relationship, wherein the first texel can be any texel, and the second texel is a texel with a preset relative position relationship with the first texel. The number of responses of the counting unit in each second texel is traversed to obtain the counting unit whose response number is a non-zero value or a non-empty value, and the highlight style corresponding to the counting unit is used as the second highlight style to be responded to, and the second highlight style whose display area parameter is an outward-expanded display is filtered, and an outward-expanded highlight display feature is generated according to its filling element parameter and the number of responses, and a number of outward-expanded highlight display features are mixed to obtain the second highlight display feature of the first texel. If the display area parameter of the second highlight style is an overlay display, when the response number is a non-zero value or a non-empty value, it is an invalid value for the second texel and is not processed. Thus, the response number of the highlight style of the outward-expanded display is converted into a highlight display feature.
[0090] In some embodiments, the first highlight display feature of the first texel itself (such as the fill color of the overlay display) is merged with the second highlight display feature (such as the stroke color) generated based on the second texel to update the highlight display feature of the first texel, so that it can fully reflect the coverage effect of the original texel and the expansion effect of the surrounding texels, thereby improving the coherence of the expanded highlight in spatial continuity and the accuracy of the overall highlight effect presentation.
[0091] It should be understood that in order to accurately restore the highlight effect according to the design parameters, a corresponding strategy for displaying the number of responses of the counting unit is provided for different highlight styles. The response count of the highlight style displayed overlays is applied to the corresponding texel itself, while the response count of the highlight style displayed outwards is independently processed into another branch, and the response count of the highlight style displayed outwards is applied to the texels in the preset position relationship. In this way, after independently counting different highlight styles, corresponding highlight effects can be generated according to their respective configuration properties, meeting the needs of using diverse highlight styles.
[0092] In some embodiments, S104 also includes: determining a first display priority between highlight styles based on the functional type of the highlight primitive; determining a second display priority between highlight styles within the same first display priority based on the primitive type of the highlight primitive; and determining a mixing order of highlight display features of each highlight style based on the first display priority and the second display priority between the highlight styles.
[0093] Specifically, after dividing the highlight styles based on the graphic element type and the function type, the first display priority between the highlight styles can be divided according to the function type of the highlighted graphic element. For example, the first display priority is from high to low: warning highlight, selected highlight, and preview highlight, so that the graphic element actively selected by the user is always in the visual focus position; further, within the same function type, the second display priority between the highlight styles is divided according to the graphic element type. For example, according to user needs, the second display priority of the key graphic element type in the drawing that is highly related to the actual business is increased.
[0094] Furthermore, the mixing order is determined according to the descending order of the first display priority and the second display priority, so that the highlight patterns with higher display priorities are mixed later in the mixing order. In other words, in the mixing order, the highlight patterns with lower first display priorities are mixed first, and then the highlight patterns with higher first display priorities are mixed; within the same first display priority, the highlight patterns with lower second display priorities are mixed first, and then the highlight patterns with higher second display priorities are mixed.
[0095] It should be understood that the highlight style mixed first is easily blocked or blurred by the highlight style mixed later. Therefore, the highlight style mixed later has higher visibility. The mixing order can maintain the clarity of visual logic when multiple styles are superimposed, highlight the key elements in complex drawings, and avoid low-priority styles interfering with the line of sight, which in turn causes visual confusion.
[0096] In some embodiments, the function type includes selected highlight and preview highlight; S104 also includes: when the function type is selected highlight, the lower the visibility of the graphic element type, the higher the second display priority; when the function type is preview highlight, the higher the visibility of the graphic element type, the higher the second display priority.
[0097] Specifically, when the function type is selected and highlighted, the display priority of easily obscured low-visibility graphics (such as dots and narrow lines) is increased. Therefore, even in scenes with multiple highlighted graphics, the highlighted low-visibility graphics remain highly visible, preventing them from being obscured by subsequently superimposed high-visibility graphics. This improves the readability and interaction convenience of low-visibility graphics actively selected by the user. For example, in a selected and highlighted scene, the second display priority, from high to low, may be dots, lines with a pixel width equal to 1, pixel width greater than 1, text, and faces.
[0098] When the feature type is preview highlight, the display priority of high-visibility elements (such as faces) is increased, so that the highlight effect of low-visibility elements blends naturally with the highlight effect of high-visibility elements. In scenes with multiple elements highlighted, the preview highlight effect is provided as a coherent and visually complete whole. For example, in a preview highlight scene, the second display priority, from high to low, may be faces, text, lines with a pixel width greater than 1, a pixel width equal to 1, and points.
[0099] For example, the first display priority of the selected highlight is higher than the first display priority of the preview highlight, and at this time the highlighted graphics in the same area include the "preview highlight point" and "preview highlight surface" determined by hovering, and the "selected highlight point" and "selected highlight surface" determined by clicking. At this time, the mixing order from front to back is "preview highlight point", "preview highlight surface", "selected highlight surface", and "selected highlight point", and finally merged into the highlight display feature of a single texture element.
[0100] It should be understood that the display priority is dynamically matched according to the functional type and graphic type of the highlight style, the prominence of key elements in the selected state is enhanced, the overall visual balance of the area in the preview state is maintained, and anti-occlusion and visual continuity are taken into account. All highlights are blended through transparency to avoid completely covering the underlying highlight style.
[0101] In some embodiments, after the highlight styles are divided based on the functional type, the third display priority between the highlight styles is determined according to the functional type of the highlight primitive, and the mixing order of the highlight display features of each highlight style is determined according to the third display priority between the highlight styles.
[0102] In some embodiments, after the highlight styles are divided based on the primitive type, the fourth display priority between the highlight styles is determined according to the primitive type of the highlight primitive, and the mixing order of the highlight display features of each highlight style is determined according to the fourth display priority between the highlight styles.
[0103] It should be understood that in the process of generating the highlight effect, the mixing order of various highlight styles is constrained to avoid visual confusion caused by the superposition of multiple styles, so that the key elements in complex drawings can be highlighted in an intuitive way, improving the visual effect of the highlight display, thereby improving user operation efficiency. For example, different display priorities are given to the two types of highlight functions, selected highlight and preview highlight, so that the highlighted object corresponding to the selected highlight is always in the visual focus position, while the preview highlight is set to a low priority to avoid interfering with the main view. For example, for different types of graphic elements, intelligent adjustments are made according to the scene. Under selected highlighting, the display priority of low-visibility graphic elements is increased to avoid occlusion. Under preview highlighting, the display priority of high-visibility graphic elements is increased to maintain the integrity of the area.
[0104] Furthermore, expanding new highlight styles only requires adding new counting unit categories, and adjusting the visual performance only requires modifying the mixing order of the counting units, which improves the visual expressiveness and engineering flexibility of the highlight display, making it not only suitable for traditional fields such as CAD, but also expandable to real-time graphics applications such as game development and industrial simulation, and has broad industry value.
[0105] S105 , obtaining the main body display feature of each pixel, and mixing the main body display feature and the highlight display feature according to the correspondence between texels and pixels to obtain a target drawing.
[0106] Specifically, the main display features refer to the original visual attributes inherent in the graphics elements in the basic drawing, such as color, texture and transparency, which can be stored in the buffer. The main display features of pixels with a one-to-one correspondence can be mixed and superimposed with the highlight display features of the texels through graphics color mixing operations such as alpha blending and additive blending to obtain the target drawing with highlight effect and present it in the display window.
[0107] It should be understood that the mixing and drawing of the main display features and the highlight display features of the primitives in the basic drawing are completed in a single rendering, without the need for secondary primitive traversal or drawing overhead, further improving the drawing refresh efficiency.
[0108] Furthermore, especially for the unobstructed outward highlight style on the top layer, a short-circuit response mechanism for counting unit reading is provided. When such highlight style is detected, the result is written immediately and the subsequent counting unit calculation is skipped, reducing the meaningless redundant processing of the covering style. It can effectively reduce the computing overhead and time consumption when processing a large number of highlight overlays.
[0109] Exemplarily, the method includes: obtaining the priority highlight style with the first display priority, detecting whether the display area parameter of the priority highlight style is an external display; if so, in the process of reading the counting unit in the first texel, preferentially reading the counting unit corresponding to the priority highlight style; if the priority highlight style is the first highlight style, setting the highlight display feature of the first texel to empty.
[0110] Specifically, a highlight style with the first display priority is obtained from the counting unit associated with the current texel, that is, the highlight style at the end of the mixing order, and the display area parameter of the priority highlight style is detected to see whether it is an outward display. If it is an outward display, the counting unit corresponding to the priority highlight style is processed first when reading the counting unit of the first texel. If the read response number is a non-zero value or a non-empty value, it is the first highlight style that needs to be responded to, and the short-circuit response mechanism is executed immediately to set the highlight display feature of the texel to empty, such as clearing the color value or marking it as an invalid state.
[0111] See also Figure 9 , Figure 9 This is another schematic diagram of the highlighting effect provided by the embodiment of the present application. Figure 9 The following figure shows the highlighting effect of two selected faces and one selected line. The line body is displayed in white. "Selected Highlight Line" is the priority highlighting style with the first priority. The display area parameter is expanded. In this case, the highlighting effect of the two selected faces will not be displayed in the pixels where the line element is located. Figure 9 The yellow frame in the lower right corner is a partial enlargement of the line highlight effect, and the pixels where the line element is located are still white.
[0112] It should be understood that since the priority highlight style is an unobstructed outward expansion style, its highlight effect is presented by the pixels within the adjacent range of the primitive. Even if a subsequent superimposed highlight style is generated, it will not affect the final display effect of the pixels covered by the primitive, so no processing is required.
[0113] In some embodiments, the method includes: allocating counting units with display area parameters as highlight style for outward display at the front of the texel data structure, and allocating counting units with display area parameters as highlight style for overlay display at the back of the texel data structure, so as to give priority to reading these counting units and improve the efficiency of short-circuit response.
[0114] In some embodiments, the mixing of highlight display features of each highlight style, as well as the mixing of main body display features and highlight display features, can be a color overlay processing, or the ALPHA, 1-ALPHA mixing technology, i.e. AlphaBlending, also known as α mixing, is an image processing technology based on the transparency channel (i.e., Alpha channel), which is used to achieve translucent effects and color overlay.
[0115] Exemplarily, the transparency ALPHA is pre-set. For example, in a selected highlighted scene, the ALPHA of a point, a line with a pixel width equal to 1, a pixel width greater than 1, text, and a surface can be 0.3160. In a preview highlighted scene, the ALPHA of a surface, text, a line with a pixel width greater than 1, a pixel width equal to 1, and a point can be 0.4515.
[0116] For example, after all styles are mixed, the highlight color RGB value of the current texel (denoted as highlightColor) is obtained. This color value (i.e., the highlight display feature) is mixed with the color value of the primitive at the pixel position (i.e., the primitive display feature). At this time, ALPHA=1.0 - (253.0 - highlightColor.b * 255.0) / 255.0. The transparency value in this process changes dynamically with the blue component (i.e., the b component) of highlightColor to optimize the highlight effect.
[0117] In some embodiments, during a single rendering process, the body of a loaded primitive is obtained to obtain the body display characteristics, and a determination is made as to whether it is a highlighted primitive to distinguish between ordinary primitives and primitives to be highlighted. If not, execution of S103 is not triggered, and the body display characteristics of the ordinary primitive are stored in the pixel-level buffer, and subsequent primitive loading continues. If so, the body display characteristics of the primitive to be highlighted are stored in the pixel-level buffer, and the response count of the target counting unit in the target texel corresponding to the pixel covered by the primitive to be highlighted is incremented by one, and subsequent primitive loading continues.
[0118] After all primitives in the base drawing are loaded, the pixel-level buffer stores the underlying display features of all primitives, presenting a window display effect without any highlight effects. The coverage and highlight status of each pixel is counted using texels, and the response count of the counting unit is updated. Furthermore, each texel can be used to obtain the final highlight color based on the pre-designed highlight style, response count, and blending algorithm. Finally, the highlight color (i.e., the highlight display feature) is blended with the underlying color (i.e., the underlying display feature) of the pixel corresponding to the texel to obtain the final image output with a highlight effect. Specifically, when designing the highlight style, the characteristics of two-dimensional textures can be flexibly utilized to preset positional relationships, achieving highlight display effects such as expansion.
[0119] In some embodiments, highlight styles are pre-designed based on user habits or special processing requirements. After the main body of different primitive types (points, lines, surfaces, text, etc.) is drawn, a layer of transparent highlight color is superimposed or blended on each pixel covered by the main body or on each pixel extended beyond it.
[0120] In some embodiments, pixels are the basic display units of a screen or drawing; texels are the constituent units of textures, and the two have a one-to-one correspondence. Each pixel on the screen has a texel with the same coordinates to count the highlight primitives covered by the pixel. The highlight style to be adopted, that is, the texels in the texture have a statistical effect and can be read when the final highlight color of the pixel is calculated later.
[0121] See also Figure 10 , Figure 10 1 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device may be a terminal device or a server.
[0122] For example, the above method can be implemented in the form of a computer program. Figure 10 Runs on the computer device shown.
[0123] like Figure 10As shown, the computer device includes a processor, a memory, and a network interface connected via a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.
[0124] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any one of the methods for drawing a highlight primitive.
[0125] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
[0126] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any method for drawing a highlight primitive.
[0127] This network interface is used for network communication, such as sending assigned tasks.
[0128] It should be understood that the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.
[0129] In one embodiment, the processor is configured to execute a computer program stored in the memory to implement the following steps: S101, obtaining a basic drawing and creating a plurality of texels based on the basic drawing, wherein the texels correspond one-to-one to pixels in the basic drawing; wherein each texel includes a plurality of counting units, and different counting units are used to record the number of responses of different highlight styles; S102, in response to an element highlighting operation, determining at least one highlighted element and a highlighting style corresponding to each highlighted element from a plurality of elements in the base drawing; S103, determining a target texel according to the pixels covered by the highlight primitive; determining a target counting unit in the target texel according to a highlight pattern corresponding to the highlight primitive, and updating the number of responses recorded by the target counting unit; S104, determining highlight display characteristics of each texel based on design parameters of different highlight styles and the number of responses recorded in the counting unit of each texel; S105 , obtaining the main body display feature of each pixel, and mixing the main body display feature and the highlight display feature according to the correspondence between texels and pixels to obtain a target drawing.
[0130] Exemplarily, the processor is used to run a computer program stored in the memory, and is also used to implement the steps of the method for drawing a highlight primitive provided in any embodiment of the present application, which will not be repeated here.
[0131] A computer-readable storage medium is also provided in an embodiment of the present application, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and the processor executes the program instructions to implement the steps of any one of the methods for drawing highlight primitives provided in the embodiments of the present application.
[0132] The computer-readable storage medium may be an internal storage unit of the computer device described in the aforementioned embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a SmartMedia Card (SMC), a Secure Digital (SD) card, a flash memory card, etc., equipped on the computer device.
[0133] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present application, and such modifications or substitutions should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A method for drawing a highlight primitive, characterized in that: The method comprises: S101, obtaining a basic drawing and creating a plurality of texels based on the basic drawing, wherein the texels correspond one-to-one to pixels in the basic drawing; wherein each texel includes a plurality of counting units, and different counting units are used to record the number of responses of different highlight styles; S102, in response to an element highlighting operation, determining at least one highlighted element and a highlighting style corresponding to each highlighted element from a plurality of elements in the base drawing; S103, determining a target texel according to the pixels covered by the highlight primitive; determining a target counting unit in the target texel according to the highlight pattern corresponding to the highlight primitive, and updating the number of responses recorded by the target counting unit; S104, determining highlight display characteristics of each texel based on design parameters of different highlight styles and the number of responses recorded in the counting unit of each texel; S105 , obtaining the main body display feature of each pixel, and mixing the main body display feature and the highlight display feature according to the correspondence between texels and pixels to obtain a target drawing.
2. The method according to claim 1, wherein The design parameters include filling element parameters and display area parameters, and the display area parameters include overlay display. S104 includes: Reading a counting unit in a first texel to determine a first highlight pattern to be responded to; If the display area parameter of the first highlight style is overlay display, determining the overlay highlight display feature of the first texel according to the corresponding filling element parameter and the response number; A plurality of the covering highlight display features are mixed to obtain a first highlight display feature of a first texel.
3. The method according to claim 2, wherein The display area parameter includes an external display, and S104 further includes: Based on a preset position relationship, obtaining a plurality of second texels corresponding to the first texel, reading a counting unit in the second texel, and determining a second highlight pattern to be responded to; If the display area parameter of the second highlight style is outward expansion display, determining an outward expansion highlight display feature of the first texel according to the corresponding filling element parameter and the number of responses; A plurality of the outward-expanding highlight display features are mixed to obtain a second highlight display feature of the first texel.
4. The method according to claim 1, wherein The highlighting styles are divided based on primitive types and / or function types.
5. The method according to claim 4, wherein The S104 also includes: Determine the first display priority among highlight styles according to the function type of the highlighted graphic element; Determine, according to the graphic element type of the highlighted graphic element, a second display priority between highlight styles within the same first display priority; The mixing order of the highlight display features of each highlight style is determined according to the first display priority and the second display priority among the highlight styles.
6. The method according to claim 5, wherein The function types include selection highlight and preview highlight; S104 further includes: When the function type is selected and highlighted, the lower the visibility of the primitive type, the higher the second display priority; When the function type is the preview highlight, the higher the visibility of the graphic element type is, the higher the second display priority is.
7. The method according to claim 4, wherein When the highlight style is divided based on the primitive type and the function type, the method further includes: Dividing the counting units according to the primitive types; Each counting unit is divided into sub-counting units according to the function type.
8. The method according to claim 4, wherein The method further comprises: When the highlight style is divided based on the primitive type, the data bits of the texels are allocated according to the visibility of the primitive type, wherein the counting unit corresponding to the primitive type with higher visibility occupies more data bits.
9. A computer device, characterized in that: The device comprises: memory for storing computer programs; A processor, configured to execute the computer program and implement the method for drawing a highlight primitive according to any one of claims 1 to 8 when executing the computer program.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, enables the processor to implement the method for drawing a highlight primitive according to any one of claims 1 to 8.
Citation Information
Patent Citations
Questionnaire page configuration method and device, computer equipment and storage medium
CN111814426A
Vector data fusion rendering method and device, computer equipment and storage medium
CN116758206A
Guide component generation method, terminal equipment and storage medium
CN118567740A
Efficient three-dimensional modeling dynamic rendering method
CN120070777A
Method and apparatus for rendering object using mipmap including plurality of textures
EP3504685A1