CN115965711A - Graphics processing method and device - Google Patents

Graphics processing method and device Download PDF

Info

Publication number
CN115965711A
CN115965711A CN202310102242.0A CN202310102242A CN115965711A CN 115965711 A CN115965711 A CN 115965711A CN 202310102242 A CN202310102242 A CN 202310102242A CN 115965711 A CN115965711 A CN 115965711A
Authority
CN
China
Prior art keywords
graph
graphic
information
initial
adjustment information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310102242.0A
Other languages
Chinese (zh)
Inventor
黎梓健
刘峰
章靖宁
刘禛
孟岩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhuhai Kingsoft Digital Network Technology Co Ltd
Original Assignee
Zhuhai Kingsoft Digital Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhuhai Kingsoft Digital Network Technology Co Ltd filed Critical Zhuhai Kingsoft Digital Network Technology Co Ltd
Priority to CN202310102242.0A priority Critical patent/CN115965711A/en
Publication of CN115965711A publication Critical patent/CN115965711A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Image Generation (AREA)

Abstract

The application provides a graphic processing method and a device, wherein the graphic processing method comprises the following steps: receiving initial graphic parameters and generating an initial graphic according to the initial graphic parameters, wherein the initial graphic parameters comprise a graphic inner diameter, a graphic outer diameter and a graphic ring width; receiving a graph adjustment instruction, wherein the graph adjustment instruction carries first adjustment information aiming at a first graph variable, and the first graph variable is the graph inner diameter or the graph outer diameter; determining second adjustment information of a second graphic variable according to the first adjustment information and the graphic ring width, wherein the second graphic variable is the graphic inner diameter or the graphic outer diameter; and adjusting the initial graph according to the first adjustment information and the second adjustment information to obtain a target graph.

Description

