CN101615298B - Method and device for playing animation - Google Patents

Method and device for playing animation Download PDF

Info

Publication number
CN101615298B
CN101615298B CN200910162732XA CN200910162732A CN101615298B CN 101615298 B CN101615298 B CN 101615298B CN 200910162732X A CN200910162732X A CN 200910162732XA CN 200910162732 A CN200910162732 A CN 200910162732A CN 101615298 B CN101615298 B CN 101615298B
Authority
CN
China
Prior art keywords
frame picture
cutting
play amount
primitive
frame
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN200910162732XA
Other languages
Chinese (zh)
Other versions
CN101615298A (en
Inventor
黄朝兴
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN200910162732XA priority Critical patent/CN101615298B/en
Publication of CN101615298A publication Critical patent/CN101615298A/en
Application granted granted Critical
Publication of CN101615298B publication Critical patent/CN101615298B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a method and a device for playing an animation, which comprises the following steps: acquiring a picture frame and the corresponding initial coordinate of the picture frame of a next frame to be played in the animation; acquiring the offset of the position of the picture frame relative to the position of an original picture frame; correcting the initial coordinate according to the offset and acquiring the actual coordinate of the picture frame; and displaying the picture frame in the actual coordinate. The device comprises a first acquisition module, a correction module and a display module, wherein the first acquisition module is used for acquiring the picture frame and the corresponding initial coordinate of the picture frame of the next frame to be played in the animation as well as the offset of the position of the picture frame relative to the position of the original picture frame; the correction module is used for correcting the initial coordinate according to the offset acquired by the first acquisition module and acquiring the actual coordinate of the picture frame; and the display module is used for displaying the picture frame in the actual coordinate acquired by the correction module. The method and the device save the memory space occupied by the stored picture frame and reduce calculation performed during the fusion of the picture frame onto a canvas.

Description

The method and apparatus that a kind of animation is play
Technical field
The present invention relates to Internet technical field, relate in particular to the method and apparatus that a kind of animation is play.
Background technology
Along with development of computer, cartoon making has obtained swift and violent development with application, makes the making of animation draw and Computer Aided Drawing to manual from pure manual drawing.And development of internet technology has promoted the development and the application of cartoon making more, and by means of the network platform, animation is applied to various webpage makings in a large number, in the animated function that various chat tools are abundant and the making of various recreation (especially online game).
The frame sequence that animation is made up of a series of static frames, frame is the most basic unit that carries out cartoon making, each animation all is made of a lot of frames, be used to show each tableaux, each frame on time shaft comprises all the elements that needs show, for example: figure, sound, various material and other multiple objects.In the time will playing to animation, at first frame sequence is stored, then each frame in the frame sequence is shown one by one according to time series, thereby form continuous animation effect.
In the prior art, when each frame was stored, the size of each frame was the same.When more, when larger animation is stored and play, taken a large amount of internal memories and CPU (Center Processing Unit, central processing unit) computational resource to a content.
In realizing process of the present invention, the inventor finds prior art, and there are the following problems at least:
Prior art, the size of each frame is the same, is not that each frame image content all has been covered with picture fully in fact, and many white spaces are often arranged, and these white spaces committed memory not only, and when animation display and the scene calculating of merging also consume the CPU computational resource.
Summary of the invention
The invention provides the method and apparatus that a kind of animation is play, be used for the coordinate of frame picture is revised back display frame picture, the memory headroom that takies when saving the storage of frame picture reduces the calculation consumption that is fused to painting canvas when the frame picture shows.
The invention provides the method that a kind of animation is play, comprising:
Obtain the frame picture and the corresponding initial coordinate of next frame to be played in the animation;
Obtain the position of described frame picture and the side-play amount of primitive frame picture position;
According to described side-play amount described initial coordinate is revised, obtained the actual coordinate of described frame picture;
Show described frame picture at described actual coordinate.
Before the described frame picture and corresponding initial coordinate that obtains next frame to be played, comprising:
Cutting primitive frame picture obtains described frame picture;
Obtain the side-play amount of described frame picture position with respect to described primitive frame picture position;
Store described frame picture and described side-play amount.
Described cutting primitive frame picture obtains described frame picture and comprises:
Discern the nontransparent locations of pixels of described primitive frame picture;
According to white space and the non-blank-white zone that the recognition result of described nontransparent locations of pixels obtains described primitive frame picture, described non-blank-white zone is regular shape or non-regular shape;
Store described non-blank-white zone, obtain described frame picture.
Described to obtain described frame picture position be to obtain the upper left side side-play amount of described frame picture position with respect to described primitive frame picture position with respect to the side-play amount of described primitive frame picture position, comprising:
Obtain horizontal ordinate side-play amount and the ordinate side-play amount of described frame picture position with respect to described primitive frame picture position;
Describedly obtain described horizontal ordinate side-play amount and be specially: obtain the left side white space of described primitive frame picture, the width of described white space is described horizontal ordinate side-play amount;
Describedly obtain described ordinate side-play amount and be specially: obtain the upside white space of described primitive frame picture, the height of described white space is described ordinate side-play amount.
Comprise:
Describedly according to described side-play amount described initial coordinate is revised, the actual coordinate that obtains described frame picture is for to described initial coordinate and the summation of described side-play amount.
Described primitive frame picture is the frame picture that size equates.
The invention provides the device that a kind of animation is play, comprising:
First acquisition module is used for obtaining frame picture and the position of corresponding initial coordinate and described frame picture and the side-play amount of primitive frame picture position of next frame to be played of animation;
Correcting module is used for according to the described side-play amount that described first acquisition module obtains described initial coordinate being revised, and obtains the actual coordinate of described frame picture;
Display module is used for showing described frame picture at the described actual coordinate that described correcting module obtains.
Also comprise:
Cutting module is used to cut the primitive frame picture, obtains described frame picture;
Second acquisition module is used to obtain described frame picture position that described cutting module the obtains side-play amount with respect to described primitive frame picture position;
Memory module is used to store the described side-play amount that frame picture that described cutting module obtains and described second acquisition module obtain.
Described cutting module comprises:
The recognin module is used to discern the nontransparent locations of pixels of described primitive frame picture;
Obtain submodule, be used for white space and non-blank-white zone that the recognition result according to the described nontransparent locations of pixels of described recognin module identification obtains described primitive frame picture, described non-blank-white zone is regular shape or non-regular shape;
Sub module stored is used to store described non-blank-white zone, obtains described frame picture.
Described second acquisition module specifically is used to obtain the upper left side side-play amount of described frame picture position with respect to described primitive frame picture position, comprising:
Obtain horizontal ordinate side-play amount and the ordinate side-play amount of described frame picture position with respect to described primitive frame picture position;
Describedly obtain described horizontal ordinate side-play amount and be specially: obtain the left side white space of described primitive frame picture, the width of described white space is described horizontal ordinate side-play amount;
Describedly obtain described ordinate side-play amount and be specially: obtain the upside white space of described primitive frame picture, the height of described white space is described ordinate side-play amount.
Compared with prior art, the present invention has the following advantages:
When playing animation, by the actual coordinate of frame picture, revise the position of role's variable in painting canvas, the memory headroom that has taken when not only having saved the storage of frame picture has reduced the calculation consumption that is fused to painting canvas when the frame picture shows simultaneously.
Description of drawings
In order to be illustrated more clearly in the present invention or technical scheme of the prior art, to do to introduce simply to the accompanying drawing of required use in the present invention or the description of the Prior Art below, apparently, accompanying drawing in describing below only is some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
A kind of animation playing method process flow diagram in Fig. 1 embodiment of the invention;
A kind of animation storage means process flow diagram in Fig. 2 embodiment of the invention;
Primitive frame picture area synoptic diagram in Fig. 3 embodiment of the invention;
Primitive frame picture cut coverage synoptic diagram in Fig. 4 embodiment of the invention;
A kind of animation playing method process flow diagram in Fig. 5 embodiment of the invention;
Cutting back frame picture is with respect to primitive frame picture position skew synoptic diagram in Fig. 6 embodiment of the invention;
Cutting back frame picture is with respect to primitive frame picture position skew synoptic diagram in Fig. 7 embodiment of the invention;
A kind of animation playing method process flow diagram in Fig. 8 embodiment of the invention;
Contrast synoptic diagram before and after the cutting of multiframe picture in Fig. 9 embodiment of the invention;
A kind of moving-image playback device structural representation in Figure 10 embodiment of the invention;
A kind of moving-image playback device structural representation in Figure 11 embodiment of the invention.
Embodiment
In the technical scheme provided by the invention, its main technical schemes is: frame picture and the corresponding initial coordinate of obtaining next frame to be played; Obtain the position of described frame picture and the side-play amount of primitive frame picture position; According to described side-play amount described initial coordinate is revised, obtained the actual coordinate of described frame picture; Show described frame picture at described actual coordinate.
Below in conjunction with the accompanying drawing among the present invention, technical scheme of the present invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
The method that the embodiment of the invention provides a kind of animation to play as shown in Figure 1, specifically may further comprise the steps:
Step 101, obtain the frame picture and the corresponding initial coordinate of next frame to be played in the animation.
The side-play amount of step 102, the position that obtains the frame picture and primitive frame picture position.
Step 103, initial coordinate is revised, obtained the actual coordinate of frame picture according to side-play amount.
Step 104, show described frame picture at actual coordinate.
The embodiment of the invention is revised the position of role's variable in painting canvas by obtain the actual coordinate of frame picture when playing, and the memory headroom that has taken when not only having saved the storage of frame picture has reduced the calculation consumption that is fused to painting canvas when the frame picture shows simultaneously.
The frame sequence that animation is made up of a series of static frames presents frame by frame according to time series and to form.Each frame picture is stored in the internal memory in advance, when playing animation, each frame in this frame sequence is imported in the animation soft one by one, each frame picture is played back continuously again.When per second was continuously play 24 frames, people's naked eyes can not differentiated each frame picture, thereby what present is continuous animation effect.
Role animation is meant that role's variable moves in a big painting canvas or in the picture scene.Wherein role's variable correspondence two data, the frame picture data that data are this role's variable, this frame picture data is the bitmap of a matrix form, is used to present the tableaux of this role's variable; Another data are the logical coordinates of this role's variable correspondence, and this coordinate carries out the coordinate of correspondence when mobile on painting canvas for this role's variable.From the above, each tableaux of role animation is finished by the frame picture, and the action of role's variable is finished by the frame of continuous broadcast in the role animation, and the role's variable in the role animation moves by the logical coordinates combination of role's variable with respect to the position of painting canvas and finishes.
For example: the picture that role animation will present is that an owner is leading a doggie to take a turn in the park.When owner was leading doggie to take a turn in the park, the tableaux of each corresponding moment was finished by the frame picture of this role animation; Owner is leading the dynamic action of doggie stroll to be finished by the above-mentioned frame picture of continuous broadcast, but this moment owner and doggie be constant with respect to the position of painting canvas, only be the stroll of carrying out the original place; The evolution that owner is leading doggie to take a turn in the park to produce is then finished by the conversion of the logical coordinates of role's variable of this role animation, and a series of logical coordinates forms the track of motion, thereby produces the evolution of role's variable.
Based on above-mentioned analysis, the method that provides a kind of animation to play in the embodiments of the invention, its main technical schemes is:
This method mainly comprises two steps: cut the primitive frame picture (1), and storage is cut back frame picture and cut the side-play amount of back frame picture position with respect to the primitive frame picture position.(2) revise cutting back frame picture corresponding initial coordinate according to the side-play amount of storage, obtain the actual coordinate of this cutting back frame picture correspondence, and show this cutting back frame picture at this actual coordinate place, realize the broadcast of animation by frame picture after the cutting of replacing current demonstration continuously.
Below at first to the cutting primitive frame picture described in the above-mentioned steps (1) and store this frame picture and corresponding side-play amount is described.Concrete, the frame picture of next frame to be played that obtains needs process frame picture cutting process in advance and stores accordingly, following flow process provides a kind of method of animation storage, during the storage frame picture, white space to the frame picture cuts, replace the primitive frame picture with cutting back frame picture and store, as shown in Figure 2, specifically may further comprise the steps:
Step 201, obtain the primitive frame picture.
Concrete, obtain the frame picture that does not carry out the white space cutting, its corresponding frame picture data be frame1}, this frame picture data is the bitmap of a matrix form, is used to present the tableaux of this role's variable, this moment, the size of each frame picture was.
In this flow process with the horizontal ordinate of the primitive frame picture institute overlay area that obtained for (X11, X12), ordinate is that (Y11 Y12) describes for example, specifically as shown in Figure 3.
Step 202, cutting primitive frame picture.
In the primitive frame picture that is obtained in step 201, owing to do not carry out the white space cutting, the size of each frame picture is the same, but is not that each primitive frame image content has been covered with whole painting canvas fully in fact, and many white spaces are often arranged.And these white spaces committed memory not only, and merge in animation display and scene and to consume the CPU computational resource when calculating.Therefore the white space of primitive frame picture need be cut away, reduce each frame picture taking and computational resource internal memory.
Concrete, cut away the white space of frame picture, as shown in Figure 4, may further comprise the steps:
A) discern the primitive frame picture nontransparent pixel on four limits up and down.
B) obtain above-mentioned primitive frame picture the ordinate of orthogonal axes Y21 and the Y22 of the nontransparent pixel on both sides, wherein Y21<Y22 up and down; And the transverse axis coordinate X21 and the X22 of the nontransparent pixel of above-mentioned frame picture the right and left, wherein X21<X22.
C) calculate the upper left side side-play amount of cutting back frame picture position with respect to the primitive frame picture position.
The non-blank-white zone that the primitive frame picture cuts the back gained is cutting back frame picture.The non-blank-white zone can be regular shape or non-regular shape, preferably, is that rectangle is that example describes with the non-blank-white zone in the embodiment of the invention.
So the non-blank-white zone that obtains in the above-mentioned steps is by X21=0, X22=0, four straight lines of Y21=0 and Y22=0 surround;
For conserve storage, preferably, will cut back frame picture in the embodiment of the invention and be offset to the upper left side, overlap until upper left side with the primitive frame picture.At this moment, the upper left side side-play amount is fX=X21-X11, fY=Y12-Y22, and wherein fX is the side-play amount of this frame picture transverse axis, and fY is the side-play amount of this frame picture longitudinal axis, and its zone is among Fig. 4 shown in the dash area.
Need to prove that the side-play amount of cutting back frame picture adopts the upper left side side-play amount of cutting back frame picture position with respect to the primitive frame picture position in the embodiment of the invention, only is preferred embodiment a kind of.The parameter that move the every position that can embody the frame picture of cutting back frame picture before with respect to cutting all can be used as side-play amount, serves as preferred with conserve storage wherein.
Step 203, storage cutting back frame picture and cutting back frame picture position are with respect to the side-play amount of primitive frame picture position.
Concrete, storage cutting back frame picture and cutting back frame picture position may further comprise the steps with respect to primitive frame picture position upper left side side-play amount:
A) according to frame picture after the cutting that step 202 obtained, this cutting back frame picture is stored as new frame picture, substitute the primitive frame picture, the frame picture data is { frame 1 ' } after this cutting back frame picture corresponding cutting.
B) the frame picture position is with respect to frame picture data { frame 1 ' } after the upper left side side-play amount of primitive frame picture position and the cutting back frame picture corresponding cutting after the cutting that obtained of storage, and its file layout is { frame 1 ', fX, fY}.At this moment, because the frame picture has carried out the cutting of white space, so this moment, each frame picture dimension varied in size.
Corresponding above-mentioned steps (2), the embodiment of the invention provide a kind of method of animation broadcast, obtain the actual coordinate of frame picture during to broadcast, revise the position of role's variable in painting canvas and are described, and as shown in Figure 5, specifically may further comprise the steps:
Step 501, obtain the initial coordinate of role's variable of the frame picture correspondence of next frame to be played.
The initial coordinate of role's variable is this role's variable carries out correspondence when mobile on painting canvas a coordinate.Regard this role's variable as a some this moment, the initial coordinate of obtaining this role's variable for (rX, rY), specifically as shown in Figure 6.Among the figure,, replace this role's variable as the position of point in painting canvas with the position of circle in painting canvas for clear.
Need to prove that the relative position of this role's variable and painting canvas is a kind of preferred implementation in the embodiment of the invention, in the role animation of reality, this role's variable can be positioned at the optional position on the painting canvas; Regarding role's variable as a point is a kind of preferred implementation, is convenient to explanation and shows, but be not limited to this, and can select any point on the frame picture of this role's variable correspondence is that benchmark calculates and shows.
Step 502, obtain the frame picture data of next frame to be played.
The frame picture data of next frame to be played is the frame picture that cuts away behind the white space in this flow implementation example, its data be frame ' 1}, and carry upper left side side-play amount { fX, the fY} that is used to revise this frame picture corresponding initial coordinate.
Step 503, calculate the actual coordinate of this frame picture.
Because the initial coordinate of in step 501, being obtained for role's variable of the frame picture correspondence of next frame to be played, when not carrying out the white space cutting for the frame picture of this role's variable correspondence, this role's variable corresponding coordinate on painting canvas.And the frame picture data of next frame to be played that is obtained in the step 502 is the frame picture data that cuts away behind the white space.So, if directly export corresponding frame picture with the initial coordinate of this role's variable, then can produce position deviation, the size of deviation is this frame picture and carries out frame picture upper left side side-play amount after the cutting of white space when cutting gained, specifically as shown in Figure 6, wherein, dash area is the upper left side side-play amount.Partial picture among Fig. 6 is amplified, obtain picture as shown in Figure 7, Fig. 7 and Fig. 3 are contrasted as can be known, this moment, this role's variable departed from initial position.Therefore, entrained upper left side side-play amount is calculated the actual coordinate of this frame picture in need the frame picture data according to the initial coordinate of this role's variable and this role's variable.
Concrete, the actual coordinate that calculates this frame picture is:
objroleView.rXa=objroleView.rX+objframe.fx;
objroleView.rYa=objroleView.rY+objframe.fy;
Wherein, objroleView is this role's variable; ObjroleView.rX and objroleView.rY are respectively the initial horizontal coordinate and the ordinate of this role's variable; The upper left side side-play amount of the horizontal ordinate of gained when the frame picture that objframe.fx and objframe.fy are respectively this role's variable carries out the white space cutting; ObjroleView.rXa and objroleView.rYa are the actual coordinate of this role's variable.
Step 504, the current display frame picture data of replacement.
Concrete, the video data of replacing the frame picture is: replace current display frame picture data with the frame picture data of next frame to be played, carry out the frame picture at the actual coordinate place of this role's variable and show, that is:
objroleView.data=objframe.frame。
Wherein, objframe.frame is the frame picture data of next frame to be played, and this frame picture data is that the frame picture data that is obtained in the step 502 is the data of frame picture itself.
When storage, cut by white space the frame picture, obtain cutting back frame picture data, thereby reduce taking of internal memory; When showing, by calculating the actual coordinate of role's variable, reduce this role's variable initial position, thereby show this frame picture exactly; And because the display area of frame picture diminishes, reduced the calculation consumption that this frame picture is fused to painting canvas.
The embodiment of the invention is revised the position of role's variable in painting canvas by obtain the actual coordinate of frame picture when playing, and the memory headroom that has taken when not only having saved the storage of frame picture has reduced the calculation consumption that is fused to painting canvas when the frame picture shows simultaneously.
The method that the embodiment of the invention provides a kind of animation to play is wherein cut storage with a complete animation sequence, and revises when playing, and as shown in Figure 8, specifically may further comprise the steps:
Step 801, obtain the first frame picture in the animation sequence.
Animation is play continuously by a frame sequence and is formed, and a frame sequence is made up of a lot of frames, and each frame picture data is the bitmap of matrix form, and the size of each frame is equally big.Being made up of 4 frames altogether in this animation sequence, and each frame is big or small identical, is conventional size in the embodiment of the invention.The action that this animation sequence is finished is turned left for this cartoon role, before walks.
At first, obtain first frame in this animation sequence, the size of this frame is conventional size, its frame picture data be frame 2}, as shown in Figure 3.
Step 802, cutting primitive frame picture.
The first frame picture that is obtained in step 801, owing to do not carry out the white space cutting, its size is 120*120.But by to the observation of Fig. 3 as can be known, this frame image content has been covered with whole painting canvas fully, at image content many white spaces is arranged all up and down.Owing to these white spaces are stored, have been taken a large amount of internal memories; And, when animation display and scene fusion calculating, consume a large amount of CPU computational resources because picture is bigger.Therefore need the white space of this frame picture is cut away, reduce this frame picture taking and computational resource internal memory.
Concrete, the concrete steps of white space that cut away the frame picture obtain the cutting back first frame picture as described in the above-mentioned step 202, and this frame frame numbers is { frame 2 ' }, and the cutting back first frame picture is with respect to side-play amount { fX2, the fY2} of the preceding first frame picture of cutting.
Step 803, the storage cutting back frame first frame picture and the cutting back first frame picture position are with respect to the side-play amount of primitive frame picture position.
Concrete, storage cutting back frame first frame picture and the cutting back first frame frame picture position may further comprise the steps with respect to the preceding first frame frame picture position upper left side side-play amount of cutting:
A) according to the first frame picture after the cutting that step 802 obtained, this cutting back first frame picture is stored as new frame picture, the preceding first frame picture of the cutting of being obtained in the alternative steps 801, the first frame picture data is { frame 2 ' } after this cutting back first frame picture corresponding cutting.
B) after the cutting that obtained of storage the first frame picture position with respect to the upper left side side-play amount { fX2 of the preceding first frame picture position of cutting, frame picture data after fY2} and the cutting back first frame picture corresponding cutting frame2 ' }, its file layout is { frame 2 ', fX2, fY2}.At this moment, the first frame picture has been owing to carried out the cutting of white space, so this moment, the first frame picture dimension no longer was conventional size, but less than conventional size.
Step 804, the residue frame in this animation sequence is carried out the white space cutting process same with first frame, each frame picture and corresponding data in this frame sequence after obtaining handling, data after the cutting of second frame are { frame 3 ', fx3, fy3}, data after the cutting of the 3rd frame are { frame 4 ', fx4, fy4}, the data after the cutting of the 4th frame are { frame 5 ', fx5, fy5}}.
At this moment, preceding frame picture of cutting and cutting back frame picture are as shown in Figure 9.As shown in Figure 9, by the cutting of white space, a large amount of memory headroom of saving.
Step 805, obtain the initial coordinate of role's variable of the first frame picture correspondence after the cutting of animation to be played.
The initial coordinate of role's variable is this role's variable carries out correspondence when mobile on painting canvas a coordinate.Regard this role's variable as a some this moment, the initial coordinate of obtaining this role's variable for (rX1, rY2).
Need to prove that the relative position of this role's variable and painting canvas is a kind of preferred implementation in the embodiment of the invention, in the role animation of reality, this role's variable can be positioned at the optional position on the painting canvas; Regarding role's variable as a point is a kind of preferred implementation, is convenient to explanation and shows, but be not limited to this, and can select any point on the frame picture of this role's variable correspondence is that benchmark calculates and shows.
Step 806, obtain the frame picture data of first frame after the cutting of animation to be played.
Obtain first frame after the cutting of animation to be played the frame picture data frame ' 2}, and carry upper left side side-play amount { fX2, the fY2} that is used to revise this frame picture corresponding initial coordinate.
Step 807, calculate the actual coordinate of this frame picture.
The initial coordinate of being obtained in the step 805 for role's variable of the frame picture correspondence of first frame after the cutting of animation to be played, when not carrying out the white space cutting for the frame picture of this role's variable correspondence, this role's variable corresponding coordinate on painting canvas.And the frame picture data of first frame is the frame picture data that cuts away behind the white space after the cutting of the animation to be played that is obtained in the step 806.Entrained upper left side side-play amount is calculated the actual coordinate of the first frame picture in the frame picture data according to first frame after the cutting of the initial coordinate of this role's variable and this role's variable.
Concrete, the actual coordinate that calculates the first frame picture is:
objroleView.rXa2=objroleView.rX2+objframe.fx2;
objroleView.rYa2=objroleView.rY2+objframe.fy2;
Wherein, objroleView is this role's variable; ObjroleView.rX2 and objroleView.rY2 are respectively the initial horizontal coordinate and the ordinate of this role's variable; The upper left side side-play amount of the horizontal ordinate of gained when the frame picture that objframe.fx2 and objframe.fy2 are respectively this role's variable carries out the white space cutting; ObjroleView.rXa2 and objroleView.rYa2 are the actual coordinate of this role's variable.
At this moment, owing to the display area that cuts the back first frame picture diminishes, therefore reduced when broadcast and the calculating of picture fusion.
Step 808, the broadcast cutting back first frame picture.
At this moment, finished first frame is revised and play.
Step 809, with residue frame in this animation sequence by carrying out the playback process identical with first frame, and replace current broadcast frame, finish the broadcast of this animation.
The embodiment of the invention is revised the position of role's variable in painting canvas by obtain the actual coordinate of frame picture when playing, and the memory headroom that has taken when not only having saved the storage of frame picture has reduced the calculation consumption that is fused to painting canvas when the frame picture shows simultaneously.
The device 10 that the embodiment of the invention provides a kind of animation to play as shown in figure 10, comprising:
First acquisition module 101 is used for obtaining frame picture and the position of corresponding initial coordinate and frame picture and the side-play amount of primitive frame picture position of next frame to be played of animation.
Wherein, the frame picture of next frame to be played is the frame picture through cutting process, and preferably, described cutting process step is as follows:
1) cutting primitive frame picture obtains the frame picture.
Preferably, the nontransparent locations of pixels of identification primitive frame picture; Obtain the white space and the non-blank-white zone of primitive frame picture; Storage non-blank-white zone obtains the frame picture.
2) obtain the side-play amount of frame picture position with respect to the primitive frame picture position.
3) storage frame picture and side-play amount.
Correcting module 102 is used for according to the side-play amount that first acquisition module 101 obtains initial coordinate being revised, and obtains the actual coordinate of frame picture.
Display module 103 is used for the actual coordinate display frame picture that obtains at correcting module 102.
Above-mentioned steps has been finished the demonstration of a frame picture, for a complete animation, its all frame picture is handled equally, and after doing above-mentioned same processing with the frame picture of next frame to be played, is replaced current display frame picture, finishes the broadcast of an animation.
The embodiment of the invention is revised the position of role's variable in painting canvas by obtain the actual coordinate of frame picture when playing, and the memory headroom that has taken when not only having saved the storage of frame picture has reduced the calculation consumption that is fused to painting canvas when the frame picture shows simultaneously.
The device 11 that the embodiment of the invention provides a kind of animation to play as shown in figure 11, comprising:
First acquisition module 101 is used for obtaining frame picture and the position of corresponding initial coordinate and frame picture and the side-play amount of primitive frame picture position of next frame to be played of animation.
Correcting module 102 is used for according to the side-play amount that first acquisition module 101 obtains initial coordinate being revised, and obtains the actual coordinate of frame picture.
Display module 103 is used for the actual coordinate display frame picture that obtains at correcting module 102.
Also comprise:
Cutting module 104 is used to cut the primitive frame picture, obtains the frame picture.
Second acquisition module 105 is used to obtain frame picture position that cutting module 104 the obtains side-play amount with respect to the primitive frame picture position.
Memory module 106 is used to store the side-play amount that the frame picture that cutting module 104 obtains and second acquisition module 105 obtain.
Cutting module 104 comprises:
Recognin module 1041 is used to discern the nontransparent locations of pixels of primitive frame picture.
Obtain submodule 1042, be used for white space and non-blank-white zone that the recognition result according to the nontransparent locations of pixels of recognin module 1041 identification obtains the primitive frame picture, the non-blank-white zone is regular shape or non-regular shape.
Sub module stored 1043 is used to store the non-blank-white zone, obtains the frame picture.
Second acquisition module 105 specifically is used to obtain the upper left side side-play amount of frame picture position with respect to the primitive frame picture position, comprising:
Obtain horizontal ordinate side-play amount and the ordinate side-play amount of frame picture position with respect to the primitive frame picture position.
Obtaining the horizontal ordinate side-play amount is specially: obtain the left side white space of primitive frame picture, the width of white space is the horizontal ordinate side-play amount;
Obtaining the ordinate side-play amount is specially: obtain the upside white space of primitive frame picture, the height of white space is the ordinate side-play amount.
The embodiment of the invention is revised the position of role's variable in painting canvas by obtain the actual coordinate of frame picture when playing, and the memory headroom that has taken when not only having saved the storage of frame picture has reduced the calculation consumption that is fused to painting canvas when the frame picture shows simultaneously.
Through the above description of the embodiments, those skilled in the art can be well understood to the present invention and can realize by the mode that software adds essential general hardware platform, can certainly pass through hardware, but the former is better embodiment under a lot of situation.Based on such understanding, the part that technical scheme of the present invention contributes to prior art in essence in other words can embody with the form of software product, this computer software product is stored in the storage medium, comprise that some instructions are with so that a station terminal equipment (can be mobile phone, personal computer, server, the perhaps network equipment etc.) carry out the described method of each embodiment of the present invention.
The above only is a preferred implementation of the present invention; should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the principle of the invention; can also make some improvements and modifications, these improvements and modifications also should be looked protection scope of the present invention.
It will be appreciated by those skilled in the art that the module in the device among the embodiment can be distributed in the device of embodiment according to the embodiment description, also can carry out respective change and be arranged in the one or more devices that are different from present embodiment.The module of the foregoing description can be integrated in one, and also can separate deployment; A module can be merged into, also a plurality of submodules can be further split into.
The invention described above embodiment sequence number is not represented the quality of embodiment just to description.
More than disclosed only be several specific embodiment of the present invention, still, the present invention is not limited thereto, any those skilled in the art can think variation all should fall into protection scope of the present invention.

