CN107369190B - Rubble-based thermodynamic diagram accelerated rendering method - Google Patents

Rubble-based thermodynamic diagram accelerated rendering method Download PDF

Info

Publication number
CN107369190B
CN107369190B CN201710606816.2A CN201710606816A CN107369190B CN 107369190 B CN107369190 B CN 107369190B CN 201710606816 A CN201710606816 A CN 201710606816A CN 107369190 B CN107369190 B CN 107369190B
Authority
CN
China
Prior art keywords
sub
canvas
region
gray
rendering
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710606816.2A
Other languages
Chinese (zh)
Other versions
CN107369190A (en
Inventor
孟凯伦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vtron Software Nanjing Co ltd
Original Assignee
Vtron Software Nanjing Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vtron Software Nanjing Co ltd filed Critical Vtron Software Nanjing Co ltd
Priority to CN201710606816.2A priority Critical patent/CN107369190B/en
Publication of CN107369190A publication Critical patent/CN107369190A/en
Application granted granted Critical
Publication of CN107369190B publication Critical patent/CN107369190B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/001Texturing; Colouring; Generation of texture or colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image

Abstract

The invention discloses a rubble-based thermodynamic diagram accelerated rendering method, which belongs to the technical field of thermodynamic diagram processing and comprises a main server and a plurality of rendering servers, wherein the thermodynamic diagram is divided into N sub-regions, the rendering servers finish the rendering work of the thermodynamic diagram on the sub-regions at the same time, and finally the sub-regions are combined into an integral thermodynamic diagram.

Description

Rubble-based thermodynamic diagram accelerated rendering method
Technical Field
The invention belongs to the technical field of thermodynamic diagram processing, and particularly relates to a method for accelerating the rendering of a thermodynamic diagram based on rubbling.
Background
In the process of generating the thermodynamic diagram, a generated canvas is often determined; and then determining a circle with a uniform radius, filling the circle with gray tape in a transparent gradual change manner in the radial direction from the circle center to the outside, and repeatedly overlapping the formed circle on the canvas according to the given point number and the corresponding coordinate value. After superposition, areas with more points are darker in color, and areas with fewer points are lighter in color.
And respectively and sequentially taking the transparency of each pixel point by using the generated gray-scale image, taking the color depth of 0-255 as an index, taking the color value corresponding to the depth index on the provided color band, filling the pixels, and forming a thermodynamic diagram after the filling is finished.
The prior art functionally realizes the generation of the thermal diagram, but the generation speed is linearly increased under the condition of more points and larger canvas, and particularly under the condition of more points, the points of the gray diagram are required to be filled in the canvas one by one and then overlapped, the working mode is serial, and the more the points are, the worse the efficiency is; and under the condition that the canvas is large, the colorization is to search the corresponding color band value through one point and one point of color depth, and the rendering efficiency is geometrically increased according to the length and the width of the canvas.
Disclosure of Invention
The invention aims to provide a rubble-based thermodynamic diagram accelerated rendering method, which solves the technical problem that the generation speed of a gray scale diagram is slow when the thermodynamic diagram is processed.
In order to achieve the purpose, the invention adopts the following technical scheme:
a rubbling-based thermodynamic diagram accelerated rendering method comprises the following steps:
step 1: connecting a main server and a plurality of rendering servers, wherein all the rendering servers are communicated with the main server through network cables;
step 2: the method comprises the steps that a main server obtains graphic data required by generating a thermodynamic diagram, wherein the graphic data comprise coordinates of original points of all gray level circles in the thermodynamic diagram and the size of the gray level circles;
and step 3: creating an integral canvas in a main server, and setting the length of the integral canvas as A and the width as B; dividing the whole canvas into N subregions, wherein the actual length of each subregion is x, and the width of each subregion is y; creating a sub-region canvas, wherein the size of the gray circle is an actual value, the radius of the gray circle is set to be R, and the length of the sub-region canvas is as follows: x1X +2R, the width of the sub-region canvas is: y is1Y + 2R; that is, the sub-region canvas is more than the sub-region by one region actually, and the region is set as a common region;
matching numbers of each sub-region, setting a row of sub-regions positioned at the top of the whole canvas as a first row of sub-regions, numbering rows of all sub-regions in sequence from top to bottom, setting a row of sub-regions positioned at the left of the whole canvas as a first row of sub-regions, and numbering rows of all sub-regions in sequence from left to right;
recording the row numbers and the column numbers of all the sub-regions into a dictionary;
the main server distributes all the sub-region canvas to all the rendering servers, and each rendering server processes a plurality of sub-region canvas;
and 4, step 4: completing drawing of a gray circle on a sub-region canvas in a rendering server: setting the point at the leftmost upper corner of the whole canvas as the origin of coordinates, and setting the abscissa of the origin of the gray circle on the whole canvas as X2Ordinate is Y2Calculating on which sub-region canvas the origin of the gray circle is located by the following formula:
sub-region canvasLine number of (0,1,2, 3.) (Y)2Y)), where the maximum number of lines is greater than or equal to Y2An integer value of div y;
column number of sub-region canvas (0,1,2, 3.) (X)2X)), where the maximum number of columns is greater than or equal to X2An integer value of x;
and then calculating the relative position of the origin of the gray circle in the sub-region canvas by the following formula:
setting the relative position of the origin of the gray circle in the sub-area canvas, and setting the abscissa of the relative position as X4Ordinate is Y4Then:
X4=X2- (line number of sub-region canvas x) -R;
Y4=Y2- (column number of sub-region canvas x y) -R;
drawing a gray circle on the sub-region canvas according to the relative position;
and 5: repeating the step 4 until all the gray circles are drawn;
step 6: acquiring all sub-region canvas drawn by a rendering server in a main server, refilling all the sub-region canvas according to the number of the sub-region canvas to form new integral canvas, and overlapping the common areas of two adjacent sub-region canvases when the sub-region canvas is combined;
and 7: dividing the whole canvas obtained in the step 6 into N clipping areas again according to the actual size of the sub-area in the step 3, wherein the size of each clipping area is the same as the actual size of the sub-area, numbering all the clipping areas according to the method in the step 3, and distributing all the clipping areas to all the rendering servers by the main server;
and 8: and the rendering server performs color filling on the cutting area: firstly, reading gray values of all gray circles in a cutting area, wherein the size of the gray value is 0-255; then searching corresponding colors in the color bars according to the gray values, and filling the colors on a gray circle to realize colorization;
and step 9: and the main server acquires all the trimming areas filled with colors by the rendering server and combines the trimming areas into an integral color thermodynamic diagram according to the numbers of the trimming areas.
The color bars are applied to a computer, and the value range of the color is 0-255.
And 6, setting the background color of each subarea canvas to be transparent, and performing color superposition on the gray-scale map.
And the main server is provided with a thread pool and distributes tasks according to the processing queuing condition of the rendering server.
The accelerated rendering method of the thermodynamic diagram based on rubble solves the technical problem that the gray level image generation speed is low when the thermodynamic diagram is processed.
Drawings
FIG. 1 is a flow chart of the present invention;
FIG. 2 is a schematic diagram of the present invention for dividing an overall canvas into N sub-regions: sub-region canvas 1, common region 2, grey circle 3.
Detailed Description
1-2, a rubble-based thermodynamic diagram accelerated rendering method includes the following steps:
step 1: connecting a main server and a plurality of rendering servers, wherein all the rendering servers are communicated with the main server through network cables;
step 2: the method comprises the steps that a main server obtains graphic data required by generating a thermodynamic diagram, wherein the graphic data comprise coordinates of original points of all gray circles 3 in the thermodynamic diagram and the size of the gray circles 3;
and step 3: creating an integral canvas in a main server, and setting the length of the integral canvas as A and the width as B; dividing the whole canvas into N subregions, wherein the actual length of each subregion is x, and the width of each subregion is y; creating a sub-region canvas 1, setting the radius of the gray circle 3 as R as the size of the gray circle 3 is an actual value, and then the length of the sub-region canvas 1 is as follows: x1=x+2RThe width of the sub-region canvas 1 is: y is1Y + 2R; namely, the sub-region canvas 1 is more than the sub-region by one region actually, and the region is set as a public region 2;
in actual application, a user inputs the length A and the width B of the whole canvas in the main server; inputting the actual length x and width y of each sub-region; finally, inputting the diameter L of the gray circle 3; the main server calculates the number of columns according to A/x and then calculates the number of rows according to B/y, and then N is equal to the number of columns multiplied by the number of rows;
matching numbers of each sub-region, setting a row of sub-regions positioned at the top of the whole canvas as a first row of sub-regions, numbering rows of all sub-regions in sequence from top to bottom, setting a row of sub-regions positioned at the left of the whole canvas as a first row of sub-regions, and numbering rows of all sub-regions in sequence from left to right;
recording the row numbers and the column numbers of all the sub-regions into a dictionary;
the main server distributes all the sub-region canvas 1 to all the rendering servers, and each rendering server processes a plurality of sub-region canvas 1;
and 4, step 4: the drawing of the gray circle 3 on the sub-area canvas 1 is completed in the rendering server: setting the point at the leftmost upper corner of the whole canvas as the origin of coordinates, and setting the abscissa of the origin of the gray circle 3 on the whole canvas as X2Ordinate is Y2On which sub-region canvas 1 the origin of the gray circle 3 is located is calculated by the following formula:
line number of the sub-region canvas 1 is (0,1,2, 3.) (Y)2Y)), where the maximum number of lines is greater than or equal to Y2An integer value of div y;
column number of sub-region canvas 1 ═ 0,1,2,3. (X)2X)), where the maximum number of columns is greater than or equal to X2An integer value of x;
then the relative position of the origin of the gray circle 3 in the sub-region canvas 1 is calculated by the following formula:
setting the relative position of the origin of the gray circle 3 in the sub-area canvas 1, and setting the abscissa of the relative position as X4Ordinate is Y4Then:
X4=X2- (line number of sub-region canvas 1 x) -R;
Y4=Y2- (column number x y-R of sub-region canvas 1;
drawing a gray circle 3 on the sub-region canvas 1 according to the relative position;
and 5: repeating the step 4 until all the gray circles 3 are drawn;
step 6: acquiring all sub-region canvases 1 drawn by a rendering server in a main server, re-filling all the sub-region canvases 1 according to the number of the sub-region canvases 1 to form a new integral canvas, and overlapping common regions 2 of two adjacent sub-region canvases 1 when the sub-region canvases 1 are combined;
and 7: dividing the whole canvas obtained in the step 6 into N clipping areas again according to the actual size of the sub-area in the step 3, wherein the size of each clipping area is the same as the actual size of the sub-area, numbering all the clipping areas according to the method in the step 3, and distributing all the clipping areas to all the rendering servers by the main server;
and 8: and the rendering server performs color filling on the cutting area: firstly, reading the gray values of all gray circles 3 in the cutting area, wherein the size of the gray value is 0-255; then searching corresponding colors in the color bars according to the gray values, and filling the colors into the gray circle 3 to realize colorization;
and step 9: and the main server acquires all the trimming areas filled with colors by the rendering server and combines the trimming areas into an integral color thermodynamic diagram according to the numbers of the trimming areas.
The color bars are applied to a computer, and the value range of the color is 0-255.
And 6, setting the background color of each sub-region canvas 1 to be transparent, and performing color superposition on the gray-scale map.
And the main server is provided with a thread pool and distributes tasks according to the processing queuing condition of the rendering server.
The invention solves the technical problem of low gray-scale image generation speed in thermodynamic diagram processing, adopts a multi-thread multi-server processing mode, simultaneously processes a plurality of subarea images, obviously accelerates the gray-scale image generation speed, improves colorization time to a certain extent compared with the original time, and has obvious effect on the whole rendering time.

Claims (4)

1. A rubble-based thermodynamic diagram accelerated rendering method is characterized in that: the method comprises the following steps:
step 1: connecting a main server and a plurality of rendering servers, wherein all the rendering servers are communicated with the main server through network cables;
step 2: the method comprises the steps that a main server obtains graphic data required by generating a thermodynamic diagram, wherein the graphic data comprise coordinates of the original points of all gray circles (3) in the thermodynamic diagram and the size of the gray circles (3);
and step 3: creating an integral canvas in a main server, and setting the length of the integral canvas as A and the width as B; dividing the whole canvas into N subregions, wherein the actual length of each subregion is x, and the width of each subregion is y; creating a sub-region canvas (1), wherein the size of the gray circle (3) is an actual value, the radius of the gray circle (3) is set to be R, and the length of the sub-region canvas (1) is as follows: x1X +2R, the width of the sub-region canvas (1) is: y is1Y + 2R; namely, the sub-region canvas (1) is more than the sub-region by one region actually, and the region is set as a public region (2);
matching numbers of each sub-region, setting a row of sub-regions positioned at the top of the whole canvas as a first row of sub-regions, numbering rows of all sub-regions in sequence from top to bottom, setting a row of sub-regions positioned at the left of the whole canvas as a first row of sub-regions, and numbering rows of all sub-regions in sequence from left to right;
recording the row numbers and the column numbers of all the sub-regions into a dictionary;
the main server distributes all sub-region canvases (1) to all rendering servers, and each rendering server processes a plurality of sub-region canvases (1);
and 4, step 4: completing the drawing of a gray circle (3) on a subarea canvas (1) in a rendering server: setting the wholeThe point of the leftmost upper corner of the canvas is the origin of coordinates, and the abscissa of the origin of the gray circle (3) on the whole canvas is X2Ordinate is Y2Calculating on which sub-region canvas (1) the origin of the grey circle (3) is by the following formula:
line number of the sub-region canvas (1) ═ 0,1,2,3. (Y)2Y)), where the maximum number of lines is greater than or equal to Y2An integer value of div y;
column number of the sub-region canvas (1) ═ 0,1,2,3. (X)2X)), where the maximum number of columns is greater than or equal to X2An integer value of x;
and then calculating the relative position of the origin of the gray circle (3) in the sub-region canvas (1) by the following formula:
setting the relative position of the origin of the gray circle (3) in the sub-region canvas (1), and setting the abscissa of the relative position as X4Ordinate is Y4Then:
X4=X2- (line number of sub-region canvas (1) × x) -R;
Y4=Y2- (column number of sub-region canvas (1) × y) -R;
drawing a gray circle (3) on the sub-region canvas (1) according to the relative position;
and 5: repeating the step 4 until all the gray circles (3) are drawn;
step 6: acquiring all sub-region canvases (1) drawn by a rendering server in a main server, refilling all the sub-region canvases (1) according to the number of the sub-region canvases (1) to form a new integral canvas, and overlapping public regions (2) of two adjacent sub-region canvases (1) when in combination;
and 7: dividing the whole canvas obtained in the step 6 into N clipping areas again according to the actual size of the sub-area in the step 3, wherein the size of each clipping area is the same as the actual size of the sub-area, numbering all the clipping areas according to the method in the step 3, and distributing all the clipping areas to all the rendering servers by the main server;
and 8: and the rendering server performs color filling on the cutting area: firstly, reading gray values of all gray circles (3) in a cutting area, wherein the size of the gray value is 0-255; then, searching corresponding colors in the color bars according to the gray values, and filling the colors into the gray circle (3) to realize colorization;
and step 9: and the main server acquires all the trimming areas filled with colors by the rendering server and combines the trimming areas into an integral color thermodynamic diagram according to the numbers of the trimming areas.
2. The rubble-based thermodynamic diagram accelerated rendering method of claim 1, wherein the color bars are color bars applied to a computer, and the value range of the color is 0-255.
3. The rubble-based thermodynamic diagram accelerated rendering method according to claim 1, wherein in the step 6, the background color of each subarea canvas (1) is set to be transparent, and the gray level diagram is subjected to color superposition.
4. The rubble-based thermodynamic diagram accelerated rendering method of claim 1, wherein the main server sets a thread pool and allocates tasks according to the processing queuing conditions of the rendering servers.
CN201710606816.2A 2017-07-24 2017-07-24 Rubble-based thermodynamic diagram accelerated rendering method Active CN107369190B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710606816.2A CN107369190B (en) 2017-07-24 2017-07-24 Rubble-based thermodynamic diagram accelerated rendering method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710606816.2A CN107369190B (en) 2017-07-24 2017-07-24 Rubble-based thermodynamic diagram accelerated rendering method