Graphics processing method and device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a graphics processing method. The present application also relates to a graphics processing apparatus, a computing device, and a computer-readable storage medium.
Background
With the continuous development of computer technology, the drawing requirements of users for virtual graphics are higher and higher.
At present, when the virtual graph is drawn by using drawing software, if the size of the virtual graph is adjusted, the data of the part of the virtual graph which needs to be fixed can be adjusted accordingly, so that a user cannot draw the virtual graph which meets the corresponding requirement.
Therefore, how to draw a virtual graph meeting the requirement and improve the drawing efficiency becomes a technical problem to be solved urgently by those skilled in the art.
Disclosure of Invention
In view of this, embodiments of the present application provide a graphics processing method. The present application is also directed to a graphics processing apparatus, a computing device, and a computer-readable storage medium to solve the above-mentioned problems in the prior art.
According to a first aspect of embodiments of the present application, there is provided a graphics processing method, including:
receiving initial graphic parameters and generating an initial graphic according to the initial graphic parameters, wherein the initial graphic parameters comprise a graphic inner diameter, a graphic outer diameter and a graphic ring width;
receiving a graph adjustment instruction, wherein the graph adjustment instruction carries first adjustment information for a first graph variable, and the first graph variable is the graph inner diameter or the graph outer diameter;
determining second adjustment information of a second graphic variable according to the first adjustment information and the graphic ring width, wherein the second graphic variable is the graphic inner diameter or the graphic outer diameter;
and adjusting the initial graph according to the first adjustment information and the second adjustment information to obtain a target graph.
According to a second aspect of embodiments of the present application, there is provided a graphics processing apparatus, including:
the generating module is configured to receive initial graph parameters and generate an initial graph according to the initial graph parameters, wherein the initial graph parameters comprise a graph inner diameter, a graph outer diameter and a graph ring width;
the receiving module is configured to receive a graph adjustment instruction, wherein the graph adjustment instruction carries first adjustment information for a first graph variable, and the first graph variable is the graph inner diameter or the graph outer diameter;
a determining module configured to determine second adjustment information of a second graphic variable according to the first adjustment information and the graphic ring width, wherein the second graphic variable is the graphic inner diameter or the graphic outer diameter;
and the adjusting module is configured to adjust the initial graph according to the first adjusting information and the second adjusting information to obtain a target graph.
According to a third aspect of embodiments of the present application, there is provided a computing device comprising a memory, a processor, and computer instructions stored on the memory and executable on the processor, the processor implementing the steps of the graphics processing method when executing the computer instructions.
According to a fourth aspect of embodiments of the present application, there is provided a computer-readable storage medium storing computer instructions which, when executed by a processor, implement the steps of the graphics processing method.
The image processing method provided by the application receives initial image parameters and generates an initial image according to the initial image parameters, wherein the initial image parameters comprise an image inner diameter, an image outer diameter and an image ring width; receiving a graph adjustment instruction, wherein the graph adjustment instruction carries first adjustment information aiming at a first graph variable, and the first graph variable is the graph inner diameter or the graph outer diameter; determining second adjustment information of a second graphic variable according to the first adjustment information and the graphic ring width, wherein the second graphic variable is the graphic inner diameter or the graphic outer diameter; and adjusting the initial graph according to the first adjustment information and the second adjustment information to obtain a target graph.
According to the embodiment of the application, the initial graph is generated according to the initial graph parameters so as to be convenient for processing the initial graph subsequently; receiving a graph adjustment instruction containing first adjustment information, and determining second adjustment information based on the first adjustment information and the graph ring width; the initial graph is adjusted based on the first adjustment information and the second adjustment information, so that the situation that the graph loop width is influenced in the graph processing process to cause loss of relevant data of the graph loop width is avoided, and the accuracy and the stability of graph processing are improved.
Drawings
Fig. 1 is a schematic view of a scene of a graphics processing method according to an embodiment of the present application;
FIG. 2 is a flowchart of a graphics processing method according to an embodiment of the present application;
FIG. 3 is a schematic view of a graphical map provided by an embodiment of the present application;
FIG. 4 is a flowchart illustrating a graphics processing method applied to rendering a ring according to an embodiment of the present disclosure;
FIG. 5 is a block diagram of a graphics processing apparatus according to an embodiment of the present application;
fig. 6 is a block diagram of a computing device according to an embodiment of the present application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is capable of implementation in many different ways than those herein set forth and of similar import by those skilled in the art without departing from the spirit and scope of this application, and thus this application is not limited to the specific implementations disclosed below.
The terminology used in the one or more embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of the present application. As used in one or more embodiments of the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in one or more embodiments of the present application refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It will be understood that, although the terms first, second, etc. may be used herein in one or more embodiments of the present application to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first aspect may be termed a second aspect, and, similarly, a second aspect may be termed a first aspect, without departing from the scope of one or more embodiments of the present application. The word "if" as used herein may be interpreted as "at" \8230; "or" when 8230; \8230; "or" in response to a determination ", depending on the context.
First, the noun terms referred to in one or more embodiments of the present application are explained.
Unity: is a real-time 3D interactive content creation and operation platform; the Unity platform provides a complete set of complete software solutions that can be used to author, operate and render any real-time interactive 2D and 3D content, and the support platforms include cell phones, tablet computers, PCs, game consoles, augmented reality and virtual reality devices.
GetOuterUV method: the method of building in the DataUtility class in Unity can return the UV range of the picture in the whole picture set, and if the picture is not in the picture set, the range returns (0, 0) - (1, 1).
UV mapping: is a planar representation of the 3D model surface for packaging textures, and the process of creating a UV map is called UV unfolding.
OnPopulateStosh method: the method for building the graph class in the Unity is used for building Mesh (Graphic grid) according to data.
Mesh: the Mesh is a Mesh of a model, and the main attribute contents of the Mesh comprise attributes and functions such as vertex coordinates, normals, texture coordinates, triangle drawing sequences and the like.
Graphic class: and the Unity visualizes the base class of the UI component and provides an interface for drawing the graph.
Spriteatlas: the sprite galleries, each gallery managed with a separate sprite atlas, are also formatted in this resource.
In the present application, a graphics processing method is provided, and the present application relates to a graphics processing apparatus, a computing device, and a computer-readable storage medium, which are described in detail in the following embodiments one by one.
Fig. 1 shows a scene schematic diagram of a graphics processing method according to an embodiment of the present application, which specifically includes: adding a ring drawing plug-in into drawing software, enabling a user to open a ring drawing operation interface shown in a part (1) in the figure 1 in the drawing software, and enabling the user to add inner diameter and outer diameter data into a right toolbar to finish drawing of a ring; specifically, the user adds inner diameter data 20 and outer diameter data 22 in the toolbar, wherein the inner diameter refers to the distance from the circle center to the point a, and the outer diameter refers to the distance from the circle center to the point b; the drawing software displays the drawn circular ring in the display space on the left side of the part (1) based on the inner diameter data and the outer diameter data set by the user; under the condition that a user adjusts the scaling, drawing software receives a graph adjusting instruction and determines a drawn circular ring and graph adjusting information based on the graph adjusting instruction; according to the graph adjustment information, the outer diameter is enlarged to 1.5 times, the outer diameter of the ring is adjusted from 22 to 33, the ring width 2 is further determined according to the original inner diameter and outer diameter of the ring, the current inner diameter of the ring is determined to be 31 according to the current outer diameter 33 and ring width 2 of the ring, and the ring is modified based on the current outer diameter 33 of the ring and the current inner diameter 31 of the ring, so that the ring shown as part (2) in fig. 1 is obtained.
In the graph processing method in one embodiment of the application, a circular ring is drawn based on data set by a user; under the condition of receiving a graph adjusting instruction aiming at the circular ring, adjusting the outer diameter of the circular ring and determining the width of the circular ring; the inner diameter of the ring is adjusted based on the ring width and the adjusted outer diameter of the ring, so that the problem that when the ring is zoomed and adjusted, the ring width is adjusted along with the ring width, data corresponding to the ring width is lost and the like is solved, the graph drawing efficiency of a user is improved, and the graph drawing quality is guaranteed.
Fig. 2 is a flowchart illustrating a graphics processing method according to an embodiment of the present application, which specifically includes the following steps:
step 202: receiving initial graphic parameters and generating an initial graphic according to the initial graphic parameters, wherein the initial graphic parameters comprise a graphic inner diameter, a graphic outer diameter and a graphic ring width.
The initial graphic parameters refer to graphic parameters for drawing an initial graphic, such as inner diameter of a circular ring, outer diameter of the circular ring, and the like; the initial figure refers to a figure drawn based on initial figure parameters, for example, a circular ring with a ring width of 2 is drawn based on a circular ring inner diameter 2 and a circular ring outer diameter 4.
It should be noted that the initial graph drawn by the present application is a graph including a ring width, such as a circular ring, a triangular ring, a rectangular ring, etc.; therefore, the initial graphic parameters include a graphic inner diameter, a graphic outer diameter and a graphic ring width, so as to draw a graphic including the ring width, taking a ring as an example, the graphic inner diameter refers to the radius or diameter of an inner ring circle of the ring, the graphic outer diameter refers to the radius or diameter of an outer ring circle of the ring, and the graphic ring width refers to the distance from the inner ring circle of the ring to the outer ring circle of the ring.
Specifically, a graph drawing terminal used by a user receives an initial graph parameter request, wherein the initial graph parameter request can be obtained by inputting data at a client or directly drawing a graph by the user; and the graph drawing terminal generates an initial graph according to the graph inner diameter, the graph outer diameter and the graph ring width in the initial graph parameters.
In a specific embodiment of the present application, the graph drawing terminal receives an initial graph parameter, and draws the graph a according to a graph inner diameter, a graph outer diameter, and a graph ring width in the initial graph parameter.
It should be noted that the graphics processing method of the present application may be directly applied to a graphics rendering terminal, or applied to a graphics rendering tool installed in the terminal, so as to assist the graphics rendering tool in completing a graphics rendering task of a user.
The initial graph is drawn based on the initial graph parameters so as to be further processed subsequently.
In practical application, the method for receiving the initial graphic parameters by the graphic drawing terminal and generating the initial graphic according to the initial graphic parameters may include:
calculating vertex coordinate information based on the graph inner diameter, the graph outer diameter and the graph ring width;
acquiring preset map information, and adjusting the preset map information according to the vertex coordinate information to acquire target map information;
and constructing an initial graph based on the vertex coordinate information and the target map information.
The vertex coordinate information refers to information obtained by calculation based on a preset algorithm and initial graphic parameters; in practical application, a graph consists of a plurality of vertexes, and vertex coordinate information corresponding to each vertex is calculated through initial graph parameters and a preset algorithm and is used for generating an initial graph; the preset algorithm refers to an algorithm for calculating vertex coordinate information, and for example, the preset algorithm may be a trigonometric function.
After determining the vertex, carrying out mapping based on the vertex to obtain an initial graph with a complete patch; the preset map information is map data used for generating an initial graph; in practical application, the preset map information is not adapted to the vertex, that is, the map cannot correctly cover the vertex, so that the preset map information needs to be adjusted according to the vertex coordinate information, and the target map information is obtained.
Specifically, the method for adjusting the preset map information according to the vertex coordinate information to obtain the target map information may include:
determining a current chartlet scale based on the vertex coordinate information;
and adjusting the preset map proportion corresponding to the preset map information according to the current map proportion to obtain target map information.
Wherein, the current mapping proportion refers to the mapping proportion determined based on the vertex coordinate information; the preset map proportion refers to a proportion determined according to preset map information, for example, the preset map proportion is 1.
And adjusting the preset map proportion based on the current map proportion to obtain the target map information corresponding to the vertex coordinate information.
In a specific embodiment of the application, map UV information of the Spriteatlas function adapted to Unity is acquired based on a GetOuterUV method in Unity, namely UV range information corresponding to a circular ring is acquired; under the condition that the UV information of the mapping is not adjusted, the mapping effect obtained by directly mapping the circular ring is shown as part (1) of fig. 3, the mapping is mapped on each rectangular panel forming the circular ring, and the mapping cannot be correctly mapped on the circular ring; therefore, each rectangular patch on the circular ring needs to be integrated into a rectangular patch corresponding to the whole circular ring, as shown in part (2) of fig. 3, and at this time, a mapping effect as shown in part (3) of fig. 3 can be obtained when mapping is performed again; at this time, the preset mapping proportion needs to be adjusted based on the current mapping proportion corresponding to the ring, specifically, the diameter of the ring is determined to be 500 pixels, and the size information of the rectangular patch corresponding to the whole ring is determined: 200 pixels long and 100 pixels wide; according to the ratio of the size of the graph to the diameter of the outer ring, namely the side length of the rectangle, the mapping is changed to a corresponding proportion, namely the transverse scaling of the mapping with the length of 200 picture and the width of 100 picture elements is multiplied by 200/500, and the mapping effect shown in part (4) of figure 3 is obtained; further, the mapping can be modified to the corresponding scale by multiplying the longitudinal scaling by 100/500, so as to obtain the mapping effect shown in part (5) of fig. 3; after the map meeting the requirement is obtained, the map position information also needs to be adjusted to obtain the expected map effect as shown in part (6) of fig. 3, that is, the target map information is obtained.
The target map information is obtained by adjusting the position, rotation, scaling and the like of the map information of the graph, so that the situation that the corresponding map information needs to be regenerated under the condition that the graph is partially adjusted is avoided, namely the corresponding adjustment is carried out on the map information, the target map information for subsequent map pasting can be obtained, and the universality is improved.
After the vertex coordinate information and the target mapping information are obtained, a graph patch can be constructed based on the vertex coordinate information, and mapping is carried out on the graph patch based on the target mapping information, so that an initial graph is obtained.
In a specific embodiment of the present application, a Mesh is constructed by using an onpopullesesh method of Graphic class in Unity in combination with the calculated vertex coordinates and vertex UV information, that is, a graph panel is generated.
In practical application, after UV mapping is carried out on the graphic panel, material balls can be added to the graphic panel, so that the graphic display effect is enriched.
Specifically, the method for constructing the initial graph based on the vertex coordinate information and the target map information may include:
creating a graphical patch based on the vertex coordinate information and the target map information;
and under the condition that the material configuration information corresponding to the graphic patch is obtained, generating an initial graphic based on the material configuration information and the graphic patch.
The material configuration information is information for configuring and displaying materials for the graph, and comprises static material information and dynamic material information; the static material information may include material information such as metal material and wood material. The dynamic material information includes progress bar material information and the like.
In practical applications, a user may select or input desired material configuration information at the graphic rendering terminal based on requirements, so that the terminal may configure the graphic based on the material configuration information.
In a specific embodiment of the present application, a user inputs progress bar function configuration information in a tool panel of a graphical drawing terminal, where the progress bar function configuration information includes progress bar position ratio information (used to represent a position ratio of a progress bar in an interface), one-way time direction turning information (used to represent that the progress bar moves in a single direction), progress bar two-way control information (used to represent that the progress bar can move in two directions), and the like; generating a material ball based on the progress bar function configuration information; and data corresponding to the material ball is transmitted, and the east bar effect of the progress bar is generated in the GPU, so that the CPU loss is reduced.
The initial graph is generated based on the material configuration information, so that the display effect of the initial graph is enriched.
Step 204: receiving a graph adjustment instruction, wherein the graph adjustment instruction carries first adjustment information for a first graph variable, and the first graph variable is the graph inner diameter or the graph outer diameter.
In practical applications, the drawn initial graph may need to be adjusted based on the service adjustment, so that the graph drawing terminal may receive the graph adjustment instruction after the initial graph is drawn.
The graphic adjustment instruction refers to an instruction for adjusting the drawn initial graphic, for example, adjusting the size and color of the initial graphic; the graphic adjustment instruction of the present application is mainly an instruction for scaling a graphic.
The first graphic variable is a graphic variable which needs to be adjusted and is determined based on the first adjustment information; the first adjustment information is information for adjusting the first graphic variable; in order to ensure that the loop width is unchanged, the inner diameter or the outer diameter of the graph needs to be adjusted, and then the graph is zoomed by combining the loop width of the graph based on the adjusted inner diameter or outer diameter of the graph.
In a specific embodiment of the present application, the received graph adjustment instruction is parsed, and it is determined that, for a first graph variable: and first adjustment information of the outer diameter of the circular ring, wherein the first adjustment information is specifically 'reducing the circular ring by 1 time'.
In another embodiment of the present application, the received graphic adjustment command is parsed, and it is determined that for a first graphic variable: first adjustment information of the inner diameter of the ring, specifically "expand the ring by 2 times".
By determining the first graphic variable and the first adjustment information, an adjusted graphic can be generated based on the graphic variable and the adjustment information.
Step 206: and determining second adjustment information of a second graphic variable according to the first adjustment information and the graphic ring width, wherein the second graphic variable is the graphic inner diameter or the graphic outer diameter.
The second adjustment information is information for adjusting the second graphic variable; the second graphic variable refers to a graphic variable that needs to be adjusted, which is determined based on the second adjustment information.
Specifically, first adjustment information and a graph loop width are determined, and then a second graph variable is adjusted based on the first adjustment information and the graph loop width, so that the problem that the loop width is adjusted along with the overall adjustment of the graph is solved.
In practical applications, the method for determining the second adjustment information of the second graphic variable according to the first adjustment information and the graphic ring width may include:
determining inner diameter adjustment information for the graph inner diameter if the first graph variable is the graph inner diameter;
and determining outer diameter adjustment information corresponding to the outer diameter of the graph according to the inner diameter adjustment information and the graph ring width.
Specifically, a first graph variable is determined as a graph inner diameter, and then first adjustment information is determined as inner diameter adjustment information; outer diameter adjustment information of the outer diameter of the pattern is further determined based on the inner diameter adjustment information and the pattern loop width.
In a specific embodiment of the present specification, it is determined that the radius of an inner ring of a circular ring to be adjusted is 6, the radius of an outer ring of the circular ring to be adjusted is 8, and the width of a graphic ring is 2; determining that the first graph variable is the inner circle radius of the circular ring, and determining that the first adjusting information is to reduce the circular ring by 1 time; reducing the inner circle radius by 1 time based on the first adjustment information to obtain inner diameter information of 3; based on the inner diameter information 3 and the figure ring width 2, the adjustment information of the outer circle radius is determined to be 5, that is, the outer diameter adjustment information is determined to be 5.
In practical applications, the method for determining the second adjustment information of the second graphic variable according to the first adjustment information and the graphic ring width may include:
determining outer diameter adjustment information for the outer diameter of the graph if the first adjustment information is the outer diameter of the graph;
and determining inner diameter adjustment information corresponding to the inner diameter of the graph according to the outer diameter adjustment information and the graph ring width.
Specifically, determining a first graph variable as a graph outer diameter, and further determining first adjustment information as outer diameter adjustment information; inner diameter adjustment information for the inner diameter of the pattern is further determined based on the outer diameter adjustment information and the pattern ring width.
In a specific embodiment of the present specification, it is determined that the radius of the outer ring of the circular ring to be adjusted is 10, the radius of the inner ring is 8, and the width of the graphic ring is 2; determining that the first graphic variable is the outer circle radius of the circular ring, and determining that the first adjusting information is to reduce the circular ring by 1 time; reducing the excircle radius by 1 time based on the first adjustment information to obtain outer diameter information of 5; based on the outer diameter information 5 and the pattern loop width 2, the inner diameter adjustment information is determined to be 3.
By determining the second adjustment information based on the first adjustment information and the loop width, the influence on the fixed loop width data when scaling is avoided.
Step 208: and adjusting the initial graph according to the first adjustment information and the second adjustment information to obtain a target graph.
The target graph is obtained by processing the initial graph in response to a graph processing instruction; and adjusting the inner diameter and the outer diameter of the graph according to the first adjustment information and the second adjustment information to obtain the target graph after zooming.
In practical applications, the method for adjusting the initial graph according to the first adjustment information and the second adjustment information to obtain the target graph may include:
and replacing the first graph information corresponding to the first graph variable with the first adjustment information, and replacing the second graph information corresponding to the second graph variable with the second adjustment information to obtain a target graph.
The first graphic information refers to initial information of the first graphic variable, for example, the initial radius of the inner circle of the circular ring is 3, the initial diameter of the outer circle of the circular ring is 10, and the like; the second graphic information refers to initial information of the second graphic variable, for example, the initial radius of the outer circle of the circular ring is 5, and so on.
Specifically, first adjustment information of a first graphic variable is determined, and the first graphic information corresponding to the first graphic variable is replaced based on the first adjustment information, so that the first graphic variable is adjusted; and determining second adjustment information corresponding to the second graphic variable, and replacing the second graphic information corresponding to the second graphic scalar quantity based on the second adjustment information, thereby realizing the adjustment of the second graphic variable.
In a specific embodiment of the present application, if it is determined that the inner ring radius of the ring is 5 and the inner ring adjustment information corresponding to the inner ring radius is 4, the inner ring radius 5 may be replaced with the inner ring adjustment information 4; determining that the outer ring radius of the ring is 8 and the outer ring adjustment information corresponding to the outer ring radius is 7, replacing the outer ring radius 8 with the outer ring adjustment information; based on the adjusted inner ring radius and outer ring radius, the inner ring with the inner diameter of 5 and the outer diameter of 8 is adjusted to be a ring with the inner ring radius of 4 and the outer ring radius of 7.
In practical applications, it is usually necessary to process a plurality of associated graphics at the same time, so that when a plurality of graphics are in the same group, the graphics in the group can be scaled at the same time.
Specifically, the method further comprises:
acquiring a related graph corresponding to the initial graph;
determining associated graph adjustment information in the graph adjustment instruction;
and adjusting the associated graph based on the associated graph adjustment information.
The associated graph refers to an image which is in the same interface with the initial graph and has an association relationship, for example, the initial graph is a circular ring, and the associated graph can be a rectangle; the associated graph adjustment information is information for adjusting the associated graph, and in practical application, the associated graph adjustment information may be consistent with the first adjustment information, that is, the associated graph adjustment information may be adjustment information such as "enlarge the graph by 1 time"; an initial graphic may contain no associated graphics, or one or more associated graphics.
In practical application, the associated graph may be a graph containing a ring width, or may not contain a ring width; if the associated graph is a graph including a ring width, processing the associated graph based on the processing step of the initial graph; if the associated graph does not include the loop width, the associated graph may be directly scaled.
In a specific embodiment of the present application, determining that the associated graph corresponding to the ring is a rectangle or a triangle; analyzing the graph adjustment instruction to obtain associated graph adjustment information; the rectangle and the triangle are adjusted based on the associated graph adjustment information.
In another specific embodiment of the present application, determining that the association graph corresponding to the circular ring is a rectangular ring; analyzing the graph adjustment instruction to obtain associated graph adjustment information aiming at the rectangular ring; determining outer ring adjustment information of the rectangular ring outer ring based on inner ring adjustment information aiming at the rectangular ring inner ring and the ring width of the rectangular ring in the associated graph adjustment information; and adjusting the initial graph based on the inner ring adjustment information and the outer ring adjustment information to obtain an adjusted rectangular ring, namely an adjusted associated graph.
The image processing method provided by the application receives initial image parameters and generates an initial image according to the initial image parameters, wherein the initial image parameters comprise an image inner diameter, an image outer diameter and an image ring width; receiving a graph adjustment instruction, wherein the graph adjustment instruction carries first adjustment information aiming at a first graph variable, and the first graph variable is the graph inner diameter or the graph outer diameter; determining second adjustment information of a second graphic variable according to the first adjustment information and the graphic ring width, wherein the second graphic variable is the graphic inner diameter or the graphic outer diameter; and adjusting the initial graph according to the first adjustment information and the second adjustment information to obtain a target graph.
According to the embodiment of the application, the initial graph is generated according to the initial graph parameters so as to be convenient for processing the initial graph subsequently; receiving a graphic adjustment instruction including first adjustment information, thereby determining second adjustment information based on the first adjustment information and a graphic ring width; the initial graph is adjusted based on the first adjustment information and the second adjustment information, so that the situation that the graph loop width is influenced in the graph processing process to cause loss of relevant data of the graph loop width is avoided, and the accuracy and the stability of graph processing are improved.
The following description will further explain the graphics processing method by taking an application of the graphics processing method provided in the present application in drawing a circle as an example, with reference to fig. 4. Fig. 4 shows a processing flow chart of a graphics processing method applied to rendering a circular ring according to an embodiment of the present application, which specifically includes the following steps:
step 402: an inner ring radius, an outer ring radius, and a ring width are received for drawing the ring H.
Specifically, a user inputs ring drawing data at a graph drawing terminal; and receiving the radius of the inner ring of the circular ring and the radius of the outer ring of the circular ring by the graph drawing terminal, and determining the width of the circular ring based on the radius of the inner ring of the circular ring and the radius of the outer ring of the circular ring.
Step 404: and drawing an initial circular ring according to the radius of the inner ring of the circular ring, the radius of the inner ring of the circular ring and the width of the circular ring.
Specifically, the graph drawing terminal calculates vertex coordinate information of an initial ring based on a trigonometric function, a ring inner ring radius and a ring width; determining preset mapping information corresponding to the ring H, and adjusting the preset mapping information based on the vertex coordinate information to obtain target mapping information; and building a circular ring frame in a drawing space according to the vertex coordinate information, and mapping the circular ring frame based on the target mapping information to obtain an initial circular ring.
Step 406: and receiving a graph adjustment instruction, wherein the graph adjustment instruction carries outer ring adjustment information aiming at the outer ring radius of the circular ring.
Specifically, the graph adjustment instruction is determined to reduce the initial circular ring by 0.5 times; the outer ring radius 8 of the initial ring may be reduced by 0.5 times based on the graph adjustment information, resulting in an outer ring adjustment information of 4.
Step 408: inner ring adjustment information for an inner ring radius of the ring is determined based on the outer ring adjustment information and the ring width.
Specifically, if the ring width of the initial ring is determined to be 1 and the inner ring radius of the initial ring is determined to be 4, the inner ring adjustment information is determined to be 3 based on the ring width and the outer ring adjustment information 4.
Step 410: and adjusting the initial ring according to the inner ring adjustment information and the outer ring adjustment information to obtain a ring H.
Specifically, based on the outer ring adjustment information 4 and the inner ring adjustment information 3, the initial ring is adjusted to obtain a ring H with an outer ring radius of 4 and an inner ring radius of 3.
The image processing method provided by the application receives initial image parameters and generates an initial image according to the initial image parameters, wherein the initial image parameters comprise an image inner diameter, an image outer diameter and an image ring width; receiving a graph adjustment instruction, wherein the graph adjustment instruction carries first adjustment information for a first graph variable, and the first graph variable is the graph inner diameter or the graph outer diameter; determining second adjustment information of a second graphic variable according to the first adjustment information and the graphic ring width, wherein the second graphic variable is the graphic inner diameter or the graphic outer diameter; and adjusting the initial graph according to the first adjustment information and the second adjustment information to obtain a target graph.
According to the embodiment of the application, the initial graph is generated according to the initial graph parameters so as to be convenient for processing the initial graph subsequently; receiving a graphic adjustment instruction including first adjustment information, thereby determining second adjustment information based on the first adjustment information and a graphic ring width; the initial graph is adjusted based on the first adjustment information and the second adjustment information, so that the situation that the graph loop width is influenced in the graph processing process to cause loss of relevant data of the graph loop width is avoided, and the accuracy and the stability of graph processing are improved.
Corresponding to the above method embodiment, the present application further provides an embodiment of a graphics processing apparatus, and fig. 5 shows a schematic structural diagram of a graphics processing apparatus provided in an embodiment of the present application. As shown in fig. 5, the apparatus includes:
a generating module 502 configured to receive initial graphic parameters and generate an initial graphic according to the initial graphic parameters, wherein the initial graphic parameters include a graphic inner diameter, a graphic outer diameter and a graphic ring width;
a receiving module 504 configured to receive a graph adjustment instruction, where the graph adjustment instruction carries first adjustment information for a first graph variable, and the first graph variable is the graph inner diameter or the graph outer diameter;
a determining module 506 configured to determine second adjustment information of a second graphic variable according to the first adjustment information and the graphic ring width, wherein the second graphic variable is the graphic inner diameter or the graphic outer diameter;
an adjusting module 508, configured to adjust the initial graph according to the first adjustment information and the second adjustment information, to obtain a target graph.
In a specific embodiment of the present application, the generating module 502 is further configured to:
calculating vertex coordinate information based on the graph inner diameter, the graph outer diameter and the graph ring width;
acquiring preset map information, and adjusting the preset map information according to the vertex coordinate information to acquire target map information;
and constructing an initial graph based on the vertex coordinate information and the target map information.
In a specific embodiment of the present application, the generating module 502 is further configured to:
determining a current chartlet scale based on the vertex coordinate information;
and adjusting the preset map proportion corresponding to the preset map information according to the current map proportion to obtain target map information.
In a specific embodiment of the present application, the generating module 502 is further configured to:
creating a graphical patch based on the vertex coordinate information and the target map information;
and under the condition that the material configuration information corresponding to the graphic patch is obtained, generating an initial graphic based on the material configuration information and the graphic patch.
In a specific embodiment of the present application, the determining module 506 is further configured to:
determining inner diameter adjustment information for the graph inner diameter if the first graph variable is the graph inner diameter;
and determining outer diameter adjustment information corresponding to the outer diameter of the graph according to the inner diameter adjustment information and the graph ring width.
In a specific embodiment of the present application, the determining module 506 is further configured to:
determining outer diameter adjustment information for the figure outer diameter in the case that the first adjustment information is the figure outer diameter;
and determining inner diameter adjustment information corresponding to the inner diameter of the graph according to the outer diameter adjustment information and the graph ring width.
In a specific embodiment of the present application, the adjusting module 508 is further configured to:
and replacing the first graphic information corresponding to the first graphic variable with the first adjustment information, and replacing the second graphic information corresponding to the second graphic variable with the second adjustment information to obtain a target graphic.
In a specific embodiment of the present application, the apparatus further includes an adjustment sub-module, where the adjustment sub-module is configured to:
acquiring a related graph corresponding to the initial graph;
determining associated graph adjustment information in the graph adjustment instruction;
and adjusting the associated graph based on the associated graph adjustment information.
The image processing device receives initial image parameters and generates an initial image according to the initial image parameters, wherein the initial image parameters comprise an inner image diameter, an outer image diameter and an image ring width; receiving a graph adjustment instruction, wherein the graph adjustment instruction carries first adjustment information for a first graph variable, and the first graph variable is the graph inner diameter or the graph outer diameter; determining second adjustment information of a second graphic variable according to the first adjustment information and the graphic ring width, wherein the second graphic variable is the graphic inner diameter or the graphic outer diameter; and adjusting the initial graph according to the first adjustment information and the second adjustment information to obtain a target graph.
According to the embodiment of the application, the initial graph is generated according to the initial graph parameters so as to be convenient for processing the initial graph subsequently; receiving a graph adjustment instruction containing first adjustment information, and determining second adjustment information based on the first adjustment information and the graph ring width; the initial graph is adjusted based on the first adjustment information and the second adjustment information, so that the situation that the graph loop width is influenced in the graph processing process to cause loss of relevant data of the graph loop width is avoided, and the accuracy and the stability of graph processing are improved.
The foregoing is a schematic diagram of a graphics processing apparatus according to this embodiment. It should be noted that the technical solution of the graphics processing apparatus belongs to the same concept as the technical solution of the graphics processing method, and details that are not described in detail in the technical solution of the graphics processing apparatus can be referred to the description of the technical solution of the graphics processing method.
Fig. 6 illustrates a block diagram of a computing device 600 provided according to an embodiment of the present application. The components of the computing device 600 include, but are not limited to, a memory 610 and a processor 620. The processor 620 is coupled to the memory 610 via a bus 630 and a database 650 is used to store data.
Computing device 600 also includes access device 640, access device 640 enabling computing device 600 to communicate via one or more networks 660. Examples of such networks include a Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the internet. The Access device 640 may include one or more of any type of network interface (e.g., a Network Interface Card (NIC)) whether wired or wireless, such as an IEEE802.11 Wireless Local Area Network (WLAN) wireless interface, a worldwide interoperability for microwave Access (Wi-MAX) interface, an ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a bluetooth interface, a Near Field Communication (NFC) interface, and so forth.
In one embodiment of the present application, the above-described components of computing device 600, as well as other components not shown in FIG. 6, may also be connected to each other, such as by a bus. It should be understood that the block diagram of the computing device architecture shown in FIG. 6 is for purposes of example only and is not limiting as to the scope of the present application. Other components may be added or replaced as desired by those skilled in the art.
Computing device 600 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), a mobile phone (e.g., smartphone), a wearable computing device (e.g., smartwatch, smartglasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or Personal Computer (PC). Computing device 600 may also be a mobile or stationary server.
Wherein the processor 620, when executing the computer instructions, performs the steps of the graphics processing method.
The foregoing is a schematic diagram of a computing device of the present embodiment. It should be noted that the technical solution of the computing device and the technical solution of the above-mentioned graphics processing method belong to the same concept, and details that are not described in detail in the technical solution of the computing device can be referred to the description of the technical solution of the above-mentioned graphics processing method.
An embodiment of the present application further provides a computer readable storage medium, which stores computer instructions, and the computer instructions, when executed by a processor, implement the steps of the graphics processing method as described above.
The above is an illustrative scheme of a computer-readable storage medium of the present embodiment. It should be noted that the technical solution of the storage medium belongs to the same concept as the technical solution of the aforementioned graphics processing method, and for details that are not described in detail in the technical solution of the storage medium, reference may be made to the description of the technical solution of the aforementioned graphics processing method.
The foregoing description of specific embodiments of the present application has been presented. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The computer instructions comprise computer program code which may be in source code form, object code form, an executable file or some intermediate form, or the like. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, etc. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
It should be noted that, for the sake of simplicity, the above-mentioned method embodiments are described as a series of acts or combinations, but those skilled in the art should understand that the present application is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present application. Further, those skilled in the art will appreciate that the embodiments described in this specification are presently considered to be preferred embodiments and that acts and modules are not required in the present application.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The preferred embodiments of the present application disclosed above are intended only to aid in the explanation of the application. Alternative embodiments are not exhaustive and do not limit the invention to the precise embodiments described. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the application and its practical application, to thereby enable others skilled in the art to best understand the application and its practical application. The application is limited only by the claims and their full scope and equivalents.

Claims (11)

1. A method of graphics processing, comprising:
receiving initial graphic parameters and generating an initial graphic according to the initial graphic parameters, wherein the initial graphic parameters comprise a graphic inner diameter, a graphic outer diameter and a graphic ring width;
receiving a graph adjustment instruction, wherein the graph adjustment instruction carries first adjustment information for a first graph variable, and the first graph variable is the graph inner diameter or the graph outer diameter;
determining second adjustment information of a second graphic variable according to the first adjustment information and the graphic ring width, wherein the second graphic variable is the graphic inner diameter or the graphic outer diameter;
and adjusting the initial graph according to the first adjustment information and the second adjustment information to obtain a target graph.
2. The method of claim 1, wherein receiving initial graphics parameters and generating an initial graphic based on the initial graphics parameters comprises:
calculating vertex coordinate information based on the graph inner diameter, the graph outer diameter and the graph ring width;
acquiring preset map information, and adjusting the preset map information according to the vertex coordinate information to acquire target map information;
and constructing an initial graph based on the vertex coordinate information and the target map information.
3. The method of claim 2, wherein adjusting the preset map information according to the vertex coordinate information to obtain target map information comprises:
determining a current chartlet scale based on the vertex coordinate information;
and adjusting the preset map proportion corresponding to the preset map information according to the current map proportion to obtain target map information.
4. The method of claim 2, wherein constructing an initial graph based on the vertex coordinate information and the target map information comprises:
creating a graphical patch based on the vertex coordinate information and the target map information;
and under the condition that the material configuration information corresponding to the graphic patch is obtained, generating an initial graphic based on the material configuration information and the graphic patch.
5. The method of claim 1, wherein determining second adjustment information for a second graphic variable based on the first adjustment information and the graphic ring width comprises:
determining inner diameter adjustment information for the graph inner diameter if the first graph variable is the graph inner diameter;
and determining outer diameter adjustment information corresponding to the outer diameter of the graph according to the inner diameter adjustment information and the graph ring width.
6. The method of claim 1, wherein determining second adjustment information for a second graphic variable based on the first adjustment information and the graphic ring width comprises:
determining outer diameter adjustment information for the outer diameter of the graph if the first adjustment information is the outer diameter of the graph;
and determining inner diameter adjustment information corresponding to the inner diameter of the graph according to the outer diameter adjustment information and the graph ring width.
7. The method as claimed in claim 1, wherein adjusting the initial pattern according to the first adjustment information and the second adjustment information to obtain a target pattern comprises:
and replacing the first graph information corresponding to the first graph variable with the first adjustment information, and replacing the second graph information corresponding to the second graph variable with the second adjustment information to obtain a target graph.
8. The method of claim 1, wherein the method further comprises:
acquiring an associated graph corresponding to the initial graph;
determining associated graph adjustment information in the graph adjustment instruction;
and adjusting the associated graph based on the associated graph adjustment information.
9. A graphics processing apparatus, comprising:
the generating module is configured to receive initial graph parameters and generate an initial graph according to the initial graph parameters, wherein the initial graph parameters comprise a graph inner diameter, a graph outer diameter and a graph ring width;
a receiving module configured to receive a graph adjustment instruction, where the graph adjustment instruction carries first adjustment information for a first graph variable, and the first graph variable is the graph inner diameter or the graph outer diameter;
a determining module configured to determine second adjustment information of a second graphic variable according to the first adjustment information and the graphic ring width, wherein the second graphic variable is the graphic inner diameter or the graphic outer diameter;
and the adjusting module is configured to adjust the initial graph according to the first adjusting information and the second adjusting information to obtain a target graph.
10. A computing device comprising a memory, a processor and computer instructions stored on the memory and executable on the processor, wherein the processor implements the steps of the method of any one of claims 1 to 8 when executing the computer instructions.
11. A computer-readable storage medium storing computer instructions, which when executed by a processor, perform the steps of the method of any one of claims 1 to 8.
CN202310102242.0A 2023-02-08 2023-02-08 Graphics processing method and device Pending CN115965711A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310102242.0A CN115965711A (en) 2023-02-08 2023-02-08 Graphics processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310102242.0A CN115965711A (en) 2023-02-08 2023-02-08 Graphics processing method and device

Publications (1)

Publication Number Publication Date
CN115965711A true CN115965711A (en) 2023-04-14

Family

ID=87354484

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310102242.0A Pending CN115965711A (en) 2023-02-08 2023-02-08 Graphics processing method and device

Country Status (1)

Country Link
CN (1) CN115965711A (en)

Similar Documents

Publication Publication Date Title
US7911467B2 (en) Method and system for displaying animation with an embedded system graphics API
CN109151540B (en) Interactive processing method and device for video image
EP3255612B1 (en) System and method for tessellation in an improved graphics pipeline
CN106575158B (en) Environment mapping virtualization mechanism
CN108959392B (en) Method, device and equipment for displaying rich text on 3D model
CN112288665A (en) Image fusion method and device, storage medium and electronic equipment
CN111583379B (en) Virtual model rendering method and device, storage medium and electronic equipment
CN110570507A (en) Image rendering method and device
US20180276870A1 (en) System and method for mass-animating characters in animated sequences
CN109697748B (en) Model compression processing method, model mapping processing method, model compression processing device, and storage medium
CN111617483A (en) Map editing method and device
EP4290464A1 (en) Image rendering method and apparatus, and electronic device and storage medium
CN114742931A (en) Method and device for rendering image, electronic equipment and storage medium
CN109598672B (en) Map road rendering method and device
CN113469883B (en) Rendering method and device of dynamic resolution, electronic equipment and readable storage medium
US20210312590A1 (en) Graphics processing using matrices of transformations
US20230401806A1 (en) Scene element processing method and apparatus, device, and medium
WO2023231926A1 (en) Image processing method and apparatus, device, and storage medium
CN112604279A (en) Special effect display method and device
CN115965711A (en) Graphics processing method and device
CN114820980A (en) Three-dimensional reconstruction method and device, electronic equipment and readable storage medium
CN109829963B (en) Image drawing method and device, computing equipment and storage medium
JP2024506879A (en) Methods and apparatus, computer equipment and storage media for presenting virtual representations
CN113487708B (en) Flow animation implementation method based on graphics, storage medium and terminal equipment
KR20120082161A (en) 3d renderer engine for 2d mobile device

Legal Events

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