Claims (8)

1. the method that animation is play is characterized in that, comprising:
Primitive frame picture in the cutting animation sequence, the side-play amount of the primitive frame picture position that the frame picture position after determining to cut is preceding with respect to cutting, frame picture after the storage cutting and the side-play amount of determining;
When the playing animation sequence, obtain frame picture to be played and corresponding initial coordinate after the cutting in the animation sequence, obtain the position of the frame picture to be played after the cutting and the side-play amount of the primitive frame picture position of this frame picture to be played, according to the side-play amount that gets access to described initial coordinate is revised, obtain the actual coordinate of the frame picture to be played after this cutting, and the frame picture to be played after described actual coordinate shows cutting.
2. the method for claim 1 is characterized in that, the primitive frame picture in the described cutting animation sequence comprises:
The nontransparent locations of pixels of the primitive frame picture in the identification animation sequence;
According to white space and the non-blank-white zone that the recognition result of described nontransparent locations of pixels obtains described primitive frame picture, described non-blank-white zone is regular shape or non-regular shape;
Cut off the white space in the described primitive frame picture, the frame picture after obtaining cutting.
3. the method for claim 1 is characterized in that, the side-play amount of the primitive frame picture position that the frame picture position after described definite cutting is preceding with respect to cutting comprises:
The horizontal ordinate side-play amount and the ordinate side-play amount of the primitive frame picture position that the frame picture position after determining to cut is preceding with respect to cutting; Wherein, the width of the described horizontal ordinate side-play amount left side white space that is described primitive frame picture; The height of the upside white space that described ordinate side-play amount is described primitive frame picture.
4. the method for claim 1 is characterized in that, the described side-play amount that described basis gets access to is revised described initial coordinate, is specially:
To described initial coordinate and the side-play amount summation that gets access to.
5. as each described method in the claim 1 to 4, it is characterized in that each the primitive frame picture in the described animation sequence is the frame picture that size equates.
6. the device that animation is play is characterized in that, comprising:
Cutting module, the primitive frame picture and the storage that are used for cutting animation sequence;
Second acquisition module is used for determining the side-play amount of the primitive frame picture position before frame picture position after the described cutting module cutting is with respect to cutting;
Memory module is used to store the described side-play amount that described second acquisition module is determined;
First acquisition module is used for obtaining the frame picture and the corresponding initial coordinate of the frame to be played after the animation sequence cutting, and the side-play amount of the position of the frame picture to be played after the cutting and the primitive frame picture position of this frame to be played;
Correcting module is used for according to the described side-play amount that described first acquisition module obtains described initial coordinate being revised, and obtains the actual coordinate of the frame picture to be played after this cutting;
Display module is used for the frame picture to be played after the described actual coordinate that described correcting module obtains shows described cutting.
7. device as claimed in claim 6 is characterized in that, described cutting module comprises:
The recognin module is used to discern the nontransparent locations of pixels of described primitive frame picture;
Obtain submodule, be used for white space and non-blank-white zone that the recognition result according to the described nontransparent locations of pixels of described recognin module identification obtains described primitive frame picture, described non-blank-white zone is regular shape or non-regular shape;
Sub module stored is used to store described non-blank-white zone.
8. device as claimed in claim 6 is characterized in that, described second acquisition module specifically is used for, the horizontal ordinate side-play amount and the ordinate side-play amount of the primitive frame picture position that the frame picture position after determining to cut is preceding with respect to cutting; Wherein, the width of the described horizontal ordinate side-play amount left side white space that is described primitive frame picture; The height of the upside white space that described ordinate side-play amount is described primitive frame picture.
CN200910162732XA 2009-08-12 2009-08-12 Method and device for playing animation Active CN101615298B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200910162732XA CN101615298B (en) 2009-08-12 2009-08-12 Method and device for playing animation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200910162732XA CN101615298B (en) 2009-08-12 2009-08-12 Method and device for playing animation

