Disclosure of Invention
Aiming at the problems in the prior art, the embodiment of the invention provides a dynamic screenshot method, a device, electronic equipment and a storage medium.
Specifically, the embodiment of the invention provides the following technical scheme:
in a first aspect, an embodiment of the present invention provides a dynamic screenshot method based on vector map rendering, including:
Intercepting rendering pictures of each level view angle of the vector map;
And synthesizing the rendered pictures intercepted at each level view into a dynamic picture.
Further, the capturing the rendering picture of each level view angle of the vector map specifically includes:
determining rendering completion time points of the vector map at each level view;
and according to the rendering completion time points of each level, intercepting rendering pictures of each level view angle of the vector map.
Further, determining the rendering completion time point of the vector map at each level view angle specifically includes:
after receiving an operation instruction for entering any level view angle, generating a mark value corresponding to the any level view angle according to the operation instruction;
Generating a rendering instruction according to the operation instruction, packaging the marking value in the rendering instruction, and then sending the marking value to a rendering processor so that the rendering processor performs rendering processing on vector data of any level view angle;
Receiving a trigger message sent by the rendering processor for informing that the vector data corresponding to any level view is rendered;
judging whether the mark value carried in the trigger message is consistent with the generated mark value corresponding to any level view angle, if so, determining the current time point as the rendering completion time point of the vector map at any level view angle.
Further, according to the rendering completion time point of each level, performing rendering picture interception of each level view angle on the vector map, specifically including:
and at the rendering completion time points of all the levels, respectively intercepting rendering pictures of the corresponding level view angles of the vector map.
Further, before the capturing of the rendered picture of each level view of the vector map, the method further comprises:
determining a rendering picture intercepting sequence of each level view angle of the vector map;
correspondingly, the capturing of the rendering picture of each level view angle of the vector map specifically comprises the following steps:
and according to the rendering picture intercepting sequence, intercepting the rendering pictures of each level view angle of the vector map.
Further, the respective hierarchical views include: national level view, urban level view, and building level view.
In a second aspect, an embodiment of the present invention further provides a dynamic screenshot device based on vector map rendering, including:
The intercepting module is used for intercepting the rendering pictures of each level view angle of the vector map;
And the synthesis module is used for synthesizing the rendering pictures intercepted at each level view angle into dynamic pictures.
In a third aspect, an embodiment of the present invention further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the steps of the vector map rendering-based dynamic screenshot method according to the first aspect when the program is executed.
In a fourth aspect, embodiments of the present invention also provide a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the vector map rendering based dynamic screenshot method of the first aspect.
In a fifth aspect, embodiments of the present invention also provide a computer program product comprising a computer program which, when executed by a processor, implements the steps of the vector map rendering based dynamic screenshot method of the first aspect.
According to the technical scheme, the dynamic screenshot method, the device, the electronic equipment and the storage medium provided by the embodiment of the invention are used for intercepting the rendering pictures of each level view angle of the vector map and synthesizing the rendering pictures intercepted by each level view angle into the dynamic map, so that the intercepting rendering pictures of each level view angle of the vector map are automatically acquired by the processing mode, the purpose of knowing the theme patterns of different level view angles from one rendering picture is achieved, and the problem that the theme patterns of the vector map cannot be completely known by a single screenshot in the prior art is well solved.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The traditional grid tile map has consistent theme displayed at different levels, so that the map theme can be known only by one screenshot when the traditional grid tile map is displayed, and the vector tile map supports independent rendering of map elements such as buildings, roads, POIs, boundaries and the like, so that the design of the pattern displayed at different map levels is different, and the pattern corresponding to the theme cannot be clearly displayed by a single screenshot. Specifically, the embodiment of the invention dynamically intercepts the rendering pictures of each level view angle of the vector map, and synthesizes the rendering pictures intercepted at each level view angle into the dynamic picture, thereby realizing a dynamic screenshot method which is convenient to implement and operates efficiently based on the vector map rendering. By adopting the method, a dynamic diagram (such as a GIF diagram) can be finally generated, and the problem that a single screenshot cannot fully know the design of the theme style is solved. The dynamic screenshot method based on vector map rendering provided by the invention is explained and illustrated in detail by a specific embodiment.
Fig. 1 shows a flowchart of a dynamic screenshot method based on vector map rendering according to an embodiment of the present invention. As shown in fig. 1, the dynamic screenshot method based on vector map rendering according to the embodiment of the present invention includes the following steps:
step 101: intercepting rendering pictures of each level view angle of the vector map;
In this embodiment, in order to solve the problem that a single screenshot in the prior art cannot fully understand the theme style of the vector map, the present embodiment adopts a process of intercepting the rendering pictures of the vector map at each level view angle, so that the intercepted rendering pictures of each level view angle of the vector map can be automatically obtained, and then the processing mode of synthesizing the rendering pictures intercepted at each level view angle into a dynamic picture is combined, so that the purpose of knowing the theme style of different level view angles from one rendering picture can be achieved.
In this embodiment, the view angle of each hierarchy may be a view angle of each map element based on the map elements. The map element here means: the map data includes element information such as country, city, county, region, road surface, ocean, building, green space, and the like. Accordingly, each hierarchical view may be a national hierarchical view, a city hierarchical view, a county hierarchical view, a district hierarchical view, a road hierarchical view, a sea hierarchical view, a building hierarchical view, a green hierarchical view, and so on.
Step 102: and synthesizing the rendered pictures intercepted at each level view into a dynamic picture.
In this embodiment, the rendering pictures taken from the view angles of each level are synthesized into the dynamic graph, so that the purpose of knowing the theme style of the view angles of different levels of the vector map from one rendering picture is achieved.
In this embodiment, the dynamic image may be a dynamic image in GIF format, which is characterized by high compression ratio and less disk space occupation, so that the image format is widely used. The dynamic image of GIF format can store several still images at the same time to form continuous animation, which makes it one of the formats supporting 2D animation.
For example, rendering pictures under the national level view, the urban level view and the building level view can be sequentially intercepted, and then the rendering pictures under the level views are synthesized into a dynamic picture, so that the purpose of simultaneously knowing the theme rendering patterns of the national level view, the urban level view and the building level view from one rendering picture is achieved.
According to the technical scheme, the dynamic screenshot method provided by the embodiment of the invention intercepts the rendering pictures of each level view angle of the vector map and synthesizes the rendering pictures intercepted by each level view angle into the dynamic map, so that the embodiment of the invention automatically acquires the intercepted rendering pictures of each level view angle of the vector map by the processing mode, achieves the purpose of knowing the theme patterns of different level view angles from one rendering picture, and well solves the problem that the theme patterns of the vector map cannot be completely known by a single screenshot in the prior art.
Based on the foregoing embodiments, in this embodiment, the capturing a rendering picture of each level view angle on a vector map specifically includes:
determining rendering completion time points of the vector map at each level view;
and according to the rendering completion time points of each level, intercepting rendering pictures of each level view angle of the vector map.
In this embodiment, when capturing the rendering pictures of each level view angle on the vector map, a key issue is to determine when to perform the screenshot operation of each level view angle, that is, to know the rendering completion time of each level view angle. Therefore, in this embodiment, the capturing of the rendering picture of each level view angle for the vector map includes two parts, the first part is to determine the rendering completion time point of the vector map at each level view angle, and the second part is to capture the rendering picture of each level view angle for the vector map according to the rendering completion time point of each level.
In the present embodiment, there are various implementations for determining the content of the rendering completion time point of the vector map at each hierarchical view with respect to the first portion. For example, ① th implementation: setting a fixed rendering delay for each level view, and then for each level view, after the fixed rendering delay is finished, performing screenshot processing of the corresponding level view. However, this method may have a problem that the fixed time delay is set to perform the screenshot, and the problem that the map tiles of the corresponding level are not completely rendered, and the screenshot is started, so that accuracy is reduced may occur.
In addition, it should be noted that, in addition to the above processing manner of setting a fixed rendering delay for each hierarchical view, the ② th implementation manner may also be adopted: and setting different rendering delays which are adaptive according to the data volume of each layer view angle. For example, for a nationwide hierarchical view, the displayed data content is relatively large, and the adaptive rendering delay can be set to be longer. For a building level perspective, the displayed data content is relatively small, and the adaptive rendering delay can be set to be short. It should be noted that, compared with the processing mode of the fixed rendering time delay, the processing mode can solve the problem of inaccurate screenshot time existing in the fixed rendering time delay to a certain extent.
In addition, in a preferred processing manner, the ③ th implementation manner may also be adopted: and determining the rendering completion time point of the vector map at each level view angle by acquiring a signal of the map rendering completion under each level view angle and taking the signal as a mark. The manner in which the fixed rendering delay is employed or the rendering delay is adapted is referred to with respect to ①-②. According to the ③ th processing mode, the rendering completion time point under each layer view angle can be accurately obtained, so that the accuracy of screenshot under each layer view angle can be greatly improved.
Based on the foregoing embodiments, in this embodiment, determining a rendering completion time point of the vector map at each level view specifically includes:
after receiving an operation instruction for entering any level view angle, generating a mark value corresponding to the any level view angle according to the operation instruction;
Generating a rendering instruction according to the operation instruction, packaging the marking value in the rendering instruction, and then sending the marking value to a rendering processor so that the rendering processor performs rendering processing on vector data of any level view angle;
Receiving a trigger message sent by the rendering processor for informing that the vector data corresponding to any level view is rendered;
judging whether the mark value carried in the trigger message is consistent with the generated mark value corresponding to any level view angle, if so, determining the current time point as the rendering completion time point of the vector map at any level view angle.
In the present embodiment, a specific implementation manner of determining the rendering completion time point of the vector map at each hierarchical view angle is given. Specifically, in this embodiment, after receiving an operation instruction for entering each level view, a flag value corresponding to the level view is generated according to the operation instruction (for example, a variable animated is created to flag the current level view change), then a rendering instruction is generated according to the operation instruction, the flag value is packaged in the rendering instruction and then sent to a rendering processor, so that the rendering processor performs rendering processing on vector data of the level view, after receiving the corresponding rendering instruction, the rendering processor reads the flag value therein and stores the flag value, then performs rendering processing operation on the corresponding level according to the rendering instruction, when the rendering processor finishes rendering processing, a trigger message for notifying that the vector data of the corresponding level view is rendered is sent, and the rendering processor reads the flag value obtained before placing in the trigger message. Therefore, after receiving a trigger message sent by a rendering processor and used for informing that the vector data corresponding to any level view is rendered, judging whether a mark value carried in the trigger message is consistent with a generated mark value corresponding to any level view, if so, indicating that the rendering work of the corresponding level is completed, and determining that the current time point is the rendering completion time point of the vector map at the corresponding level view.
The dynamic screenshot method provided in this embodiment is explained and illustrated in detail below in conjunction with fig. 2. As shown in fig. 2, when the map view changes (from one hierarchical view to another), a variable animated is created to mark the current change in the hierarchical view, the vector tile layer calculates the tile data required for this change, and the map is then loaded with tile data. After the data is loaded, an event is triggered loadedData, after the vector tile layer receives the event, whether the animated mark is consistent with the mark transmitted before is judged, if so, the map rendering of the change is considered to be finished, a screenshot operation can be performed, otherwise, the triggering of the next event is waited, and the abnormal is prompted when the timeout is over, and the screenshot is needed to be restarted. In this way, the corresponding pictures are taken at the corresponding levels, and the GIF picture is finally synthesized.
Based on the foregoing embodiments, in this embodiment, according to the rendering completion time point of each level, performing rendering picture interception of each level view angle on the vector map specifically includes:
and at the rendering completion time points of all the levels, respectively intercepting rendering pictures of the corresponding level view angles of the vector map.
In this embodiment, it is to be noted that, after the rendering completion time points of each level are determined in the above embodiments, rendering pictures of corresponding level views are directly taken from the vector map at the rendering completion time points of each level, so that a picture rendered at the corresponding level is accurately obtained, and thus the picture can accurately represent style subjects of the corresponding level.
Based on the foregoing embodiment, in this embodiment, before performing the rendering picture interception of each level view angle on the vector map, the method further includes:
determining a rendering picture intercepting sequence of each level view angle of the vector map;
correspondingly, the capturing of the rendering picture of each level view angle of the vector map specifically comprises the following steps:
and according to the rendering picture intercepting sequence, intercepting the rendering pictures of each level view angle of the vector map.
In this embodiment, when capturing the rendered pictures of each level view, the screenshot process may be performed according to a preset order. For example, the screenshot process may be performed in the order of national level view, city level view, and building level view. When the screenshot is processed according to the set hierarchy sequence, it is necessary to judge when to enter which hierarchy view one by one, and then to intercept the rendering pictures of each hierarchy view for the vector map.
FIG. 3 is a complete flow of dynamic screenshots for vector map-based rendering. Fig. 3 illustrates the process of taking shots in the order of national level view, city level view, and building level view. When a user sends a screenshot instruction, the map is firstly animated to a national viewing angle, a animated mark is created, and then the vector tile layer calculates tile data required by the change, wherein the vector tile layer can adopt the following processing procedure when calculating the required tile data: A. determining a trapezoid bounding box range (also called a visible area) of the window through an intersection point of the camera viewing cone and the XOZ plane; B. calculating coordinates of the range of the trapezoid bounding box; C. calculating pyramid tiles at four corners according to coordinates of the trapezoid bounding box range to obtain a tile pyramid bounding box range; D. and calculating the index of the current window tile according to the tile pyramid bounding box.
Then, after the vector tile layer calculates the required tile data, the tile data is loaded, after the data is loaded, a loadedData event is triggered, after the vector tile layer receives the event, whether the animated mark is consistent with the mark which is input before is judged, if so, the map rendering of the change is considered to be finished, the screenshot operation can be performed, otherwise, the triggering of the next event is waited, the abnormal condition is prompted when the timeout is over, and the screenshot is needed to be restarted. After the screenshot operation is finished, judging whether the current view angle is the building level, if not, judging whether the current level is the city view angle, if not, performing the screenshot operation of the city view angle, and if true, performing the screenshot operation of the building level. If the current view angle is the building level, the screenshot operation is considered to be completed, and the truncated picture is synthesized into a final GIF picture according to the level data, so that the purpose of knowing the theme designs of different view angles from one picture is achieved. When the final GIF picture is synthesized from the truncated picture according to the hierarchical data, the final GIF picture may be sequentially tiled in the order of the national hierarchical view, the urban hierarchical view, and the building hierarchical view.
As can be seen from the above description, the present embodiment provides a dynamic screenshot method, which firstly obtains rendering shots of each level view, and then synthesizes the captured pictures into a final GIF picture according to the level data, so as to achieve the purpose of knowing the theme style of different view from one picture. In addition, the embodiment also provides a dynamic screenshot method driven based on the event of ending the rendering of the vector map, compared with a method for setting larger time delay to screen, the dynamic screenshot method based on the rendering of the vector map greatly improves the accuracy of screen capturing by taking the event as a drive through acquiring the signal of ending the rendering of the map (setting the time delay to screen, the screen capturing is started when map tiles are not completely rendered frequently, the accuracy is reduced), and redundant waiting time is removed, so that the operation is efficient and convenient. Therefore, the method and the device for dynamically driving the screenshot according to the rendering end event in each layer by adopting the thought of the view screenshot in each layer in combination well solve the problem that a single screenshot cannot fully know the design of the theme style.
Fig. 4 shows a schematic structural diagram of a dynamic screenshot device based on vector map rendering according to an embodiment of the present invention. As shown in fig. 4, the dynamic screenshot device based on vector map rendering provided in this embodiment includes: an interception module 21 and a synthesis module 22, wherein:
The intercepting module 21 is used for intercepting the rendering pictures of each level view angle of the vector map;
the synthesizing module 22 is configured to synthesize the rendered pictures taken from the view angles of the respective layers into a dynamic graph.
Based on the content of the foregoing embodiment, in this embodiment, the interception module 21 is specifically configured to:
determining rendering completion time points of the vector map at each level view;
and according to the rendering completion time points of each level, intercepting rendering pictures of each level view angle of the vector map.
Based on the foregoing embodiments, in this embodiment, the intercepting module 21 is specifically configured to, when determining a rendering completion time point of the vector map at each level view:
after receiving an operation instruction for entering any level view angle, generating a mark value corresponding to the any level view angle according to the operation instruction;
Generating a rendering instruction according to the operation instruction, packaging the marking value in the rendering instruction, and then sending the marking value to a rendering processor so that the rendering processor performs rendering processing on vector data of any level view angle;
Receiving a trigger message sent by the rendering processor for informing that the vector data corresponding to any level view is rendered;
judging whether the mark value carried in the trigger message is consistent with the generated mark value corresponding to any level view angle, if so, determining the current time point as the rendering completion time point of the vector map at any level view angle.
Based on the foregoing embodiments, in this embodiment, the capturing module 21 is specifically configured to, when performing, according to a rendering completion time point of each level, capturing a rendering picture of each level view of the vector map:
and at the rendering completion time points of all the levels, respectively intercepting rendering pictures of the corresponding level view angles of the vector map.
Based on the content of the above embodiment, in this embodiment, before the capturing module 21 captures the rendered picture of each level view angle of the vector map, the method is further used for:
determining a rendering picture intercepting sequence of each level view angle of the vector map;
accordingly, the intercepting module 21 is specifically configured to, when intercepting the rendered picture of each level view angle of the vector map:
and according to the rendering picture intercepting sequence, intercepting the rendering pictures of each level view angle of the vector map.
Based on the content of the foregoing embodiments, in this embodiment, the respective hierarchical perspectives include: national level view, urban level view, and building level view.
The dynamic screenshot device based on vector map rendering provided by the embodiment of the invention can be used for executing the dynamic screenshot method based on vector map rendering described in the above embodiment, and the working principle and the beneficial effects are similar, so that the detailed description is omitted herein, and the specific content can be referred to the description of the above embodiment.
In this embodiment, it should be noted that, each module in the apparatus of the embodiment of the present invention may be integrated into one body, or may be separately deployed. The modules can be combined into one module or further split into a plurality of sub-modules.
Based on the same inventive concept, a further embodiment of the present invention provides an electronic device, see fig. 5, comprising in particular: a processor 301, a memory 302, a communication interface 303, and a communication bus 304;
Wherein, the processor 301, the memory 302, and the communication interface 303 complete communication with each other through the communication bus 304;
The processor 301 is configured to invoke a computer program in the memory 302, where the processor executes the computer program to implement all the steps of the dynamic screenshot method based on vector map rendering, for example, the processor executes the computer program to implement the following procedures: intercepting rendering pictures of each level view angle of the vector map; and synthesizing the rendered pictures intercepted at each level view into a dynamic picture.
It will be appreciated that the refinement and expansion functions that the computer program may perform are as described with reference to the above embodiments.
Based on the same inventive concept, a further embodiment of the present invention provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements all the steps of the above-described vector map rendering based dynamic screenshot method, for example, the processor implements the following procedure when executing the computer program: intercepting rendering pictures of each level view angle of the vector map; and synthesizing the rendered pictures intercepted at each level view into a dynamic picture. It will be appreciated that the refinement and expansion functions that the computer program may perform are as described with reference to the above embodiments.
Based on the same inventive concept, a further embodiment of the present invention provides a computer program product comprising a computer program which, when executed by a processor, implements all the steps of the above-mentioned associated application launch control method, for example, the processor implementing the following procedure when executing the computer program: intercepting rendering pictures of each level view angle of the vector map; and synthesizing the rendered pictures intercepted at each level view into a dynamic picture. It will be appreciated that the refinement and expansion functions that the computer program may perform are as described with reference to the above embodiments.
It will be appreciated that the refinement and expansion functions that the computer program may perform are as described with reference to the above embodiments.
Further, the logic instructions in the memory described above may be implemented in the form of software functional units and stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules can be selected according to actual needs to achieve the purpose of the embodiment of the invention. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on such understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the vector map rendering-based dynamic screenshot method of the various embodiments or some parts of the embodiments.
Moreover, in the present invention, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Furthermore, in the present disclosure, descriptions of the terms "one embodiment," "some embodiments," "examples," "particular examples," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present disclosure. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.