Image rendering method, device, apparatus and storage medium
Patent Information
- Application Number
- CN202610828605.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-09
- Publication Date
- 2026-10-09
AI Technical Summary
[0002]随着技术的发展,显示设备能够显示的图像越来复杂,与之对应的是图像渲染的要求也是越来越高,目前复杂图像一般都是由线段、三角形、矩形和圆形等基本图元组合而成,在图像渲染过程中,需要依次对图像所需的基本图元进行一一渲染,从而组合形成最后的目标图像,但由于复杂图像的基本图元数量庞大,导致图形渲染效率低下且占用CPU较多资源
[0008]第四方面,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,其中所述计算机程序被处理器执行时,实现如上述的图像渲染方法的步骤。
Smart Images

Figure CN122888086A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to an image rendering method, apparatus, device and storage medium. Background Technology
[0002] With the development of technology, display devices can display increasingly complex images, and correspondingly, the requirements for image rendering are also getting higher and higher. Currently, complex images are generally composed of basic primitives such as line segments, triangles, rectangles and circles. In the image rendering process, the basic primitives required by the image need to be rendered one by one in sequence to form the final target image. However, due to the large number of basic primitives in complex images, the graphics rendering efficiency is low and it consumes a lot of CPU resources.
[0003] Therefore, improving image rendering efficiency is an urgent problem to be solved. Summary of the Invention
[0004] The main objective of this application is to provide an image rendering method, apparatus, device, and storage medium, which aims to improve the efficiency of image rendering.
[0005] In a first aspect, this application provides an image rendering method, which includes the following steps: Obtain a graphics rendering request, which includes the type, size, and color of the graphics to be rendered; Based on the type and size of the graphic to be rendered, determine whether there are candidate graphics in the preset graphics library; If a candidate graphic exists in the preset graphic library, the candidate graphic is copied from the preset graphic library, and the graphic is rendered according to the size, color and the candidate graphic to obtain the first target graphic; If no candidate graphic exists in the preset graphic library, the graphic is rendered according to the type, size, and color of the graphic to be rendered to obtain the second target graphic.
[0006] Secondly, this application also provides an image rendering apparatus, which includes an acquisition module, a determination module, and an output module, wherein: The acquisition module is used to acquire a graphics rendering request, which includes the type, size, and color of the graphics to be rendered. The determining module is used to determine whether there are candidate graphics in the preset graphics library based on the type and size of the graphics to be rendered; The output module is used to copy the candidate graphic from the preset graphic library if a candidate graphic exists in the preset graphic library, and to perform graphic rendering based on the size, color and the candidate graphic to obtain the first target graphic; The output module is further configured to render a second target graphic based on the type, size, and color of the graphic to be rendered if no candidate graphic exists in the preset graphic library.
[0007] Thirdly, this application also provides a computer device, the computer device including a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, it implements the steps of the image rendering method described above.
[0008] Fourthly, this application also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the steps of the image rendering method described above.
[0009] This application provides an image rendering method, apparatus, device, and storage medium. The method involves obtaining a graphics rendering request, which includes the type, size, and color of the graphic to be rendered; determining whether a candidate graphic exists in a preset graphics library based on the type and size of the graphic to be rendered; copying the candidate graphic from the preset graphics library and rendering the graphic based on its size, color, and the candidate graphic to obtain a first target graphic; and rendering the graphic based on the type, size, and color of the graphic to be rendered to obtain a second target graphic. In this application, determining whether a candidate graphic exists in the preset graphics library based on the type and size of the graphic to be rendered, and directly copying the candidate graphic from the preset graphics library if it exists, effectively shortens the rendering time. Rendering the graphic based on its size, color, and the candidate graphic to obtain the first target graphic effectively improves the efficiency of graphics rendering. Rendering the graphic based on its type, size, and color to obtain the second target graphic if it does not exist also ensures accurate graphics rendering. Attached Figure Description
[0010] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 A flowchart illustrating an image rendering method provided in an embodiment of this application; Figure 2 for Figure 1 A flowchart illustrating the sub-steps of the image rendering method in the image rendering process. Figure 3 for Figure 1 A flowchart illustrating the sub-steps of the image rendering method in the image rendering process. Figure 4 for Figure 1 A flowchart illustrating the sub-steps of the image rendering method in the image rendering process. Figure 5 for Figure 1 A flowchart illustrating the sub-steps of the image rendering method in the image rendering process. Figure 6 A schematic block diagram of an image rendering apparatus provided in an embodiment of this application; Figure 7 This is a schematic block diagram of the structure of a computer device provided in an embodiment of this application.
[0012] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0013] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0014] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.
[0015] With the development of technology, display devices can display increasingly complex images, and correspondingly, the requirements for image rendering are also getting higher and higher. Currently, complex images are generally composed of basic primitives such as line segments, triangles, rectangles and circles. In the image rendering process, the basic primitives required by the image need to be rendered one by one in sequence to form the final target image. However, due to the large number of basic primitives in complex images, the graphics rendering efficiency is low and it consumes a lot of CPU resources.
[0016] To address the aforementioned problems, embodiments of this application provide an image rendering method, apparatus, device, and storage medium. The image rendering method includes acquiring a graphics rendering request, the graphics rendering request including the type, size, and color of the graphics to be rendered; determining whether a candidate graphics exist in a preset graphics library based on the type and size of the graphics to be rendered; if a candidate graphics exist in the preset graphics library, copying the candidate graphics from the preset graphics library, and rendering the graphics based on the size, color, and candidate graphics to obtain a first target graphics; if no candidate graphics exist in the preset graphics library, rendering the graphics based on the type, size, and color of the graphics to be rendered to obtain a second target graphics.
[0017] This image rendering method can be applied to computer devices, such as mobile phones, tablets, laptops, desktop computers, and personal digital assistants.
[0018] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0019] Please refer to Figure 1 , Figure 1 This is a schematic flowchart of an image rendering method provided for an embodiment of this application.
[0020] like Figure 1 As shown, the image rendering method includes steps S101 to S104.
[0021] Step S101: Obtain a graphics rendering request, wherein the graphics rendering request includes the type, size and color of the graphics to be rendered.
[0022] The graphics rendering request is a sub-rendering task in the image rendering process. For example, during the image rendering process, the central processing unit or graphics processing unit divides the image to be rendered into multiple graphics to be rendered, and renders each of the multiple graphics to be rendered, thereby completing the rendering of the image to be rendered.
[0023] In some embodiments, an image rendering request is obtained, which includes the type, size, and color of the graphic to be rendered. By obtaining the image rendering request, the graphic information to be rendered can be accurately determined.
[0024] It should be noted that the type of the graphic includes line segments, rectangles, triangles, arcs, sectors, and trapezoids, etc.; the size of the graphic includes length, width, and radius; and the color of the graphic includes color and transparency.
[0025] In some embodiments, a preset graphics library is obtained, which stores target graphics rendered in the past, which are target graphics that have been rendered before the current time. After each graphics rendering is completed, the rendered target image is stored in the preset graphics library.
[0026] Step S102: Determine whether there are candidate graphics in the preset graphics library based on the type and size of the graphics to be rendered.
[0027] In some embodiments, such as Figure 2 As shown, step S102 includes sub-step S1021.
[0028] Sub-step S1021: If there is a graphic in the preset graphic library that is the same type and size as the graphic to be rendered, then it is determined that there is a candidate graphic in the preset graphic library.
[0029] Determine if a graphic of the same type as the graphic to be rendered exists in the preset graphic library. If no graphic of the same type as the graphic to be rendered exists in the preset graphic library, then no candidate graphic exists in the preset graphic library. Then, render the graphic according to the type, size and color of the graphic to be rendered to obtain the second target graphic.
[0030] In some embodiments, it is determined whether there is a graphic of the same type as the graphic to be rendered in the preset graphics library. If there is a graphic of the same type as the graphic to be rendered in the preset graphics library, and the size of the graphic of the same type is the same as the size of the graphic to be rendered, the graphic of the same type is determined to be a candidate graphic, that is, it is determined that there is a candidate graphic in the preset graphics library.
[0031] In some embodiments, such as Figure 3 As shown, step S102 includes sub-step S1022.
[0032] Sub-step S1022: If there is a graphic in the preset graphic library that is the same type and similar in size as the graphic to be rendered, then it is determined that there is a candidate graphic in the preset graphic library.
[0033] Determine if there is a graphic of the same type as the graphic to be rendered in the preset graphic library. If there is a graphic of the same type as the graphic to be rendered in the preset graphic library, and the size of the graphic of the same type is similar to the size of the graphic to be rendered, then the graphic of the same type is determined to be a candidate graphic, that is, it is determined that there is a candidate graphic in the preset graphic library.
[0034] It should be noted that the size of the graphic to be rendered is similar to the size of a graphic of the same type, meaning that there is a proportional relationship between the sizes of the graphic to be rendered and the graphic of the same type.
[0035] In some embodiments, it is determined whether there is a graphic of the same type as the graphic to be rendered in the preset graphics library. If there is a graphic of the same type as the graphic to be rendered in the preset graphics library, and the size of the graphic of the same type is not similar to the size of the graphic to be rendered, it is determined that there is no candidate graphic in the preset graphics library.
[0036] Step S103: If a candidate graphic exists in the preset graphic library, copy the candidate graphic from the preset graphic library, and perform graphic rendering based on the size, color, and candidate graphic to obtain the first target graphic.
[0037] In some embodiments, if candidate graphics exist in a preset graphics library, the candidate graphics are copied from the preset graphics library so that graphics rendering can be performed based on the candidate graphics, thereby improving graphics rendering efficiency and reducing the CPU resource usage.
[0038] In some embodiments, if there is a candidate graphic in the preset graphics library, and there is only one candidate graphic, the candidate graphic is copied from the preset graphics library so that graphics rendering can be performed based on the candidate graphic, thereby improving graphics rendering efficiency and reducing the CPU resource usage.
[0039] In some embodiments, if candidate graphics exist in a preset graphics library, and there are multiple candidate graphics, the candidate graphics with the highest matching score to the graphic to be rendered is selected as the target candidate graphics. This matching score is calculated based on size and color.
[0040] For example, the matching score is 10 for the same size, 5 for similar sizes, 5 for the same color, 0 for different colors, 5 for the same transparency, and 0 for different transparency. The matching score between each candidate graphic and the graphic to be rendered is calculated separately, and the candidate graphic with the highest matching score is selected as the target candidate graphic.
[0041] In some embodiments, such as Figure 4 As shown, step S103 includes sub-steps S1031 to S1032.
[0042] Sub-step S1031: When the size of the graphic to be rendered is the same as the size of the candidate graphic, and the color of the graphic to be rendered is the same as the color of the candidate graphic, the candidate graphic is output as the first target graphic.
[0043] If the size of the graphic to be rendered is the same as the size of the candidate graphic, and the color of the graphic to be rendered is the same as the color of the candidate graphic, the candidate graphic is directly output as the first target graphic, thereby completing the rendering of the graphic to be rendered, which greatly improves the efficiency of graphic rendering.
[0044] Sub-step S1032: When the size of the graphic to be rendered is the same as the size of the candidate graphic, and the color of the graphic to be rendered is different from the color of the candidate graphic, perform color texture rendering on the candidate graphic according to the color of the graphic to be rendered to obtain the first target graphic.
[0045] The color here includes both hue and transparency.
[0046] In some embodiments, when the size of the image to be rendered is the same as the size of the candidate image, but the colors of the image to be rendered and the candidate images are different, color texture rendering is performed on the candidate image based on the color of the image to be rendered, thereby changing the color texture of the candidate image and obtaining the first target image. By simply rendering the color texture of the candidate image, the first target image can be accurately obtained, greatly improving the efficiency of image rendering.
[0047] In some embodiments, when the size of the image to be rendered is the same as the size of the candidate image, and the color of the image to be rendered is different from the color of the candidate image, color texture rendering is performed on the candidate image based on the color of the image to be rendered, thereby changing the color texture of the candidate image and obtaining the first target image. By simply rendering the color texture of the candidate image, the first target image can be accurately obtained, greatly improving the efficiency of image rendering.
[0048] In some embodiments, when the size of the image to be rendered is the same as the size of the candidate image, but the transparency of the image to be rendered is different from that of the candidate image, the candidate image is rendered with a transparency texture based on the transparency of the image to be rendered, thereby changing the transparency texture of the candidate image and obtaining the first target image. By simply rendering the transparency texture of the candidate image, the first target image can be accurately obtained, greatly improving the efficiency of image rendering.
[0049] In some embodiments, when the size of the image to be rendered is the same as the size of the candidate image, but the color and transparency of the image to be rendered are different from those of the candidate image, color and transparency texture rendering is performed on the candidate image based on the color and transparency of the image to be rendered, thereby changing the color and transparency texture of the candidate image to obtain the first target image. By simply rendering the color and transparency texture of the candidate image, the first target image can be accurately obtained, greatly improving the efficiency of image rendering.
[0050] In some embodiments, such as Figure 5 As shown, step S103 includes sub-steps S1033 to S1034.
[0051] Sub-step S1033: When the size of the graphic to be rendered is similar to the size of the candidate graphic, and the color of the graphic to be rendered is the same as the color of the candidate graphic, the size of the candidate graphic is rendered according to the size to obtain the first target graphic.
[0052] In some embodiments, when the size of the image to be rendered is similar to the size of the candidate image, and the colors of the image to be rendered are the same as those of the candidate image, the candidate image is rendered according to its size to adjust its size to match that of the image to be rendered, thereby obtaining the first target image. By simply rendering the candidate image, the first target image can be accurately obtained, greatly improving the efficiency of image rendering.
[0053] Sub-step S1034: When the size of the graphic to be rendered is similar to the size of the candidate graphic, and the color of the graphic to be rendered is different from the color of the candidate graphic, the size of the candidate graphic is adjusted according to the size, and the color texture of the candidate graphic is rendered according to the color of the graphic to be rendered to obtain the first target graphic.
[0054] In some embodiments, when the size of the image to be rendered is similar to the size of the candidate image, but the colors of the image to be rendered and the candidate images are different, the candidate image is rendered according to its size to adjust its size to match that of the image to be rendered. Furthermore, the candidate image is rendered with color texture based on its color to change its color texture, thus obtaining the first target image. Rendering the candidate image by adjusting its size and color texture allows for accurate acquisition of the first target image.
[0055] Step S104: If there are no candidate graphics in the preset graphics library, render the graphics according to the type, size and color of the graphics to be rendered to obtain the second target graphics.
[0056] If no candidate graphic exists in the preset graphic library, the graphic is rendered according to its type, size, and color to obtain the second target graphic. Rendering the graphic according to its type, size, and color ensures an accurate acquisition of the second target graphic.
[0057] In some embodiments, the graphics are rendered according to the type, size and color of the graphics to be rendered to obtain a second target graphics, and the second target graphics are cached in a preset graphics library to facilitate the rendering of subsequent graphics.
[0058] It should be noted that when the preset graphics library reaches its maximum storage capacity, the second target graphic generated by the current rendering will overwrite the first historical graphic, which is the first graphic stored in the preset graphics library.
[0059] The image rendering method provided in the above embodiments obtains a graphics rendering request, which includes the type, size, and color of the graphic to be rendered; determines whether a candidate graphic exists in a preset graphics library based on the type and size of the graphic to be rendered; if a candidate graphic exists in the preset graphics library, the candidate graphic is copied from the preset graphics library, and graphics rendering is performed based on the size, color, and candidate graphic to obtain a first target graphic; if no candidate graphic exists in the preset graphics library, graphics rendering is performed based on the type, size, and color of the graphic to be rendered to obtain a second target graphic. In this application, determining whether a candidate graphic exists in the preset graphics library based on the type and size of the graphic to be rendered, and directly copying the candidate graphic from the preset graphics library if a candidate graphic exists, can effectively shorten the rendering time. Furthermore, performing graphics rendering based on the size, color, and candidate graphic to obtain a first target graphic effectively improves the efficiency of graphics rendering. If no candidate graphic exists in the preset graphics library, performing graphics rendering based on the type, size, and color of the graphic to be rendered to obtain a second target graphic also accurately completes the graphics rendering.
[0060] Please see Figure 6 , Figure 6 This is a schematic block diagram of an image rendering apparatus provided in an embodiment of this application.
[0061] like Figure 6 As shown, the image rendering device 200 includes an acquisition module 210, a determination module 220, and an output module 230, wherein: The acquisition module 210 is used to acquire a graphics rendering request, which includes the type, size and color of the graphics to be rendered. The determining module 220 is used to determine whether there are candidate graphics in the preset graphics library based on the type and size of the graphics to be rendered; The output module 230 is used to copy the candidate graphic from the preset graphic library if a candidate graphic exists in the preset graphic library, and to perform graphic rendering based on the size, color and the candidate graphic to obtain a first target graphic; The output module 230 is further configured to render a second target graphic based on the type, size, and color of the graphic to be rendered if no candidate graphic exists in the preset graphic library.
[0062] In some embodiments, the determining module 220 is further configured to: If the preset graphics library contains a graphic of the same type and size as the graphic to be rendered, then it is determined that a candidate graphic exists in the preset graphics library.
[0063] In some embodiments, the determining module 220 is further configured to: If a candidate graphic exists in the preset graphic library that is of the same type and similar in size to the graphic to be rendered, then it is determined that a candidate graphic exists in the preset graphic library.
[0064] In some embodiments, the output module 230 is further configured to: When the size of the graphic to be rendered is the same as the size of the candidate graphic, and the color of the graphic to be rendered is the same as the color of the candidate graphic, the candidate graphic is output as the first target graphic. When the size of the graphic to be rendered is the same as the size of the candidate graphic, and the color of the graphic to be rendered is different from the color of the candidate graphic, the candidate graphic is rendered with color texture according to the color of the graphic to be rendered to obtain the first target graphic.
[0065] In some embodiments, the output module 230 is further configured to: When the size of the graphic to be rendered is similar to the size of the candidate graphic, and the color of the graphic to be rendered is the same as the color of the candidate graphic, the size of the candidate graphic is rendered according to the size to obtain the first target graphic; When the size of the graphic to be rendered is similar to that of the candidate graphic, and the color of the graphic to be rendered is different from that of the candidate graphic, the size of the candidate graphic is adjusted according to the size, and the candidate graphic is color texture rendered according to the color of the graphic to be rendered to obtain the first target graphic.
[0066] In some embodiments, the output module 230 is further configured to: The candidate graphic is rendered with color and texture based on the color and / or transparency of the graphic to be rendered, to obtain the first target graphic.
[0067] In some embodiments, the output module 230 is further configured to: The second target graphic is cached in the preset graphics library.
[0068] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the above-mentioned image rendering device can be referred to the corresponding process in the aforementioned image rendering method embodiments, and will not be repeated here.
[0069] Please see Figure 7 , Figure 7 This is a schematic block diagram of the structure of a computer device provided in an embodiment of this application.
[0070] like Figure 7 As shown, the computer device 300 includes a processor 302 and a memory 303 connected via a system bus 301, wherein the memory may include a storage medium and internal memory.
[0071] The storage medium may store a computer program. The computer program includes program instructions that, when executed, cause the processor to perform any image rendering method.
[0072] The processor 302 provides computing and control capabilities to support the operation of the entire computer device.
[0073] Internal memory provides an environment for the execution of computer programs stored in the storage medium. When these computer programs are executed by the processor, the processor can perform any image rendering method.
[0074] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0075] It should be understood that processor 302 can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among these, the general-purpose processor can be a microprocessor or any conventional processor.
[0076] In one embodiment, the processor 302 is configured to run a computer program stored in a memory to perform the following steps: Obtain a graphics rendering request, which includes the type, size, and color of the graphics to be rendered; Based on the type and size of the graphic to be rendered, determine whether there are candidate graphics in the preset graphics library; If a candidate graphic exists in the preset graphic library, the candidate graphic is copied from the preset graphic library, and the graphic is rendered according to the size, color and the candidate graphic to obtain the first target graphic; If no candidate graphic exists in the preset graphic library, the graphic is rendered according to the type, size, and color of the graphic to be rendered to obtain the second target graphic.
[0077] In one embodiment, when the processor 302 determines whether a candidate graphic exists in a preset graphics library based on the type and size of the graphic to be rendered, it is configured to: If the preset graphics library contains a graphic of the same type and size as the graphic to be rendered, then it is determined that a candidate graphic exists in the preset graphics library.
[0078] In one embodiment, when the processor 302 determines whether a candidate graphic exists in a preset graphics library based on the type and size of the graphic to be rendered, it is configured to: If a candidate graphic exists in the preset graphic library that is of the same type and similar in size to the graphic to be rendered, then it is determined that a candidate graphic exists in the preset graphic library.
[0079] In one embodiment, when the processor 302 performs graphic rendering based on the size, color, and candidate graphics to obtain a first target graphic, it is configured to: When the size of the graphic to be rendered is the same as the size of the candidate graphic, and the color of the graphic to be rendered is the same as the color of the candidate graphic, the candidate graphic is output as the first target graphic. When the size of the graphic to be rendered is the same as the size of the candidate graphic, and the color of the graphic to be rendered is different from the color of the candidate graphic, the candidate graphic is rendered with color texture according to the color of the graphic to be rendered to obtain the first target graphic.
[0080] In one embodiment, when the processor 302 performs graphic rendering based on the size, color, and candidate graphics to obtain a first target graphic, it is configured to: When the size of the graphic to be rendered is similar to the size of the candidate graphic, and the color of the graphic to be rendered is the same as the color of the candidate graphic, the size of the candidate graphic is rendered according to the size to obtain the first target graphic; When the size of the graphic to be rendered is similar to that of the candidate graphic, and the color of the graphic to be rendered is different from that of the candidate graphic, the size of the candidate graphic is adjusted according to the size, and the candidate graphic is color texture rendered according to the color of the graphic to be rendered to obtain the first target graphic.
[0081] In one embodiment, the color includes hue and transparency; the processor 302, when implementing the color texture rendering of the candidate graphic based on the color of the graphic to be rendered, is used to: The candidate graphic is rendered with color and texture based on the color and / or transparency of the graphic to be rendered, to obtain the first target graphic.
[0082] In one embodiment, after rendering the second target graphic based on the type, size, and color of the graphic to be rendered, the processor 302 is further configured to: The second target graphic is cached in the preset graphics library.
[0083] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the computer device described above can be referred to the corresponding process in the aforementioned image rendering method embodiments, and will not be repeated here.
[0084] This application also provides a computer-readable storage medium storing a computer program, the computer program including program instructions, and the method implemented when the program instructions are executed can be referred to various embodiments of the image rendering method of this application.
[0085] The computer-readable storage medium can be an internal storage unit of the computer device described in the foregoing embodiments, such as a hard disk or memory of the computer device. The computer-readable storage medium can be non-volatile or volatile. Alternatively, the computer-readable storage medium can be an external storage device of the computer device, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the computer device.
[0086] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification, unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “the” are intended to include the plural forms.
[0087] It should also be understood that the term "and / or" as used in this specification refers to any combination and all possible combinations of one or more of the associated listed items, and includes such combinations. It should be noted that, herein, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0088] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments. The above descriptions are merely specific implementations of this application, but the protection scope of this 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 this application, and these modifications or substitutions should all be covered within the protection scope of this application.
Claims
1. An image rendering method, characterized in that, include: Obtain a graphics rendering request, which includes the type, size, and color of the graphics to be rendered; Based on the type and size of the graphic to be rendered, determine whether there are candidate graphics in the preset graphics library; If a candidate graphic exists in the preset graphic library, the candidate graphic is copied from the preset graphic library, and the graphic is rendered according to the size, color and the candidate graphic to obtain the first target graphic; If no candidate graphic exists in the preset graphic library, the graphic is rendered according to the type, size, and color of the graphic to be rendered to obtain the second target graphic.
2. The image rendering method as described in claim 1, characterized in that, The step of determining whether candidate graphics exist in the preset graphics library based on the type and size of the graphics to be rendered includes: If the preset graphics library contains a graphic of the same type and size as the graphic to be rendered, then it is determined that a candidate graphic exists in the preset graphics library.
3. The image rendering method as described in claim 1, characterized in that, The step of determining whether candidate graphics exist in the preset graphics library based on the type and size of the graphics to be rendered includes: If a candidate graphic exists in the preset graphic library that is of the same type and similar in size to the graphic to be rendered, then it is determined that a candidate graphic exists in the preset graphic library.
4. The image rendering method as described in claim 1, characterized in that, The step of rendering the image based on the size, color, and candidate images to obtain the first target image includes: When the size of the graphic to be rendered is the same as the size of the candidate graphic, and the color of the graphic to be rendered is the same as the color of the candidate graphic, the candidate graphic is output as the first target graphic. When the size of the graphic to be rendered is the same as the size of the candidate graphic, and the color of the graphic to be rendered is different from the color of the candidate graphic, the candidate graphic is rendered with color texture according to the color of the graphic to be rendered to obtain the first target graphic.
5. The image rendering method as described in claim 1, characterized in that, The step of rendering the image based on the size, color, and candidate images to obtain the first target image includes: When the size of the graphic to be rendered is similar to the size of the candidate graphic, and the color of the graphic to be rendered is the same as the color of the candidate graphic, the size of the candidate graphic is rendered according to the size to obtain the first target graphic; When the size of the graphic to be rendered is similar to that of the candidate graphic, and the color of the graphic to be rendered is different from that of the candidate graphic, the size of the candidate graphic is adjusted according to the size, and the candidate graphic is color texture rendered according to the color of the graphic to be rendered to obtain the first target graphic.
6. The image rendering method as described in any one of claims 4 or 5, characterized in that, The color includes hue and transparency; the step of performing color texture rendering on the candidate graphic based on the color of the graphic to be rendered includes: The candidate graphic is rendered with color and texture based on the color and / or transparency of the graphic to be rendered, to obtain the first target graphic.
7. The image rendering method as described in claim 6, characterized in that, After rendering the graphic according to its type, size, and color to obtain the second target graphic, the process further includes: The second target graphic is cached in the preset graphics library.
8. An image rendering apparatus, characterized in that, The image rendering device includes an acquisition module, a determination module, and an output module, wherein: The acquisition module is used to acquire a graphics rendering request, which includes the type, size, and color of the graphics to be rendered. The determining module is used to determine whether there are candidate graphics in the preset graphics library based on the type and size of the graphics to be rendered; The output module is used to copy the candidate graphic from the preset graphic library if a candidate graphic exists in the preset graphic library, and to perform graphic rendering based on the size, color and the candidate graphic to obtain the first target graphic; The output module is further configured to render a second target graphic based on the type, size, and color of the graphic to be rendered if no candidate graphic exists in the preset graphic library.
9. A computer device, characterized in that, The computer device includes a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, it implements the steps of the image rendering method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, it implements the steps of the image rendering method as described in any one of claims 1 to 7.