Publications (2)

Publication Number Publication Date
CN101615298A CN101615298A (en) 2009-12-30
CN101615298B true CN101615298B (en) 2011-09-28

Family

ID=41494919

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200910162732XA Active CN101615298B (en) 2009-08-12 2009-08-12 Method and device for playing animation

Country Status (1)

Country Link
CN (1) CN101615298B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103186917B (en) * 2011-12-30 2017-09-22 腾讯科技(深圳)有限公司 It is a kind of to realize the method and apparatus that view animation is shown
CN104866506B (en) * 2014-02-25 2019-07-09 腾讯科技(深圳)有限公司 A kind of method and device of playing animation
CN105635703A (en) * 2015-12-25 2016-06-01 北京小鸟科技发展有限责任公司 Projection method and device based on image geometric correction coordinate compression and projector
CN109582427B (en) * 2018-12-06 2022-03-11 深圳市优创亿科技有限公司 TFT screen display method of wearable device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004021149A (en) * 2002-06-20 2004-01-22 Nec Micro Systems Ltd Image processing apparatus and image processing method
CN101026772A (en) * 2006-02-20 2007-08-29 腾讯科技(深圳)有限公司 Animation file reading method
CN101073256A (en) * 2004-12-09 2007-11-14 汤姆森许可贸易公司 Method and apparatus for generating motion compensated pictures

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004021149A (en) * 2002-06-20 2004-01-22 Nec Micro Systems Ltd Image processing apparatus and image processing method
CN101073256A (en) * 2004-12-09 2007-11-14 汤姆森许可贸易公司 Method and apparatus for generating motion compensated pictures
CN101026772A (en) * 2006-02-20 2007-08-29 腾讯科技(深圳)有限公司 Animation file reading method

