Vector diagram data processing method and device
By calculating the transformation matrix to process the enlargement or reduction transformation of vector images, the problem of distortion caused by traditional image amplification is solved, high-resolution image transformation is achieved, and user experience is improved.
Patent Information
- Application Number
- CN202510035494.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-05-06
AI Technical Summary
When the image in the traditional way is enlarged, image distortion occurs due to the enlargement of pixels, resulting in the image resolution being not clear enough and affecting the user experience.
By obtaining the initial vector diagram and responding to the transformation instructions, the transformation matrix is calculated to achieve the enlargement or reduction transformation of the vector diagram, ensuring that the image is not affected by resolution during the transformation process.
During graphic transformation, the resolution of the vector image is not affected, which improves the user experience.
Smart Images

Figure CN119941916A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vector graph processing, and in particular to a vector graph data processing method and device. Background Art
[0002] Vector graphics are graphics drawn based on geometric characteristics. Their basic elements include points, lines, rectangles, polygons, circles and arcs, which can be calculated by mathematical formulas. When images are enlarged in traditional ways, the image will be distorted due to the enlargement of pixels, resulting in unclear image resolution, which in turn affects the user experience. Summary of the invention
[0003] In view of this, the present invention provides a vector graphics data processing method and device to solve the problem that when the traditional method enlarges the image, the image will be distorted due to the enlarged pixels, resulting in unclear image resolution, which in turn affects the user experience.
[0004] According to a first aspect, an embodiment of the present disclosure provides a method for processing vector graph data, the method comprising:
[0005] Get the initial vector image;
[0006] In response to receiving a transformation instruction of the initial vector diagram, performing a transformation action on the initial vector diagram;
[0007] Based on the transformation result of the initial vector diagram, the transformation factor, initial coordinates, and transformation coordinates of the target feature point in the initial vector diagram are obtained; wherein the target feature point is any feature point of the initial vector diagram;
[0008] Calculate the transformation matrix of the initial vector map based on the transformation factors, initial coordinates and transformation coordinates of the target feature points in the initial vector map;
[0009] Based on the transformation matrix of the initial vector image, a target vector image after the initial vector image is transformed is obtained.
[0010] The vector graphics data processing method in the embodiment of the present disclosure obtains an initial vector graphics; in response to receiving a transformation instruction of the initial vector graphics, performs a transformation action on the initial vector graphics; based on the transformation result of the initial vector graphics, obtains the transformation factor, initial coordinates, and transformation coordinates of the initial vector graphics; based on the transformation factor, initial coordinates, and transformation coordinates of the initial vector graphics, calculates the transformation matrix of the initial vector graphics; based on the transformation matrix of the initial vector graphics, obtains the target vector graphics after the transformation of the initial vector graphics. Finally, when performing graphic transformation, whether it is a magnification transformation or a reduction transformation, the embodiment of the present disclosure can ensure that the vector graphics are not affected by the resolution, thereby improving the user experience.
[0011] In some optional implementations, the transformation matrix of the initial vector image is calculated based on the transformation factor, the initial coordinates, and the transformed coordinates of the initial vector image, and is performed by the following formula:
[0012]
[0013]
[0014]
[0015] Among them, S is the transformation matrix of the initial vector map, P is the initial coordinates of the target feature point in the initial vector map, P' is the transformation coordinates of the target feature point in the initial vector map, the target feature point is any feature point in the initial vector map, x is the horizontal coordinate of the initial vector map, y is the vertical coordinate of the initial vector map, S x is the x-axis transformation factor, S y is the y-axis transformation factor.
[0016] The embodiment of the present disclosure facilitates the enlargement or reduction transformation of the initial vector image by using the transformation matrix of the initial vector image.
[0017] In some optional implementations, obtaining a target vector diagram after the initial vector diagram is transformed based on a transformation matrix of the initial vector diagram includes:
[0018] Obtain the initial coordinates of the target feature point in the initial vector graph, where the target feature point is any feature point in the initial vector graph;
[0019] Determine whether the initial coordinates of the target feature points in the initial vector map are the origin coordinates;
[0020] If so, take the origin coordinate as the transformation center, transform the initial vector diagram according to the transformation matrix of the initial vector diagram, and obtain the target vector diagram after the initial vector diagram is transformed;
[0021] If not, the initial vector graph is translated to the origin coordinates, the initial vector graph is transformed according to the transformation matrix of the initial vector graph, and the transformed initial vector graph is translated to the initial position to obtain the target vector graph after the transformation of the initial vector graph.
[0022] The embodiments of the present disclosure are conducive to achieving more stable transformation of the initial vector diagram through the above implementation methods.
[0023] In some optional implementations, the vector graphics data processing method in the embodiment of the present disclosure further includes:
[0024] Convert the target vector image to a bitmap;
[0025] Generate identification information corresponding to the bitmap;
[0026] Displays a bitmap based on the identification information.
[0027] The disclosed embodiments are conducive to clearly displaying bitmap information on a mobile terminal.
[0028] In some optional implementations, the transformation action includes: an action of enlarging and a action of reducing the initial vector image.
[0029] In some optional implementations, the vector diagram data processing method in the embodiment of the present disclosure further includes: performing fitting processing on the transformation matrix of the initial vector diagram to obtain an optimal transformation matrix.
[0030] The embodiments of the present disclosure are helpful to ensure the accuracy of the optimal transformation matrix through the above implementation methods.
[0031] According to a second aspect, an embodiment of the present disclosure provides a vector diagram data processing device, the device comprising:
[0032] A first acquisition module is used to acquire an initial vector graph;
[0033] an action transformation module, configured to execute a transformation action on the initial vector diagram in response to receiving a transformation instruction of the initial vector diagram;
[0034] The second acquisition module is used to acquire the transformation factor, initial coordinates, and transformation coordinates of the target feature point in the initial vector map based on the transformation result of the initial vector map; wherein the target feature point is any feature point of the initial vector map;
[0035] A matrix calculation module, used for calculating the transformation matrix of the initial vector map based on the transformation factors, initial coordinates and transformation coordinates of the target feature points in the initial vector map;
[0036] The third acquisition module is used to acquire a target vector image after the initial vector image is transformed based on the transformation matrix of the initial vector image.
[0037] According to a third aspect, an embodiment of the present disclosure provides a computer device, including:
[0038] The memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the vector graphics data processing method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0039] According to a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the vector graphics data processing method of the first aspect or any corresponding embodiment thereof.
[0040] According to a fifth aspect, an embodiment of the present disclosure provides a computer program product, including computer instructions, which are used to enable a computer to execute the vector graphics data processing method of the above-mentioned first aspect or any corresponding implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 is a flow chart of a method for processing vector graph data according to an embodiment of the present invention;
[0043] Figure 2 is a structural block diagram of a vector graphics data processing device according to an embodiment of the present invention;
[0044] Figure 3 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0046] According to an embodiment of the present invention, an embodiment of a vector graphics data processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0047] In this embodiment, a vector graphics data processing method is provided, which can be used in mobile terminals, such as mobile phones, tablet computers, etc. Figure 1 is a flowchart of a method for processing vector graph data according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0048] Step S101, obtaining an initial vector image.
[0049] Specifically, the initial vector graph is a graph composed of geometric shapes such as points, lines, curves, and polygons. For example, the initial vector graph is a triangle, a rectangle, or a circle.
[0050] Step S102: in response to receiving a graphic transformation instruction of the initial vector image, performing a transformation operation on the initial vector image.
[0051] In some optional implementations, the transformation action includes: an action of enlarging and a action of reducing the initial vector image.
[0052] Specifically, for example, when the user wants to enlarge or reduce the initial vector image, after receiving the user's enlargement transformation instruction or reduction transformation instruction to enlarge or reduce the initial vector image, the mobile terminal can perform the enlargement transformation action and the reduction transformation action on the initial vector image.
[0053] Step S103, based on the transformation result of the initial vector map, obtaining the transformation factor, initial coordinates, and transformation coordinates of the target feature point in the initial vector map; wherein the target feature point is any feature point of the initial vector map.
[0054] Specifically, for example, when the initial vector image is enlarged and transformed, the transformation factor, initial coordinates and transformation coordinates of the target feature point of the initial vector image after the enlargement transformation are obtained. The target feature point is any feature point of the initial vector image. For example, when the initial vector image is reduced and transformed, the transformation factor, initial coordinates and transformation coordinates of the target feature point of the initial vector image after the reduction transformation are obtained.
[0055] Step S104, calculating a transformation matrix of the initial vector map based on the transformation factors, initial coordinates and transformation coordinates of the target feature points in the initial vector map.
[0056] In some optional implementations, the above step S104, based on the transformation factors, initial coordinates and transformation coordinates of the target feature points in the initial vector map, calculates the transformation matrix of the initial vector map, which is performed by the following formula:
[0057]
[0058]
[0059]
[0060] Among them, S is the transformation matrix of the initial vector map, P is the initial coordinates of the target feature point in the initial vector map, P' is the transformation coordinates of the target feature point in the initial vector map, the target feature point is any feature point in the initial vector map, x is the horizontal coordinate of the initial vector map, y is the vertical coordinate of the initial vector map, S x is the x-axis transformation factor, S y is the y-axis transformation factor.
[0061] Specifically, for the above formula, if S x =S y , the initial vector graph is uniformly scaled, if S x ≠S y , the initial vector image is not uniformly scaled.
[0062] Step S105 , obtaining a target vector diagram after the initial vector diagram is transformed based on the transformation matrix of the target feature points of the initial vector diagram.
[0063] Specifically, when the target feature point in the initial vector map is multiplied by the transformation matrix of the initial vector map, a transformed target feature point of the initial vector map is obtained, which means that the transformed coordinates of the transformed target feature point are S times the coordinates of the origin. x and S y For example, if the coordinates of the target feature point in the initial vector map are (2,3), and the user wants to enlarge it by two times along the x-axis and reduce it by half along the y-axis, substitute it into the transformation matrix of the initial vector map above, and the transformation matrix is expressed as follows:
[0064]
[0065]
[0066]
[0067] Therefore, according to the transformation matrix of the target vector graph, all target feature points of the initial vector graph are calculated, and the target vector graph after the initial vector graph is transformed is further obtained.
[0068] The vector graphics data processing method in the embodiment of the present disclosure obtains an initial vector graphics; in response to receiving a transformation instruction of the initial vector graphics, performs a transformation action on the initial vector graphics; based on the transformation result of the initial vector graphics, obtains the transformation factor, initial coordinates, and transformation coordinates of the initial vector graphics; based on the transformation factor, initial coordinates, and transformation coordinates of the initial vector graphics, calculates the transformation matrix of the initial vector graphics; based on the transformation matrix of the initial vector graphics, obtains the target vector graphics after the transformation of the initial vector graphics. Finally, when performing graphic transformation, whether it is a magnification transformation or a reduction transformation, the embodiment of the present disclosure can ensure that the vector graphics are not affected by the resolution, thereby improving the user experience.
[0069] In some optional implementations, obtaining a target vector diagram after the initial vector diagram is transformed based on a transformation matrix of the initial vector diagram includes:
[0070] Step a1, obtaining the initial coordinates of the target feature point in the initial vector map, where the target feature point is any feature point in the initial vector map.
[0071] Specifically, for example, the initial coordinates of any feature point of the initial vector map are P.
[0072] Step a2, determining whether the initial coordinates of the target feature points in the initial vector map are the origin coordinates.
[0073] Specifically, the embodiment of the present disclosure needs to use the origin coordinates as the scaling center, and therefore, it is necessary to further determine whether the initial coordinates of the target feature point in the initial vector map are the origin coordinates.
[0074] Step a3: If yes, take the origin coordinate as the transformation center, transform the initial vector image according to the transformation matrix of the initial vector image, and obtain the target vector image after the initial vector image is transformed.
[0075] Specifically, when the initial coordinates of the target feature points of the initial vector diagram are the origin coordinates, the origin coordinates are used as the transformation center, and the initial vector diagram is transformed according to the transformation matrix of the initial vector diagram to obtain the target vector diagram after the initial vector diagram is transformed.
[0076] Step a4, if not, translate the initial vector graph to the origin coordinates, transform the initial vector graph according to the transformation matrix of the initial vector graph, and then translate the transformed initial vector graph to the initial position to obtain the target vector graph after the transformation of the initial vector graph.
[0077] Specifically, when the initial coordinates of the target feature point of the initial vector diagram are not the origin coordinates, the initial vector diagram is translated to the origin coordinates, the initial vector diagram is transformed according to the transformation matrix of the initial vector diagram, and then the transformed initial vector diagram is translated to the initial position to obtain the target vector diagram after the transformation of the initial vector diagram.
[0078] The embodiment of the present disclosure performs a magnification transformation or a reduction transformation on the initial vector map at the origin coordinates through the above steps a1 to a4 to ensure the stability of the scaling of the initial vector map.
[0079] In some optional implementations, the vector graphics data processing method in the embodiment of the present disclosure further includes:
[0080] Step b1, converting the target vector image into a bitmap.
[0081] Specifically, a bitmap is an image composed of pixels, each of which contains color and position information. Common file formats include JPEG, PNG, etc. Bitmaps are suitable for expressing images with rich colors and complex details. Here, for example, open a graphics editing software such as CorelDRAW, and in the software interface, you can convert the target vector image into a bitmap.
[0082] Step b2, generating identification information corresponding to the bitmap.
[0083] Specifically, the identification information is used to map the bitmap and the target vector image, so as to facilitate mapping from the target vector image to the bitmap through the identification information. The identification information is used to uniquely identify the bitmap and the target vector image, and may include the identity of the bitmap and the identity of the target vector image, which may be a unique code or a unique number, and may be described by various character information such as numbers and letters. The target vector image corresponding to the identification information may be each vector object in a single-frame vector image, including the basic components of the target vector image, and the position, size, shape, color format, layer, background, displayed text, state (such as the click state or normal state of a button), etc. of the components.
[0084] Step b3, displaying the bitmap according to the identification information.
[0085] Specifically, according to the identification information corresponding to the bitmap, the bitmap is clearly displayed on the mobile terminal in the embodiment of the present disclosure.
[0086] In some optional implementations, the vector diagram data processing method in the embodiment of the present disclosure performs fitting processing on the transformation matrix of the initial vector diagram to obtain an optimal transformation matrix.
[0087] Furthermore, the transformation matrix of the initial vector graph is fitted to obtain the optimal transformation matrix, including:
[0088] Step c1, according to the transformation matrix of the initial vector map, calculate the matching errors of the target feature point pairs before and after the initial vector map is transformed, and obtain multiple error values.
[0089] Step c2, comparing the multiple error values with the preset thresholds respectively, iterating the error values that are greater than the preset thresholds, and recalculating to obtain new error values;
[0090] Step c3, calculating the optimal transformation matrix according to the new error value.
[0091] The specific algorithm flow is as follows:
[0092] 1) The target feature points extracted from the initial vector map are used as the sample feature point set.
[0093] 2) Determine the initial value of the transformation matrix after the initial vector map is transformed, and calculate a transformation matrix based on the target feature points in the sample feature set;
[0094] 3) Calculate the target feature point matching error. The formula is as follows:
[0095] d=P'(x',y')-P(x,y)
[0096] Among them, let (x, y) be the initial coordinates of any feature point in the initial vector diagram P, and (x', y') be a point that matches any target feature point in the target vector diagram P'. When d is less than the specified threshold, the point is judged to be an internal point, otherwise it is an external point and is discarded.
[0097] 4) Iteratively refine the transformation matrix; (based on the Levenberg-Marquardt nonlinear minimization iterative algorithm (LM algorithm for short)) determine the size of d. If d decreases but is still not less than the threshold, estimate the model again and calculate the new d. When d is less than the given threshold parameter, stop the iteration and obtain the transformation matrix between the final initial vector graphs, which is the optimal transformation matrix.
[0098] The core idea of the algorithm is to determine the sum of the distances between all feature point pairs through iterations, and then Among them, the minimum value is selected. When the distance and W are less than the specified threshold, the iteration is stopped to obtain the final transformation matrix.
[0099] In this embodiment, a vector graphics data processing device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0100] The present disclosure provides a vector graphics data processing device, such as Figure 2 As shown, the device comprises:
[0101] A first acquisition module 201 is used to acquire an initial vector graph;
[0102] An action transformation module 202 is used to perform a transformation action on the initial vector diagram in response to receiving a transformation instruction of the initial vector diagram;
[0103] The second acquisition module 203 is used to acquire the transformation factor, initial coordinates, and transformation coordinates of the target feature point in the initial vector map based on the transformation result of the initial vector map; wherein the target feature point is any feature point in the initial vector map;
[0104] A matrix calculation module 204, used to calculate a transformation matrix of the initial vector map based on the transformation factors, initial coordinates and transformation coordinates of the target feature points in the initial vector map;
[0105] The third acquisition module 205 is used to acquire a target vector diagram after the initial vector diagram is transformed based on the transformation matrix of the initial vector diagram.
[0106] In some optional implementations, the matrix calculation module 204 calculates the transformation matrix of the initial vector map based on the transformation factor, the initial coordinates and the transformation coordinates of the initial vector map, and is performed by the following formula:
[0107]
[0108]
[0109]
[0110] Among them, S is the transformation matrix of the initial vector map, P is the initial coordinates of the target feature point in the initial vector map, P' is the transformation coordinates of the target feature point in the initial vector map, the target feature point is any feature point in the initial vector map, x is the horizontal coordinate of the initial vector map, y is the vertical coordinate of the initial vector map, S x is the x-axis transformation factor, S y is the y-axis transformation factor.
[0111] The third acquisition module 205 includes:
[0112] The first acquisition submodule is used to acquire the initial coordinates of the target feature point in the initial vector map, where the target feature point is any feature point in the initial vector map;
[0113] A data judgment submodule is used to judge whether the initial coordinates of the target feature points in the initial vector map are the origin coordinates;
[0114] The first determination submodule is used to, if yes, transform the initial vector graph according to the transformation matrix of the initial vector graph with the origin coordinate as the transformation center, to obtain a target vector graph after the initial vector graph is transformed;
[0115] The second determination submodule is used to, if not, translate the initial vector graph to the origin coordinates, transform the initial vector graph according to the transformation matrix of the initial vector graph, and then translate the transformed initial vector graph to the initial position to obtain a target vector graph after the initial vector graph is transformed.
[0116] In some optional implementations, the vector graphics data processing device in the embodiment of the present disclosure further includes:
[0117] A data conversion module, used for converting a target vector map into a bitmap;
[0118] A data generation module, used to generate identification information corresponding to the bitmap;
[0119] The data display module is used to display the bitmap according to the identification information.
[0120] In some optional implementations, the transformation action includes: an action of enlarging and a action of reducing the initial vector image.
[0121] In some optional implementations, the vector diagram data processing device in the embodiment of the present disclosure further includes: a data fitting module, which is used to fit the transformation matrix of the initial vector diagram to obtain an optimal transformation matrix.
[0122] The vector graphics data processing device in the disclosed embodiment obtains an initial vector graphics; in response to receiving a transformation instruction of the initial vector graphics, performs a transformation action on the initial vector graphics; based on the transformation result of the initial vector graphics, obtains the transformation factor, initial coordinates, and transformation coordinates of the initial vector graphics; based on the transformation factor, initial coordinates, and transformation coordinates of the initial vector graphics, calculates the transformation matrix of the initial vector graphics; based on the transformation matrix of the initial vector graphics, obtains the target vector graphics after the transformation of the initial vector graphics. Finally, when performing graphic transformation, whether it is a magnification transformation or a reduction transformation, the present invention can ensure that the vector graphics are not affected by the resolution, thereby improving the user experience.
[0123] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0124] The vector graphics data processing device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0125] An embodiment of the present invention further provides a computer device having the above-mentioned vector graphics data processing device.
[0126] See also Figure 3 , Figure 3 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 3 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 3A processor 10 is taken as an example.
[0127] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0128] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0129] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0130] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0131] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 3 The example of connecting through bus is taken in the following.
[0132] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0133] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0134] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0135] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A vector graphics data processing method, characterized in that: The method comprises: Get the initial vector image; In response to receiving a transformation instruction of the initial vector diagram, performing a transformation action on the initial vector diagram; Based on the transformation result of the initial vector map, the transformation factor, initial coordinates, and transformation coordinates of the target feature point in the initial vector map are obtained; wherein the target feature point is any feature point of the initial vector map; Calculating a transformation matrix of the initial vector map based on the transformation factors, initial coordinates and transformation coordinates of the target feature points in the initial vector map; Based on the transformation matrix of the initial vector image, a target vector image after the initial vector image is transformed is obtained.
2. The method according to claim 1, characterized in that Based on the transformation factor, initial coordinates and transformation coordinates of the initial vector graph, the transformation matrix of the initial vector graph is calculated, which is performed by the following formula: Wherein, S is the transformation matrix of the initial vector map, P is the initial coordinate of the target feature point in the initial vector map, P' is the transformation coordinate of the target feature point in the initial vector map, the target feature point is any feature point in the initial vector map, x is the horizontal coordinate of the initial vector map, y is the vertical coordinate of the initial vector map, S x is the x-axis transformation factor, S y is the y-axis transformation factor.
3. The method according to claim 1, characterized in that Based on the transformation matrix of the initial vector image, obtaining a target vector image after the initial vector image is transformed includes: Obtaining initial coordinates of a target feature point in the initial vector graph, wherein the target feature point is any feature point in the initial vector graph; Determine whether the initial coordinates of the target feature point in the initial vector map are the origin coordinates; If yes, taking the origin coordinate as the transformation center, transforming the initial vector graph according to the transformation matrix of the initial vector graph to obtain a target vector graph after the initial vector graph is transformed; If not, the initial vector graph is translated to the origin coordinates, the initial vector graph is transformed according to the transformation matrix of the initial vector graph, and the transformed initial vector graph is translated to the initial position to obtain a target vector graph after the transformation of the initial vector graph.
4. The method according to claim 1, characterized in that: Also includes: Convert the target vector map into a bitmap; generating identification information corresponding to the bitmap; The bitmap is displayed according to the identification information.
5. The method according to any one of claims 1 to 4, characterized in that The transformation action includes: an enlargement action and a reduction action of the initial vector image.
6. The method according to claim 1, characterized in that Also includes: The transformation matrix of the initial vector map is fitted to obtain an optimal transformation matrix.
7. A vector graphics data processing device, characterized in that: The device comprises: A first acquisition module is used to acquire an initial vector graph; an action transformation module, configured to perform a transformation action on the initial vector diagram in response to receiving a transformation instruction of the initial vector diagram; A second acquisition module is used to acquire the transformation factor, initial coordinates, and transformation coordinates of the target feature point in the initial vector map based on the transformation result of the initial vector map; wherein the target feature point is any feature point of the initial vector map; A matrix calculation module, used for calculating the transformation matrix of the initial vector map based on the transformation factors, initial coordinates and transformation coordinates of the target feature points in the initial vector map; The third acquisition module is used to acquire a target vector image after the initial vector image is transformed based on the transformation matrix of the initial vector image.
8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the vector graphics data processing method described in any one of claims 1 to 6 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the vector graphics data processing method described in any one of claims 1 to 6.
10. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the vector graphics data processing method according to any one of claims 1 to 6.