Method for quickly previewing and displaying CAM vector diagram and storage medium
By performing chunked analysis and real-time graphical rasterization processing on CAM vector diagrams, the contradiction between high-resolution graph details and computer processing resource utilization is solved, and efficient and smooth vector image preview display is achieved.
Patent Information
- Application Number
- CN202411893171.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-11
AI Technical Summary
In CAM vector graphics preview display, high-resolution graphics details and optimal utilization of computer processing resources are difficult to meet at the same time, resulting in poor interaction fluency and graphics distortion problems.
By loading CAM vector graphics data, chunking and parsing it into multiple element information, grouping and sorting marks, and constructing resolution bitmaps based on user interaction, rasterizing graphics in real time to avoid rasterizing operations with pre-fixed resolution.
It realizes efficient display and interacting CAM vector graphics without occupying too much computer resources, avoiding graphic distortion and improving the fluency of user interaction.
Smart Images

Figure CN119807460A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of vector graphics raster display, and in particular relates to a method and a storage medium for fast preview display of a CAM vector graphics. Background Art
[0002] In some CAM vector graphics preview and display applications, the working process is generally as follows: load the CAM vector graphics file, rasterize the vector graphics into a whole bitmap at a fixed resolution, and operate the rasterized bitmap during the user interaction process in the preview display; generally, in order to present more vector graphics details during preview display, a higher rasterization resolution will be selected, which will occupy a lot of computer resources and the UI user interaction will be very stuck. At the same time, when the user zooms in on the vector graphics to a certain extent to observe the graphic details, there will be graphic distortion problems. The current common processing methods are: improving the interaction fluency or improving the distortion of the low rasterization resolution graphic preview by improving the computer hardware performance indicators or reducing the rasterization data resolution. Under the premise of fixed computer hardware performance, high-resolution graphic details and optimal computer processing resources cannot be met at the same time. Summary of the invention
[0003] In order to solve the above technical problems, the present invention proposes a method and storage medium for fast preview display of CAM vector graphics. The specific technical solution is as follows:
[0004] A method for quickly previewing and displaying a CAM vector diagram, comprising:
[0005] Load the entire CAM vector graphics data, divide it into blocks and parse it into information of multiple CAM vector graphics primitives;
[0006] Group, sort and mark the information of the plurality of CAM vector graphics primitives;
[0007] Construct a corresponding resolution bitmap based on the CAM graphics information that needs to be displayed on the computer user interface for front-end display;
[0008] The CAM vector map area that the user expects to display is used as the CAM target area vector map, and the block records are traversed according to the CAM target area vector map to find the associated vector map element;
[0009] Calculating the rasterization accuracy of the CAM target area vector diagram that the user expects to display according to the information of the resolution bitmap and the size of the CAM target area vector diagram;
[0010] The associated vector graphics primitives are rasterized and drawn according to the rasterization accuracy, and after the drawing is completed, the computer user interface is notified to refresh.
[0011] Furthermore, after the information of dividing and parsing into a plurality of CAM vector graphics primitives is divided into blocks, it also includes:
[0012] The information of the plurality of CAM vector graphics primitives is loaded into the computer memory.
[0013] Furthermore, the information of dividing and parsing into a plurality of CAM vector graphics primitives includes:
[0014] The information of the CAM vector graphics primitives is divided into blocks and parsed, and the information includes the position, area and type of each CAM vector graphics primitive.
[0015] Furthermore, before grouping, sorting and marking the information of the plurality of CAM vector graphics primitives, the method includes:
[0016] Preliminary processing is performed on the information of the plurality of CAM vector graphics primitives, including:
[0017] Calculate the bounding rectangle of the primitive;
[0018] A grid block is set according to the entire CAM vector graphics structure.
[0019] Furthermore, the resolution bitmap has a pixel buffer.
[0020] Furthermore, after rasterizing and drawing the associated vector primitives according to the rasterization accuracy, the method further includes:
[0021] The dot matrix data output after the associated vector graphics primitive is rasterized is copied to the pixel buffer.
[0022] Furthermore, the rasterization accuracy of the vector map of the CAM target area that the user expects to display is calculated, and the formula is expressed as:
[0023]
[0024]
[0025] Resolution x Indicates the rasterization accuracy of the horizontal axis, Resolution y Indicates the rasterization accuracy of the vertical axis, W cam h is the horizontal coordinate size of the vector diagram of the CAM target area, cam is the ordinate size of the CAM target area vector diagram, W bmp is the horizontal coordinate size of the resolution bitmap, H bmp The vertical dimension of the resolution bitmap.
[0026] Furthermore, the method further comprises:
[0027] The CAM vector image area is updated, and the updated CAM vector image area is used as a new CAM target area vector image. Return to execute traversing the block records according to the CAM target area vector image to find the associated vector element, and notify the computer user interface to refresh after the drawing is completed.
[0028] Furthermore, the user interaction operations corresponding to the updating of the CAM vector map area include dragging, zooming in, and zooming out.
[0029] The present application also discloses a storage medium, in which a computer program is stored, wherein the computer program is configured to implement the above-mentioned method for fast preview display of a CAM vector graph when running.
[0030] The advantages of the present invention are:
[0031] (1) The present invention no longer pre-rasterizes the entire image with a fixed resolution and saves the rasterized data of the entire image, and the system resource usage is low. The above mainly retrieves the corresponding primitive information quickly when displaying the vector map of the CAM target area, and does not require all primitives to be tested for collision one by one, which can greatly improve the processing performance in practical applications.
[0032] (2) The vector graphics information displayed in the foreground of the application of the present invention will be rasterized in real time according to the current resolution each time the desired display area is updated, thereby ensuring the accuracy of the vector graphics preview.
[0033] (3) When the CAM vector map is loaded for the first time, the present invention groups, sorts and marks the position and size information of each graphic element. When the user zooms in on a local vector map area, the graphic element to be displayed can be quickly retrieved, thus avoiding the collision test process of all graphic elements in the entire CAM vector map and greatly reducing some calculation processes.
[0034] (4) The present invention uses a real-time graphics rasterization method. When the user wants to adjust the posture of the CAM vector graphics, he only needs to perform a linear transformation on the CAM vector graphics loaded into the computer to observe the posture changes of the preview graphics in real time without distortion. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 It is a flow chart of the entire invention process.
[0036] Figure 2 It is a schematic diagram of the entire CAM vector diagram in one embodiment.
[0037] Figure 3 This is a diagram showing the effect of sorting, grouping and marking each graphic element in the entire CAM vector graphics loaded in one embodiment.
[0038] Figure 4In one embodiment, the entire CAM vector diagram includes a CAM target area vector diagram.
[0039] Figure 5 for Figure 4 The application foreground bitmap is formed by rasterizing the vector map of the CAM target area. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application. In the description of the embodiments of the present application, it should be understood that the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first" and "second" can explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0041] In order to improve the performance of computer CAM vector graphics preview and preview CAM vector graphics without distortion, there are only two ways in the prior art. One is to upgrade the equipment configuration from the hardware aspect or use high-speed storage devices, which greatly increases the cost of solving the problem. The other is from the software aspect, including optimizing the vector graphics and optimizing the vector graphics software itself. In the process of optimizing the vector graphics, the vector graphics are pre-processed, such as simplifying the entire graphic elements or managing the graphics in layers, and then selecting a suitable vector graphics format. In addition, data compression or decompression is optimized. These methods can solve some problems. After the introduction of background technology, under the premise of fixed computer hardware performance, high-resolution graphic details and optimal computer processing resources cannot be met at the same time.
[0042] In order to solve the above problems, Figure 1 As shown, the present application proposes a method for fast preview display of CAM vector graphics, including:
[0043] Load the entire CAM vector graphics data, divide it into blocks and parse it into information of multiple CAM vector graphics primitives;
[0044] Group, sort and mark the information of the plurality of CAM vector graphics primitives;
[0045] Construct a corresponding resolution bitmap based on the CAM graphics information that needs to be displayed on the computer user interface for front-end display;
[0046] The CAM vector map area that the user expects to display is used as the CAM target area vector map, and the block records are traversed according to the CAM target area vector map to find the associated vector map element;
[0047] Calculating the rasterization accuracy of the CAM target area vector diagram that the user expects to display according to the information of the resolution bitmap and the size of the CAM target area vector diagram;
[0048] The associated vector graphics primitives are rasterized and drawn according to the rasterization accuracy, and after the drawing is completed, the computer user interface is notified to refresh.
[0049] The size of the CAM target area vector diagram, and the rasterization accuracy of the CAM target area vector diagram that the user expects to display;
[0050] Based on this method, the system no longer pre-rasterizes the entire image with a fixed resolution and saves the rasterized data of the entire image, and the computer resource usage is low. At the same time, the vector graphics information displayed in the foreground of the application will be rasterized in real time according to the current resolution each time the expected display area is updated, that is, the CAM target area vector graphics are updated, thereby ensuring the accuracy of the CAM target area vector graphics during preview. Furthermore, when the CAM vector graphics are loaded for the first time, the position and size information of each graphic element is grouped, sorted and marked. When the user zooms in on the local vector graphics area, the graphic elements that need to be displayed can be quickly retrieved, avoiding the collision test process of all graphic elements of the entire CAM vector graphics, and greatly reducing some calculation processes. Finally, the present application uses a real-time graphics rasterization method. When the user expects to adjust the posture of the CAM vector graphics, he only needs to perform a linear transformation on the CAM vector graphics loaded into the computer to observe the posture changes of the preview graphics in real time without distortion.
[0051] In one embodiment, the entire CAM vector graphics data is loaded as follows: Figure 2 The effect of sorting and grouping the various primitives in the entire CAM vector graphics loaded is shown in the figure below. Figure 3 shown.
[0052] In one embodiment, after the information of dividing and parsing into a plurality of CAM vector graphics primitives is divided into blocks, the method further includes:
[0053] The information of the plurality of CAM vector graphics primitives is loaded into the computer memory.
[0054] In one embodiment, the information of dividing and parsing into a plurality of CAM vector graphics primitives includes:
[0055] The information of the CAM vector graphics primitives is divided into blocks and parsed, and the information includes the position, area, and type of each CAM vector graphics primitive. That is, the information of each CAM vector graphics primitive includes the corresponding position and size information.
[0056] Since the information of the entire CAM vector graphics element loaded into the computer memory does not belong to the CAM vector graphics data, but the data of the location, area and type of the element, the amount of data is reduced exponentially, which increases the computer's operating speed on the other hand.
[0057] According to the information of the CAM graphics to be displayed in the computer user interface, a corresponding resolution bitmap is constructed for front-end display. The resolution bitmap is represented as (W bmp ,H bmp ), the resolution size is generally related to the user's display resolution.
[0058] like Figure 4 As shown, the CAM vector map area that the user expects to display is used as the CAM target area vector map R cam , traverse the block records according to the CAM target area vector map, and find the associated vector element List geom .
[0059] The application foreground bitmap formed by rasterizing the CAM target area vector map is as follows: Figure 5 shown.
[0060] In one embodiment, before grouping, sorting and marking the information of the plurality of CAM vector graphics primitives, the method includes:
[0061] Preliminary processing is performed on the information of the plurality of CAM vector graphics primitives, including:
[0062] Calculate the bounding rectangle of the primitive;
[0063] According to the whole CAM vector graphics structure, a grid block is set. Each block has its own position, size and other area information. The block size is generally an empirical value. The current actual processing is to divide the effective area of the whole image into 128*128 blocks.
[0064] Specifically, the resolution bitmap has a pixel buffer.
[0065] In one of the embodiments, after rasterizing and drawing the associated vector primitives according to the rasterization accuracy, the method further includes:
[0066] The dot matrix data output after the associated vector graphics primitive is rasterized is copied to the pixel buffer.
[0067] This method can reduce flicker and jamming: the pixel buffer can store the pixel data of the bitmap and organize and transmit it according to the requirements of the display device. When displaying an image, the data is directly transmitted from the buffer to the display device, avoiding the problem of untimely or discontinuous transmission that may occur when the image data is directly read from the storage device, thereby making the image display smoother, reducing flicker and jamming, and improving the visual experience.
[0068] In one embodiment, the rasterization accuracy of the vector graph of the CAM target area that the user expects to display is calculated, and the formula is expressed as:
[0069]
[0070]
[0071] Resolution x Indicates the rasterization accuracy of the horizontal axis, Resolution y Indicates the rasterization accuracy of the vertical axis, W cam H is the horizontal coordinate size of the vector diagram of the CAM target area, cam is the ordinate size of the CAM target area vector diagram, W bmp is the horizontal coordinate size of the resolution bitmap, H bmp The vertical dimension of the resolution bitmap.
[0072] The above is a step of displaying one of the CAM target area vector diagrams. In order to display any CAM target area vector diagram, in one embodiment, the following is further included:
[0073] The CAM vector image area is updated, and the updated CAM vector image area is used as a new CAM target area vector image. Return to execute traversing the block records according to the CAM target area vector image to find the associated vector element, and notify the computer user interface to refresh after the drawing is completed.
[0074] Furthermore, the user interaction operations corresponding to the updating of the CAM vector map area include dragging, zooming in, and zooming out.
[0075] The present application also discloses a storage medium, in which a computer program is stored, wherein the computer program is configured to implement the above-mentioned method for fast preview display of a CAM vector graph when running.
[0076] The readable storage medium can be a tangible device that can keep and store the instructions used by the instruction execution device, such as but not limited to an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device or any suitable combination of the above. The more specific example (non-exhaustive list) of the readable storage medium includes: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination of the above. The computer program described here can be downloaded from the readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device through a network, such as the Internet, a local area network, a wide area network and / or a wireless network. The network can include copper transmission cables, optical fiber transmission, wireless transmission, routers, firewalls, switches, gateway computers and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer program from the network and forwards the computer program for storage in a readable storage medium in each computing / processing device. The computer program for performing the operation of the present invention may be an assembly instruction, an instruction set architecture (ISA) instruction, a machine instruction, a machine-dependent instruction, a microcode, a firmware instruction, a state setting data, or a source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as "C" language or similar programming languages. The computer program may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect through the Internet). In some embodiments, by utilizing the state information of a computer program to personalize an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), the electronic circuit can execute computer-readable program instructions to implement various aspects of the present invention.
[0077] Here, various aspects of the present invention are described with reference to the flowchart and / or block diagram of the method, system and computer program product according to the embodiment of the present invention. It should be understood that each square frame of the flowchart and / or block diagram and the combination of the square frames in the flowchart and / or block diagram can be realized by a computer program. These computer programs can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device, so as to produce a machine, so that these programs, when executed by the processor of a computer or other programmable data processing device, produce a device for realizing the function / action specified in one or more square frames in the flowchart and / or block diagram. These computer programs can also be stored in a readable storage medium, and these computer programs make the computer, programmable data processing device and / or other equipment work in a specific way, so that the readable storage medium storing the computer program includes a manufactured product, which includes instructions for realizing various aspects of the function / action specified in one or more square frames in the flowchart and / or block diagram.
[0078] The computer program may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are executed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the computer program executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0079] It should be understood that the specific examples in this article are only intended to help those skilled in the art better understand the implementation methods of the present application, rather than to limit the scope of the present application.
[0080] It can be understood that in the various implementations of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the implementation methods of the present application.
[0081] It can be understood that the various embodiments described in this application can be implemented individually or in combination, and the embodiments of this application are not limited to this.
[0082] Unless otherwise stated, all technical and scientific terms used in the embodiments of the present application have the same meaning as those generally understood by those skilled in the art of the technical field of the present application. The terms used in the present application are only for the purpose of describing specific embodiments and are not intended to limit the scope of the present application. The term "and / or" used in the present application includes any and all combinations of one or more related listed items. The singular forms of "a kind of", "above" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0083] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0084] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of each implementation method described above can refer to the corresponding process in other implementation methods and will not be repeated here.
[0085] In the description of this specification, the description with reference to the terms "some embodiments" or "examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification.
[0086] The above is only a preferred embodiment of the present invention and does not limit the present invention in any way. Any technician in the relevant technical field, without departing from the scope of the technical solution of the present invention, makes any form of equivalent replacement or modification to the technical solution and technical content disclosed in the present invention, which does not depart from the content of the technical solution of the present invention and still falls within the protection scope of the present invention.
Claims
1. A method for fast preview and display of CAM vector graphics, characterized in that: include: Load the entire CAM vector graphics data, divide it into blocks and parse it into information of multiple CAM vector graphics primitives; Group, sort and mark the information of the plurality of CAM vector graphics primitives; Construct a corresponding resolution bitmap based on the CAM graphics information that needs to be displayed on the computer user interface for front-end display; The CAM vector map area that the user expects to display is used as the CAM target area vector map, and the block records are traversed according to the CAM target area vector map to find the associated vector map element; Calculating the rasterization accuracy of the CAM target area vector diagram that the user expects to display according to the information of the resolution bitmap and the size of the CAM target area vector diagram; The associated vector graphics primitives are rasterized and drawn according to the rasterization accuracy, and after the drawing is completed, the computer user interface is notified to refresh.
2. The method for fast previewing and displaying a CAM vector diagram according to claim 1, characterized in that: After the information of dividing and parsing into a plurality of CAM vector graphics primitives is divided into blocks, it also includes: The information of the plurality of CAM vector graphics primitives is loaded into the computer memory.
3. A method for fast previewing and displaying a CAM vector diagram according to claim 1 or 2, characterized in that: The information of dividing and parsing into multiple CAM vector graphics primitives includes: The information of the CAM vector graphics primitives is divided into blocks and parsed, and the information includes the position, area and type of each CAM vector graphics primitive.
4. The method for fast previewing and displaying a CAM vector diagram according to claim 1, characterized in that: Before grouping, sorting and marking the information of the plurality of CAM vector graphics primitives, the method includes: Preliminary processing is performed on the information of the plurality of CAM vector graphics primitives, including: Calculate the bounding rectangle of the primitive; A grid block is set according to the entire CAM vector graphics structure.
5. The method for fast previewing and displaying a CAM vector diagram according to claim 1, characterized in that: The resolution bitmap comes with a pixel buffer.
6. The method for fast previewing and displaying a CAM vector diagram according to claim 5, characterized in that: After rasterizing and drawing the associated vector primitives according to the rasterization accuracy, the method further includes: The dot matrix data output after the associated vector graphics primitive is rasterized is copied to the pixel buffer.
7. The method for fast previewing and displaying a CAM vector diagram according to claim 1, characterized in that: The rasterization accuracy of the vector graph of the CAM target area that the user expects to display is calculated, and the formula is expressed as: Resolution x Indicates the rasterization accuracy of the horizontal axis, Resolution y Indicates the rasterization accuracy of the vertical axis, W cam H is the horizontal coordinate size of the vector diagram of the CAM target area, cam is the ordinate size of the CAM target area vector diagram, W bmp is the horizontal coordinate size of the resolution bitmap, H bmp The vertical dimension of the resolution bitmap.
8. The method for fast previewing and displaying a CAM vector diagram according to claim 1, characterized in that: Also includes: The CAM vector image area is updated, and the updated CAM vector image area is used as a new CAM target area vector image. Return to execute traversing the block records according to the CAM target area vector image to find the associated vector element, and notify the computer user interface to refresh after the drawing is completed.
9. The method for fast previewing and displaying a CAM vector diagram according to claim 8, characterized in that: The user interaction operations corresponding to the updating of the CAM vector map area include dragging, zooming in, and zooming out.
10. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to implement the method for fast preview display of a CAM vector graph as described in any one of claims 1 to 9 when running.