Also Published As

Publication number Publication date
CN101615298A (en) 2009-12-30

Similar Documents

Publication Publication Date Title
CN102270093B (en) Video-image-resolution-based vision adaptive method
US20170132827A1 (en) Data Driven Design and Animation of Animatronics
CN101046888A (en) Rendering apparatus and method, and shape data generation apparatus and method
CN101615298B (en) Method and device for playing animation
CN112541867A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN111371983A (en) Video online stabilization method and system
CN104537697A (en) Implementation method for progressively blurred animation
CN112651881A (en) Image synthesis method, apparatus, device, storage medium, and program product
JP2009124510A (en) Display control apparatus and method thereof, program, and recording medium
CN114387386A (en) Rapid modeling method and system based on three-dimensional lattice rendering
CN112218107A (en) Live broadcast rendering method and device, electronic equipment and storage medium
Chiang et al. Fast JND-based video carving with GPU acceleration for real-time video retargeting
CN105578035A (en) Image processing method and electronic device
CN106331435B (en) method for realizing image special effect display in real time
CN104318236B (en) A kind of method and system for obtaining image local feature
CN113658288B (en) Method for generating and displaying polygonal data vector slices
CN107301045B (en) Window display method and device
CN102739973B (en) A kind of method for realizing subtitle van gogh's oil painting special efficacy
CN110022184B (en) Broadcast method, storage medium, device and system based on canvas
CN100405404C (en) Virtual man real-time drawing method
TWI543589B (en) Image Processing Method for an Original Mosaic
CN102739998B (en) A kind of implementation method of space transformation in three-dimensional space
CN116665004B (en) Augmented reality image processing method, system, equipment and storage medium
CN114429666B (en) Video face replacement method, device, equipment and storage medium
JP2007310577A (en) Device, method, and program for extracting drawing-data

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant