WO2024046284A1 - 绘制动画生成方法、装置、设备、可读存储介质及产品 - Google Patents
绘制动画生成方法、装置、设备、可读存储介质及产品 Download PDFInfo
- Publication number
- WO2024046284A1 WO2024046284A1 PCT/CN2023/115331 CN2023115331W WO2024046284A1 WO 2024046284 A1 WO2024046284 A1 WO 2024046284A1 CN 2023115331 W CN2023115331 W CN 2023115331W WO 2024046284 A1 WO2024046284 A1 WO 2024046284A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- animation
- strokes
- stroke
- line
- target
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 130
- 238000004590 computer program Methods 0.000 claims abstract description 31
- 230000004044 response Effects 0.000 claims abstract description 29
- 230000001960 triggered effect Effects 0.000 claims abstract description 21
- 239000000463 material Substances 0.000 claims description 49
- 239000013077 target material Substances 0.000 claims description 13
- 230000004927 fusion Effects 0.000 claims description 12
- 239000007787 solid Substances 0.000 claims description 9
- 230000008569 process Effects 0.000 description 29
- 238000010586 diagram Methods 0.000 description 12
- 230000000694 effects Effects 0.000 description 9
- 230000006870 function Effects 0.000 description 8
- 238000012545 processing Methods 0.000 description 7
- 230000003287 optical effect Effects 0.000 description 6
- 238000004891 communication Methods 0.000 description 4
- 238000012552 review Methods 0.000 description 4
- 239000013307 optical fiber Substances 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 101000822695 Clostridium perfringens (strain 13 / Type A) Small, acid-soluble spore protein C1 Proteins 0.000 description 1
- 101000655262 Clostridium perfringens (strain 13 / Type A) Small, acid-soluble spore protein C2 Proteins 0.000 description 1
- 101000655256 Paraclostridium bifermentans Small, acid-soluble spore protein alpha Proteins 0.000 description 1
- 101000655264 Paraclostridium bifermentans Small, acid-soluble spore protein beta Proteins 0.000 description 1
- 208000003028 Stuttering Diseases 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000011160 research Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T13/00—Animation
- G06T13/80—2D [Two Dimensional] animation, e.g. using sprites
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0484—Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
- G06F3/04845—Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
- G06T11/60—Editing figures and text; Combining figures or text
Definitions
- Embodiments of the present disclosure relate to the field of image processing technology, and in particular, to a drawing animation generation method, device, electronic equipment, computer-readable storage media, computer program products, and computer programs.
- a graffiti function is provided for the video. Users can add graffiti to the video according to actual needs.
- Embodiments of the present disclosure provide a drawing animation generation method, device, electronic equipment, computer-readable storage media, computer program products and computer programs, which are used to solve the problem that the existing graffiti drawing animation method has high equipment performance requirements and reproduces the process. It takes a long time and is prone to technical problems such as lags.
- embodiments of the present disclosure provide a drawing animation generation method, including:
- line drawing information corresponding to the target line is obtained.
- the line drawing information includes a stroke snapshot, a stroke bounding box, and a drawing trajectory corresponding to at least part of the strokes in the target line.
- the target line is composed of multiple strokes;
- the line drawing information is used to draw at least part of the strokes corresponding to the target line, and a drawing animation corresponding to the target line is generated.
- an embodiment of the present disclosure provides a drawing animation generating device, including:
- An acquisition module configured to obtain line drawing information corresponding to the target line in response to a drawing animation generation request triggered by the user for the target line.
- the line drawing information includes stroke snapshots and strokes corresponding to at least part of the strokes in the target line. Bounding box and drawing trajectory, the target line is composed of multiple strokes;
- a drawing module configured to use the line drawing information to draw at least part of the strokes corresponding to the target line according to the drawing animation generation request, and generate a drawing animation corresponding to the target line.
- embodiments of the present disclosure provide an electronic device, including: a processor and a memory;
- the memory stores computer execution instructions
- the processor executes the computer execution instructions stored in the memory, so that the at least one processor executes the drawing animation generation method described in the first aspect and various possible designs of the first aspect.
- embodiments of the present disclosure provide a computer-readable storage medium.
- Computer-executable instructions are stored in the computer-readable storage medium.
- the processor executes the computer-executable instructions, the above first aspect and the first aspect are implemented. Aspects of various possible designs described in the drawing animation generation method.
- embodiments of the present disclosure provide a computer program product, including a computer program that, when executed by a processor, implements the drawing animation generation method described in the first aspect and various possible designs of the first aspect.
- embodiments of the present disclosure provide a computer program that, when executed by a processor, implements the drawing animation generation method described in the first aspect and various possible designs of the first aspect.
- the drawing animation generation method, device, electronic equipment, computer-readable storage medium, computer program product and computer program provided by this embodiment pre-store the stroke snapshot, stroke bounding box and drawing time corresponding to each stroke in the target line, thereby When the user-triggered drawing animation generation request is obtained, the target line drawing process can be quickly reproduced based on the stroke snapshot and stroke bounding box. There is no need to redraw all small squares for each stroke, which effectively improves the efficiency of drawing animation generation and avoids lags in the terminal device.
- Figure 1 is a schematic flowchart of a drawing animation generation method provided by an embodiment of the present disclosure.
- FIG. 2 is a schematic flowchart of a drawing animation generation method provided by yet another embodiment of the present disclosure.
- Figure 3 is a schematic diagram of drawing animation provided by an embodiment of the present disclosure.
- FIG. 4 is a schematic flowchart of a drawing animation generation method provided by yet another embodiment of the present disclosure.
- Figure 5 is a schematic diagram of a target line drawn by a material brush provided by an embodiment of the present disclosure.
- FIG. 6 is a schematic flowchart of a drawing animation generation method provided by yet another embodiment of the present disclosure.
- FIG. 7 is a schematic structural diagram of a drawing animation generating device provided by an embodiment of the present disclosure.
- FIG. 8 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
- Bounding box An algorithm for solving the optimal bounding space of a discrete point set. The basic idea is to approximately replace complex geometric objects with slightly larger geometries with simple characteristics (called bounding boxes).
- the present disclosure provides a drawing animation generation method, device, equipment, and a readable storage medium and products.
- drawing animation generation method can be applied in any application scenario that requires reproducing the drawing process.
- each stroke is composed of multiple small squares, and each stroke forms the final graffiti pattern. Therefore, in the process of generating graffiti drawing animation, each small square in the graffiti pattern also needs to be redrawn. Therefore, when there are many strokes in a graffiti pattern, more small squares need to be drawn, which will cause drawing lag and affect the user experience.
- the inventor found through research that in order to quickly redraw the drawing process, the stroke snapshot, stroke bounding box and drawing time corresponding to each stroke in the target line can be stored in advance, so as to obtain When the user triggers a drawing animation request, the target line drawing process can be quickly reproduced based on the stroke snapshot and stroke bounding box. This eliminates the need to redraw a large number of small squares and avoids the phenomenon of drawing lag.
- Figure 1 is a schematic flowchart of a drawing animation generation method provided by an embodiment of the present disclosure. As shown in Figure 1, the method includes:
- Step 101 In response to a drawing animation generation request triggered by the user for a target line, obtain line drawing information corresponding to the target line.
- the line drawing information includes stroke snapshots and stroke bounding boxes corresponding to at least part of the strokes in the target line. and drawing a trajectory, where the target line is composed of multiple strokes.
- the execution subject of this embodiment is a drawing animation generating device, and the drawing animation generating device can be coupled to a terminal device.
- the drawing animation corresponding to the target line can be generated according to the instructions triggered by the user on the terminal device.
- the drawing animation generating device may be coupled to a server.
- the server is connected through communication with the terminal device, so that it can obtain the drawing animation generation request sent by the terminal device, generate the drawing animation according to the drawing animation generation request, and feed back the generated drawing animation to the terminal device for playback.
- the user can perform editing operations on the target video or target image on the terminal device. For example, you can add randomly drawn lines to the target video or target image, and use the lines corresponding to multiple strokes drawn by the user as the target lines.
- the target line can be displayed as a graffiti.
- the line drawing information corresponding to the target line can be stored.
- the line drawing information includes the stroke snapshot corresponding to each stroke in the target line, the stroke bounding box, and Draw a trajectory.
- the stroke snapshot can represent the drawing situation corresponding to a certain stroke, and the stroke bounding box can optimally surround the stroke.
- the stroke snapshot can be an image corresponding to the stroke.
- the strokes drawn by the user can be determined based on the sliding operation.
- Each stroke is drawn in a separate page and stored to obtain a stroke snapshot.
- the stroke snapshots of all the stored strokes can be fused and displayed to obtain the target line.
- a drawing animation generation request for the target line can be generated through a preset trigger control to review the drawing process of the target line.
- the drawing animation generation device may obtain pre-stored line drawing information in response to the drawing animation generation request.
- Step 102 According to the drawing animation generation request, use the line drawing information to draw at least part of the strokes corresponding to the target line, and generate a drawing animation corresponding to the target line.
- drawing operations can be performed on at least part of the strokes corresponding to the target line according to the drawing order according to the line drawing information to generate a drawing animation corresponding to the target line.
- the user can select the strokes to be drawn according to actual needs. For example, the user can choose to redraw all strokes in the target line. Alternatively, the user can also select part of the strokes in the target line to generate the drawing animation, which is not limited by this disclosure.
- the drawing animation generation request includes the animation type.
- Step 102 includes:
- drawing at least part of the strokes corresponding to the target line according to the line drawing information generates a drawing animation corresponding to the target line.
- different animation types may be preset.
- the entry animation type can be configured as an animation in which each stroke is gradually drawn
- the exit animation can be configured as an animation in which each stroke gradually disappears.
- Loop animation can be configured as an animation in which the target line is displayed in a loop according to the preset animation editing elements.
- At least part of the strokes corresponding to the target line can be drawn according to the drawing method corresponding to the animation type and the line drawing information, and a drawing corresponding to the target line can be generated. animation.
- the drawing animation generation method provided in this embodiment pre-stores the stroke snapshot, stroke bounding box, and drawing time corresponding to each stroke in the target line, so that when a user-triggered drawing animation generation request is obtained, the drawing animation generation request can be generated based on the stroke snapshot, stroke Bounding boxes quickly reproduce the target line drawing process. There is no need to redraw all small squares for each stroke, which effectively improves the efficiency of drawing animation generation and avoids lags in the terminal device.
- Figure 2 is a schematic flow chart of a drawing animation generation method provided by yet another embodiment of the present disclosure.
- the animation type includes an entry animation type and/or an exit animation, as shown in Figure 2.
- the method of using a drawing method corresponding to the animation type, drawing at least part of the strokes corresponding to the target line according to the line drawing information, and generating a drawing animation corresponding to the target line includes:
- Step 201 Determine the strokes to be drawn corresponding to the current time frame according to the line drawing information and preset drawing animation information.
- the drawing animation information includes the drawing duration and/or drawing speed corresponding to the drawing animation;
- Step 202 Perform a drawing operation on the stroke to be drawn to obtain a drawn stroke, and draw other strokes in the target line whose display order is before the stroke to be drawn according to the line drawing information to obtain the drawn stroke. animation.
- the animation type may specifically be an entry animation type and/or an exit animation type.
- the entry animation type can be configured as an animation in which each stroke is gradually drawn
- the exit animation can be configured as an animation in which each stroke gradually disappears.
- the drawing animation can be generated by combining stroke drawing and stroke snapshot.
- preset drawing animation information can be obtained, wherein the drawing animation information can be set by the user according to actual needs when triggering a drawing animation generation request.
- the drawing animation information may include the drawing duration and/or drawing speed corresponding to the drawing animation.
- the user can set the drawing duration of the drawing animation to 30 seconds. Therefore, you can control the strokes in the drawing animation to be drawn at a constant speed, and the drawing ends at 30 seconds.
- the stroke to be drawn corresponding to the current time frame can be determined based on the drawing animation information and the line drawing information, and a drawing operation can be performed on the stroke to be drawn.
- a drawing operation can be performed on the stroke to be drawn.
- step 202 includes:
- Stroke snapshots corresponding to the other strokes are determined based on the line drawing information.
- a fusion operation is performed on the drawing stroke and the stroke snapshots corresponding to the other strokes to generate a drawing animation corresponding to the target line.
- the stroke snapshots corresponding to the other strokes can be determined in the line drawing information.
- the stroke snapshot corresponding to the other strokes is fused with the drawing stroke to generate a drawing animation corresponding to the target line.
- step 201 includes:
- the drawing time period corresponding to each stroke is determined.
- the total length corresponding to all the strokes can be calculated first. Based on the total length and the drawing animation information, the drawing time period corresponding to each stroke is determined. During the drawing animation generation process, the current time frame is determined, and the stroke corresponding to the drawing time period matching the time frame is used as the current stroke to be drawn.
- the drawing animation generation method provided in this embodiment realizes the generation of drawing animation by combining stroke drawing and stroke snapshots, thereby effectively avoiding the jamming phenomenon of the terminal device. In addition, the efficiency of drawing animation generation can be improved.
- step 202 when the animation type is an entry animation type and the animation drawing order is sequential drawing, and/or when the animation type is an exit animation type and the animation drawing order is When drawing in reverse order, step 202 includes:
- the drawing animation information the total length corresponding to all strokes in the target line, and the drawing trajectory, the first drawing position corresponding to the current time frame and the drawing position corresponding to the next time frame are determined.
- sequential drawing means drawing according to the user's drawing direction
- reverse order drawing means drawing in the opposite direction to the user's drawing direction.
- sequential drawing means that the drawing process is displayed in the drawing animation in the order from left to right
- reverse order drawing means that the drawing process is displayed in the drawing animation from right to left.
- Sequence shows the drawing process in a drawing animation.
- the sequential drawing in the entry animation is an animation that controls the strokes to gradually draw according to the user's drawing order.
- the reverse drawing in the exit animation is an animation that controls the strokes to gradually disappear in the opposite order to the user's drawing order.
- the strokes are displayed in an incremental form, that is, the stroke length drawn in the next frame is greater than the stroke length in the previous frame. Therefore, for the above application scenarios, incremental drawing can be used to draw the strokes to be drawn.
- For the current time frame determine the first drawing position corresponding to the current time frame based on the drawing animation information, the total length corresponding to all strokes in the target line, and the drawing trajectory. Determine the next time frame with a preset time interval from the current time frame, and determine the second drawing position corresponding to the current time frame based on the drawing animation information, the total length corresponding to all strokes in the target line, and the drawing trajectory.
- Figure 3 is a schematic diagram of drawing animation provided by an embodiment of the present disclosure.
- the drawing order is sequential drawing
- the first drawing position 31 corresponding to the current time frame and the second drawing position corresponding to the next time frame can be determined.
- Draw position 32 The area to be drawn 33 between the first drawing position 31 and the second drawing position 32 is incrementally drawn to obtain a drawing result 34 . After all target lines are drawn, a drawing animation is obtained.
- the drawing animation generation method provided in this embodiment uses incremental drawing to perform the drawing operation of strokes to be drawn, thereby effectively improving the efficiency of the drawing operation, lowering the resource occupancy rate of the drawing process, avoiding lagging, and improving user experience.
- step 202 when the animation type is an entry animation type, the animation drawing order is reverse order, and/or, when the animation type is an exit animation type, and the animation drawing order is When drawing sequentially, step 202 includes:
- the target drawing length corresponding to the next time frame is determined.
- the animation type when the animation type is the entry type and the animation drawing order is reverse drawing, it represents an animation in which strokes are gradually drawn in the reverse order of the user's drawing order.
- the animation type is the exit animation type and the animation drawing order is sequential drawing, it means that the strokes disappear in the same order as the user's drawing order. That is to say, in the above application scenario, the drawing length of each stroke in the current time frame is greater than the drawing length in the next time frame. Therefore, in order to achieve the above animation effect, the strokes to be drawn in each time frame need to be drawn in full amount.
- the drawn length corresponding to the stroke to be drawn in the current time frame can be determined.
- Draw animation information based on And the time difference between the current time frame and the next time frame determines the target drawing length corresponding to the next time frame. In the next time frame, perform a full drawing operation on the strokes to be drawn with the target drawing length to obtain the drawn strokes.
- the drawing animation generation method provided by this embodiment uses full drawing for strokes to be drawn and stroke snapshots for other strokes, thereby eliminating the need to redraw all strokes during the drawing process and improving drawing efficiency. In addition, there is no need to redraw a large number of small squares corresponding to each stroke, which may cause lag in the drawing process.
- Figure 4 is a schematic flowchart of a drawing animation generation method provided by yet another embodiment of the present disclosure.
- the animation type includes a loop animation type.
- drawing at least part of the strokes corresponding to the target line according to the line drawing information, and generating a drawing animation corresponding to the target line includes:
- Step 401 Determine the brush type used when drawing the target line.
- Step 402 Use a drawing method corresponding to the brush type, draw at least part of the strokes corresponding to the target line according to the line drawing information, and generate a drawing animation corresponding to the target line.
- the animation type may specifically be a loop animation type
- the loop animation type may specifically include adding random editing elements to the target line and controlling the edited target line to play in a loop. For example, at least one of random jitter, random scaling, size adjustment, random offset, and random rotation can be added to each stroke in the target line.
- the brush type can include a solid color brush and a material brush, and the color of the solid color brush can be customized by the user.
- the strokes drawn by the material brush can be composed of the material grid corresponding to the material brush.
- the drawing animation generation method provided in this embodiment adopts different drawing methods to perform the drawing operation of the drawing animation according to different brush types, so that the final generated drawing animation effect can match the brush type and improve the drawing animation. the quality of.
- the brush type includes a solid color brush type
- step 402 includes:
- a fusion operation is performed on stroke snapshots associated with target strokes corresponding to at least part of the strokes to obtain the drawing animation.
- the brush type is a solid color brush
- stroke snapshots and stroke bounding boxes can be used to generate the drawing animation. Therefore, you can add preset editing elements to the stroke bounding box corresponding to each stroke to obtain the edited target stroke.
- the preset editing elements include user-preset rotation elements, scaling elements, offset elements, and movement elements. One or more items.
- the preset editing elements may include one or more of random rotation elements, scaling elements, offset elements, and moving elements.
- the strokes associated with the target stroke corresponding to at least part of the strokes can be Snapshots are fused to obtain drawing animations.
- the drawing animation generation method when the brush type is a solid color pen, adds preset editing elements to the bounding box of each stroke, and performs a fusion operation on the stroke snapshots associated with the target stroke corresponding to at least part of the stroke, thereby This enables each stroke of the generated drawing animation to present editing elements, enriching the display effect of the drawing animation, making the generated drawing animation more in line with the actual needs of the user, and improving the user experience.
- the brush type includes a material brush
- the strokes drawn by the material brush are composed of a plurality of material grids corresponding to the material brush.
- Step 402 includes:
- the editing elements include rotation elements, scaling elements, offset elements, Move one or more elements
- the strokes drawn by the material brush can be composed of material grids corresponding to the material brush. Therefore, when generating the drawing animation, each material grid needs to be edited. operate.
- a preset editing element can be added to it to obtain the edited target material grid, where the preset editing elements include user-preset rotation elements, scaling elements, One or more of offset elements and moved elements.
- the preset editing elements may include one or more of random rotation elements, scaling elements, offset elements, and moving elements.
- FIG. 5 is a schematic diagram of a target line drawn by a material brush provided by an embodiment of the present disclosure. As shown in Figure 5, in the target line 51 drawn by a material brush, each stroke has multiple material grids 52 corresponding to the material brush. Composition, wherein the material grid 52 can be in the shape of a heart.
- the drawing animation generation method when the brush type is a material brush, adds random editing elements to each material grid corresponding to each stroke, and generates an edited target stroke according to the target material grid. Perform a full drawing operation on at least part of the target strokes corresponding to the target line to obtain a drawing animation, so that each material grid can present random editing elements, enriching the display effect of the drawing animation.
- Embodiment 4 is a diagrammatic representation of Embodiment 4:
- Figure 6 is a schematic flowchart of a drawing animation generation method provided by yet another embodiment of the present disclosure. Based on any of the above embodiments, before step 101, it also includes:
- Step 601 In response to the user's drawing operation on the target video in the drawing editing page, obtain the line drawing information corresponding to each stroke drawn by the user.
- Step 602 In response to the user's triggering operation on the preset completion control, determine all strokes currently drawn by the user as the target lines, and store the line drawing information corresponding to the target lines.
- the user can perform editing operations on the target video or target image on the terminal device. For example, you can add random graffiti to the target video or target image to obtain the target lines.
- line drawing information corresponding to each stroke drawn by the user is obtained.
- the line drawing information includes each stroke pair in the target line
- the stroke snapshot can represent the line drawing situation at a certain moment, and the stroke bounding box can optimally surround the stroke.
- the drawing editing page is also provided with a completion control.
- the completion control can be triggered.
- all strokes currently drawn by the user are determined as target lines.
- the line drawing information corresponding to the target line can be stored.
- step 602 it also includes:
- a stroke snapshot corresponding to the drawn target line when the user triggers the completion control is merged with the target video.
- the user may also choose not to generate a graffiti video based on the target line.
- the target line and the target video can be directly fused to show the user the final effect.
- the stroke snapshot corresponding to the drawn target line when the user triggers the completion control can be fused with the target video.
- the drawing animation generation method provided by this embodiment saves the line drawing information corresponding to the target line during the drawing process of the target line, so that the drawing animation can be quickly generated based on the line drawing information later, and avoids the need for redrawing. Stuttering phenomenon improves user experience.
- FIG. 7 is a schematic structural diagram of a drawing animation generation device provided by an embodiment of the present disclosure.
- the device includes: an acquisition module 71 and a drawing module 72 .
- the acquisition module 71 is configured to obtain line drawing information corresponding to the target line in response to a drawing animation generation request triggered by the user for the target line, where the line drawing information includes strokes corresponding to at least part of the strokes in the target line. Snapshot, stroke bounding box and drawing trajectory, the target line is composed of multiple strokes.
- the drawing module 72 is configured to use the line drawing information to draw at least part of the strokes corresponding to the target line according to the drawing animation generation request, and generate a drawing animation corresponding to the target line.
- the drawing animation generation request includes an animation type; the drawing module is configured to: adopt a drawing method corresponding to the animation type, and draw the line according to the line drawing information. Draw at least part of the strokes corresponding to the target line, and generate a drawing animation corresponding to the target line.
- the animation type includes entry animation and/or exit animation
- the drawing module is configured to: determine the current drawing animation according to the line drawing information and preset drawing animation information.
- the strokes to be drawn corresponding to the time frame, the drawing animation information includes the drawing duration and/or drawing speed corresponding to the drawing animation; the drawing operation is performed on the strokes to be drawn to obtain the drawing strokes, and the drawing strokes are obtained according to the line drawing information. Draw other strokes in the target line whose display order is before the stroke to be drawn, and obtain the drawing animation.
- the drawing module is configured to: determine stroke snapshots corresponding to the other strokes according to the line drawing information; and compare the stroke snapshots corresponding to the drawing strokes to the other strokes.
- a fusion operation is performed to generate a drawing animation corresponding to the target line.
- the drawing module is configured to: determine the drawing time period corresponding to each stroke according to the total length corresponding to all strokes in the target line and the drawing animation information; determine the current drawing time period. In the previous time frame, determine the drawing time period that matches the current time frame, and determine the stroke corresponding to the drawing time period as the stroke to be drawn.
- the drawing module is used to determine the first drawing position corresponding to the current time frame and the next time based on the drawing animation information, the total length corresponding to all strokes in the target line, and the drawing trajectory.
- the drawing position corresponding to the frame perform an incremental drawing operation on the area to be drawn between the second drawing position and the first drawing position until the drawing operation of the stroke to be drawn is completed, and the drawing stroke is obtained.
- the animation drawing order is reverse order, and/or, when the animation type is an exit animation type, and the animation drawing order is When drawing sequentially, the drawing module is used to: determine the drawn length corresponding to the stroke to be drawn in the current time frame; determine the next time frame according to the drawing animation information and the time difference between the current time frame and the next time frame. The target drawing length corresponding to one time frame; in the next time frame, a full drawing operation is performed on the strokes to be drawn of the target drawing length to obtain the drawing strokes.
- the animation type includes a loop animation
- the drawing module is used to: determine the brush type used when drawing the target line; use a brush type corresponding to the brush type
- the drawing method includes drawing at least part of the strokes corresponding to the target line according to the line drawing information, and generating a drawing animation corresponding to the target line.
- the brush type includes a solid color brush
- the drawing module is configured to: for at least part of the strokes in the target line, draw a stroke bounding box corresponding to the stroke Add preset editing elements to obtain edited target strokes, wherein the editing elements include one or more of rotation elements, scaling elements, offset elements, and moving elements; associate target strokes corresponding to at least part of the strokes Perform a fusion operation on the stroke snapshots to obtain the drawing animation.
- the brush type includes a material brush
- the strokes drawn by the material brush are composed of a plurality of material grids corresponding to the material brush
- the drawing module uses In: for each material grid corresponding to at least part of the strokes in the target line, add a preset editing element to the material grid to obtain the target material grid, wherein the editing elements include a rotation element, a scaling element, an offset One or more of elements and moving elements; generating edited target strokes according to the target material grid; performing a full drawing operation on at least part of the target strokes corresponding to the target lines to obtain the drawing animation.
- the device further includes: an acquisition module, configured to obtain the corresponding data of each stroke drawn by the user in response to the user's drawing operation on the target video in the drawing editing page.
- Line drawing information configured to obtain the corresponding data of each stroke drawn by the user in response to the user's drawing operation on the target video in the drawing editing page.
- a determination module configured to determine all strokes currently drawn by the user as the target lines in response to the user's triggering operation on the preset completion control, and store the line drawing information corresponding to the target lines.
- the device further includes: a fusion module, configured to respond to the user's display request triggered by the target line, and convert the target line corresponding to the drawn target line when the user triggers the completion control.
- the stroke snapshot is merged with the target video.
- the equipment provided in this embodiment can be used to execute the technical solutions of the above method embodiments. Its implementation principles and technical effects are similar, and will not be described again in this embodiment.
- Embodiment 7 is a diagrammatic representation of Embodiment 7:
- embodiments of the present disclosure also provide an electronic device, including: a processor and a memory.
- the memory stores computer-executable instructions.
- the processor executes the computer execution instructions stored in the memory, so that the processor executes the drawing animation generation method as described in any of the above embodiments.
- FIG. 8 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
- the electronic device 800 may be a terminal device or a server.
- terminal devices may include but are not limited to mobile phones, laptops, digital broadcast receivers, personal digital assistants (Personal Digital Assistant, PDA for short), tablet computers (Portable Android Device, PAD for short), portable multimedia players (Portable Mobile terminals such as Media Player (PMP for short), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and fixed terminals such as digital TVs, desktop computers, etc.
- PDA Personal Digital Assistant
- PDA Personal Digital Assistant
- PAD Personal Android Device
- portable multimedia players Portable Mobile terminals such as Media Player (PMP for short
- vehicle-mounted terminals such as vehicle-mounted navigation terminals
- fixed terminals such as digital TVs, desktop computers, etc.
- the electronic device shown in FIG. 8 is only an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.
- the electronic device 800 may include a processing device (such as a central processing unit, a graphics processor, etc.) 801, which may process data according to a program stored in a read-only memory (Read Only Memory, ROM for short) 802 or from a storage device. 808 loads the program in Random Access Memory (RAM) 803 to perform various appropriate actions and processing. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored.
- the processing device 801, ROM 802 and RAM 803 are connected to each other via a bus 804.
- An input/output (I/O for short) interface 805 is also connected to bus 804.
- the following devices can be connected to the I/O interface 805: input devices 806 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a Liquid Crystal Display (LCD). ), an output device 807 such as a speaker, a vibrator, etc.; a storage device 808 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 809.
- the communication device 809 may allow the electronic device 800 to communicate wirelessly or wiredly with other devices to exchange data.
- FIG. 8 illustrates an electronic device 800 having various means, it should be understood that implementation or availability of all illustrated means is not required. More or fewer means may alternatively be implemented or provided.
- embodiments of the present disclosure include a computer program product including a computer program carried on a computer-readable medium, the computer program containing program code for performing the method illustrated in the flowchart.
- the computer program may be downloaded and installed from the network via communication device 809, or from storage device 808, or from ROM 802.
- the processing device 801 the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
- the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two.
- the computer-readable storage medium may be, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any combination thereof. More specific examples of computer readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard drives, RAM, ROM, Erasable Programmable Read Only Memory , referred to as EPROM) or flash memory, optical fiber, portable compact disk read only memory (Compact Disk Read Only Memory, referred to as CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
- EPROM Erasable Programmable Read Only Memory
- CD-ROM Compact Disk Read Only Memory
- a computer-readable storage medium may be any computer-readable storage medium that contains or stores A tangible medium for a program that may be used by or in connection with an instruction execution system, apparatus, or device.
- a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above.
- a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device .
- Program code contained on a computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wires, optical cables, radio frequency (Radio Frequency, RF for short), etc., or any suitable combination of the above.
- Embodiments of the present disclosure also provide a computer-readable storage medium.
- Computer-executable instructions are stored in the computer-readable storage medium.
- the processor executes the computer-executable instructions, the methods described in any of the above embodiments are implemented.
- Draw animation generation method is implemented.
- An embodiment of the present disclosure also provides a computer program product, which includes a computer program.
- the computer program When the computer program is executed by a processor, the method for generating a drawing animation as described in any of the above embodiments is implemented.
- An embodiment of the present disclosure also provides a computer program.
- the computer program is executed by a processor, the method for generating a drawing animation as described in any of the above embodiments is implemented.
- the above-mentioned computer-readable medium may be included in the above-mentioned electronic device; it may also exist independently without being assembled into the electronic device.
- the computer-readable medium carries one or more programs.
- the electronic device When the one or more programs are executed by the electronic device, the electronic device performs the method shown in the above embodiment.
- Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional Procedural programming language—such as "C" or a similar programming language.
- 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.
- the remote computer can 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 it can be connected to an external computer Computer (e.g. connected via the Internet using an Internet service provider).
- LAN Local Area Network
- WAN Wide Area Network
- each block in the flowchart or block diagram may represent a module, segment, or portion of code that contains one or more logic functions that implement the specified executable instructions.
- the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown one after another may actually execute substantially in parallel, or they may sometimes execute in the reverse order, depending on the functionality involved.
- each block of the block diagram and/or flowchart illustration, and combinations of blocks in the block diagram and/or flowchart illustration can be implemented by special purpose hardware-based systems that perform the specified functions or operations. , or can be implemented using a combination of specialized hardware and computer instructions.
- the units involved in the embodiments of the present disclosure can be implemented in software or hardware. Among them, the name of a unit does not constitute a limitation on the unit itself under certain circumstances, for example, The first acquisition unit may also be described as "a unit that acquires at least two Internet Protocol addresses.”
- exemplary types of hardware logic components include: Field Programmable Gate Array (FPGA), Application Specific Integrated Circuit (ASIC), Application Specific Standard Products ( Application Specific Standard Parts (ASSP for short), System on Chip (SOC for short), Complex Programmable Logic Device (CPLD for short), etc.
- FPGA Field Programmable Gate Array
- ASIC Application Specific Integrated Circuit
- ASSP Application Specific Standard Parts
- SOC System on Chip
- CPLD Complex Programmable Logic Device
- a machine-readable medium may be a tangible medium that may contain or store a program for use by or in connection with an instruction execution system, apparatus, or device.
- the machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
- Machine-readable media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, RAM, ROM, EPROM or flash memory, optical fiber, CD-ROM, optical storage device, magnetic storage device , or any suitable combination of the above.
- a drawing animation generation method including:
- line drawing information corresponding to the target line is obtained.
- the line drawing information includes a stroke snapshot, a stroke bounding box, and a drawing trajectory corresponding to at least part of the strokes in the target line.
- the target line is composed of multiple strokes;
- the line drawing information is used to draw at least part of the strokes corresponding to the target line, and a drawing animation corresponding to the target line is generated.
- the drawing animation generation request includes an animation type
- the method of using the line drawing information to draw at least part of the strokes corresponding to the target line and generating a drawing animation corresponding to the target line includes:
- drawing at least part of the strokes corresponding to the target line according to the line drawing information generates a drawing animation corresponding to the target line.
- the animation type includes entry animation and/or exit animation
- the method of using a drawing method corresponding to the animation type, drawing at least part of the strokes corresponding to the target line according to the line drawing information, and generating a drawing animation corresponding to the target line includes:
- the drawing operation is performed on the stroke to be drawn to obtain the drawing stroke, and other lines in the target line whose display order is before the stroke to be drawn are displayed according to the line drawing information.
- Draw strokes to obtain the drawing animation including:
- a fusion operation is performed on the drawing stroke and the stroke snapshots corresponding to the other strokes to generate a drawing animation corresponding to the target line.
- the line drawing information and the preset drawing animation are Information to determine the stroke to be drawn corresponding to the current time frame, including:
- the animation type when the animation type is an entry animation type and the animation drawing order is sequential drawing, and/or when the animation type is an exit animation type and the animation drawing order is reverse order
- the drawing operation is performed on the strokes to be drawn to obtain the drawing strokes, including:
- An incremental drawing operation is performed on the area to be drawn between the second drawing position and the first drawing position until the drawing operation of the stroke to be drawn is completed, and the drawing stroke is obtained.
- the animation drawing order is reverse order drawing, and/or, when the animation type is an exit animation type, and the animation drawing order is sequential drawing
- the drawing operation is performed on the stroke to be drawn to obtain the drawing stroke, including:
- the animation type includes a loop animation
- the method of using a drawing method corresponding to the animation type, drawing at least part of the strokes corresponding to the target line according to the line drawing information, and generating a drawing animation corresponding to the target line includes:
- the brush type includes a solid color brush
- the drawing method corresponding to the animation type is used, and at least part of the strokes corresponding to the target line is drawn according to the line drawing information.
- Carry out drawing and generate drawing animation corresponding to the target line including:
- a fusion operation is performed on stroke snapshots associated with target strokes corresponding to at least part of the strokes to obtain the drawing animation.
- the brush type includes a material brush, and the strokes drawn by the material brush are composed of a plurality of material grids corresponding to the material brush;
- the method of using a drawing method corresponding to the animation type, drawing at least part of the strokes corresponding to the target line according to the line drawing information, and generating a drawing animation corresponding to the target line includes:
- the editing elements include rotation elements, scaling elements, offset elements, Move one or more elements
- the method before obtaining the line drawing information corresponding to the target line in response to a drawing animation generation request triggered by the user for the target line, the method further includes:
- the method after storing the line drawing information corresponding to the target line, the method further includes:
- a stroke snapshot corresponding to the drawn target line when the user triggers the completion control is merged with the target video.
- a drawing animation generating device including:
- An acquisition module configured to obtain line drawing information corresponding to the target line in response to a drawing animation generation request triggered by the user for the target line.
- the line drawing information includes stroke snapshots and strokes corresponding to at least part of the strokes in the target line. Bounding box and drawing trajectory, the target line is composed of multiple strokes;
- a drawing module configured to use the line drawing information to draw at least part of the strokes corresponding to the target line according to the drawing animation generation request, and generate a drawing animation corresponding to the target line.
- the drawing animation generation request includes an animation type; the drawing module is configured to: adopt a drawing method corresponding to the animation type, and draw the target according to the line drawing information. At least part of the strokes corresponding to the line is drawn, and a drawing animation corresponding to the target line is generated.
- the animation type includes entry animation and/or exit animation
- the drawing module is configured to: determine the current time frame according to the line drawing information and preset drawing animation information.
- the drawing animation information includes the drawing duration and/or drawing speed corresponding to the drawing animation; performing a drawing operation on the strokes to be drawn to obtain the drawing strokes, and drawing the line according to the line drawing information Draw other strokes in the target line whose display order is before the stroke to be drawn, and obtain the drawing animation.
- the drawing module is configured to: determine stroke snapshots corresponding to the other strokes based on the line drawing information; and fuse the drawing strokes with the stroke snapshots corresponding to the other strokes. Operation to generate a drawing animation corresponding to the target line.
- the drawing module is configured to: determine the drawing time period corresponding to each stroke according to the total length corresponding to all strokes in the target line and the drawing animation information; determine the current time frame , determine the drawing time period that matches the current time frame, and determine the stroke corresponding to the drawing time period as the stroke to be drawn.
- the drawing module is used to: determine the first drawing position corresponding to the current time frame and the corresponding next time frame based on the drawing animation information, the total length corresponding to all strokes in the target line, and the drawing trajectory. the drawing position; perform an incremental drawing operation on the area to be drawn between the second drawing position and the first drawing position until the drawing operation of the stroke to be drawn is completed, and the drawing stroke is obtained.
- the animation drawing order is reverse order drawing, and/or, when the animation type is an exit animation type, and the animation drawing order is sequential drawing
- the drawing module is used to: determine the drawn length corresponding to the stroke to be drawn in the current time frame; determine the next time according to the drawing animation information and the time difference between the current time frame and the next time frame.
- the animation type includes a loop animation
- the drawing module is configured to: determine the brush type used when drawing the target line; use a drawing corresponding to the brush type
- the drawing module is configured to: determine the brush type used when drawing the target line; use a drawing corresponding to the brush type
- at least part of the strokes corresponding to the target line is drawn according to the line drawing information, and a drawing animation corresponding to the target line is generated.
- the brush type includes a solid color brush
- the drawing module is configured to: for at least part of the strokes in the target line, add a predetermined stroke bounding box corresponding to the stroke.
- an editing element to obtain the edited target stroke, wherein the editing element includes one or more of a rotation element, a scaling element, an offset element, and a moving element; the strokes associated with the target stroke corresponding to at least part of the strokes
- the snapshots are fused to obtain the drawing animation.
- the brush type includes a material brush, and the strokes drawn by the material brush are composed of a plurality of material grids corresponding to the material brush;
- the drawing module is used to: For each material grid corresponding to at least part of the strokes in the target line, add a preset editing element to the material grid to obtain the target material grid, wherein the editing elements include rotation elements, scaling elements, offset elements, Move one or more of the elements; generate an edited target stroke according to the target material grid; perform a full drawing operation on at least part of the target strokes corresponding to the target line to obtain the drawing animation.
- the device further includes: an acquisition module, configured to obtain the line drawing corresponding to each stroke drawn by the user in response to the user's drawing operation on the target video in the drawing editing page. Information; a determination module, configured to determine all strokes currently drawn by the user as the target lines in response to the user's triggering operation on the preset completion control, and store the line drawing information corresponding to the target lines.
- the device further includes: a fusion module configured to, in response to a display request triggered by the user for the target line, take a snapshot of the stroke corresponding to the drawn target line when the user triggers the completion control. Perform a fusion operation with the target video.
- a fusion module configured to, in response to a display request triggered by the user for the target line, take a snapshot of the stroke corresponding to the drawn target line when the user triggers the completion control. Perform a fusion operation with the target video.
- an electronic device including: at least one processor and a memory;
- the memory stores computer execution instructions
- the at least one processor executes the computer execution instructions stored in the memory, so that the at least one processor executes the drawing animation generation method described in the above first aspect and various possible designs of the first aspect.
- a computer-readable storage medium is provided.
- Computer-executable instructions are stored in the computer-readable storage medium.
- a processor executes the computer-executed instructions, Implement the drawing animation generation method described in the first aspect and various possible designs of the first aspect.
- a computer program product including a computer program that, when executed by a processor, implements the above first aspect and various possible designs of the first aspect.
- the drawing animation generation method is provided, including a computer program that, when executed by a processor, implements the above first aspect and various possible designs of the first aspect.
- a computer program which when executed by a processor implements the drawing animation described in the first aspect and various possible designs of the first aspect. Generate method.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Human Computer Interaction (AREA)
- Processing Or Creating Images (AREA)
Abstract
本公开实施例提供一种绘制动画生成方法、装置、电子设备、计算机可读存储介质、计算机程序产品及计算机程序,该方法包括:响应于用户针对目标线条触发的绘制动画生成请求,获取所述目标线条对应的线条绘制信息,所述线条绘制信息中包括所述目标线条中至少部分笔画对应的笔画快照、笔画包围盒以及绘制轨迹,所述目标线条由多个笔画构成;根据所述绘制动画生成请求,采用所述线条绘制信息对所述目标线条对应的至少部分笔画进行绘制,生成所述目标线条对应的绘制动画。无需针对每一笔画对全部小正方形进行重新绘制,有效地提高了绘制动画生成的效率,且避免造成终端设备的卡顿。
Description
相关申请的交叉引用
本申请要求于2022年09月01日提交中国专利局、申请号为202211068030.7、申请名称为“绘制动画生成方法、装置、设备、可读存储介质及产品”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本公开实施例涉及图像处理技术领域,尤其涉及一种绘制动画生成方法、装置、电子设备、计算机可读存储介质、计算机程序产品及计算机程序。
在视频编辑软件中,为了提升编辑后的视频效果提供了针对视频的涂鸦功能。用户可以根据实际需求在视频内添加涂鸦。
现有的涂鸦在绘制过程中采用很多小正方形堆叠在一起构成涂鸦轨迹。当用户需要对绘制过程进行重新回顾时,则针对每一帧需要对该帧图像内涂鸦轨迹对应的全部小正方形进行重新绘制,对终端设备的性能要求较高。当终端设备性能不佳时,则会产生卡顿现象,无法实现绘制过程的重现。
发明内容
本公开实施例提供一种绘制动画生成方法、装置、电子设备、计算机可读存储介质、计算机程序产品及计算机程序,用于解决现有的涂鸦绘制动画方法对设备性能要求较高,重现过程耗时较长且容易出现卡顿的技术问题。
第一方面,本公开实施例提供一种绘制动画生成方法,包括:
响应于用户针对目标线条触发的绘制动画生成请求,获取所述目标线条对应的线条绘制信息,所述线条绘制信息中包括所述目标线条中至少部分笔画对应的笔画快照、笔画包围盒以及绘制轨迹,所述目标线条由多个笔画构成;
根据所述绘制动画生成请求,采用所述线条绘制信息对所述目标线条对应的至少部分笔画进行绘制,生成所述目标线条对应的绘制动画。
第二方面,本公开实施例提供一种绘制动画生成装置,包括:
获取模块,用于响应于用户针对目标线条触发的绘制动画生成请求,获取所述目标线条对应的线条绘制信息,所述线条绘制信息中包括所述目标线条中至少部分笔画对应的笔画快照、笔画包围盒以及绘制轨迹,所述目标线条由多个笔画构成;
绘制模块,用于根据所述绘制动画生成请求,采用所述线条绘制信息对所述目标线条对应的至少部分笔画进行绘制,生成所述目标线条对应的绘制动画。
第三方面,本公开实施例提供一种电子设备,包括:处理器和存储器;
所述存储器存储计算机执行指令;
所述处理器执行所述存储器存储的计算机执行指令,使得所述至少一个处理器执行如上第一方面以及第一方面各种可能的设计所述的绘制动画生成方法。
第四方面,本公开实施例提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如上第一方面以及第一方面各种可能的设计所述的绘制动画生成方法。
第五方面,本公开实施例提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现如上第一方面以及第一方面各种可能的设计所述的绘制动画生成方法。
第六方面,本公开实施例提供一种计算机程序,所述计算机程序被处理器执行时实现如上第一方面以及第一方面各种可能的设计所述的绘制动画生成方法。
本实施例提供的绘制动画生成方法、装置、电子设备、计算机可读存储介质、计算机程序产品及计算机程序,通过预先存储目标线条中每一笔画对应的笔画快照、笔画包围盒以及绘制时间,从而在获取到用户触发的绘制动画生成请求时,可以根据笔画快照、笔画包围盒快速地实现目标线条绘制过程的重现。无需针对每一笔画对全部小正方形进行重新绘制,有效地提高了绘制动画生成的效率,且避免造成终端设备的卡顿。
为了更清楚地说明本公开实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本公开实施例提供的绘制动画生成方法的流程示意图。
图2为本公开又一实施例提供的绘制动画生成方法的流程示意图。
图3为本公开实施例提供的绘制动画绘制示意图。
图4为本公开又一实施例提供的绘制动画生成方法的流程示意图。
图5为本公开实施例提供的素材笔刷绘制的目标线条示意图。
图6为本公开又一实施例提供的绘制动画生成方法的流程示意图。
图7为本公开实施例提供的绘制动画生成装置的结构示意图。
图8为本公开实施例提供的电子设备的结构示意图。
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本公开一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范围。
名词解释:
包围盒:一种求解离散点集最优包围空间的算法,基本思想是用体积稍大且特性简单的几何体(称为包围盒)来近似地代替复杂的几何对象。
为了解决现有的涂鸦绘制动画生成方法对终端设备性能要求较高,且动画绘制过程中容易出现卡顿的技术问题,本公开提供了一种绘制动画生成方法、装置、设备、可读存储介质及产品。
需要说明的是,本公开提供的绘制动画生成方法、装置、电子设备、计算机可读存储介质、计算机程序产品及计算机程序可以应用在任意一种需要重现绘制过程的应用场景中。
现有的涂鸦绘制过程中,是由多个小正方形组成每一笔画,由每一笔画组成最终的涂鸦图案。因此,在进行涂鸦绘制动画生成的过程中,也需要对涂鸦图案中每一个小正方形进行重新绘制。因此,当涂鸦图案中笔画较多时,需要绘制的小正方形也较多,会造成绘制卡顿现象,影响用户体验。
在解决上述技术问题的过程中,发明人通过研究发现,为了快速地实现对绘制过程的重新绘制,可以预先存储目标线条中每一笔画对应的笔画快照、笔画包围盒以及绘制时间,从而在获取到用户触发的绘制动画生成请求时,可以根据笔画快照、笔画包围盒快速地实现目标线条绘制过程的重现。从而无需进行大量小正方形的重新绘制,避免了绘制卡顿的现象。
实施例一:
图1为本公开实施例提供的绘制动画生成方法的流程示意图,如图1所示,该方法包括:
步骤101、响应于用户针对目标线条触发的绘制动画生成请求,获取所述目标线条对应的线条绘制信息,所述线条绘制信息中包括所述目标线条中至少部分笔画对应的笔画快照、笔画包围盒以及绘制轨迹,所述目标线条由多个笔画构成。
本实施例的执行主体为绘制动画生成装置,该绘制动画生成装置可耦合于终端设备中。从而可以根据用户在终端设备上触发的指令进行目标线条对应的绘制动画的生成。可选地,该绘制动画生成装置可以耦合于服务器中。该服务器与终端设备通信连接,从而可以获取终端设备发送的绘制动画生成请求,根据该绘制动画生成请求进行绘制动画的生成,并将生成的绘制动画反馈至终端设备进行播放。
在本实施方式中,用户可以在终端设备上针对目标视频或者目标图像进行编辑操作。例如,可以在目标视频或者目标图像上添加随手绘制的线条,将用户绘制的多个笔画对应的线条作为目标线条。可选地,该目标线条可以以涂鸦的形式进行显示。
为了便于后续用户对绘制过程的回顾,在绘制过程中,可以对目标线条对应的线条绘制信息进行存储,其中,该线条绘制信息中包括目标线条中每一笔画对应的笔画快照、笔画包围盒以及绘制轨迹。该笔画快照能够表征某一笔画对应的绘制情况,该笔画包围盒能够对笔画的最优包围空间。
该笔画快照可以为笔画对应的图像。在用户绘制该目标线条的过程中,针对用户每一次在屏幕上的滑动操作,可以根据该滑动操作确定用户绘制的笔画。将每一笔画绘制在单独的页面内进行存储,得到笔画快照。在用户完成对目标线条的绘制操作之后,可以将存储的全部笔画的笔画快照进行融合操作并显示,得到该目标线条。
当用户完成对目标线条的绘制时,可以通过预设的触发控件生成针对该目标线条的绘制动画生成请求,以实现对目标线条的绘制过程的回顾。相应地,绘制动画生成装置可以响应于该绘制动画生成请求,获取预存的线条绘制信息。
步骤102、根据所述绘制动画生成请求,采用所述线条绘制信息对所述目标线条对应的至少部分笔画进行绘制,生成所述目标线条对应的绘制动画。
在本实施方式中,在获取到线条绘制信息之后,即可以根据该线条绘制信息对目标线条对应的至少部分笔画按照绘制顺序进行绘制操作,以生成目标线条对应的绘制动画。
需要说明的是,用户可以根据实际需求对需要进行绘制的笔画进行选择。举例来说,用户可以选择对目标线条中的全部笔画进行重新绘制操作。或者,用户也可以在目标线条中选择部分笔画进行绘制动画的生成,本公开对此不做限制。
从而无需对目标线条对应的全部小正方形进行重新绘制,有效地避免了绘制过程的卡顿现象。
进一步地,在上述任一实施例的基础上,所述绘制动画生成请求中包括动画类型。
步骤102包括:
采用与所述动画类型对应的绘制方式,根据所述线条绘制信息对所述目标线条对应的至少部分笔画进行绘制,生成所述目标线条对应的绘制动画。
在本实施例中,为了丰富绘制动画的显示效果,可以预设有不同的动画类型。例如,可以包括入场动画类型、出场动画类型以及循环动画类型。其中,该入场动画类型可以被配置为各笔画逐渐绘制的动画,出场动画则可以被配置为各笔画逐渐消失的动画。循环动画则可以被配置为目标线条按照预设的动画编辑元素进行循环显示的动画。
用户在触发绘制动画生成请求时,可以同时选择动画类型。
相应地,为了能够使得生成的绘制动画与用户的实际需求相匹配,可以根据该动画类型对应的绘制方式,根据该线条绘制信息对目标线条对应的至少部分笔画进行绘制,生成目标线条对应的绘制动画。
本实施例提供的绘制动画生成方法,通过预先存储目标线条中每一笔画对应的笔画快照、笔画包围盒以及绘制时间,从而在获取到用户触发的绘制动画生成请求时,可以根据笔画快照、笔画包围盒快速地实现目标线条绘制过程的重现。无需针对每一笔画对全部小正方形进行重新绘制,有效地提高了绘制动画生成的效率,且避免造成终端设备的卡顿。
实施例二:
图2为本公开又一实施例提供的绘制动画生成方法的流程示意图,在上述任一实施例的基础上,所述动画类型包括入场动画类型和/或出场动画,如图2所示,所述采用与所述动画类型对应的绘制方式,根据所述线条绘制信息对所述目标线条对应的至少部分笔画进行绘制,生成所述目标线条对应的绘制动画,包括:
步骤201、根据所述线条绘制信息以及预设的绘制动画信息,确定当前时间帧对应的待绘制笔画,所述绘制动画信息中包括所述绘制动画对应的绘制时长和/或绘制速度;
步骤202、对所述待绘制笔画进行绘制操作,获得绘制笔画,根据所述线条绘制信息对所述目标线条中显示顺序在所述待绘制笔画之前的其他笔画进行绘制,获得所述绘制
动画。
在本实施例中,动画类型具体可以为入场动画类型和/或出场动画类型。其中,该入场动画类型可以被配置为各笔画逐渐绘制的动画,出场动画则可以被配置为各笔画逐渐消失的动画。
为了能够有效地避免绘制动画的卡顿现象,可以采用笔画绘制与笔画快照相结合的方式实现绘制动画的生成。具体地,可以获取预设的绘制动画信息,其中,该绘制动画信息可以为用户在触发绘制动画生成请求时根据实际需求设置的。该绘制动画信息可以包括绘制动画对应的绘制时长和/或绘制速度。举例来说,用户可以设置绘制动画的绘制时长为30秒。因此,可以控制绘制动画中的笔画匀速绘制,在30秒时绘制结束。
在获取到绘制动画信息之后,可以根据该绘制动画信息以及线条绘制信息,确定当前时间帧对应的待绘制笔画,针对该待绘制笔画,可以对该待绘制笔画进行绘制操作。针对目标线条中,显示顺序在该待绘制笔画之前的其他笔画,为了避免对其他笔画进行绘制造成终端设备的卡顿,可以根据线条绘制信息中的笔画快照对该其他笔画进行绘制操作,获得绘制动画。
进一步地,在上述任一实施例的基础上,步骤202包括:
根据所述线条绘制信息确定所述其他笔画对应的笔画快照。
对所述绘制笔画与所述其他笔画对应的笔画快照进行融合操作,生成所述目标线条对应的绘制动画。
在本实施例中,针对目标线条中显示顺序在待绘制笔画之前的其他笔画,可以在线条绘制信息中确定其他笔画对应的笔画快照。将该其他笔画对应的笔画快照与绘制笔画进行融合操作,生成目标线条对应的绘制动画。
进一步地,在上述任一实施例的基础上,步骤201包括:
根据所述目标线条中全部笔画对应的总长度以及所述绘制动画信息,确定各笔画对应的绘制时间段。
确定当前时间帧,确定与所述当前时间帧相匹配的绘制时间段,将所述绘制时间段对应的笔画确定为所述待绘制笔画。
在本实施例中,针对目标线条中的全部笔画,首先可以计算该全部笔画对应的总长度。根据该总长度以及绘制动画信息,确定各笔画对应的绘制时间段。在绘制动画生成过程中,确定当前时间帧,将于该时间帧相匹配的绘制时间段对应的笔画作为当前的待绘制笔画。
本实施例提供的绘制动画生成方法,通过采用笔画绘制与笔画快照相结合的方式实现绘制动画的生成,从而能够有效地避免终端设备的卡顿现象。此外,能够提高绘制动画生成的效率。
进一步地,在上述任一实施例的基础上,当所述动画类型为入场动画类型,动画绘制顺序为顺序绘制时,和/或,当所述动画类型为出场动画类型,且动画绘制顺序为倒序绘制时,步骤202包括:
根据所述绘制动画信息、所述目标线条中全部笔画对应的总长度以及所述绘制轨迹,确定当前时间帧对应的第一绘制位置以及下一时间帧对应的绘制位置。
对所述第二绘制位置与第一绘制位置中间的待绘制区域进行增量绘制操作,直至完
成所述待绘制笔画的绘制操作,获得所述绘制笔画。
在本实施例中,针对入场动画类型以及出场动画类型,分别对应有顺序绘制以及倒序绘制两种绘制方式。其中,顺序绘制即为按照用户的绘制方向进行绘制,倒序绘制即为按照与用户的绘制方向相反的方向进行绘制。举例来说,若用户按照从左到右的顺序完成对目标线条的绘制,则顺序绘制即为按照从左到右的顺序在绘制动画中显示绘制过程,倒序绘制即为按照从右到左的顺序在绘制动画中显示绘制过程。
相应地,入场动画中的顺序绘制即为按照用户的绘制顺序,控制笔画逐渐绘制的动画,出场动画中的倒序绘制即为按照与用户的绘制顺序相反的顺序,控制笔画逐渐消失的动画。
具体地,在上述应用场景下,笔画以增量的形式显示,也即下一帧绘制的笔画长度大于上一帧的笔画长度。因此,针对上述应用场景,可以采用增量绘制的方式进行待绘制笔画的绘制操作。
针对当前时间帧,根据绘制动画信息、目标线条中全部笔画对应的总长度以及绘制轨迹确定当前时间帧对应的第一绘制位置。确定与当前时间帧存在预设时间间隔的下一时间帧,根据绘制动画信息、目标线条中全部笔画对应的总长度以及绘制轨迹确定当前时间帧对应的第二绘制位置。
确定第一绘制位置与第二绘制位置之间的待绘制区域,在当前时间帧的基础上,对该待绘制区域进行增量绘制,在完成对该待绘制笔画的增量绘制之后,获得该绘制笔画。
图3为本公开实施例提供的绘制动画绘制示意图,如图3所示,当绘制顺序为顺序绘制时,可以确定当前时间帧对应的第一绘制位置31,以及下一时间帧对应的第二绘制位置32。对第一绘制位置31与第二绘制位置32之间的待绘制区域33进行增量绘制,获得绘制结果34。在完成对全部目标线条的绘制之后,获得绘制动画。
本实施例提供的绘制动画生成方法,通过采用增量绘制的方式进行待绘制笔画的绘制操作,从而能够有效地提高绘制操作的效率,绘制过程资源占用率较低,避免造成卡顿现象,提升用户体验。
进一步地,在上述任一实施例的基础上,当所述动画类型为入场动画类型,动画绘制顺序为倒序绘制,和/或,当所述动画类型为出场动画类型,且动画绘制顺序为顺序绘制时,步骤202包括:
确定当前时间帧所述待绘制笔画对应的已绘制长度。
根据所述绘制动画信息以及所述当前时间帧与下一时间帧之间的时间差,确定下一时间帧对应的目标绘制长度。
在下一时间帧对所述目标绘制长度的待绘制笔画进行全量绘制操作,获得绘制笔画。
在本实施例中,当动画类型为入场类型,动画绘制顺序为倒序绘制时,则表征其为按照与用户的绘制顺序相反的顺序逐渐绘制笔画的动画。当动画类型为出场动画类型,且动画绘制顺序为顺序绘制时,则表征其为按照与用户的绘制顺序相同的顺序进行笔画消失的动画。也即在上述应用场景中,每一笔画在当前时间帧的绘制长度均大于下一时间帧的绘制长度。因此,为了能够实现上述动画效果,针对每一时间帧的待绘制笔画,需要采用全量绘制的方式进行绘制。
可选地,可以确定当前时间帧下待绘制笔画对应的已绘制长度。根据绘制动画信息
以及当前时间帧与下一时间帧之间的时间差,确定下一时间帧对应的目标绘制长度。在下一时间帧对目标绘制长度的待绘制笔画进行全量绘制操作,获得绘制笔画。
本实施例提供的绘制动画生成方法,通过对待绘制笔画采用全量绘制的方式,针对其他笔画采用笔画快照的方式,从而无需在绘制过程中对全部笔画进行重新绘制,提高了绘制效率。此外,无需对各笔画对应的大量小正方形进行重新绘制,避免造成绘制过程的卡顿现象。
实施例三:
图4为本公开又一实施例提供的绘制动画生成方法的流程示意图,在上述任一实施例的基础上,所述动画类型包括循环动画类型。如图4所示,所述采用与所述动画类型对应的绘制方式,根据所述线条绘制信息对所述目标线条对应的至少部分笔画进行绘制,生成所述目标线条对应的绘制动画,包括:
步骤401、确定绘制所述目标线条时所使用的笔刷类型。
步骤402、采用与所述笔刷类型对应的绘制方式,根据所述线条绘制信息对所述目标线条对应的至少部分笔画进行绘制,生成所述目标线条对应的绘制动画。
在本实施例中,动画类型具体可以为循环动画类型,该循环动画类型具体可以为对目标线条中添加随机编辑元素,并控制编辑后的目标线条循环播放。例如,可以对目标线条中的每一笔画添加随机抖动、随机缩放、尺寸调整、随机偏移、随机旋转中的至少一种。
实际应用中,为了优化涂鸦效果,可以设置有多种不同的笔刷类型。其中,笔刷类型可以包括纯色笔刷以及素材笔刷,该纯色笔刷的颜色可以为用户自定义的。素材笔刷绘制的笔画则可以为素材笔刷对应的素材格构成的。
因此,针对不同的笔刷类型,可以采用不同的绘制方式根据线条绘制信息对目标线条对应的每一笔画进行绘制,生成目标线条对应的绘制动画。
本实施例提供的绘制动画生成方法,通过根据不同的笔刷类型,采用不同的绘制方式进行绘制动画的绘制操作,从而能够使得最终生成的绘制动画效果与笔刷类型相匹配,提升了绘制动画的质量。
进一步地,在上述任一实施例的基础上,所述笔刷类型包括纯色笔刷类型,步骤402包括:
针对所述目标线条中的至少部分笔画,对所述笔画对应的笔画包围盒添加预设的编辑元素,获得编辑后的目标笔画,其中,所述编辑元素包括旋转元素、缩放元素、偏移元素、移动元素中的一项或多项。
对至少部分笔画对应的目标笔画关联的笔画快照进行融合操作,获得所述绘制动画。
在本实施例中,当笔刷类型为纯色笔刷时,可以采用笔画快照以及笔画包围盒的实现绘制动画的生成。因此,可以对每一笔画对应的笔画包围盒添加预设编辑元素,获得编辑后的目标笔画,其中,预设编辑元素包括用户预设的旋转元素、缩放元素、偏移元素、移动元素中的一项或多项。或者,该预设编辑元素可以包括随机的旋转元素、缩放元素、偏移元素、移动元素中的一项或多项。
在完成对各笔画的编辑操作之后,可以对至少部分笔画对应的目标笔画关联的笔画
快照进行融合操作,获得绘制动画。
本实施例提供的绘制动画生成方法,当笔刷类型为纯色笔时,通过对每一笔画的包围盒加入预设编辑元素,对至少部分笔画对应的目标笔画关联的笔画快照进行融合操作,从而能够使得生成的绘制动画中,每一笔画都能够呈现编辑元素,丰富了绘制动画的显示效果,使得生成的绘制动画更加贴合用户的实际需求,提升用户体验。
进一步地,在上述任一实施例的基础上,所述笔刷类型包括素材笔刷,所述素材笔刷绘制的笔画由多个所述素材笔刷对应的素材格构成,步骤402包括:
针对所述目标线条中至少部分笔画对应的每一素材格,对所述素材格添加预设的编辑元素,获得目标素材格,其中,所述编辑元素包括旋转元素、缩放元素、偏移元素、移动元素中的一项或多项;
根据所述目标素材格生成编辑后的目标笔画;
对所述目标线条对应的至少部分目标笔画进行全量绘制操作,获得所述绘制动画。
在本实施例中,当笔刷类型为素材笔刷时,素材笔刷绘制的笔画可以为素材笔刷对应的素材格构成的,因此,在生成绘制动画时,需要对每一个素材格进行编辑操作。
具体地,针对目标线条中各笔画对应的每一素材格,可以对其添加预设编辑元素,获得编辑后的目标素材格,其中,预设编辑元素包括用户预设的旋转元素、缩放元素、偏移元素、移动元素中的一项或多项。或者,该预设编辑元素可以包括随机的旋转元素、缩放元素、偏移元素、移动元素中的一项或多项。
根据目标素材格生成编辑后的目标笔画。对目标线条对应的至少部分目标笔画进行全量绘制操作,获得绘制动画。
图5为本公开实施例提供的素材笔刷绘制的目标线条示意图,如图5所示,由素材笔刷绘制的目标线条51中,每一笔画均有多个素材笔刷对应的素材格52组成,其中,该素材格52可以为爱心形状。
本实施例提供的绘制动画生成方法,当笔刷类型为素材笔刷时,通过对各笔画对应的每一素材格加入随机编辑元素,根据目标素材格生成编辑后的目标笔画。对目标线条对应的至少部分目标笔画进行全量绘制操作,获得绘制动画,从而能够使得每一素材格都能够呈现随机编辑元素,丰富了绘制动画的显示效果。
实施例四:
图6为本公开又一实施例提供的绘制动画生成方法的流程示意图,在上述任一实施例的基础上,步骤101之前,还包括:
步骤601、响应于用户在绘制编辑页面内对目标视频的绘制操作,获取所述用户绘制的每一笔画对应的线条绘制信息。
步骤602、响应于用户对预设的完成控件的触发操作,将用户当前绘制的全部笔画确定为所述目标线条,并存储所述目标线条对应的线条绘制信息。
在本实施例中,用户可以在终端设备上针对目标视频或者目标图像进行编辑操作。例如,可以在目标视频或者目标图像上添加随手绘制的涂鸦,获得目标线条。
可选地,响应于用户在绘制编辑页面内对目标视频的绘制操作,获取所述用户绘制的每一笔画对应的线条绘制信息。其中,该线条绘制信息中包括目标线条中每一笔画对
应的笔画快照、笔画包围盒以及绘制轨迹。该笔画快照能够表征某一时刻线条绘制的情况,该笔画包围盒能够对笔画的最优包围空间。
进一步地,该绘制编辑页面中还设置有完成控件。当用户完成对目标线条的绘制时,可以对该完成控件进行触发操作。相应地,响应于用户对预设的完成控件的触发操作,将用户当前绘制的全部笔画确定为目标线条。为了便于用户后续对绘制过程的回顾,以生成绘制动画,可以存储目标线条对应的线条绘制信息。
进一步地,在上述任一实施例的基础上,步骤602之后,还包括:
响应于用户针对目标线条触发的展示请求,将所述用户触发完成控件时的绘制的目标线条对应的笔画快照与所述目标视频进行融合操作。
在本实施例中,用户在完成目标线条的绘制之后,也可以选择不根据该目标线条生成涂鸦视频。此时,可以直接将目标线条与目标视频进行融合操作,给用户展示最终的效果。
具体地,可以响应于用户针对目标线条触发的展示请求,将用户触发完成控件时的绘制的目标线条对应的笔画快照与目标视频进行融合操作。
本实施例提供的绘制动画生成方法,通过在目标线条的绘制过程中,保存目标线条对应的线条绘制信息,从而后续能够基于该线条绘制信息快速地实现绘制动画的生成,避免重新绘制过程中的卡顿现象,提升用户体验。
实施例五:
图7为本公开实施例提供的绘制动画生成装置的结构示意图,如图7所示,该装置包括:获取模块71以及绘制模块72。其中,获取模块71,用于响应于用户针对目标线条触发的绘制动画生成请求,获取所述目标线条对应的线条绘制信息,所述线条绘制信息中包括所述目标线条中至少部分笔画对应的笔画快照、笔画包围盒以及绘制轨迹,所述目标线条由多个笔画构成。绘制模块72,用于根据所述绘制动画生成请求,采用所述线条绘制信息对所述目标线条对应的至少部分笔画进行绘制,生成所述目标线条对应的绘制动画。
进一步地,在上述任一实施例的基础上,所述绘制动画生成请求中包括动画类型;所述绘制模块用于:采用与所述动画类型对应的绘制方式,根据所述线条绘制信息对所述目标线条对应的至少部分笔画进行绘制,生成所述目标线条对应的绘制动画。
进一步地,在上述任一实施例的基础上,所述动画类型包括入场动画和/或出场动画;所述绘制模块用于:根据所述线条绘制信息以及预设的绘制动画信息,确定当前时间帧对应的待绘制笔画,所述绘制动画信息中包括所述绘制动画对应的绘制时长和/或绘制速度;对所述待绘制笔画进行绘制操作,获得绘制笔画,根据所述线条绘制信息对所述目标线条中显示顺序在所述待绘制笔画之前的其他笔画进行绘制,获得所述绘制动画。
进一步地,在上述任一实施例的基础上,所述绘制模块用于:根据所述线条绘制信息确定所述其他笔画对应的笔画快照;对所述绘制笔画与所述其他笔画对应的笔画快照进行融合操作,生成所述目标线条对应的绘制动画。
进一步地,在上述任一实施例的基础上,所述绘制模块用于:根据所述目标线条中全部笔画对应的总长度以及所述绘制动画信息,确定各笔画对应的绘制时间段;确定当
前时间帧,确定与所述当前时间帧相匹配的绘制时间段,将所述绘制时间段对应的笔画确定为所述待绘制笔画。
进一步地,在上述任一实施例的基础上,当所述动画类型为入场动画类型,动画绘制顺序为顺序绘制时,和/或,当所述动画类型为出场动画类型,且动画绘制顺序为倒序绘制时,所述绘制模块用于:根据所述绘制动画信息、所述目标线条中全部笔画对应的总长度以及所述绘制轨迹,确定当前时间帧对应的第一绘制位置以及下一时间帧对应的绘制位置;对所述第二绘制位置与第一绘制位置中间的待绘制区域进行增量绘制操作,直至完成所述待绘制笔画的绘制操作,获得所述绘制笔画。
进一步地,在上述任一实施例的基础上,当所述动画类型为入场动画类型,动画绘制顺序为倒序绘制,和/或,当所述动画类型为出场动画类型,且动画绘制顺序为顺序绘制时,所述绘制模块用于:确定当前时间帧所述待绘制笔画对应的已绘制长度;根据所述绘制动画信息以及所述当前时间帧与下一时间帧之间的时间差,确定下一时间帧对应的目标绘制长度;在下一时间帧对所述目标绘制长度的待绘制笔画进行全量绘制操作,获得绘制笔画。
进一步地,在上述任一实施例的基础上,所述动画类型包括循环动画;所述绘制模块用于:确定绘制所述目标线条时所使用的笔刷类型;采用与所述笔刷类型对应的绘制方式,根据所述线条绘制信息对所述目标线条对应的至少部分笔画进行绘制,生成所述目标线条对应的绘制动画。
进一步地,在上述任一实施例的基础上,所述笔刷类型包括纯色笔刷,所述绘制模块用于:针对所述目标线条中的至少部分笔画,对所述笔画对应的笔画包围盒添加预设的编辑元素,获得编辑后的目标笔画,其中,所述编辑元素包括旋转元素、缩放元素、偏移元素、移动元素中的一项或多项;对至少部分笔画对应的目标笔画关联的笔画快照进行融合操作,获得所述绘制动画。
进一步地,在上述任一实施例的基础上,所述笔刷类型包括素材笔刷,所述素材笔刷绘制的笔画由多个所述素材笔刷对应的素材格构成;所述绘制模块用于:针对所述目标线条中至少部分笔画对应的每一素材格,对所述素材格添加预设的编辑元素,获得目标素材格,其中,所述编辑元素包括旋转元素、缩放元素、偏移元素、移动元素中的一项或多项;根据所述目标素材格生成编辑后的目标笔画;对所述目标线条对应的至少部分目标笔画进行全量绘制操作,获得所述绘制动画。
进一步地,在上述任一实施例的基础上,所述装置还包括:获取模块,用于响应于用户在绘制编辑页面内对目标视频的绘制操作,获取所述用户绘制的每一笔画对应的线条绘制信息;确定模块,用于响应于用户对预设的完成控件的触发操作,将用户当前绘制的全部笔画确定为所述目标线条,并存储所述目标线条对应的线条绘制信息。
进一步地,在上述任一实施例的基础上,所述装置还包括:融合模块,用于响应于用户针对目标线条触发的展示请求,将所述用户触发完成控件时的绘制的目标线条对应的笔画快照与所述目标视频进行融合操作。
本实施例提供的设备,可用于执行上述方法实施例的技术方案,其实现原理和技术效果类似,本实施例此处不再赘述。
实施例七:
为了实现上述实施例,本公开实施例还提供了一种电子设备,包括:处理器和存储器。
所述存储器存储计算机执行指令。
所述处理器执行所述存储器存储的计算机执行指令,使得所述处理器执行如上述任一实施例所述的绘制动画生成方法。
图8为本公开实施例提供的电子设备的结构示意图,如图8所示,该电子设备800可以为终端设备或服务器。其中,终端设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、个人数字助理(Personal Digital Assistant,简称PDA)、平板电脑(Portable Android Device,简称PAD)、便携式多媒体播放器(Portable Media Player,简称PMP)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图8示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图8所示,电子设备800可以包括处理装置(例如中央处理器、图形处理器等)801,其可以根据存储在只读存储器(Read Only Memory,简称ROM)802中的程序或者从存储装置808加载到随机访问存储器(Random Access Memory,简称RAM)803中的程序而执行各种适当的动作和处理。在RAM 803中,还存储有电子设备800操作所需的各种程序和数据。处理装置801、ROM 802以及RAM 803通过总线804彼此相连。输入/输出(Input/Output,简称I/O)接口805也连接至总线804。
通常,以下装置可以连接至I/O接口805:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置806;包括例如液晶显示器(Liquid Crystal Display,简称LCD)、扬声器、振动器等的输出装置807;包括例如磁带、硬盘等的存储装置808;以及通信装置809。通信装置809可以允许电子设备800与其他设备进行无线或有线通信以交换数据。虽然图8示出了具有各种装置的电子设备800,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置809从网络上被下载和安装,或者从存储装置808被安装,或者从ROM 802被安装。在该计算机程序被处理装置801执行时,执行本公开实施例的方法中限定的上述功能。
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、RAM、ROM、可擦式可编程只读存储器(Erasable Programmable Read Only Memory,简称EPROM)或闪存、光纤、便携式紧凑磁盘只读存储器(Compact Disk Read Only Memory,简称CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储
程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、射频(Radio Frequency,简称RF)等等,或者上述的任意合适的组合。
本公开实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如上述任一实施例所述的绘制动画生成方法。
本公开实施例还提供了一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现如上述任一实施例所述的绘制动画生成的方法。
本公开实施例还提供了一种计算机程序,所述计算机程序被处理器执行时实现如上述任一实施例所述的绘制动画生成的方法。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备执行上述实施例所示的方法。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(Local Area Network,简称LAN)或广域网(Wide Area Network,简称WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在某种情况下并不构成对该单元本身的限定,例如,
第一获取单元还可以被描述为“获取至少两个网际协议地址的单元”。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(Field Programmable Gate Array,简称FPGA)、专用集成电路(Application Specific Integrated Circuit,简称ASIC)、专用标准产品(Application Specific Standard Parts,简称ASSP)、片上系统(System on Chip,简称SOC)、复杂可编程逻辑设备(Complex Programmable Logic Device,简称CPLD)等等。
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、RAM、ROM、EPROM或快闪存储器、光纤、CD-ROM、光学储存设备、磁储存设备、或上述内容的任何合适组合。
第一方面,根据本公开的一个或多个实施例,提供了一种绘制动画生成方法,包括:
响应于用户针对目标线条触发的绘制动画生成请求,获取所述目标线条对应的线条绘制信息,所述线条绘制信息中包括所述目标线条中至少部分笔画对应的笔画快照、笔画包围盒以及绘制轨迹,所述目标线条由多个笔画构成;
根据所述绘制动画生成请求,采用所述线条绘制信息对所述目标线条对应的至少部分笔画进行绘制,生成所述目标线条对应的绘制动画。
根据本公开的一个或多个实施例,所述绘制动画生成请求中包括动画类型;
所述采用所述线条绘制信息对所述目标线条对应的至少部分笔画进行绘制,生成所述目标线条对应的绘制动画,包括:
采用与所述动画类型对应的绘制方式,根据所述线条绘制信息对所述目标线条对应的至少部分笔画进行绘制,生成所述目标线条对应的绘制动画。
根据本公开的一个或多个实施例,所述动画类型包括入场动画和/或出场动画;
所述采用与所述动画类型对应的绘制方式,根据所述线条绘制信息对所述目标线条对应的至少部分笔画进行绘制,生成所述目标线条对应的绘制动画,包括:
根据所述线条绘制信息以及预设的绘制动画信息,确定当前时间帧对应的待绘制笔画,所述绘制动画信息中包括所述绘制动画对应的绘制时长和/或绘制速度;
对所述待绘制笔画进行绘制操作,获得绘制笔画,根据所述线条绘制信息对所述目标线条中显示顺序在所述待绘制笔画之前的其他笔画进行绘制,获得所述绘制动画。
根据本公开的一个或多个实施例,所述对所述待绘制笔画进行绘制操作,获得绘制笔画,根据所述线条绘制信息对所述目标线条中显示顺序在所述待绘制笔画之前的其他笔画进行绘制,获得所述绘制动画,包括:
根据所述线条绘制信息确定所述其他笔画对应的笔画快照;
对所述绘制笔画与所述其他笔画对应的笔画快照进行融合操作,生成所述目标线条对应的绘制动画。
根据本公开的一个或多个实施例,所述根据所述线条绘制信息以及预设的绘制动画
信息,确定当前时间帧对应的待绘制笔画,包括:
根据所述目标线条中全部笔画对应的总长度以及所述绘制动画信息,确定各笔画对应的绘制时间段;
确定当前时间帧,确定与所述当前时间帧相匹配的绘制时间段,将所述绘制时间段对应的笔画确定为所述待绘制笔画。
根据本公开的一个或多个实施例,当所述动画类型为入场动画类型,动画绘制顺序为顺序绘制时,和/或,当所述动画类型为出场动画类型,且动画绘制顺序为倒序绘制时,所述对所述待绘制笔画进行绘制操作,获得绘制笔画,包括:
根据所述绘制动画信息、所述目标线条中全部笔画对应的总长度以及所述绘制轨迹,确定当前时间帧对应的第一绘制位置以及下一时间帧对应的绘制位置;
对所述第二绘制位置与第一绘制位置中间的待绘制区域进行增量绘制操作,直至完成所述待绘制笔画的绘制操作,获得所述绘制笔画。
根据本公开的一个或多个实施例,当所述动画类型为入场动画类型,动画绘制顺序为倒序绘制,和/或,当所述动画类型为出场动画类型,且动画绘制顺序为顺序绘制时,所述对所述待绘制笔画进行绘制操作,获得绘制笔画,包括:
确定当前时间帧所述待绘制笔画对应的已绘制长度;
根据所述绘制动画信息以及所述当前时间帧与下一时间帧之间的时间差,确定下一时间帧对应的目标绘制长度;
在下一时间帧对所述目标绘制长度的待绘制笔画进行全量绘制操作,获得绘制笔画。
根据本公开的一个或多个实施例,所述动画类型包括循环动画;
所述采用与所述动画类型对应的绘制方式,根据所述线条绘制信息对所述目标线条对应的至少部分笔画进行绘制,生成所述目标线条对应的绘制动画,包括:
确定绘制所述目标线条时所使用的笔刷类型;
采用与所述笔刷类型对应的绘制方式,根据所述线条绘制信息对所述目标线条对应的至少部分笔画进行绘制,生成所述目标线条对应的绘制动画。
根据本公开的一个或多个实施例,所述笔刷类型包括纯色笔刷,所述采用与所述动画类型对应的绘制方式,根据所述线条绘制信息对所述目标线条对应的至少部分笔画进行绘制,生成所述目标线条对应的绘制动画,包括:
针对所述目标线条中的至少部分笔画,对所述笔画对应的笔画包围盒添加预设的编辑元素,获得编辑后的目标笔画,其中,所述编辑元素包括旋转元素、缩放元素、偏移元素、移动元素中的一项或多项;
对至少部分笔画对应的目标笔画关联的笔画快照进行融合操作,获得所述绘制动画。
根据本公开的一个或多个实施例,所述笔刷类型包括素材笔刷,所述素材笔刷绘制的笔画由多个所述素材笔刷对应的素材格构成;
所述采用与所述动画类型对应的绘制方式,根据所述线条绘制信息对所述目标线条对应的至少部分笔画进行绘制,生成所述目标线条对应的绘制动画,包括:
针对所述目标线条中至少部分笔画对应的每一素材格,对所述素材格添加预设的编辑元素,获得目标素材格,其中,所述编辑元素包括旋转元素、缩放元素、偏移元素、移动元素中的一项或多项;
根据所述目标素材格生成编辑后的目标笔画;
对所述目标线条对应的至少部分目标笔画进行全量绘制操作,获得所述绘制动画。
根据本公开的一个或多个实施例,所述响应于用户针对目标线条触发的绘制动画生成请求,获取所述目标线条对应的线条绘制信息之前,还包括:
响应于用户在绘制编辑页面内对目标视频的绘制操作,获取所述用户绘制的每一笔画对应的线条绘制信息;
响应于用户对预设的完成控件的触发操作,将用户当前绘制的全部笔画确定为所述目标线条,并存储所述目标线条对应的线条绘制信息。
根据本公开的一个或多个实施例,所述存储所述目标线条对应的线条绘制信息之后,还包括:
响应于用户针对目标线条触发的展示请求,将所述用户触发完成控件时的绘制的目标线条对应的笔画快照与所述目标视频进行融合操作。
第二方面,根据本公开的一个或多个实施例,提供了一种绘制动画生成装置,包括:
获取模块,用于响应于用户针对目标线条触发的绘制动画生成请求,获取所述目标线条对应的线条绘制信息,所述线条绘制信息中包括所述目标线条中至少部分笔画对应的笔画快照、笔画包围盒以及绘制轨迹,所述目标线条由多个笔画构成;
绘制模块,用于根据所述绘制动画生成请求,采用所述线条绘制信息对所述目标线条对应的至少部分笔画进行绘制,生成所述目标线条对应的绘制动画。
根据本公开的一个或多个实施例,所述绘制动画生成请求中包括动画类型;所述绘制模块用于:采用与所述动画类型对应的绘制方式,根据所述线条绘制信息对所述目标线条对应的至少部分笔画进行绘制,生成所述目标线条对应的绘制动画。
根据本公开的一个或多个实施例,所述动画类型包括入场动画和/或出场动画;所述绘制模块用于:根据所述线条绘制信息以及预设的绘制动画信息,确定当前时间帧对应的待绘制笔画,所述绘制动画信息中包括所述绘制动画对应的绘制时长和/或绘制速度;对所述待绘制笔画进行绘制操作,获得绘制笔画,根据所述线条绘制信息对所述目标线条中显示顺序在所述待绘制笔画之前的其他笔画进行绘制,获得所述绘制动画。
根据本公开的一个或多个实施例,所述绘制模块用于:根据所述线条绘制信息确定所述其他笔画对应的笔画快照;对所述绘制笔画与所述其他笔画对应的笔画快照进行融合操作,生成所述目标线条对应的绘制动画。
根据本公开的一个或多个实施例,所述绘制模块用于:根据所述目标线条中全部笔画对应的总长度以及所述绘制动画信息,确定各笔画对应的绘制时间段;确定当前时间帧,确定与所述当前时间帧相匹配的绘制时间段,将所述绘制时间段对应的笔画确定为所述待绘制笔画。
根据本公开的一个或多个实施例,当所述动画类型为入场动画类型,动画绘制顺序为顺序绘制时,和/或,当所述动画类型为出场动画类型,且动画绘制顺序为倒序绘制时,所述绘制模块用于:根据所述绘制动画信息、所述目标线条中全部笔画对应的总长度以及所述绘制轨迹,确定当前时间帧对应的第一绘制位置以及下一时间帧对应的绘制位置;对所述第二绘制位置与第一绘制位置中间的待绘制区域进行增量绘制操作,直至完成所述待绘制笔画的绘制操作,获得所述绘制笔画。
根据本公开的一个或多个实施例,当所述动画类型为入场动画类型,动画绘制顺序为倒序绘制,和/或,当所述动画类型为出场动画类型,且动画绘制顺序为顺序绘制时,所述绘制模块用于:确定当前时间帧所述待绘制笔画对应的已绘制长度;根据所述绘制动画信息以及所述当前时间帧与下一时间帧之间的时间差,确定下一时间帧对应的目标绘制长度;在下一时间帧对所述目标绘制长度的待绘制笔画进行全量绘制操作,获得绘制笔画。
根据本公开的一个或多个实施例,所述动画类型包括循环动画;所述绘制模块用于:确定绘制所述目标线条时所使用的笔刷类型;采用与所述笔刷类型对应的绘制方式,根据所述线条绘制信息对所述目标线条对应的至少部分笔画进行绘制,生成所述目标线条对应的绘制动画。
根据本公开的一个或多个实施例,所述笔刷类型包括纯色笔刷,所述绘制模块用于:针对所述目标线条中的至少部分笔画,对所述笔画对应的笔画包围盒添加预设的编辑元素,获得编辑后的目标笔画,其中,所述编辑元素包括旋转元素、缩放元素、偏移元素、移动元素中的一项或多项;对至少部分笔画对应的目标笔画关联的笔画快照进行融合操作,获得所述绘制动画。
根据本公开的一个或多个实施例,所述笔刷类型包括素材笔刷,所述素材笔刷绘制的笔画由多个所述素材笔刷对应的素材格构成;所述绘制模块用于:针对所述目标线条中至少部分笔画对应的每一素材格,对所述素材格添加预设的编辑元素,获得目标素材格,其中,所述编辑元素包括旋转元素、缩放元素、偏移元素、移动元素中的一项或多项;根据所述目标素材格生成编辑后的目标笔画;对所述目标线条对应的至少部分目标笔画进行全量绘制操作,获得所述绘制动画。
根据本公开的一个或多个实施例,所述装置还包括:获取模块,用于响应于用户在绘制编辑页面内对目标视频的绘制操作,获取所述用户绘制的每一笔画对应的线条绘制信息;确定模块,用于响应于用户对预设的完成控件的触发操作,将用户当前绘制的全部笔画确定为所述目标线条,并存储所述目标线条对应的线条绘制信息。
根据本公开的一个或多个实施例,所述装置还包括:融合模块,用于响应于用户针对目标线条触发的展示请求,将所述用户触发完成控件时的绘制的目标线条对应的笔画快照与所述目标视频进行融合操作。
第三方面,根据本公开的一个或多个实施例,提供了一种电子设备,包括:至少一个处理器和存储器;
所述存储器存储计算机执行指令;
所述至少一个处理器执行所述存储器存储的计算机执行指令,使得所述至少一个处理器执行如上第一方面以及第一方面各种可能的设计所述的绘制动画生成方法。
第四方面,根据本公开的一个或多个实施例,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如上第一方面以及第一方面各种可能的设计所述的绘制动画生成方法。
第五方面,根据本公开的一个或多个实施例,提供了一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现如上第一方面以及第一方面各种可能的设计所述的绘制动画生成方法。
第六方面,根据本公开的一个或多个实施例,提供了一种计算机程序,所述计算机程序被处理器执行时实现如上第一方面以及第一方面各种可能的设计所述的绘制动画生成方法。
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。
此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解释为对本公开的范围的限制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。
尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本主题,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。
Claims (17)
- 一种绘制动画生成方法,包括:响应于用户针对目标线条触发的绘制动画生成请求,获取所述目标线条对应的线条绘制信息,所述线条绘制信息中包括所述目标线条中至少部分笔画对应的笔画快照、笔画包围盒以及绘制轨迹,所述目标线条由多个笔画构成;根据所述绘制动画生成请求,采用所述线条绘制信息对所述目标线条对应的至少部分笔画进行绘制,生成所述目标线条对应的绘制动画。
- 根据权利要求1所述的方法,其中,所述绘制动画生成请求中包括动画类型;所述采用所述线条绘制信息对所述目标线条对应的至少部分笔画进行绘制,生成所述目标线条对应的绘制动画,包括:采用与所述动画类型对应的绘制方式,根据所述线条绘制信息对所述目标线条对应的至少部分笔画进行绘制,生成所述目标线条对应的绘制动画。
- 根据权利要求2所述的方法,其中,所述动画类型包括入场动画和/或出场动画;所述采用与所述动画类型对应的绘制方式,根据所述线条绘制信息对所述目标线条对应的至少部分笔画进行绘制,生成所述目标线条对应的绘制动画,包括:根据所述线条绘制信息以及预设的绘制动画信息,确定当前时间帧对应的待绘制笔画,所述绘制动画信息中包括所述绘制动画对应的绘制时长和/或绘制速度;对所述待绘制笔画进行绘制操作,获得绘制笔画,根据所述线条绘制信息对所述目标线条中显示顺序在所述待绘制笔画之前的其他笔画进行绘制,获得所述绘制动画。
- 根据权利要求3所述的方法,其中,所述对所述待绘制笔画进行绘制操作,获得绘制笔画,根据所述线条绘制信息对所述目标线条中显示顺序在所述待绘制笔画之前的其他笔画进行绘制,获得所述绘制动画,包括:根据所述线条绘制信息确定所述其他笔画对应的笔画快照;对所述绘制笔画与所述其他笔画对应的笔画快照进行融合操作,生成所述目标线条对应的绘制动画。
- 根据权利要求3所述的方法,其中,所述根据所述线条绘制信息以及预设的绘制动画信息,确定当前时间帧对应的待绘制笔画,包括:根据所述目标线条中全部笔画对应的总长度以及所述绘制动画信息,确定各笔画对应的绘制时间段;确定当前时间帧,确定与所述当前时间帧相匹配的绘制时间段,将所述绘制时间段对应的笔画确定为所述待绘制笔画。
- 根据权利要求3所述的方法,其中,当所述动画类型为入场动画类型,动画绘制顺序为顺序绘制时,和/或,当所述动画类型为出场动画类型,且动画绘制顺序为倒序绘制时,所述对所述待绘制笔画进行绘制操作,获得绘制笔画,包括:根据所述绘制动画信息、所述目标线条中全部笔画对应的总长度以及所述绘制轨迹,确定当前时间帧对应的第一绘制位置以及下一时间帧对应的绘制位置;对第二绘制位置与第一绘制位置中间的待绘制区域进行增量绘制操作,直至完成所述待绘制笔画的绘制操作,获得所述绘制笔画。
- 根据权利要求3所述的方法,其中,当所述动画类型为入场动画类型,动画绘制顺序 为倒序绘制,和/或,当所述动画类型为出场动画类型,且动画绘制顺序为顺序绘制时,所述对所述待绘制笔画进行绘制操作,获得绘制笔画,包括:确定当前时间帧所述待绘制笔画对应的已绘制长度;根据所述绘制动画信息以及所述当前时间帧与下一时间帧之间的时间差,确定下一时间帧对应的目标绘制长度;在下一时间帧对所述目标绘制长度的待绘制笔画进行全量绘制操作,获得绘制笔画。
- 根据权利要求2所述的方法,其中,所述动画类型包括循环动画;所述采用与所述动画类型对应的绘制方式,根据所述线条绘制信息对所述目标线条对应的至少部分笔画进行绘制,生成所述目标线条对应的绘制动画,包括:确定绘制所述目标线条时所使用的笔刷类型;采用与所述笔刷类型对应的绘制方式,根据所述线条绘制信息对所述目标线条对应的至少部分笔画进行绘制,生成所述目标线条对应的绘制动画。
- 根据权利要求8所述的方法,其中,所述笔刷类型包括纯色笔刷,所述采用与所述动画类型对应的绘制方式,根据所述线条绘制信息对所述目标线条对应的至少部分笔画进行绘制,生成所述目标线条对应的绘制动画,包括:针对所述目标线条中的至少部分笔画,对所述笔画对应的笔画包围盒添加预设的编辑元素,获得编辑后的目标笔画,其中,所述编辑元素包括旋转元素、缩放元素、偏移元素、移动元素中的一项或多项;对至少部分笔画对应的目标笔画关联的笔画快照进行融合操作,获得所述绘制动画。
- 根据权利要求8所述的方法,其中,所述笔刷类型包括素材笔刷,所述素材笔刷绘制的笔画由多个所述素材笔刷对应的素材格构成;所述采用与所述动画类型对应的绘制方式,根据所述线条绘制信息对所述目标线条对应的至少部分笔画进行绘制,生成所述目标线条对应的绘制动画,包括:针对所述目标线条中至少部分笔画对应的每一素材格,对所述素材格添加预设的编辑元素,获得目标素材格,其中,所述编辑元素包括旋转元素、缩放元素、偏移元素、移动元素中的一项或多项;根据所述目标素材格生成编辑后的目标笔画;对所述目标线条对应的至少部分目标笔画进行全量绘制操作,获得所述绘制动画。
- 根据权利要求1至10中任一项所述的方法,其中,所述响应于用户针对目标线条触发的绘制动画生成请求,获取所述目标线条对应的线条绘制信息之前,还包括:响应于用户在绘制编辑页面内对目标视频的绘制操作,获取所述用户绘制的每一笔画对应的线条绘制信息;响应于用户对预设的完成控件的触发操作,将用户当前绘制的全部笔画确定为所述目标线条,并存储所述目标线条对应的线条绘制信息。
- 根据权利要求11所述的方法,其中,所述存储所述目标线条对应的线条绘制信息之后,还包括:响应于用户针对目标线条触发的展示请求,将所述用户触发完成控件时的绘制的目标线条对应的笔画快照与所述目标视频进行融合操作。
- 一种绘制动画生成装置,包括:获取模块,用于响应于用户针对目标线条触发的绘制动画生成请求,获取所述目标线条对应的线条绘制信息,所述线条绘制信息中包括所述目标线条中至少部分笔画对应的笔画快照、笔画包围盒以及绘制轨迹,所述目标线条由多个笔画构成;绘制模块,用于根据所述绘制动画生成请求,采用所述线条绘制信息对所述目标线条对应的至少部分笔画进行绘制,生成所述目标线条对应的绘制动画。
- 一种电子设备,包括:处理器和存储器;所述存储器存储计算机执行指令;所述处理器执行所述存储器存储的计算机执行指令,使得所述处理器执行如权利要求1至12中任一项所述的绘制动画生成方法。
- 一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如权利要求1至12中任一项所述的绘制动画生成方法。
- 一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现如权利要求1至12中任一项所述的绘制动画生成的方法。
- 一种计算机程序,所述计算机程序被处理器执行时实现如权利要求1至12中任一项所述的绘制动画生成的方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211068030.7 | 2022-09-01 | ||
CN202211068030.7A CN115330916A (zh) | 2022-09-01 | 2022-09-01 | 绘制动画生成方法、装置、设备、可读存储介质及产品 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2024046284A1 true WO2024046284A1 (zh) | 2024-03-07 |
Family
ID=83930945
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2023/115331 WO2024046284A1 (zh) | 2022-09-01 | 2023-08-28 | 绘制动画生成方法、装置、设备、可读存储介质及产品 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN115330916A (zh) |
WO (1) | WO2024046284A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117930995A (zh) * | 2024-03-22 | 2024-04-26 | 杭州海康威视数字技术股份有限公司 | 一种文字绘制方法及装置 |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115330916A (zh) * | 2022-09-01 | 2022-11-11 | 北京字跳网络技术有限公司 | 绘制动画生成方法、装置、设备、可读存储介质及产品 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170221253A1 (en) * | 2016-02-03 | 2017-08-03 | Adobe Systems Incorporated | Creating reusable and configurable digital whiteboard animations |
CN110910469A (zh) * | 2019-10-18 | 2020-03-24 | 北京字节跳动网络技术有限公司 | 一种绘制笔迹的方法、装置、介质和电子设备 |
CN113093969A (zh) * | 2021-06-09 | 2021-07-09 | 北京易真学思教育科技有限公司 | 手绘轨迹渲染方法、装置、电子设备、介质及程序产品 |
CN114241094A (zh) * | 2021-12-16 | 2022-03-25 | 广州博冠信息科技有限公司 | 动画绘制方法、装置、存储介质及电子设备 |
CN115330916A (zh) * | 2022-09-01 | 2022-11-11 | 北京字跳网络技术有限公司 | 绘制动画生成方法、装置、设备、可读存储介质及产品 |
-
2022
- 2022-09-01 CN CN202211068030.7A patent/CN115330916A/zh active Pending
-
2023
- 2023-08-28 WO PCT/CN2023/115331 patent/WO2024046284A1/zh unknown
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170221253A1 (en) * | 2016-02-03 | 2017-08-03 | Adobe Systems Incorporated | Creating reusable and configurable digital whiteboard animations |
CN110910469A (zh) * | 2019-10-18 | 2020-03-24 | 北京字节跳动网络技术有限公司 | 一种绘制笔迹的方法、装置、介质和电子设备 |
CN113093969A (zh) * | 2021-06-09 | 2021-07-09 | 北京易真学思教育科技有限公司 | 手绘轨迹渲染方法、装置、电子设备、介质及程序产品 |
CN114241094A (zh) * | 2021-12-16 | 2022-03-25 | 广州博冠信息科技有限公司 | 动画绘制方法、装置、存储介质及电子设备 |
CN115330916A (zh) * | 2022-09-01 | 2022-11-11 | 北京字跳网络技术有限公司 | 绘制动画生成方法、装置、设备、可读存储介质及产品 |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117930995A (zh) * | 2024-03-22 | 2024-04-26 | 杭州海康威视数字技术股份有限公司 | 一种文字绘制方法及装置 |
Also Published As
Publication number | Publication date |
---|---|
CN115330916A (zh) | 2022-11-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2024046284A1 (zh) | 绘制动画生成方法、装置、设备、可读存储介质及产品 | |
JP7387891B2 (ja) | 動画ファイルの生成方法、装置、端末及び記憶媒体 | |
US11670339B2 (en) | Video acquisition method and device, terminal and medium | |
US11037600B2 (en) | Video processing method and apparatus, terminal and medium | |
US12112772B2 (en) | Method and apparatus for video production, device and storage medium | |
US20230336828A1 (en) | Playback Control | |
WO2020220773A1 (zh) | 图片预览信息的显示方法、装置、电子设备及计算机可读存储介质 | |
CN110519645B (zh) | 视频内容的播放方法、装置、电子设备及计算机可读介质 | |
US12019669B2 (en) | Method, apparatus, device, readable storage medium and product for media content processing | |
WO2023284437A1 (zh) | 媒体文件处理方法、装置、设备、可读存储介质及产品 | |
US20240348914A1 (en) | Photographing method and apparatus, electronic device, and storage medium | |
WO2023202360A1 (zh) | 视频预览方法、装置、可读介质及电子设备 | |
WO2023179424A1 (zh) | 弹幕添加方法、装置、电子设备和存储介质 | |
WO2023273854A9 (zh) | 控件显示方法、装置、设备及介质 | |
US20240064367A1 (en) | Video processing method and apparatus, electronic device, and storage medium | |
WO2023202590A1 (zh) | 页面切换方法、装置以及终端设备的交互方法 | |
WO2024109706A1 (zh) | 媒体内容显示方法、装置、设备、可读存储介质及产品 | |
WO2023116480A1 (zh) | 多媒体内容的发布方法、装置、设备、介质和程序产品 | |
WO2022242482A1 (zh) | 播放控制方法、设备、存储介质及程序产品 | |
US20140282000A1 (en) | Animated character conversation generator | |
WO2024067159A1 (zh) | 视频生成方法、装置、电子设备及存储介质 | |
WO2024046360A1 (zh) | 媒体内容处理方法、装置、设备、可读存储介质及产品 | |
WO2024032635A1 (zh) | 媒体内容获取方法、装置、设备、可读存储介质及产品 | |
WO2023179404A1 (zh) | 直播启播方法、设备及程序产品 | |
WO2023165390A1 (zh) | 变焦特效的生成方法、装置、设备及存储介质 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 23859314 Country of ref document: EP Kind code of ref document: A1 |