Methods, devices, equipment, and machinery for drawing work areas

By acquiring the parameters of the operating machinery and the transparency value of the drawing tool, and using preset relationships to render the operating area, the problem of not being able to distinguish the number of operating layers in the existing technology is solved, and the effective differentiation and visual management of the operating area is realized.

CN116228904BActive Publication Date: 2025-12-02HUNAN SANY INTELLIGENT CONTROL EQUIP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310088125.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-29
Publication Date
2025-12-02
Estimated Expiration
2043-01-29

AI Technical Summary

Technical Problem

In existing technologies, the drawing of the working area of ​​operating machinery cannot effectively distinguish the colors corresponding to different working layers, resulting in the inability to accurately distinguish areas with different number of operations.

Method used

By acquiring the parameters of the drawing tools and the working machinery, the transparency value of each pixel is determined. Using preset transparency changes and color relationships, the current working area is rendered to distinguish different working layers.

Benefits of technology

It enables effective differentiation of the operating areas of the machinery, and displays different operating layers through different color values, thereby improving the efficiency of visual management of the operating area.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116228904B_ABST
    Figure CN116228904B_ABST
Patent Text Reader

Abstract

This invention relates to the field of computer technology, and provides a method, apparatus, device, and machinery for drawing a work area. The method includes: acquiring drawing parameters of a drawing tool and work parameters of the work machinery; drawing the current work area based on the drawing parameters and work parameters; acquiring pixel data of each pixel in the current work area; determining a target color value corresponding to the pixel data; and rendering the current work area based on the target color value. This invention solves the problem in the prior art that different work layers cannot be mapped to different colors when drawing the work area of ​​work machinery, and achieves effective differentiation of work layers of work machinery.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, equipment, and machinery for drawing a work area. Background Technology

[0002] In the digital engineering of operating machinery, it is necessary to draw the operating trajectory of the operating machinery for each operation and to use different colors to distinguish the operating areas for different number of operations.

[0003] In existing technologies, a canvas is used to draw the work area, and the drawing is performed once after each work operation is completed by the machine, with each newly drawn area on the top layer. However, this drawing method cannot determine the drawing color of the work area corresponding to different drawing layers, nor can it effectively distinguish the drawing area for each operation. Summary of the Invention

[0004] This invention provides a method, apparatus, equipment, and machinery for drawing work areas, which solves the problem in the prior art that different colors cannot be used to correspond to different work layers when drawing work areas of machinery, and achieves effective differentiation of work layers of machinery.

[0005] This invention provides a method for drawing a work area, comprising:

[0006] Obtain the drawing parameters of the drawing tool and the operating parameters of the machinery.

[0007] The current work area is drawn based on the drawing parameters and the work parameters;

[0008] Obtain the pixel data of each pixel in the current working area;

[0009] Determine the target color value corresponding to the pixel data;

[0010] The current working area is rendered based on the target color value.

[0011] According to a method for drawing a work area provided by the present invention, the pixel data includes: target transparency value;

[0012] Determining the target color value corresponding to the pixel data includes:

[0013] Based on the target transparency value, determine the current drawing layer number corresponding to the pixel data;

[0014] Based on a pre-created first correspondence between drawing layers and color values, a first color value corresponding to the current drawing layer is determined, and based on the first color value, the target color value is determined.

[0015] According to a method for drawing a work area provided by the present invention, determining the current drawing layer number corresponding to the pixel data based on the target transparency value includes:

[0016] Get the initial transparency value and the preset transparency change value;

[0017] Based on the initial transparency value, the transparency change value, and the target transparency value, the current drawing layer number corresponding to the pixel data is obtained.

[0018] According to a method for drawing a work area provided by the present invention, obtaining pixel data of each pixel in the current work area includes:

[0019] Based on a preset pixel extraction method, the transparency value of each pixel is extracted;

[0020] The target transparency value is obtained based on the extracted transparency value.

[0021] According to a method for drawing a work area provided by the present invention, after extracting the transparency value of each pixel based on a preset pixel extraction method, the method further includes:

[0022] The extracted transparency values ​​are stored in an array;

[0023] The process of obtaining the target transparency value based on the extracted transparency value includes:

[0024] The maximum transparency value is obtained from the array, and the maximum transparency value is determined as the target transparency value.

[0025] According to a method for drawing a work area provided by the present invention, the pixel data includes: target transparency value;

[0026] Determining the target color value corresponding to the pixel data includes:

