CN116704105A - Scribing rendering method, scribing rendering device, scribing rendering equipment and storage medium - Google Patents
Scribing rendering method, scribing rendering device, scribing rendering equipment and storage medium Download PDFInfo
- Publication number
- CN116704105A CN116704105A CN202310667158.3A CN202310667158A CN116704105A CN 116704105 A CN116704105 A CN 116704105A CN 202310667158 A CN202310667158 A CN 202310667158A CN 116704105 A CN116704105 A CN 116704105A
- Authority
- CN
- China
- Prior art keywords
- current
- scribing
- rendering
- image
- result
- 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.)
- Pending
Links
- 238000009877 rendering Methods 0.000 title claims abstract description 173
- 238000000034 method Methods 0.000 title claims abstract description 58
- 230000000694 effects Effects 0.000 claims abstract description 76
- 238000010586 diagram Methods 0.000 claims abstract description 43
- 230000004044 response Effects 0.000 claims abstract description 17
- 238000004590 computer program Methods 0.000 claims description 4
- 239000000758 substrate Substances 0.000 claims 1
- 230000003287 optical effect Effects 0.000 description 6
- 230000008569 process Effects 0.000 description 6
- 230000006870 function Effects 0.000 description 4
- 238000002372 labelling Methods 0.000 description 4
- 230000008901 benefit Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 238000000926 separation method Methods 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000015572 biosynthetic process Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 229920001690 polydopamine Polymers 0.000 description 1
- 230000008707 rearrangement Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000003786 synthesis reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
- G06T15/10—Geometric effects
- G06T15/20—Perspective computation
- G06T15/205—Image-based rendering
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/20—Analysis of motion
- G06T7/246—Analysis of motion using feature-based methods, e.g. the tracking of corners or segments
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Geometry (AREA)
- Computer Graphics (AREA)
- Multimedia (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Processing Or Creating Images (AREA)
Abstract
The embodiment of the invention discloses a scribing rendering method, a scribing rendering device, scribing rendering equipment and a storage medium, and relates to the field of image processing, wherein the scribing rendering method comprises the following steps: determining a scribing track in response to a scribing operation of a user in a background image; determining a current track section of the scribing track and a current drawing area corresponding to the current track section based on a set number of character intervals; drawing a scribing pattern corresponding to the current track segment in the transparent image to obtain a current drawing result; and overlapping the scribing patterns in the rendering results corresponding to the current drawing results to the current drawing areas of the target image to obtain a current overlapping effect diagram, wherein the target image is the background image or the previous overlapping effect diagram. By adopting the technical scheme provided by the embodiment of the invention, the problem of unstable scribing rendering speed in the prior art can be solved.
Description
Technical Field
The embodiment of the invention relates to the technical field of image processing, in particular to a scribing rendering method, a scribing rendering device, scribing rendering equipment and a storage medium.
Background
The existing mobile terminal reading application can basically realize the function of marking the reading content, and marking marks include but are not limited to fluorescent pens, wavy lines and marking lines with different colors.
For image rendering in the scribing process, in the prior art, scribing content is usually drawn on a background image, then the scribing content is rendered to generate a rendering result, and the rendering result is sent to a video memory for display.
However, in the process of implementing the present invention, the inventor finds that in the prior art, when the content of scribing is more or the scribing pattern is complex, the page image data of each frame to be rendered is more, and the problem of serious reduction of the scribing rendering speed is easy to occur.
Disclosure of Invention
The embodiment of the invention provides a scribing rendering method, a scribing rendering device, scribing rendering equipment and a storage medium, which are used for solving the problem that the conventional scribing rendering speed is unstable.
In a first aspect, an embodiment of the present invention provides a scribe line rendering method, where the method includes:
determining a scribing track in response to a scribing operation of a user in a background image;
determining a current track section of the scribing track and a current drawing area corresponding to the current track section based on a set number of character intervals;
drawing a scribing pattern corresponding to the current track segment in the transparent image to obtain a current drawing result;
and overlapping the scribing patterns in the rendering results corresponding to the current drawing results to the current drawing areas of the target image to obtain a current overlapping effect diagram, wherein the target image is the background image or the previous overlapping effect diagram.
In a second aspect, an embodiment of the present invention further provides a scribe line rendering apparatus, including:
the track module is used for determining a scribing track in response to scribing operation of a user in the background image;
the area determining module is used for determining a current track section of the scribing track and a current drawing area corresponding to the current track section based on the set number of character intervals;
the drawing module is used for drawing a scribing pattern corresponding to the current track segment in the transparent image so as to obtain a current drawing result;
and the effect diagram module is used for superposing the scribing patterns in the rendering results corresponding to the current rendering results to the current rendering area of the target image so as to obtain a current superposition effect diagram, wherein the target image is the background image or the previous superposition effect diagram.
In a third aspect, an embodiment of the present invention provides an electronic device, including:
one or more processors;
a memory for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the scribe line rendering method as provided by any embodiment of the present invention.
In a fourth aspect, embodiments of the present invention also provide a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a scribe line rendering method as provided by any of the embodiments of the present invention.
The embodiments of the above invention have the following advantages or benefits:
in the process of scribing operation in a background image, a user draws a scribing pattern corresponding to the scribing operation in a transparent image and superimposes a rendering result corresponding to the scribing pattern on the background image or a previous superimposed effect image to obtain a current superimposed effect image.
Drawings
Fig. 1 is a schematic flow chart of a scribe line rendering method according to an embodiment of the present invention;
FIG. 2 is a flow chart of another scribe line rendering method according to an embodiment of the present invention;
FIG. 3 is a flowchart of another scribe line rendering method according to an embodiment of the present invention;
FIG. 4 is a flowchart of another scribe line rendering method according to an embodiment of the present invention;
FIG. 5 is a flowchart of another scribe line rendering method according to an embodiment of the present invention;
FIG. 6 is a flowchart of another scribe line rendering method according to an embodiment of the present invention;
fig. 7A is a schematic structural diagram of a scribe line rendering device according to an embodiment of the present invention;
fig. 7B is a schematic structural diagram of another scribe line rendering device according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Fig. 1 is a flowchart of a scribing rendering method according to an embodiment of the present invention, where the embodiment may be suitable for displaying, in real time, a scribing result corresponding to a scribing operation performed by a user in a background image. The method may be performed by a scribe line rendering device integrated in an electronic device, which may be implemented in software and/or hardware. As shown in fig. 1, the method specifically includes the following steps:
S110, determining a scribing track in response to scribing operation of a user in the background image.
The scribing operation may be a scribing operation performed by a user in a touch manner, or may be a scribing operation performed by a user in a manner of dragging a mouse in an operating state. The touch mode may be a finger touch mode, a touch mode corresponding to a stylus, or the like.
The application takes the scribing operation as an example of scribing operation executed by a user on a terminal display screen in a touch mode to carry out the detailed description of the technical scheme.
The background image is a text image read by a user, and the format of the text image can be PDF format or image format, wherein the image format can be selected from TIFF format, JPEG format and the like.
When a user marks a certain line of characters on a background image displayed on the terminal, the user only needs to use a finger to execute a marking operation on the line of characters displayed on the display screen of the terminal, for example, the finger slides from one end to the other end of the line of characters displayed on the display screen. And the processor determines a scribing track corresponding to the scribing operation by detecting the touch track of the finger on the display screen in real time, namely the scribing track corresponds to the touch track of the user on the terminal display screen.
S120, determining a current track section of the scribing track and a current drawing area corresponding to the current track section based on the set number of character intervals.
Wherein the set number may be set according to the speed requirement of the real-time display, such as one, two or three. It can be understood that, in the case of setting the number to 1, the user sees the fastest updating speed of the scribing result, and the user experience is the best.
The current drawing area is an area of the current track segment corresponding to the drawing pattern in the background image.
In order to display the scribing effect in real time in the scribing process, the embodiment divides the scribing track into a plurality of track segments in real time based on the number of character rectangular frames corresponding to the scribing track, and determines that each track segment corresponds to a current drawing area, and specifically includes:
and a1, determining a character rectangular frame set corresponding to the scribing track.
Each character is placed in the rectangular box of the character in which it is located. The scribing track is usually drawn below a certain line of characters or on a certain line of characters, so after the scribing track is determined, a rectangular box set of characters corresponding to the scribing track can be determined.
And a2, taking the area corresponding to the character rectangular frames with the latest set number as the current drawing area under the condition that the number of the character rectangular frames in the character rectangular frame set reaches N times of the set number, wherein N is a positive integer greater than or equal to 1.
The latest set number of character rectangular frames can be understood as m×n-m× (N-1), where M is the number of a set of character rectangular frames, N is a multiple of M, and its value is greater than or equal to 1.
The latest set number of character rectangular boxes corresponds to the current track segment, so that the area where the latest set number of character rectangular boxes are located is taken as the current drawing area.
In one embodiment, in the case where the scribing operation is ended, the number of character rectangular boxes corresponding to the last track segment of the scribing track may be configured to be less than or equal to M. And under the condition that the scribing operation is not finished, the number of the character rectangular frames corresponding to any track segment is M.
And S130, drawing a scribing pattern corresponding to the current track segment in the transparent image to obtain a current drawing result.
Drawing a scribing pattern corresponding to the current track segment onto the transparent image by:
and b, obtaining a scribing pattern type corresponding to scribing operation.
And c, drawing a scribing pattern determined based on the scribing pattern type and the current track segment in the transparent image to obtain a current drawing result.
When marking and labeling the background image, a user selects a labeling mode, and then marks one or more lines of characters in the background image in the labeling mode, wherein different labeling modes correspond to different marking pattern types.
A scribe pattern is thus determined from the pattern type and the current track segment, and then drawn in the background image to obtain the current background image.
And S140, overlapping the scribing patterns in the rendering result corresponding to the current rendering result to the current rendering area of the target image to obtain a current overlapping effect diagram, wherein the target image is a background image or a previous overlapping effect diagram.
The scribing pattern in the rendering result refers to the scribing pattern after rendering.
In one embodiment, the size of the transparent image is greater than or equal to the size of the current drawing area. And after a rendering result corresponding to the current rendering result is obtained, overlapping the scribing pattern in the rendering result to the current rendering area of the target image to obtain a current overlapping effect diagram. The rendered scribing pattern in the current superposition effect map corresponds to the current track segment corresponding to the scribing operation in the background image.
And when the drawing result is detected, determining a rendering result corresponding to the drawing result. Because the transparent background image only comprises the scribing pattern, when the transparent background image is subjected to image rendering, the rendering data is less, and the rendering speed is higher.
When the current drawing area is the first drawing area corresponding to the scribing track, the scribing pattern in the rendering result is overlapped to the current drawing area in the background image to obtain a corresponding overlapped effect diagram; and when the current drawing area is not the first drawing area corresponding to the scribing track, overlapping the scribing pattern in the rendering result to the current drawing area in the previous overlapping effect diagram to obtain a corresponding overlapping effect diagram. The superimposed effect graph is an accumulated effect image, and as the scribing operation is carried out, the superimposed rendering result of the superimposed effect graph is more and more, so that along with the change of the superimposed effect graph, a user can know the scribing effect graph corresponding to the scribing operation in real time.
According to the technical scheme of the scribing rendering method, the scribing result is determined by drawing the scribing pattern on the transparent image, and the data processing amount during image rendering is reduced by determining the rendering result corresponding to the scribing result; and overlapping the scribing patterns in the rendering result to the corresponding positions of the current drawing area in the background image or the previous overlapping effect image to obtain a current overlapping effect image, and enabling a user to know the scribing effect corresponding to the scribing operation through the current overlapping effect image.
Fig. 2 is a flowchart of another scribe line rendering method according to an embodiment of the present invention. As shown in fig. 2, the method includes:
s210, determining a scribing track in response to scribing operation of a user in the background image.
S220, determining a current track section of the scribing track and a current drawing area corresponding to the current track section based on the set number of character intervals.
And S230, drawing a scribing pattern corresponding to the current track segment in the transparent image to obtain a current drawing result.
S240, overlapping the scribing patterns in the rendering result corresponding to the current rendering result to the current rendering area of the target image to obtain a current overlapping effect diagram, wherein the target image is a background image or a previous overlapping effect diagram.
S250, responding to the scribing ending operation of the user in the background image, and determining the total drawing area corresponding to the scribing track.
When the scribing operation end signal is detected, the sum of all the drawing areas corresponding to the scribing track is taken as the total drawing area.
And S260, drawing a total scribing pattern corresponding to the scribing track in the total drawing area of the background image to obtain a total drawing result.
And after the total drawing area is determined, drawing a total scribing pattern corresponding to the total scribing track in the total drawing area of the background image to obtain a total drawing result. That is, in the present embodiment, only after the scribing operation is completed, the total scribing pattern corresponding to the total scribing track may be drawn in the total scribing area of the background image.
In one embodiment, after the total drawing area is determined, a total scribing pattern is determined based on the scribing type corresponding to the scribing operation and the total scribing track, and the total scribing pattern is drawn in the total drawing area of the background image to obtain a total drawing result.
And S270, performing image rendering on the total drawing result to update the background image.
In one embodiment, the total rendering result is rendered by a processor to update the background image. Because the display memory currently outputs the current superposition effect diagram corresponding to the updated background image, no matter how much time is spent by the processor in rendering the image with the total drawing result, the satisfaction degree of the user on the scribing rendering function of the terminal is not affected.
In one embodiment, the total drawing result is sent to the video memory for image rendering by the video memory to update the background image. Because the video memory has higher image rendering speed, the updating speed of the background image is improved by performing image rendering on the total drawing result through the video memory, so that the video memory can more quickly replace the current superposition effect graph by using the updated background image.
In one embodiment, after the background image is updated, in the case where the scribing operation is detected, the updated background image is taken as the current background image.
It will be appreciated that the display memory always displays the current overlay effect map during the time that S250-S270 are performed.
S280, displaying the updated background image.
When the updated background image is detected, the updated background image is used for replacing the current superposition effect map.
According to the embodiment of the invention, only after the scribing operation is finished, the total scribing pattern corresponding to the scribing track is drawn in the total drawing area of the background image to obtain the total drawing result, and the total drawing result is subjected to image rendering to update the background image, namely, the scribing pattern on the background image is subjected to image rendering once in one scribing operation, and the drawing pattern drawn on the transparent image is subjected to image rendering once in the rest, and in the process of carrying out image rendering on the scribing pattern in the background image, the display memory always outputs a current superposition effect image with the same visual effect as the updated background image, so that the time spent for carrying out image rendering on the scribing pattern in the background image is not influenced no matter how long the time is.
Fig. 3 is a flowchart of another scribe line rendering method according to an embodiment of the present invention. As shown in fig. 3, the method includes:
s310, determining a scribing track in response to scribing operation of a user in the background image.
S320, determining a current track section of the scribing track and a current drawing area corresponding to the current track section based on the set number of character intervals.
S3301, when the current drawing area is the first drawing area corresponding to the scribing track, a transparent image capable of covering the background image is created.
And if the current drawing area is the first drawing area corresponding to the scribing operation, creating a transparent image capable of covering the background image in response to the generation of the current drawing area. Illustratively, a transparent image of the same size as the background image is created.
It will be appreciated that overlaying the transparent image over the background image may display the information of the background image in its entirety.
S3302, drawing a scribing pattern corresponding to the current track segment in the current drawing area of the transparent image to obtain an initial drawing result.
After the transparent image is determined, determining the position of the current drawing area in the transparent image, and drawing a scribing pattern corresponding to the current track segment in the area to obtain an initial drawing result. Compared with the process of drawing the scribing pattern corresponding to the scribing operation on the background image, the separation of the scribing pattern and the background image is realized, and the technical effect of greatly reducing the image rendering data volume is achieved through the separation.
S3303, a part of transparent image comprising the scribing pattern is cut from the initial drawing result, so that the current drawing result is obtained.
Since the current drawing result is a partially transparent image including the scribe line pattern cut from the initial drawing result, the subsequent image rendering of the current drawing result can further reduce the amount of image rendering data, thereby further improving the image rendering speed.
In one embodiment, a part of the transparent image including the scribe line pattern, which is cut out from the initial drawing result, is taken as the current drawing result, and the rest of the transparent image is taken as the rest of the transparent image. And creating a transparent image capable of covering the background image only when the current drawing area is the first drawing area corresponding to the scribing track, and drawing scribing patterns corresponding to the corresponding track sections in the remaining transparent image when the current drawing area is the non-first drawing area corresponding to the scribing track.
And S340, overlapping the scribing patterns in the rendering result corresponding to the current rendering result to the current rendering area of the target image to obtain a current overlapping effect diagram, wherein the target image is a background image or a previous overlapping effect diagram.
According to the embodiment of the invention, the partial transparent image comprising the scribing pattern corresponding to the scribing operation is intercepted from the transparent background image to obtain the scribing result, so that the data processing amount during image rendering is greatly reduced, and the image rendering speed and the real-time performance of scribing effect display are greatly improved.
Fig. 4 is a flowchart of another scribe line rendering method according to an embodiment of the present invention. As shown in fig. 4, the method includes:
s410, determining a scribing track in response to scribing operation of a user in the background image.
S420, determining a current track section of the scribing track and a current drawing area corresponding to the current track section based on the set number of character intervals.
S4301, creating a transparent image that can cover the current drawing area.
In one embodiment, the transparent image is the same size as the current rendering region. In another embodiment, the size of the transparent image is larger than the size of the current rendering area, such as the same size as the background image.
Since it is easier to generate transparent images of the same size for each current rendering region, in one embodiment, transparent images of the same size as the background image are created in response to the generation of the current rendering region.
S4302, drawing a scribing pattern corresponding to the current track segment in the current drawing area in the transparent image to obtain an initial drawing result.
In one embodiment, the size of the transparent image is larger than the size of the current rendering area, e.g., the same as the size of the background image. And drawing a scribing pattern corresponding to the current track segment on the transparent image to obtain an initial drawing result. The drawing result includes a scribe pattern region and a blank region.
S4303, intercepting part of the transparent image comprising the scribing pattern from the initial drawing result to obtain the current drawing result.
Under the condition that the size of the transparent image is larger than that of the current drawing area, intercepting part of the transparent image comprising the scribing pattern from the initial drawing result to obtain the current drawing result; in the case where the size of the transparent image is equal to the size of the current drawing area, the initial drawing result is taken as the current drawing result.
S440, overlapping the scribing patterns in the rendering result corresponding to the current rendering result to the current rendering area of the target image to obtain a current overlapping effect diagram, wherein the target image is a background image or a previous overlapping effect diagram.
According to the embodiment of the invention, the transparent image is created under the condition that the current drawing area is detected to be generated each time, so that the drawing pattern can be drawn in any area of the transparent image, and after the drawing of the scribing pattern is completed, a corresponding drawing result can be obtained, and the generation speed of the drawing result is improved.
Fig. 5 is a flowchart of another scribe line rendering method according to an embodiment of the present invention. As shown in fig. 5, the method includes:
s510, determining a scribing track in response to scribing operation of a user in the background image.
S520, determining a current track section of the scribing track and a current drawing area corresponding to the current track section based on the set number of character intervals.
And S530, drawing a scribing pattern corresponding to the current track segment in the transparent image to obtain a current drawing result.
S540, sending the current drawing result to a video memory, determining a rendering result corresponding to the current drawing result by the video memory, and overlapping a scribing pattern in the rendering result to a current drawing area in a target image to obtain a current overlapping effect image, wherein the target image is a background image or a previous overlapping effect image.
After the current drawing result is determined, the current drawing result is sent to a video memory, so that the current drawing result is subjected to image rendering by the video memory to obtain a rendering result, and then a scribing pattern in the rendering result is overlapped to a current drawing area of a background image or a current drawing area in a previous overlapped effect image. Because the current drawing result only comprises drawing patterns and the video memory has higher image rendering speed, the current drawing result is subjected to image rendering by adopting the video memory, and the rendering speed of the drawing patterns can be further improved, so that the generation speed of the superposition effect graph and the satisfaction degree of user experience are improved.
In one embodiment, the current drawing result is sent to the video memory, so that the video memory performs image rendering on the current drawing result by using an OpenGL ES method and a GPU (Graphics Processing Unit, graphics processor) to obtain a rendering result, a drawing pattern of the rendering result is superimposed on a current drawing area of the target image, and then an image synthesis operation is performed to obtain a current superimposed effect map. Among them, openGL ES (OpenGL for Embedded Systems) is a subset of three-dimensional graphics API (interface) OpenGL, and is designed for embedded devices such as mobile phones, PDAs (palm computers), game hosts, and the like.
The embodiment of the invention utilizes the high image rendering performance of the video memory to render the current manufacturing result, and can further improve the image rendering speed, thereby improving the updating speed of the superposition effect graph and the satisfaction degree of user experience.
Fig. 6 is a flowchart of another scribe line rendering method according to an embodiment of the present invention. As shown in fig. 6, the method includes:
s610, determining a scribing track in response to scribing operation of a user in the background image.
S620, determining a current track section of the scribing track and a current drawing area corresponding to the current track section based on the set number of character intervals.
And S630, drawing a scribing pattern corresponding to the current track segment in the transparent image to obtain a current drawing result.
S6401, performing image rendering on the current drawing result to obtain a rendering result.
The embodiment adopts a processor to carry out image rendering on the current drawing result so as to obtain a rendering result. Because the current drawing result only comprises the scribing patterns, the data size is smaller, the speed of image rendering by adopting the processor is higher, and correspondingly, the generation speed of the superposition effect graph is higher.
S6402, sending the rendering result to a video memory, and overlapping the scribing pattern in the rendering result to the current drawing area of the target image by the video memory to obtain a current overlapping effect diagram, wherein the target image is a background image or a previous overlapping effect diagram.
After the rendering result is determined, the rendering result is sent to the video memory, so that the rendering pattern of the rendering result is overlapped to the current rendering area of the background image or the current rendering area of the previous overlapped effect image by the video memory.
In the embodiment of the invention, the drawing result only comprises the scribing pattern, so that the data size is smaller, the image rendering speed is higher when the processor is adopted to render the image, and correspondingly, the generation speed of the superposition effect graph is higher.
The following is an embodiment of a scribe line rendering device provided by the embodiment of the present invention, which belongs to the same inventive concept as the scribe line rendering method of the first embodiment, and details of the embodiment of the scribe line rendering device, which are not described in detail, may be referred to the content of the embodiments.
Fig. 7A is a schematic structural diagram of a scribing rendering device according to an embodiment of the present invention. As shown in fig. 7A, the apparatus includes:
a trajectory module 71 for determining a scribing trajectory in response to a scribing operation of a user in a background image;
a region determining module 72, configured to determine a current track segment of the scribing track and a current drawing region corresponding to the current track segment based on a set number of character intervals;
a drawing module 73, configured to draw a scribe line pattern corresponding to the current track segment in the transparent image to obtain a current drawing result;
and an effect map module 74, configured to superimpose a scribe line pattern in a rendering result corresponding to the current rendering result onto the current rendering area of a target image, so as to obtain a current superimposed effect map, where the target image is the background image or a previous superimposed effect map.
In one embodiment, in a case where the current drawing area is a first drawing area corresponding to the scribing track, the target image is the background image; and under the condition that the current drawing area is a non-first drawing area corresponding to the scribing track, the target image is a previous superposition effect diagram.
In one embodiment, as shown in fig. 7B, the apparatus further comprises:
a total drawing area module 75, configured to determine a total drawing area corresponding to the scribing track in response to a scribing ending operation of the user in the background image;
a total drawing result module 76 for drawing a total scribe pattern corresponding to the scribe line locus in the total drawing area of the background image to obtain a total drawing result;
an updating module 77, configured to perform image rendering on the total drawing result to update the background image;
and a display module 78, configured to display the updated background image.
In one embodiment, the area determining module is specifically configured to determine a set of character rectangular boxes corresponding to the scribing track; and under the condition that the number of the character rectangular frames in the character rectangular frame set reaches N times of the set number, taking the area corresponding to the latest character rectangular frames with the set number as the current drawing area, wherein N is a positive integer greater than or equal to 1.
In one embodiment, the apparatus further comprises:
the transparent image module is used for creating a transparent image capable of covering the background image under the condition that the current drawing area is the first drawing area corresponding to the scribing track;
The drawing module is used for drawing a scribing pattern corresponding to the current track segment in the current drawing area in the transparent image so as to obtain an initial drawing result; and intercepting part of the transparent image comprising the scribing pattern from the updated transparent image so as to obtain a current drawing result.
In one embodiment, the drawing module is specifically configured to:
creating a transparent image that can cover the current drawing area;
and drawing a scribing pattern corresponding to the current track segment on the transparent image to obtain a current drawing result.
In one embodiment, the effect graph module is specifically configured to:
and sending the drawing result to a video memory to determine a rendering result corresponding to the current drawing result by the video memory, and overlapping a scribing pattern in the rendering result to the current drawing area in the target image to obtain a current overlapping effect diagram.
In one embodiment, the effect graph module is specifically configured to:
performing image rendering on the current drawing result to obtain a rendering result;
and sending the rendering result to a video memory, so that the video memory can be used for superposing the scribing patterns in the rendering result to the current drawing area of the target image to obtain a current superposition effect diagram.
In one embodiment, the drawing module is specifically configured to:
obtaining a scribing pattern type corresponding to the scribing operation;
and drawing a scribing pattern determined based on the scribing pattern type and the current track segment in the transparent image so as to obtain a current drawing result.
According to the embodiment of the invention, the current superposition effect image is obtained by drawing the scribing pattern corresponding to the scribing operation in the transparent image and superposing the rendering result corresponding to the scribing pattern to the background image or the previous superposition effect image, and because the image rendering is only related to the scribing pattern in the transparent image and is irrelevant to the content of the background image, the data processing amount of the image rendering can be always kept at a lower value, so that the image rendering speed is always kept at a higher value, and the user obtains the scribing effect corresponding to the current scribing operation in real time through the current superposition effect image updated in real time, thereby having better user experience.
The scribing rendering device provided by the embodiment of the invention can execute the scribing rendering method provided by the first embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the scribing rendering method.
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. Fig. 8 shows a block diagram of an exemplary server 12 suitable for use in implementing embodiments of the present invention. The server 12 shown in fig. 8 is merely an example, and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in fig. 8, the server 12 is in the form of a general purpose computing device. The components of server 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, a bus 18 that connects the various system components, including the system memory 28 and the processing units 16.
Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, and a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Server 12 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by server 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 30 and/or cache memory 32. The server 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 8, commonly referred to as a "hard disk drive"). Although not shown in fig. 8, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 18 through one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of the embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored in, for example, system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 42 generally perform the functions and/or methods of the embodiments described herein.
The server 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the server 12, and/or any devices (e.g., network card, modem, etc.) that enable the server 12 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 22. Also, the server 12 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, via a network adapter 20. As shown, network adapter 20 communicates with the other modules of server 12 via bus 18. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with server 12, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processing unit 16 executes various functional applications and data processing by running a program stored in the system memory 28, for example, implementing a scribe line rendering method step provided in the first embodiment of the present invention, the method includes:
determining a scribing track in response to a scribing operation of a user in a background image;
determining a current track section of the scribing track and a current drawing area corresponding to the current track section based on a set number of character intervals;
drawing a scribing pattern corresponding to the current track segment in the transparent image to obtain a current drawing result;
and overlapping the scribing patterns in the rendering results corresponding to the current drawing results to the current drawing areas of the target image to obtain a current overlapping effect diagram, wherein the target image is the background image or the previous overlapping effect diagram. Of course, those skilled in the art will understand that the processor may also implement the technical solution of the scribe line rendering method provided in any embodiment of the present invention.
The present embodiment provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a scribe line rendering method step as provided in the foregoing embodiment of the present invention, the method comprising:
Determining a scribing track in response to a scribing operation of a user in a background image;
determining a current track section of the scribing track and a current drawing area corresponding to the current track section based on a set number of character intervals;
drawing a scribing pattern corresponding to the current track segment in the transparent image to obtain a current drawing result;
and overlapping the scribing patterns in the rendering results corresponding to the current drawing results to the current drawing areas of the target image to obtain a current overlapping effect diagram, wherein the target image is the background image or the previous overlapping effect diagram. The computer storage media of embodiments of the invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium may be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present invention may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
It will be appreciated by those of ordinary skill in the art that the modules or steps of the invention described above may be implemented in a general purpose computing device, they may be centralized on a single computing device, or distributed over a network of computing devices, or they may alternatively be implemented in program code executable by a computer device, such that they are stored in a memory device and executed by the computing device, or they may be separately fabricated as individual integrated circuit modules, or multiple modules or steps within them may be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.
Claims (12)
1. A scribe line rendering method, the method comprising:
determining a scribing track in response to a scribing operation of a user in a background image;
determining a current track section of the scribing track and a current drawing area corresponding to the current track section based on a set number of character intervals;
drawing a scribing pattern corresponding to the current track segment in the transparent image to obtain a current drawing result;
and overlapping the scribing patterns in the rendering results corresponding to the current drawing results to the current drawing areas of the target image to obtain a current overlapping effect diagram, wherein the target image is the background image or the previous overlapping effect diagram.
2. The method of claim 1, wherein the step of determining the position of the substrate comprises,
the target image is the background image under the condition that the current drawing area is the first drawing area corresponding to the scribing track;
and under the condition that the current drawing area is a non-first drawing area corresponding to the scribing track, the target image is a previous superposition effect diagram.
3. The method as recited in claim 1, further comprising:
responding to the scribing ending operation of a user in the background image, and determining a total drawing area corresponding to the scribing track;
Drawing a total scribing pattern corresponding to the scribing track in the total drawing area of the background image to obtain a total drawing result;
performing image rendering on the total drawing result to update the background image;
and displaying the updated background image.
4. The method of claim 1, wherein the determining the current track segment of the scribing track and the current drawing area corresponding to the current track segment based on the set number of character intervals comprises:
determining a character rectangular frame set corresponding to the scribing track;
and under the condition that the number of the character rectangular frames in the character rectangular frame set reaches N times of the set number, taking the area corresponding to the latest character rectangular frames with the set number as the current drawing area, wherein N is a positive integer greater than or equal to 1.
5. The method of claim 1, wherein before drawing a scribe pattern corresponding to the current track segment in the transparent image to obtain a current drawing result, further comprising:
creating a transparent image capable of covering the background image under the condition that the current drawing area is the first drawing area corresponding to the scribing track;
The drawing of the scribing pattern corresponding to the current track segment in the transparent image to obtain the current drawing result includes:
drawing a scribing pattern corresponding to the current track segment in the current drawing area in the transparent image to obtain an initial drawing result;
and intercepting part of the transparent image comprising the scribing pattern from the initial drawing result to obtain a current drawing result.
6. The method of claim 1, wherein the drawing a scribe pattern corresponding to the current track segment in the transparent image to obtain a current drawing result comprises:
creating a transparent image that can cover the current drawing area;
drawing a scribing pattern corresponding to the current track segment on the transparent image to update the transparent image;
and intercepting part of the transparent image comprising the scribing pattern from the updated transparent image so as to obtain a current drawing result.
7. The method according to claim 1, wherein the step of overlaying the scribe line pattern in the rendering result corresponding to the current rendering result to the current rendering area of the target image to obtain a current overlay effect map includes:
And sending the current drawing result to a video memory so as to determine a rendering result corresponding to the current drawing result by the video memory, and overlapping a scribing pattern in the rendering result to the current drawing area in a target image so as to obtain a current overlapping effect diagram.
8. The method according to claim 1, wherein the step of overlaying the scribe line pattern in the rendering result corresponding to the current rendering result to the current rendering area of the target image to obtain a current overlay effect map includes:
performing image rendering on the current drawing result to obtain a rendering result;
and sending the rendering result to a video memory, so that the video memory can be used for superposing the scribing patterns in the rendering result to the current drawing area of the target image to obtain a current superposition effect diagram.
9. The method of claim 1, wherein the drawing the scribe line pattern corresponding to the current track segment in the transparent image to obtain the current drawing result comprises:
obtaining a scribing pattern type corresponding to the scribing operation;
and drawing a scribing pattern determined based on the scribing pattern type and the current track segment in the transparent image to obtain a current drawing result.
10. A scribing rendering device, characterized by comprising:
the track module is used for determining a scribing track in response to scribing operation of a user in the background image;
the area determining module is used for determining a current track section of the scribing track and a current drawing area corresponding to the current track section based on the set number of character intervals;
the drawing module is used for drawing a scribing pattern corresponding to the current track segment in the transparent image so as to obtain a current drawing result;
and the effect diagram module is used for superposing the scribing patterns in the rendering results corresponding to the current rendering results to the current rendering area of the target image so as to obtain a current superposition effect diagram, wherein the target image is the background image or the previous superposition effect diagram.
11. An electronic device, the electronic device comprising:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the scribe line rendering method of any of claims 1-9.
12. A computer-readable storage medium, on which a computer program is stored, characterized in that the program, when executed by a processor, implements the scribe line rendering method as claimed in any one of claims 1-9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310667158.3A CN116704105A (en) | 2023-06-06 | 2023-06-06 | Scribing rendering method, scribing rendering device, scribing rendering equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310667158.3A CN116704105A (en) | 2023-06-06 | 2023-06-06 | Scribing rendering method, scribing rendering device, scribing rendering equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116704105A true CN116704105A (en) | 2023-09-05 |
Family
ID=87833427
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310667158.3A Pending CN116704105A (en) | 2023-06-06 | 2023-06-06 | Scribing rendering method, scribing rendering device, scribing rendering equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116704105A (en) |
-
2023
- 2023-06-06 CN CN202310667158.3A patent/CN116704105A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109766879B (en) | Character detection model generation method, character detection device, character detection equipment and medium | |
EP2805258B1 (en) | Low resolution placeholder content for document navigation | |
CN107204023B (en) | Method and apparatus for avoiding distortion of graphics drawn in canvas | |
CN109472852B (en) | Point cloud image display method and device, equipment and storage medium | |
JP7267434B2 (en) | Document input content processing method, device, electronic device and storage medium | |
CN111783508A (en) | Method and apparatus for processing image | |
CN112272109A (en) | Network topological graph generation method, equipment and system | |
US20230334880A1 (en) | Hot word extraction method and apparatus, electronic device, and medium | |
CN110912870B (en) | Method, device, medium and electronic equipment for synchronizing data of electronic whiteboard | |
CN110188299B (en) | Response type page processing method and device and electronic equipment | |
CN112487871B (en) | Handwriting data processing method and device and electronic equipment | |
CN110807161A (en) | Page framework rendering method, device, equipment and medium | |
CN111836093B (en) | Video playing method, device, equipment and medium | |
CN115209215B (en) | Video processing method, device and equipment | |
CN111054072B (en) | Method, device, equipment and storage medium for role model tailing | |
CN112492399B (en) | Information display method and device and electronic equipment | |
CN115129278A (en) | Image display control method, system, readable storage medium and electronic device | |
CN114356475B (en) | Display processing method, device, equipment and storage medium | |
CN116704105A (en) | Scribing rendering method, scribing rendering device, scribing rendering equipment and storage medium | |
CN114090817A (en) | Dynamic construction method and device of face feature database and storage medium | |
CN109509013B (en) | Method for pushing image information by mobile terminal equipment | |
CN113613043A (en) | Screen display and image processing method, embedded device and cloud server | |
CN112233206B (en) | Character image generation method, device, equipment and storage medium | |
WO2020133386A1 (en) | Note partial selection method, apparatus, electronic terminal and readable storage medium | |
CN114911564B (en) | Page movement processing method, device, equipment and storage medium |
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 |