Publications (2)

Publication Number Publication Date
CN107369190A CN107369190A (en) 2017-11-21
CN107369190B true CN107369190B (en) 2020-12-29

Family

ID=60308470

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710606816.2A Active CN107369190B (en) 2017-07-24 2017-07-24 Rubble-based thermodynamic diagram accelerated rendering method

Country Status (1)

Country Link
CN (1) CN107369190B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109241466A (en) * 2018-07-26 2019-01-18 威创软件南京有限公司 It is a kind of suitable for small area and the full frame rendering method of the thermodynamic chart of few hot spot
CN109712151A (en) * 2018-12-31 2019-05-03 航天精一(广东)信息科技有限公司 A kind of method of reverse color applying drawing thermodynamic chart
CN112198964A (en) * 2020-11-03 2021-01-08 北京歌尔泰克科技有限公司 Function implementation method and device on wearable device
CN113220748B (en) * 2021-05-21 2023-10-27 国网江苏省电力有限公司镇江供电分公司 Method and system for constructing power distribution network equipment load thermodynamic diagram and data analysis

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001063556A1 (en) * 2000-02-25 2001-08-30 Inzomia Ab A method and device for picture presentation
CN103618773A (en) * 2013-11-19 2014-03-05 北京国双科技有限公司 Display method, device and system for thermodynamic diagrams
CN104899227A (en) * 2014-03-07 2015-09-09 腾讯科技(深圳)有限公司 Webpage character rendering method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001063556A1 (en) * 2000-02-25 2001-08-30 Inzomia Ab A method and device for picture presentation
CN103618773A (en) * 2013-11-19 2014-03-05 北京国双科技有限公司 Display method, device and system for thermodynamic diagrams
CN104899227A (en) * 2014-03-07 2015-09-09 腾讯科技(深圳)有限公司 Webpage character rendering method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
An integrated visualization on network events VAST 2011 Mini Challenge #2 Award: "Outstanding integrated overview display";Walter Marcelo Lamagna;《IEEE》;20111215;全文 *
基于 Spark 的大数据热图可视化方法;张繁 等;《计算机辅助设计与图形学学报》;20161130;第28卷(第11期);第1881-1886页 *