[0027] Based on a pre-created second correspondence between transparency values ​​and color values, a second color value corresponding to the target transparency value is determined, and based on the second color value, the target color value is determined.

[0028] According to a method for drawing a work area provided by the present invention, the method further includes:

[0029] Create a thread pool, which includes a main thread and child threads;

[0030] The sub-thread is started to execute the steps of obtaining the drawing parameters of the drawing tool and the operating parameters of the machine; drawing the current operating area based on the drawing parameters and the operating parameters; obtaining the pixel data of each pixel in the current operating area; and determining the target color value corresponding to the pixel data.

[0031] Start the main thread to execute the step of rendering the current working area based on the target color value.

[0032] The present invention also provides a drawing device for a work area, comprising:

[0033] The first acquisition module is used to acquire the drawing parameters of the drawing tool and the operating parameters of the operating machinery;

[0034] A drawing module is used to draw the current work area based on the drawing parameters and the work parameters;

[0035] The second acquisition module is used to acquire pixel data of each pixel in the current working area;

[0036] The determining module is used to determine the target color value corresponding to the pixel data;

[0037] The rendering module is used to render the current working area based on the target color value.

[0038] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the drawing method of the working area as described above.

[0039] The present invention also provides a work machine, including a work area drawing device as described in any of the preceding claims, or a work area drawing method as described in any of the preceding claims.

[0040] The present invention provides a method, apparatus, equipment, and machinery for drawing a work area. It acquires the drawing parameters of the drawing tool and the working parameters of the machinery; based on these parameters, it draws the current work area, demonstrating a correspondence between the current work area and the actual work area of ​​the machinery; it acquires pixel data for each pixel in the current work area; it determines a target color value corresponding to the pixel data; and it renders the current work area based on the target color value. The present invention determines a corresponding target color value for the current work area to effectively distinguish work areas corresponding to different drawing layers, thus achieving effective differentiation of the working layers of the machinery. Attached Figure Description

[0041] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0042] Figure 1 This is one of the flowcharts illustrating the method for drawing the work area provided by the present invention;

[0043] Figure 2 This is the second flowchart illustrating the method for drawing the work area provided by the present invention;

[0044] Figure 3 This is a schematic diagram of the structure of the drawing device for the work area provided by the present invention;

[0045] Figure 4 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0046] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0047] The following is combined with Figures 1 to 2 The method for drawing the working area of ​​the present invention is described.

[0048] This invention provides a method for drawing a work area. This method can be applied to smart terminals, such as mobile phones, computers, and tablets, as well as to servers and the controllers of machinery. The following description uses the application of this method to a server as an example; however, it should be noted that this is merely illustrative and not intended to limit the scope of protection of this invention. Other descriptions in this invention are also illustrative and not intended to limit the scope of protection of this invention, and will not be described in detail thereafter.

[0049] like Figure 1 As shown, the method includes:

[0050] Step 101: Obtain the drawing parameters of the drawing tool and the operating parameters of the operating machinery.

[0051] The drawing tools include drawing brushes, and the drawing parameters include brush color, brush thickness, etc. The brush color includes the brush's RGBA value, which is the brush's RGB value (the color values ​​of the three channels: red, green, and blue) and transparency value (A).

[0052] The operational parameters include: the starting point, ending point, width of the operational path, and all operational points along the path between the starting point and the ending point of the current operation of the machinery.

[0053] Specifically, drawing parameters and operation parameters can be obtained through manual input; they can also be obtained through communication with the drawing tools and operation machinery and transmitted through them; or they can be actively obtained from the drawing tools and operation machinery by establishing a communication connection with them.

[0054] Specifically, there are various drawing software programs in the existing technology, such as management software computer-aided design (CAD), drawing software, canvas software, etc.

[0055] The invention will now be described in detail using canvas software as an example:

[0056] The canvas itself does not have drawing capabilities; drawing requires the execution of scripts. Furthermore, the canvas provides methods for directly drawing vector graphics, which can be done by specifying path points. The canvas draws vector graphics on the canvas through the execution of scripts.

[0057] Step 102: Draw the current work area based on the drawing parameters and the work parameters.

[0058] Specifically, the current work area is drawn on the canvas. Based on the pre-set mapping relationship between the canvas and the overall work area, the work parameters and drawing parameters, the current work area is drawn on the canvas to obtain the image to be processed.

[0059] The overall work area refers to all work areas in the canvas, including the current work area. The scaling ratio between the overall work area and the canvas size is preset, i.e., the mapping relationship.

[0060] In this process, the image to be processed may contain one or more regions that have already been drawn, and may also contain regions that have not been drawn. The current working area of ​​this invention is the region drawn at the current moment.

[0061] Specifically, the `globalCompositeOperation` property, a built-in feature of the canvas, sets the overlay method when multiple drawings are performed on the canvas. For example, the `lighter` option in the `globalCompositeOperation` property adds the RGBA values ​​separately to distinguish the brush color for each drawing. When the overlay value exceeds 255, 255 is used as the final value.

[0062] This invention utilizes the globalCompositeOperation property built into canvas to draw the work area, enabling the work area to be drawn quickly.

[0063] Step 103: Obtain pixel data for each pixel in the current working area.

[0064] The pixel data includes the RGBA of each pixel, namely the color value and transparency value of the red, green and blue channels.

[0065] In one specific embodiment, the acquisition of pixel data is implemented as follows: based on a preset pixel extraction method, the transparency value of each pixel is extracted; based on the extracted transparency value, the target transparency value is obtained.

[0066] Specifically, there are various pixel extraction methods. For example, extracting pixel data one by one in a horizontal-then-vertical manner; extracting pixel data one by one in a vertical-then-horizontal manner; extracting pixel data of odd-numbered rows first and then even-numbered rows in a horizontal-then-vertical manner; or randomly selecting any pixel to extract its pixel data until all pixels have been extracted.

[0067] This invention does not limit the pixel extraction method; users can set it according to their actual needs.

[0068] Below, we will use the getImageData method provided by canvas to extract pixel data.

[0069] The `getImageData` method retrieves pixel data for each pixel. It extracts pixel data one by one, first horizontally and then vertically, returning an array of pixel data. Each array has a length of 4. The RGBA values ​​of each pixel are placed in a separate array, with the total array length being the product of the number of pixels and 4. Then, based on this array of pixel data, the transparency values ​​are obtained.

[0070] In one specific embodiment, after extracting the transparency value of each pixel based on a preset pixel extraction method, the extracted transparency values ​​are stored in an array, the maximum transparency value is obtained from the array, and the maximum transparency value is determined as the target transparency value.

[0071] Specifically, since the drawing areas may overlap each time, the topmost drawing area is the newest. Therefore, the maximum transparency value is obtained from the array. This can be done by comparing all transparency values ​​in the array to find the maximum; or by comparing the currently stored transparency values ​​to find the maximum.

[0072] This invention provides an effective data basis for obtaining the target color value corresponding to the current working area by acquiring the transparency value of each pixel.

[0073] Step 104: Determine the target color value corresponding to the pixel data.

[0074] The pixel data includes the target transparency value.

[0075] In one specific embodiment, obtaining the target color value is implemented as follows: based on the target transparency value, determine the current drawing layer corresponding to the pixel data; based on the pre-created first correspondence between the drawing layer and the color value, determine the first color value corresponding to the current drawing layer; and determine the target color value based on the first color value.

[0076] Of course, you can also directly obtain the target color value corresponding to the current drawing layer based on the first correspondence.

[0077] In one specific embodiment, obtaining the current drawing layer number is achieved by: obtaining the initial transparency value and the preset transparency change value; and obtaining the current drawing layer number corresponding to the pixel data based on the initial transparency value, the transparency change value, and the target transparency value.

[0078] Specifically, a layer number calculation formula can be created in advance, and the current drawing layer number can be obtained based on the layer number calculation formula, as follows:

[0079] Input the target transparency value, transparency change value, and initial transparency value into the preset layer number calculation formula to obtain the current drawing layer number output by the layer number calculation formula.

[0080] Specifically, the initial brush color is preset, and the brush thickness corresponding to the width of the current work path is determined based on the preset matching relationship between the width of the work path and the brush thickness. Then, the current work area is drawn according to the work parameters.

[0081] For example, if the initial brush color is RGBA(0,0,0,0.01), then the corresponding initial opacity value is 0.01.

[0082] Specifically, the transparency change value of each working area is preset. Based on the superimposed transparency value, the transparency value of the current working area can be obtained, and thus the current drawing layer number can be obtained.

[0083] In this context, the number of layers and the number of layers drawn are the same concept.

[0084] Specifically, the formula for calculating the number of layers is shown in formula (1):

[0085] C=(MT-CT) / B+1 (1)

[0086] Where C is the current layer number, MT is the target transparency value, CT is the initial transparency value, and B is the transparency change value. The initial transparency value is not 0.

[0087] Specifically, a first correspondence between layer numbers and color values ​​is pre-created. At this stage, the color values ​​only include RGB values. This first correspondence is stored as a dictionary. After obtaining the current drawing layer number, the target color value corresponding to the current drawing layer is retrieved using the first correspondence. Of course, arrays, sequences, linked lists, or other storage methods can also be used.

[0088] Different layers correspond to different color values.

[0089] For example, the first correspondence is shown in Table 1:

[0090]

[0091]

[0092] Table 1 First Correspondence Relationship

[0093] In one specific embodiment, obtaining the target color value is achieved by: determining a second color value corresponding to the target transparency value based on a pre-created second correspondence between transparency values ​​and color values, and determining the target color value based on the second color value.

[0094] Of course, the target color value corresponding to the target transparency value can also be obtained directly through the second correspondence.

[0095] Different transparency values ​​correspond to different color values.

[0096] Specifically, a second mapping between transparency values ​​and color values ​​can be pre-created. In this case, the color values ​​only include RGB values. This second mapping is stored as a dictionary. After obtaining the target transparency value, the target color value corresponding to that value is retrieved using the second mapping. Alternatively, arrays, sequences, linked lists, or other storage methods can also be used.

[0097] This invention obtains the target color value of the current working area by creating a first correspondence between the number of layers and the color value and / or creating a second correspondence between the transparency value and the color value, thus providing an effective data foundation for rendering the current working area.

[0098] Step 105: Render the current working area based on the target color value.

[0099] For example, the canvas's image data rendering method (putImageData) can be used to render the current work area using the target color value and then redisplay it on the canvas.

[0100] Below, through Figure 2 The present invention will be described in detail below:

[0101] Step 201: Obtain the drawing parameters of the drawing pen and the operating parameters of the operating machinery.

[0102] Step 202: Draw the current working area in the current image based on the drawing parameters and the working parameters to obtain the image to be processed.

[0103] Step 203: Extract the pixel data of each pixel one by one using the method of first horizontal and then vertical, and store it in an array.

[0104] Step 204: Traverse the array, read and compare each transparency value, obtain the maximum transparency value, and use the maximum transparency value as the target transparency value.

[0105] Step 205: Based on the target transparency value, obtain the current drawing layer number.

[0106] Step 206: Based on the pre-created first correspondence between layer number and color value, determine the target color value corresponding to the currently drawn layer number.

[0107] Step 207: Render the current work area using the target color value and display it on the canvas.

[0108] This invention sets an initial transparency value, a transparency change value, and a first correspondence relationship. Based on the superimposed transparency value (target transparency value), a target color value is obtained, enabling different colors to be displayed for different drawing layers for visual management.

[0109] In one specific embodiment, the present invention pre-creates a thread pool; starts a sub-thread to perform the steps of obtaining the drawing parameters of the drawing tool and the operating parameters of the operating machinery; drawing the current operating area based on the drawing parameters and the operating parameters; obtaining the pixel data of each pixel in the current operating area; determining the target color value corresponding to the pixel data; and starts the main thread to perform the steps of rendering the current operating area based on the target color value.

[0110] The thread pool includes the main thread and child threads.

[0111] Alternatively, image processing can be performed by deploying sub-threads:

[0112] Existing browsers provide worker objects for running and executing scripts (JavaScript code), which communicate with the main thread via messages. A worker object is created when a web page starts, and a canvas is created within the worker object. Upon receiving job parameters, the image data is processed using a method of overlaying opacity and modifying colors. The processed data is then sent to the main thread in a queue (first-in, first-out) manner within the worker object. The main thread then handles rendering and display.

[0113] The child thread is used to execute the operations corresponding to steps 101-104.

[0114] This invention improves page rendering speed by processing image data in a sub-thread and then rendering and displaying the image in the main thread. Furthermore, it reduces the number of times the page is drawn on the visible canvas, using the main thread to completely draw the current working area on the page.

[0115] The main thread is used to execute the operation corresponding to step 105.

[0116] The method for drawing a work area provided by this invention involves acquiring the drawing parameters of the drawing tool and the work parameters of the machine; drawing the current work area based on the drawing parameters and work parameters, thus demonstrating the correspondence between the current work area and the actual work area of ​​the machine; acquiring pixel data for each pixel in the current work area; determining the target color value corresponding to the pixel data; and rendering the current work area based on the target color value. This invention determines the target color value corresponding to the current work area to effectively distinguish work areas corresponding to different drawing layers, thereby achieving effective differentiation of the work layers of the machine.

[0117] The following describes the apparatus for drawing the work area provided by the present invention. The apparatus for drawing the work area described below can be referred to in correspondence with the method for drawing the work area described above; repeated details will not be repeated. Figure 3As shown, the device includes:

[0118] The first acquisition module 301 is used to acquire the drawing parameters of the drawing tool and the operating parameters of the operating machinery;

[0119] The drawing module 302 is used to draw the current work area based on the drawing parameters and the work parameters;

[0120] The second acquisition module 303 is used to acquire pixel data of each pixel in the current working area;

[0121] The determination module 304 is used to determine the target color value corresponding to the pixel data;

[0122] Rendering module 305 is used to render the current working area based on the target color value.

[0123] In one specific embodiment, the pixel data includes: a target transparency value; a determining module 304, specifically used to determine the current drawing layer corresponding to the pixel data based on the target transparency value; determine a first color value corresponding to the current drawing layer based on a pre-created first correspondence between drawing layer number and color value; and determine a target color value based on the first color value.

[0124] In one specific embodiment, the determining module 304 is specifically used to obtain an initial transparency value and a preset transparency change value; based on the initial transparency value, the transparency change value and the target transparency value, the current drawing layer corresponding to the pixel data is obtained.

[0125] In one specific embodiment, the second acquisition module 303 is specifically used to extract the transparency value of each pixel based on a preset pixel extraction method; and to obtain the target transparency value based on the extracted transparency value.

[0126] In one specific embodiment, the second acquisition module 303 is further configured to store the extracted transparency value in an array; specifically, the second acquisition module 303 is configured to obtain the maximum transparency value from the array and determine the maximum transparency value as the target transparency value.

[0127] In one specific embodiment, the pixel data includes: a target transparency value; and a determining module 304, specifically configured to determine a second color value corresponding to the target transparency value based on a pre-created second correspondence between transparency values ​​and color values, and to determine a target color value based on the second color value.

[0128] In one specific embodiment, the device further includes a creation module for creating a thread pool, wherein the thread pool includes a main thread and a sub-thread; starting the sub-thread to perform the steps of obtaining drawing parameters of the drawing tool and operating parameters of the operating machinery; drawing the current operating area based on the drawing parameters and operating parameters; obtaining pixel data of each pixel in the current operating area; determining the target color value corresponding to the pixel data; and starting the main thread to perform the steps of rendering the current operating area based on the target color value.

[0129] The drawing device for the working area provided by this invention acquires the drawing parameters of the drawing tool and the working parameters of the working machinery through a first acquisition module 301; a drawing module 302 draws the current working area based on the drawing parameters and the working parameters, thus demonstrating a correspondence between the current working area and the actual working area of ​​the working machinery; a second acquisition module 303 acquires the pixel data of each pixel in the current working area; a determination module 304 determines the target color value corresponding to the pixel data; and a rendering module 305 renders the current working area based on the target color value. This invention determines a corresponding target color value for the current working area to effectively distinguish working areas corresponding to different drawing layers, thereby achieving effective differentiation of the working layers of the working machinery.

[0130] This invention also provides a work machine, which includes a work area drawing device as described in any of the above claims, or a work area drawing method as described in any of the above claims.

[0131] The operating machinery includes: road rollers, pavers, milling machines, excavators, cranes, pump trucks, and mixer trucks.

[0132] Specifically, the logic of the above-mentioned method for drawing the work area can be deployed in the controller of the work machinery, or it can be deployed in the central control screen of the work machinery, and the overall work area can be displayed on the screen of the central control screen for the convenience of the operator.

[0133] Figure 4 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 4As shown, the electronic device may include a processor 401, a communication interface 402, a memory 403, and a communication bus 404. The processor 401, communication interface 402, and memory 403 communicate with each other via the communication bus 404. The processor 401 can call logical instructions in the memory 403 to execute a method for drawing a work area. This method includes: acquiring drawing parameters of a drawing tool and work parameters of the working machine; drawing the current work area based on the drawing parameters and work parameters; acquiring pixel data for each pixel in the current work area; determining the target color value corresponding to the pixel data; and rendering the current work area based on the target color value.