Also Published As

Publication number Publication date
CN107369190A (en) 2017-11-21

Similar Documents

Publication Publication Date Title
CN107369190B (en) Rubble-based thermodynamic diagram accelerated rendering method
JPWO2020191391A5 (en)
CN108510562B (en) Digital camouflage pattern generation method based on image fractal texture
CN109584366B (en) Terrain rendering method, device, equipment and readable storage medium
CN104143186B (en) A kind of SLIC super-pixel piecemeal optimization method
US20200279415A1 (en) Efficiently Computed Distance Fields
CN109559316A (en) A kind of improved graph theory dividing method based on super-pixel
CN106447671A (en) Automatic vector polygon segmentation method based on designated areas
KR20150108241A (en) Apparatus and method of fast and natural terrain generation
CN109978968B (en) Video drawing method, device and equipment of moving object and storage medium
JP6305912B2 (en) Texture generation system
JP2001333437A (en) Image display device, image display method and recording medium
CN106815879B (en) A kind of quick texture synthesis method based on LBP feature
JP5254250B2 (en) Method and system for generating boundaries in the process of rasterizing vector graphics, and method for manufacturing the system
US8502824B2 (en) Method and display device for displaying characters
CN105005991A (en) Method for batch computing of displacements of atomic mass centers in high-resolution scanning transmission image
US20140347373A1 (en) Method of generating terrain model and device using the same
CN106651993A (en) Method for filling non self-intersecting polygon in FPGA
CN102682456B (en) Anti-aliasing straight line drawing method based on non-weighted region sampling
CN110807113B (en) Non-iterative elimination method for rectangular primitive overlap in visual layout
KR101098830B1 (en) Surface texture mapping apparatus and its method
US20180150990A1 (en) Animation display apparatus and animation display method
US20100020096A1 (en) Antialiasing apparatus
Tokura et al. A square pointillism image generation, and its GPU acceleration
Huang et al. A GPU implementation of watercolor painting image generation

Legal Events

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