[0134] Furthermore, the logical instructions in the aforementioned memory 403 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0135] On the other hand, the present invention also provides a computer program product, the computer program product including a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, and when the program instructions are executed by a computer, the computer is able to execute the drawing method of the working area provided in the above embodiments, the method including: obtaining drawing parameters of a drawing tool and working parameters of a working machine; drawing the current working area based on the drawing parameters and working parameters; obtaining pixel data of each pixel point of the current working area; determining a target color value corresponding to the pixel data; and rendering the current working area based on the target color value.

[0136] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements the method for drawing the work area provided in the above embodiments. The method includes: obtaining drawing parameters of a drawing tool and work parameters of a working machine; drawing the current work area based on the drawing parameters and work parameters; obtaining pixel data of each pixel in the current work area; determining a target color value corresponding to the pixel data; and rendering the current work area based on the target color value.

[0137] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0138] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0139] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for drawing a work area, characterized in that, include: Obtain the drawing parameters of the drawing tool and the operating parameters of the machinery. The current work area is drawn based on the drawing parameters and the work parameters; Obtain the pixel data of each pixel in the current working area; Determine the target color value corresponding to the pixel data; Render the current working area based on the target color value; The pixel data includes: target transparency value; Determining the target color value corresponding to the pixel data includes: Based on the target transparency value, determine the current drawing layer number corresponding to the pixel data; Based on a pre-created first correspondence between drawing layers and color values, a first color value corresponding to the current drawing layer is determined, and based on the first color value, the target color value is determined. Determining the current rendering layer number corresponding to the pixel data based on the target transparency value includes: Get the initial transparency value and the preset transparency change value; Based on the initial transparency value, the transparency change value, and the target transparency value, the current drawing layer number corresponding to the pixel data is obtained.

2. The method for drawing the work area according to claim 1, characterized in that, The step of obtaining pixel data for each pixel in the current working area includes: Based on a preset pixel extraction method, the transparency value of each pixel is extracted; The target transparency value is obtained based on the extracted transparency value.

3. The method for drawing the work area according to claim 2, characterized in that, After extracting the transparency value of each pixel based on a preset pixel extraction method, the method further includes: The extracted transparency values ​​are stored in an array; The process of obtaining the target transparency value based on the extracted transparency value includes: The maximum transparency value is obtained from the array and determined as the target transparency value.

4. The method for drawing the work area according to claim 1, characterized in that, The pixel data includes: target transparency value; Determining the target color value corresponding to the pixel data includes: Based on a pre-created second correspondence between transparency values ​​and color values, a second color value corresponding to the target transparency value is determined, and based on the second color value, the target color value is determined.

5. The method for drawing the work area according to any one of claims 1-4, characterized in that, The method further includes: Create a thread pool, which includes a main thread and child threads; The sub-thread is started to execute the steps of obtaining the drawing parameters of the drawing tool and the operating parameters of the machine; drawing the current operating area based on the drawing parameters and the operating parameters; obtaining the pixel data of each pixel in the current operating area; and determining the target color value corresponding to the pixel data. Start the main thread to execute the step of rendering the current working area based on the target color value.

6. A device for drawing a work area, characterized in that, include: The first acquisition module is used to acquire the drawing parameters of the drawing tool and the operating parameters of the operating machinery; A drawing module is used to draw the current work area based on the drawing parameters and the work parameters; The second acquisition module is used to acquire pixel data of each pixel in the current working area; The determining module is used to determine the target color value corresponding to the pixel data; The rendering module is used to render the current working area based on the target color value; The pixel data includes: target transparency value; Determining the target color value corresponding to the pixel data includes: Based on the target transparency value, determine the current drawing layer number corresponding to the pixel data; Based on a pre-created first correspondence between drawing layers and color values, a first color value corresponding to the current drawing layer is determined, and based on the first color value, the target color value is determined. Determining the current rendering layer number corresponding to the pixel data based on the target transparency value includes: Get the initial transparency value and the preset transparency change value; Based on the initial transparency value, the transparency change value, and the target transparency value, the current drawing layer number corresponding to the pixel data is obtained.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method for drawing the working area as described in any one of claims 1 to 5.

8. A type of operating machinery, characterized in that, Includes the drawing device for the work area as described in claim 6, or implements the drawing method for the work area as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Automatic drawing method, system and device for outburst prevention measure drilling diagram, and readable storage medium

    CN112487542A

  • Navigation map generation method and device, electronic equipment and program product

    CN115307621A