CN103176788B - The method and apparatus that a kind of mobile phone desktop animated content seamlessly transits - Google Patents

The method and apparatus that a kind of mobile phone desktop animated content seamlessly transits Download PDF

Info

Publication number
CN103176788B
CN103176788B CN201110440987.5A CN201110440987A CN103176788B CN 103176788 B CN103176788 B CN 103176788B CN 201110440987 A CN201110440987 A CN 201110440987A CN 103176788 B CN103176788 B CN 103176788B
Authority
CN
China
Prior art keywords
animation
picture
queue
index value
transition cartoon
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
CN201110440987.5A
Other languages
Chinese (zh)
Other versions
CN103176788A (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.)
China Mobile Group Fujian Co Ltd
Original Assignee
China Mobile Group Fujian Co Ltd
Filing date
Publication date
Application filed by China Mobile Group Fujian Co Ltd filed Critical China Mobile Group Fujian Co Ltd
Priority to CN201110440987.5A priority Critical patent/CN103176788B/en
Publication of CN103176788A publication Critical patent/CN103176788A/en
Application granted granted Critical
Publication of CN103176788B publication Critical patent/CN103176788B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses the method and apparatus that a kind of mobile phone desktop animated content seamlessly transits, firstly generate initial animation queue, terminate animation queue and transition cartoon queue, the display queue of regeneration animation;Sequentially read the animation index value in animation display queue, obtain the positional information of picture according to animation index value;The picture that positional information according to picture will read every time, uses buffering to call container and plays out.Have employed technical scheme, by increasing capacitance it is possible to increase animated content smooth features, improve the quality that animation is play on Consumer's Experience, really realize animated content and smooth, animation effect is more life-like.

Description

The method and apparatus that a kind of mobile phone desktop animated content seamlessly transits
Technical field
The present invention relates to data service technical field, smooth particularly to a kind of mobile phone desktop animated content The method and apparatus of transition.
Background technology
Seamlessly transitting currently in order to realize animation, main method is to utilize window server to create top window Mouth group, based on top group of windows establishment RWsSprite as the container of animation, can decode gif Become two bmp pictures of the subsidiary mask figure of multiframe, and add in RWsSprite container, activate and hold Device shows one group of animation.
If desired for seamlessly transit to another group animation method have two kinds:
1. create new RWsSprit container, activate display after adding new animated content, delete former simultaneously Container, as shown in Figure 1;
2. delete the animated content of former RWsSprit container, add new animated content, such as Fig. 2 institute Show.
If it is known that animated content to be seamlessly transitted, can be simultaneously by content to be play with wait to put down The content of sliding transition cartoon together decodes to be put into a RWsSprit container and plays out, because container can With the animated content therein of loop play in order, it is also possible to realize the effect that animation seamlessly transits.
Existing animation smooth transient method has the disadvantage in that
1. EMS memory occupation is many.If wanting container to show animated content, first need in animation to be shown Appearance is decoded into after meeting form adds in container.The image parameters of RWsSprit container reception requires 8 gray scales bmp of one 24 true color bmp and its correspondence are as shade, and bitmap is a kind of picture Element file, all of pixel in its preservation piece image, individual bmp picture size and color figure place Relevant with dimension of picture, the internal memory shared by 24 true color pictures of a 240*320 size is big General is 256K, and the gray scale picture of 8 is 86K.If one group of animation is made up of a lot of frames, So joining the memory size shared by the picture in container is animation totalframes * (24 bmp figures The size of+8 bmp bitmap committed memories of the size of sheet committed memory), EMS memory occupation amount is the most surprising, The properly functioning of mobile phone can be directly affected.
2. decoding delay.If animated content is made with one group of animation (gif) or plurality of pictures sequence Using for external file, when one group of animation file is excessive, (gif file is more than 80K or multiple are bigger Image content), the decoding time linearly increases with file size or number of files, seamlessly transits two There will be obvious time delay when organizing big animation file, lose the real-time of event response;
3. control freedom degree.When RWsSprite container contents has been filled, RWsSprite container meeting Loop play animation file therein content.Because the control method that container provides is more single, for The animated content putting into it can not arbitrarily control playing sequence and broadcasting time, and can only sequential loop Play.In this motion seamlessly transit to next group animation before intercut a transition cartoon, and requirement The transition cartoon intercutted only is play one time, uses existing technology to send out and is difficult to accomplish that freely controlling animation broadcasts Put forward sequence.
Summary of the invention
It is an object of the invention to provide the method and apparatus that a kind of mobile phone desktop animated content seamlessly transits, Animated content smooth features can be increased, Consumer's Experience improves the quality that animation is play, really real Existing animated content smooths, and animation effect is more life-like.
According to an aspect of the present invention, it is provided that the side that a kind of mobile phone desktop animated content seamlessly transits Method, including step: according to the initial animation being preset in mobile phone, terminate animation and transition cartoon difference Generate initial animation queue, terminate animation queue and transition cartoon queue, according to initial animation queue, Terminate animation queue, transition cartoon queue and the information of animation configuration file being preset in mobile phone generates Animation display queue;Sequentially read the animation index value in animation display queue, according to animation index value Obtain the positional information of picture;The picture that positional information according to picture will read every time, uses buffering Mechanism is called container and is played out.
A kind of method that in the present invention, mobile phone desktop animated content seamlessly transits, figure preset in mobile phone Sheet is all png picture, further comprising the steps of: reads band alpha according to the positional information of picture and leads to The png picture in road, is decoded generating the bmp figure of band alpha passage to the png picture read Sheet, then through number of pixels and byte-aligned, the bmp picture of band alpha passage is decomposed into one Without true color bmp picture and a gray scale picture of alpha passage, lead to described without alpha True color bmp picture and the described gray scale picture in road are overlapped as picture to be played.
A kind of method that in the present invention, mobile phone desktop animated content seamlessly transits, further comprising the steps of: According to animation number initial in mobile phone and termination animation number, set up two dimension transition cartoon concordance list, and Give initial value and be-1;According in animation configuration file about initial animation and terminate animation with The information of corresponding transition cartoon, is recorded as transition by initial animation index value in initial animation queue The abscissa of the concordance list of animation, was recorded as terminating animation index value in terminating animation queue Cross the vertical coordinate of the concordance list of animation, the index value in the concordance list of transition cartoon is entered as this transition Index value in the transition cartoon queue of animation place adds 1 and negates the value of gained.
A kind of method that in the present invention, mobile phone desktop animated content seamlessly transits, according to initial animation team Row, terminate animation queue, transition cartoon queue and the information of animation configuration file being preset in mobile phone The step generating animation display queue farther includes: using current animation as initial animation;According to being System or customer incident obtain animation to be played as terminating animation;Index value according to initial animation with The index value terminating animation inquires about the index value of transition cartoon in transition cartoon concordance list;To play initiating Picture index value, transition cartoon index value and termination animation index value generate animation for storage content and show team Row.
A kind of method that in the present invention, mobile phone desktop animated content seamlessly transits, according to initial animation team Row, terminate animation queue, transition cartoon queue and the information of animation configuration file being preset in mobile phone The step generating animation display queue farther includes: presets initial animation or terminates in animation For intermediate animation;Using current animation as initial animation, obtain to be played according to system or customer incident Animation as terminate animation;Judge initial animation or terminate whether animation is intermediate animation, if all It not intermediate animation, then between initial animation and termination animation, insert intermediate animation, generated initiating Draw to intermediate animation and intermediate animation extremely termination two groups of animations of animation;Initialize animation display queue;Will The index value of initial animation adds animation display queue;Index value according to initial animation and intermediate animation Index value in transition cartoon concordance list, inquire about the index value of transition cartoon, if the rope of transition cartoon Draw value not for-1, then the index value of transition cartoon corresponding with intermediate animation for initial animation is added 1 and take Instead, animation display queue is joined;The index value of intermediate animation is added animation display queue;According to The index value of intermediate animation and the index value terminating animation are inquired about transition in transition cartoon concordance list and are moved The index value drawn, if the index value of transition cartoon is not-1, then by intermediate animation and termination animation phase The index value of corresponding transition cartoon adds 1 and negates, and joins animation display queue;Animation will be terminated Index value adds animation display queue.
A kind of method that in the present invention, mobile phone desktop animated content seamlessly transits, initial motion picture and end Only motion picture circulation display at least one time, transition cartoon picture playing one time.
A kind of method that in the present invention, mobile phone desktop animated content seamlessly transits, the initial animation generated Queue, termination animation queue, transition cartoon queue save the figure often organizing animation in respective queue respectively Sheet frame information, described picture frame information includes picture name, the frame period that frame number, picture frame are corresponding Time and Pictures location information.
A kind of method that in the present invention, mobile phone desktop animated content seamlessly transits, believes according to the position of picture Breath reads the png picture of band alpha passage, is decoded the png picture read generating band alpha The bmp picture of passage, then through number of pixels and byte-aligned, the bmp of band alpha passage is schemed Sheet is decomposed into a true color bmp picture without alpha passage and a gray scale picture, by described True color bmp picture and described gray scale picture without alpha passage are overlapped as to be played The step of picture farther includes: call animation display queue, sequentially reads from animation display queue Animation index value;If animation index value less than 0, then negates subtracts 1 and obtain the animation index value revised, In transition cartoon queue, the picture frame letter of corresponding transition cartoon is read according to the animation index value revised Breath, otherwise or terminates reading corresponding animation in animation queue in initial animation queue according to animation index value Picture frame information;Read mobile terminal according to the Pictures location information in picture frame information 32 With the png picture of alpha passage, png picture is decoded into the bmp figure of 32 bit strip alpha passages Sheet;
The actual pixel number of each base line and byte number is calculated respectively by below equation,
Each base line actual pixels point number=sW & 0x3?(sW+4-(sW& 0x3)): sW, Wherein, sW is the number of pixels that picture to be converted is often gone,
Byte number=((nWidth*nBits+31)/32) * 4 needed for each base line, wherein, nBits For color figure place, nWidth is every row number of pixels;
Less than 4 byte multiple and add 0 less than the base line of 4 pixel multiples, circulation 24 true color bmp pictures and the gray scale of 8 is generated after processing each base line of picture Bmp picture, is carried out the described true color bmp picture without alpha passage and described gray scale picture Superposition is as picture to be played.
A kind of method that in the present invention, mobile phone desktop animated content seamlessly transits, farther includes: create New container, fills picture to be played to newly created container, calls newly created container and plays The picture filled.
A kind of method that in the present invention, mobile phone desktop animated content seamlessly transits, farther includes:
A. detecting whether to there is the container showing animation, if existed, then going to step B, If it does not exist, then go to step C;
B. create buffer container, go to step D;
C. create primary tank, go to step D;
D. gray scale bmp of 24 true color bmp generated and 8 is filled to buffer container or master In container;
E. detect whether to there is the container showing animation, if it has, then go to step F, if No, then step G is gone to;
F. close the container showing animation, then activate buffer container, go to step H;
G. activate primary tank, go to step H;
H. refresh window server, shows animation;
I. timer is opened;
J. the next frame Pictures location information in display animation queue it is successively read, to according to Pictures location Information inquiry to picture be decoded, waiting time sheet arrive;
K. arriving when timeslice, circulation step A is to step J.
According to a further aspect in the invention, additionally provide a kind of mobile phone desktop animated content and seamlessly transit dress Putting, including transition cartoon generation module and animation buffered play module, wherein, transition cartoon generates mould Block, for having generated respectively according to the initial animation being preset in mobile phone, termination animation and transition cartoon Initiating is drawn queue, is terminated animation queue and transition cartoon queue, according to initial animation queue, terminates moving The information drawing queue, transition cartoon queue and animation configuration file generates animation display queue, and will be dynamic Draw display queue and flow to animation buffered play module;Animation buffered play module, for sequentially reading Animation index value in animation display queue, obtains the positional information of picture, root according to animation index value The picture that will every time read according to the positional information of picture, uses buffering to call container and plays out.
In the present invention, a kind of machine desktop animated content seamlessly transits device, and picture preset in mobile phone is all It is png picture, also includes: picture decoder module, for sequentially reading moving in animation display queue Draw index value, obtain the positional information of picture according to animation index value, read according to the positional information of picture Take the png picture of band alpha passage in mobile phone, be decoded the png picture read generating band The bmp picture of alpha passage, then through number of pixels and byte-aligned, by band alpha passage Bmp picture is decomposed into a true color bmp picture without alpha passage and a gray scale picture, The described true color bmp picture without alpha passage and described gray scale picture are overlapped as treating The picture play flows to animation buffered play module.
In the present invention, a kind of machine desktop animated content seamlessly transits device, also includes: transition cartoon indexes Table creation module, is used for creating transition cartoon concordance list.
In the present invention, a kind of machine desktop animated content seamlessly transits device, also includes, container creation module, For creating new container;The picture that described newly created vessel filling is to be played, described animation buffers Playing module calls newly created container and plays the picture filled.
The method have technical effect that, animated content based on existing material seamlessly transits, and uses The mode crossing animation concordance list provides the method for quick-searching, searches picture speed and improves;In picture solution In Ma, every pictures is all carried out byte and aligns with pixel, decrease the distortion of picture;Desktop animation Display aspect by the Special use method of animation container, reach the no-delay switching that animation is play, This special display packing and buffering ensure that the smoothness that animation switches, and make animating image action Show lifelike image;Above three characteristic adds animated content smooth features, carries on Consumer's Experience The quality that high animation is play, really realizes animated content and smooths, and animation effect is more life-like.
Other features and advantages of the present invention will illustrate in the following description, and, partly from Description becomes apparent, or understands by implementing the present invention.The purpose of the present invention and its His advantage can be by knot specifically noted in the description write, claims and accompanying drawing Structure realizes and obtains.
Below by drawings and Examples, technical scheme is described in further detail.
Accompanying drawing explanation
Accompanying drawing is for providing a further understanding of the present invention, and constitutes a part for description, with Embodiments of the invention are used for explaining the present invention together, are not intended that limitation of the present invention.At accompanying drawing In:
Fig. 1 is the schematic diagram of existing a kind of mobile phone animation player method;
Fig. 2 is the schematic diagram of existing another kind of mobile phone animation player method;
Fig. 3 is that the mobile phone desktop animated content in the specific embodiment of the invention one seamlessly transits flow process Figure;
Fig. 4 is to initiate animation in the specific embodiment of the invention one, between transition cartoon and termination animation Incidence relation schematic diagram;
Fig. 5 is initial animation, transition cartoon, intermediate animation and end in the specific embodiment of the invention one Incidence relation schematic diagram between stop picture;
Fig. 6 is the byte-aligned schematic diagram used in the specific embodiment of the invention one;
Fig. 7 is animation buffering flow for displaying figure in the specific embodiment of the invention one;
Fig. 8 is that in the specific embodiment of the invention two, mobile phone desktop animated content seamlessly transits showing of device It is intended to.
Detailed description of the invention
Below in conjunction with accompanying drawing, the preferred embodiments of the present invention are illustrated, it will be appreciated that this place is retouched The preferred embodiment stated is merely to illustrate and explains the present invention, is not intended to limit the present invention.
Below with reference to Figure of description, describe the present invention in detail.
Generally animation file can be single gif/swf or one group of sequence of pictures, if with one group of animation (gif/swf) use as external file, when one group of animation file is excessive (gif file is more than 80K), The decoding time linearly increases with file size, seamlessly transits time delay increase thus causes event response real Shi Xing.Therefore the present invention uses one group of png sequence of pictures to express an animation.
As it is shown on figure 3, the method that mobile phone desktop animated content of the present invention seamlessly transits mainly includes as follows Step:
At the preset initial animation of mobile phone, terminate animation, transition cartoon and animation configuration file, generate Initiating is drawn queue, is terminated animation queue and transition cartoon queue, according to initial animation queue, terminates moving The information drawing queue, transition cartoon queue and animation configuration file generates animation display queue;
Sequentially read the animation index value in animation display queue, obtain picture according to animation index value Positional information;Positional information according to picture reads the png picture of band alpha passage in mobile phone, right The png picture read is decoded generating the bmp picture of band alpha passage, then through pixel Number and byte-aligned, be decomposed into one without alpha passage by the bmp picture of band alpha passage True color bmp picture and a gray scale picture;
Buffering is used to process the true color bmp picture without alpha passage and ash every time generated Degree picture, container plays out.
The method seamlessly transitted based on animated content, is primarily directed to the switching between any two groups of animations Realization seamlessly transits, and broadcasts one group of transition cartoon realize animation by adding between animation A and animation B Effect is seamlessly transitted between content.
Often group animated content is made up of plurality of pictures sequence, and picture format can be selected for bmp, jpg, png Deng common format.The method of the present invention uses png sequence of pictures, it is possible to achieve have transparent effect Animation is play.Material needed for animation is play needs preset in mobile phone, and material includes initiateing, terminating State animation and transition cartoon.One group of animation sequence is constructed by the method, suitable according to animation sequence Sequence is play, then broadcasting between animation A to animation B can be made to realize content and take over seamlessly.
For realizing seamlessly transitting of animated content, according to animation character, all animations are divided into state and move Picture, transition cartoon.State animation is the most initial or terminates animation, state animation multipass capable of circulation Display;Transition cartoon is play between two sections of state animations, the most only plays one time, plays linking initial Effect with final state animated content.
Use transition cartoon two state animations of linking, i.e. after completely playing first state animation Inserting a transition cartoon, after transition cartoon completely plays one time, second state of recirculation broadcasting is moved Draw.Concrete implementation:
The state animation that record is currently played is as initial state;
Final state animation is obtained as final state according to system or customer incident;
Read transition cartoon concordance list by the index value of two state animation place queues, obtain transition The index value of animation place queue;
Constituted to be played dynamic with initial animation index value, transition cartoon index value and termination animation index value Draw sequence.
For quickly calculating the transition cartoon index value obtained between two state animations, transition cartoon can be set up Concordance list, uses two state animation indexes as the index of the corresponding transition cartoon of vernier quick search Value.Transition cartoon concordance list carries out initializing structure by the local animation configuration file of scanning, specifically at the beginning of Beginningization step is as follows:
According to state animation number, set up the concordance list of the transition cartoon of two dimension, be initialized as-1;
Scanning animation configuration file, sequential processing state animation and transition cartoon label (id and TID);
The label reading transition cartoon is split into two parts, is recorded as horizontal stroke, vertical coordinate respectively;
Index value corresponding to transverse and longitudinal coordinate is entered as the position in this its queue of transition cartoon place.
A part of example of animation configuration file is as follows:
Wherein,<AN>label holds the information for state animation, and id represents state animation sequence number;<TAN> Label substance is the information of transition cartoon, and TID represents transition cartoon sequence number.It is divided into according to TID is removable The sequence number of corresponding states animation, is temporarily recorded as transverse and longitudinal coordinate, by the sequence number value assignment of this transition cartoon Sit target value to corresponding transverse and longitudinal.
Transverse and longitudinal coordinate figure is the index value of state animation place queue, and the value in concordance list represents that transition is moved Draw the index value of place queue.When given two state animations index value (a, b), with (a, b) Taking out manipulative indexing tabular value for transverse and longitudinal coordinate figure, this numerical value is then that transition cartoon is in transition cartoon queue Sequence number.The signal of the following table transition cartoon concordance list by being set up according to n web state motion picture.
The problem that animated content takes over seamlessly can be solved by the way of intercutting transition cartoon, but need Preset animation quantity is wanted also to have increase, for reducing the number of transition cartoon, in two state animations Add an intermediate animation, can effectively reduce the quantity of transition cartoon.Intermediate animation be one special Animation, it is also possible to use as state animation.
It is required to it is assumed that have between n state animation, and any two state animation During transition, the transition cartoon quantity of needs is n2, required transition cartoon quantity is more.As it is shown in figure 5, If using intermediate animation to use as intermediate animation state, can convert to terminating animation from initial animation First from initial animation to intermediateness, then from intermediateness to terminating animation, between all state animations Transition cartoon quantity is then 2n, and the quantity of transition cartoon can be greatly reduced.
When being triggered switching animation by system or customer incident, need to use current animation state and termination Transition cartoon status retrieval transition cartoon concordance list, obtains the index value of transition cartoon, passes through index value From transition cartoon retrieval animation file title, re-use animation playing module and realize animation switching, Implement step as follows:
When receiving the event of switching animation, current state animation is designated as initial animated state, new thing Animation produced by part is designated as terminating animated state;
Check initial state animation or final state animation, if being not intermediate animation, then at two Insert intermediate animation between animation, then become from original one group of animation (initial animation is to terminating animation) Two groups of animations (initial animation-intermediate animation-termination animation);
Resetting animation display queue value, initial value is-1;
Take out the initial animation numbering of first group of animation and terminate animation numbering, at transition cartoon mapping table , if value is for-1, the most there is not transition cartoon in the index value of middle inquiry transition cartoon place queue, as Fruit value is not-1, then add 1 by index value and negate, and joins animation display queue;
The termination animation of first group is numbered and adds animation display queue;
If there is the second group of animation situation of intermediate animation (add), use the animation of second group Initial animation numbering and termination animation numbering, inquire about transition cartoon place team in transition cartoon mapping table The index value of row, if value is not-1, then adds 1 by index value and negates, and joins animation display queue;
If there is second group of animation (adding the situation of intermediate animation), then by second group of transition cartoon Termination animation add animation display queue;
According to the indexed sequential playing animation crossed in animation display queue, if index value is less than 0, then Negate and subtract 1 and try to achieve correct index value, use index value to take out animation broadcasting from transition cartoon queue, If index value is more than or equal to 0, then uses index value to take out animation from state animation queue and play.
Above index value inversion operation is because state animation and transition cartoon leaves two respectively in In individual queue, in order to distinguish state animation and transition cartoon index value (index value all from the beginning of 0, Sequentially it is incremented by), the index value of transition cartoon is added 1 every time and negate and be stored in, negate during taking-up and subtract one also Former, state animation index value does not processes, can be according to the positive negative judgement animation place queue of index value.
Use transition cartoon concordance list can index with the transition cartoon between two animations of quick-searching, it is achieved The broadcasting of animation need to decode display successively to the motion picture in the animation queue after calculating, and completes animation Play.
Because the use of picture format is limited by platform so that can not directly use png form to read Take display, and need extra picture to change;Further, translucent effect to be realized, system needs Two pictures are overlapped realizing picture by the correspondence 8 bitmask picture in addition to real color bitmap Translucent effect.
The principle of picture decoding is the inverse process of compression, can be according to code table information and compressed bit stream during decoding Restore raw image data.The present invention uses the png decoder module of own coding to enter the picture loaded Row decoding, generates the bitmap of 32 bit strip alpha passages, then to 32 bit strip alpha passages Bmp does after-treatment, mainly includes that bitmap alignment and pixel number align, generates one 24 very Two pictures just can be realized by colored bmp and 8 gray scales bmp as the input of display module Transparent effect.
I byte-aligned
Structure is a kind of composite data type, its constitution element both can be basic data type (as int, Long, float etc.) variable, it is also possible to be that some composite data type are (such as array, structure, connection Close etc.) data cell.In the structure, compiler is that each member of structure is by its natural boundary (alignment) allocation space.Each member deposits according to they declared orders order in internal memory Storage, the address of first member is identical with the address of total.In order to enable CPU to variable Quickly accessing, the initial address of variable should have some characteristic, the most so-called " alignment ". The int type of such as 4 bytes, its initial address should be positioned on the border of 4 bytes, i.e. initial address Can be divided exactly by 4.If spanning 4 bytes or less than 4 bytes all can reducing variables access speed.
Ii bitmap aligns
BMP (Bitmap-File) graphic file is the graphics file format that Windows uses, and is one Planting pixel file, it saves all of pixel in piece image.This file format can preserve list Color bitmap, 16 colors or 256 color indexing model pixel maps, 24 true color images, in each pattern The size of single pixel is respectively 1/8 byte, 1/2 byte, 1 byte and 3 bytes.At Windows Lower in order to accelerate the processing speed of CPU, a base line in Windows regulation image file Shared byte number must be the multiple (i.e. in units of word) of 4, and not enough position is filled with 0.
When byte number shared by one base line of image is less than the multiple of 4, the size of data bitmap can not Calculate according to the line width in bitmap header information, need to carry out extra cover and calculate.
Definition: the data length (nWidthBytes) of each row of pixels, color figure place (nBits), Often row number of pixels (nWidth).
Monochrome bitmap: nWidthBytes=(nWidth+7)/8
4 color bitmaps: nWidthBytes=(nWidth+1)/2
16 color bitmaps: nWidthBytes=nWidth*2
24 color bitmaps: nWidthBytes=nWidth*3
32 color bitmaps: nWidthBytes=nWidth*4
The byte number that data line is actually used can be calculated, if byte number is not by above-mentioned formula The multiple of 4, then need cover to calculate.In image file, the byte number shared by a base line is as the following formula Calculate (in the case of not compressing):
Byte number=((nWidth*nBits+31)/32) * 4 needed for each base line. (1)
Such as one bitmap is 29 (wide) * 100 (high) pixel, then nWidth is 29, if position The data scheming each pixel are 1 (usually 8 gray-scale maps, or 24 true coloured pictures), then nBits Being 1, needed for each base line, byte is ((nWidth*nBits+31)/32) * 4= ((29*1+31)/32) 4=4 byte of *.After polishing, long each pitch of scanning is 32 (4 bytes), As shown in Figure 6: 8 29 3 use 0 cover
Symbian system provides CFbsBitmap class management bitmap, is obtained by DataAddress () Removing the address pointer of internal storage data beyond pictorial information head, carrying out internal memory operation can be to picture Internal storage data is modified.Symbian system have followed the byte-aligned principle of bitmap equally, with Time must also follow each base line the number of pixel be 4 multiple, not enough position uses 0 cover. The computational methods of the number of pixels of each base line can be calculated as follows:
Each base line actual pixels point number=sW & 0x3?(sW+4-(sW& 0x3)): sW; (2)
SW is the number of pixels that picture to be converted is often gone, in the position of the pixel beyond physical length Upper use 0 carrys out cover.
Align according to bitmap alignment and pixel number, the bmp figure of 32 bit strip alpha passages is entered Row memory value is revised, and calculates the actual pixel number of each base line and word by above-mentioned formula Joint number, less than 4 byte multiple and add 0 less than the base line of 4 pixel multiples, follow Ring generates 24 true color bmp and the gray scale of 8 after processing each base line of picture Bmp, the display for transparent picture provides input.Load png picture from this locality, png dll move State chained library is decoded, and generates the bmp of 32 bit strip alpha information, is split as 24 very Two pictures are overlapped, can realize the transparent of picture by colour picture and 8 gray scale pictures.
24 the true color pictures exported by picture decoding process module and the gray scale picture of 8, make For the input of animation buffer module, shown on the table and carry out being switched fast realize concrete dynamic Draw and play.
Animation is play the main mode using played in order motion picture frame and is realized animation broadcasting.Initialize Time structure transition cartoon and state animation queue, its save often group animation in whole animation frame letter Breath, including picture name corresponding to frame number, animation frame, frame period time, the relative position of picture Etc. information.
When animation sequence is ready, the animation frame picture that can take out in turn in sequence is decoded broadcasting Put.When between two animations during switching, in order to realize smooth connection, no-delay effect, animation shows Module have employed the method for double buffering.
Desktop display animation uses RWsSprite as display container, loads the picture needing display, Show foremost at screen.Prior art is put into after being decoded by the full content of one group of animation simultaneously Container shows.This motion is in order to effectively control playing sequence and the broadcasting time of animation frame, every time It is filled only with a frame animation content in RWsSprite container, then refreshes container and show, display While prepare next frame animated content to be shown, primary operational is from calculated animation sequence Middle acquisition next frame picture indices, is decoded the picture of assigned indexes by picture decoder module, etc. Treat that the time point that next frame is play arrives, when timeslice set in advance arrives, take out next successively Frame animation content is decoded showing.The method sets the most voluntarily when generating animation sequence Put play rules (playing sequence and broadcasting time), play according to animation sequence and can realize freely Animated content controls.
Transition cartoon feed generation module exists and is showing that the container of animated content creates buffer container Create primary tank and animation frame is put into the container closure that newly created container detects whether showing Showing that the container of animation activates newly-built container and refreshes screen window group animation buffering flow for displaying figure The most whether call when the external module decoding next frame picture waiting time sheet sheet time of advent arrives aobvious Show that next pictures external module is opened timer and taken out index value picture solution from animation sequence in turn Code module-external module 24 true color of output and 8 gray scales bmp
A kind of method that in the present invention, mobile phone desktop animated content seamlessly transits, farther includes: create New container, fills picture to be played to newly created container, calls newly created container and plays The picture filled.
As it is shown in fig. 7, animation buffering to implement step as follows:
1) according to the event that event interface is incoming, use transition cartoon feed generation module to calculate and comprise The animation sequence of transition cartoon;
2) from animation sequence, motion picture index to be broadcast is taken out successively;
3) use picture indices to read local animation file, picture decoder module be decoded generating One 24 and the bitmap of 8;
4) detect whether to there is the container showing animated content;
5) if there is the container showing animation, buffer container is created;
6) primary tank is then created if there is no the container showing animation;
7) bitmap of 24 generated and the bitmap of 8 are filled to newly created container;
8) detect whether to there is the container showing content;
9) if had, closing the container showing animation, then activating new container;
10) without the most directly activating the container filling new content;
11) force refresh window server, show animation;
12) timer is opened;
13) take out the next frame picture indices in animation sequence successively, call picture decoder module to this The picture that index points to is decoded, and waiting time sheet arrives;
14) arrive when timeslice, cyclic process 4) to process 13).
As shown in Figure 8, the present invention also disclosed a kind of mobile phone desktop animated content and seamlessly transits device, Including: transition cartoon generation module, for preserving the index sequence of initial motion picture, transition cartoon Picture indices sequence and terminate the index sequence of motion picture, dynamically generate one group of animation sequence, and Dynamically generate one group of animation sequence is flowed to picture decoder module;Picture decoder module, for from Reference numeral is sequentially read in animation display queue, reads local 32 bit strip alpha passages according to numbering Png picture as input, call png decoding DLL and be decoded generating 32 bit strip alpha and lead to The bmp in road, then calculate through special bitmap alignment, the bmp of 32 bit strip alpha passages is divided Xie Weiyi opens 24 true color bmp without alpha passage and the gray scale picture of 8, and This two pictures is flowed to animation buffered play module;Animation buffered play module, for by incoming Two bmp bitmaps as input, use container to play out, and use buffering to process every time Incoming picture.
A kind of machine desktop animated content in the present invention seamlessly transits device, also includes: transition cartoon rope Draw table creation module, be used for creating transition cartoon concordance list.
In the present invention, a kind of machine desktop animated content seamlessly transits device, also includes, container creation module, For creating new container;The picture that described newly created vessel filling is to be played, described animation buffers Playing module calls newly created container and plays the picture filled.
In sum, in the present invention, the display aspect of desktop animation is made by the special of animation container By method, reach the no-delay switching that animation is play, and shifting will not be affected because desktop contents blocks The normal function of dynamic terminal use uses;The present invention compensate for existing mobile phone desktop animation and plays content not Coherent deficiency, adds animated content smooth features, improves the matter that animation is play on Consumer's Experience Amount, really realizes animated content and smooths, and animation effect is more life-like;Meanwhile, intermediateness is used to move Make to effectively reduce transition cartoon number as animation transfer, decrease (n*n-2n) altogether individual, reduce Requirement to hardware (memorizer).

Claims (12)

1. the method that a mobile phone desktop animated content seamlessly transits, it is characterised in that include step:
Initiating has been generated respectively according to the initial animation being preset in mobile phone, termination animation and transition cartoon Draw queue, terminate animation queue and transition cartoon queue, according to initial animation queue, terminate animation team Row, transition cartoon queue and the animation configuration file being preset in mobile phone generate animation display queue;
Sequentially read the animation index value in animation display queue, obtain picture according to animation index value Positional information;
The picture that positional information according to picture will read every time, uses buffering to call container and carries out Play;
Picture preset in mobile phone is all png picture, and the method is further comprising the steps of:
Positional information according to picture reads the png picture of band alpha passage, to the png read Picture is decoded generating the bmp picture of band alpha passage, then through number of pixels and byte-aligned, The bmp picture of band alpha passage is decomposed into a true color bmp picture without alpha passage With a gray scale picture, by the described true color bmp picture without alpha passage and described gray-scale map Sheet is overlapped as picture to be played.
2. the method for claim 1, it is characterised in that further comprising the steps of:
According to animation number initial in mobile phone and termination animation number, set up two dimension transition cartoon index Table, and give initial value and be-1;
According to animation initial in animation configuration file, terminate the animation letter with each corresponding transition cartoon Breath, is recorded as the horizontal stroke of the concordance list of transition cartoon by initial animation index value in initial animation queue Coordinate, is recorded as the concordance list of transition cartoon by termination animation index value in terminating animation queue Vertical coordinate, is entered as this transition cartoon place transition cartoon by the index value in the concordance list of transition cartoon Index value in queue adds 1 and negates the value of gained.
3. method as claimed in claim 2, it is characterised in that according to initial animation queue, termination Animation queue, transition cartoon queue and the animation configuration file being preset in mobile phone generate animation and show team The step of row farther includes:
Using current animation as initial animation;
Animation to be played is obtained as terminating animation according to system or customer incident;
Index value according to initial animation and the index value terminating animation are looked in transition cartoon concordance list Ask the index value of transition cartoon;
Raw with initial animation index value, transition cartoon index value and termination animation index value for storage content Become animation display queue.
4. method as claimed in claim 3, it is characterised in that according to initial animation queue, termination Animation queue, transition cartoon queue and the animation configuration file being preset in mobile phone generate animation and show team The step of row farther includes:
One preset in initial animation or termination animation is intermediate animation;
Using current animation as initial animation, obtain animation to be played according to system or customer incident and make For terminating animation;
Judge initial animation or terminate whether animation is intermediate animation, if being not intermediate animation, then At initial animation and terminate inserting between animation intermediate animation, generate initial animation to intermediate animation and in Between animation to terminate two groups of animations of animation;
Initialize animation display queue;
The index value of initial animation is added animation display queue;
The index value of the index value according to initial animation and intermediate animation is looked in transition cartoon concordance list Ask transition cartoon index value, if the index value of transition cartoon be-1, then by initial animation with in Between the index value of the corresponding transition cartoon of animation add 1 and negate, join animation display queue;
The index value of intermediate animation is added animation display queue;
Index value according to intermediate animation and the index value terminating animation are looked in transition cartoon concordance list Ask the index value of transition cartoon, if the index value of transition cartoon is not-1, then by intermediate animation and end The index value of the transition cartoon that stop picture is corresponding adds 1 and negates, and joins animation display queue;
The index value terminating animation is added animation display queue.
5. the method for claim 1, it is characterised in that initial motion picture and termination animation Picture circulation display at least one time, transition cartoon picture playing one time.
6. method as claimed in claim 2, it is characterised in that the initial animation queue that generated, Terminate animation queue, transition cartoon queue saves the picture frame letter often organizing animation in respective queue respectively Breath, described picture frame information include picture name that frame number, picture frame are corresponding, the frame period time and Pictures location information.
7. method as claimed in claim 6, it is characterised in that read according to the positional information of picture With the png picture of alpha passage, the png picture read is decoded generates band alpha and leads to The bmp picture in road, then through number of pixels and byte-aligned, by the bmp picture of band alpha passage Be decomposed into a true color bmp picture without alpha passage and a gray scale picture, by described not True color bmp picture and described gray scale picture with alpha passage are overlapped as figure to be played The step of sheet farther includes:
Call animation display queue, from animation display queue, sequentially read animation index value;
If animation index value less than 0, then negates subtracts 1 and obtain the animation index value revised, according to repairing Positive animation index value reads the picture frame information of corresponding transition cartoon in transition cartoon queue, otherwise In initial animation queue or terminate animation queue is read the picture of corresponding animation according to animation index value Frame information;
32 bit strip alpha passages of mobile terminal are read according to the Pictures location information in picture frame information Png picture, png picture is decoded into the bmp picture of 32 bit strip alpha passages;
The actual pixel number of each base line and byte number is calculated respectively by below equation,
Each base line actual pixels point number=sW&0x3?(sW+4-(sW&0x3)): sW, Wherein, sW is the number of pixels that picture to be converted is often gone,
Byte number=((nWidth*nBits+31)/32) * 4 needed for each base line, wherein, nBits For color figure place, nWidth is every row number of pixels;
Less than 4 byte multiple and add 0 less than the base line of 4 pixel multiples, circulation 24 true color bmp pictures and the gray scale of 8 is generated after processing each base line of picture Bmp picture, is carried out the described true color bmp picture without alpha passage and described gray scale picture Superposition is as picture to be played.
8. the method for claim 1, it is characterised in that farther include: create new appearance Device, fills picture to be played to newly created container, calls newly created container broadcasting and is filled Picture.
9. method as claimed in claim 8, it is characterised in that farther include:
A. detecting whether to there is the container showing animation, if existed, then going to step B, If it does not exist, then go to step C;
B. create buffer container, go to step D;
C. create primary tank, go to step D;
D. the gray scale bmp picture of 24 the true color bmp pictures generated and 8 is filled to buffering In container or primary tank;
E. detect whether to there is the container showing animation, if it has, then go to step F, if No, then step G is gone to;
F. close the container showing animation, then activate buffer container, go to step H;
G. activate primary tank, go to step H;
H. refresh window server, shows animation;
I. timer is opened;
J. the next frame Pictures location information in display animation queue it is successively read, to according to Pictures location Information inquiry to picture be decoded, waiting time sheet arrive;
K. arriving when timeslice, circulation step A is to step J.
10. a mobile phone desktop animated content seamlessly transits device, it is characterised in that include that transition is moved Picture generation module and animation buffered play module, wherein,
Transition cartoon generation module, for according to be preset in mobile phone initial animation, terminate animation and Transition cartoon generates initial animation queue respectively, terminates animation queue and transition cartoon queue, according to rising Initiating is drawn queue, termination animation queue, transition cartoon queue and animation configuration file generation animation and is shown Queue, and animation is shown, and queue flows to animation buffered play module;
Animation buffered play module, for sequentially reading the animation index value in animation display queue, root The positional information of picture is obtained, the figure that will every time read according to the positional information of picture according to animation index value Sheet, uses buffering to call container and plays out;
Picture preset in mobile phone is all png picture, and this device also includes:
Picture decoder module, for sequentially reading the animation index value in animation display queue, according to dynamic Draw index value and obtain the positional information of picture, read band alpha in mobile phone according to the positional information of picture The png picture of passage, is decoded generating the bmp of band alpha passage to the png picture read Picture, then through number of pixels and byte-aligned, the bmp picture of band alpha passage is decomposed into one Open the true color bmp picture without alpha passage and a gray scale picture, by described without alpha The true color bmp picture of passage and described gray scale picture are overlapped as picture conveying to be played To animation buffered play module.
11. devices as claimed in claim 10, it is characterised in that also include:
Transition cartoon index table creation module, is used for creating transition cartoon concordance list.
12. devices as claimed in claim 10, it is characterised in that also include, container creation module, For creating new container;The picture that newly created vessel filling is to be played, described animation buffered play Module is called newly created container and is play the picture filled.
CN201110440987.5A 2011-12-26 The method and apparatus that a kind of mobile phone desktop animated content seamlessly transits Active CN103176788B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110440987.5A CN103176788B (en) 2011-12-26 The method and apparatus that a kind of mobile phone desktop animated content seamlessly transits

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110440987.5A CN103176788B (en) 2011-12-26 The method and apparatus that a kind of mobile phone desktop animated content seamlessly transits

Publications (2)

Publication Number Publication Date
CN103176788A CN103176788A (en) 2013-06-26
CN103176788B true CN103176788B (en) 2016-12-14

Family

ID=

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101609561A (en) * 2009-06-30 2009-12-23 广州市八丁动漫网络科技有限公司 A kind of method that realizes smooth transition among animated cartoons
CN101893980A (en) * 2009-05-20 2010-11-24 龙旗科技(上海)有限公司 Display method for multi-image viewing interface with sliding animation effect
CN101937309A (en) * 2010-08-10 2011-01-05 深圳市金立通信设备有限公司 Man-machine interactive system and method of flash animation on mobile phone desktop
CN102214068A (en) * 2011-04-28 2011-10-12 宇龙计算机通信科技(深圳)有限公司 Control method for page switching display and mobile terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101893980A (en) * 2009-05-20 2010-11-24 龙旗科技(上海)有限公司 Display method for multi-image viewing interface with sliding animation effect
CN101609561A (en) * 2009-06-30 2009-12-23 广州市八丁动漫网络科技有限公司 A kind of method that realizes smooth transition among animated cartoons
CN101937309A (en) * 2010-08-10 2011-01-05 深圳市金立通信设备有限公司 Man-machine interactive system and method of flash animation on mobile phone desktop
CN102214068A (en) * 2011-04-28 2011-10-12 宇龙计算机通信科技(深圳)有限公司 Control method for page switching display and mobile terminal

Similar Documents

Publication Publication Date Title
CN109636884A (en) Animation processing method, device and equipment
CN111899322B (en) Video processing method, animation rendering SDK, equipment and computer storage medium
US9077970B2 (en) Independent layered content for hardware-accelerated media playback
CN105354872A (en) Rendering engine, implementation method and producing tools for 3D web game
CN108966036B (en) Barrage display methods, electronic equipment and computer storage medium
CN105096368B (en) Three dimensional object processing method and relevant apparatus
CN106713889A (en) 3D frame rendering method and system and mobile terminal
CN102651142A (en) Image rendering method and image rendering device
CN100421119C (en) Method for drawing map in game
CN109448094A (en) A kind of texture maps set dispatching method
CN102244784A (en) Method for compressing and displaying picture including transparent information
CN102915563A (en) Method and system for transparently drawing three-dimensional grid model
RU2014153030A (en) METHOD, DEVICE AND ANIMATION PLAYER
CN111899169A (en) Network segmentation method of face image based on semantic segmentation
CN110533579A (en) Based on the video style conversion method from coding structure and gradient order-preserving
CN106204672A (en) Texture compression document generating method
CN109801352B (en) Meteorological lattice data animation display method
CN103176788B (en) The method and apparatus that a kind of mobile phone desktop animated content seamlessly transits
CN104008565B (en) System and method for playing Flash bitmap animation by using cocos2d-x and HE engines
CN102572207A (en) Color space transformation method suitable for joint photographic experts group (JPEG) image
CN102572297B (en) Efficient high-quality video special effect rendering method
WO2023160041A1 (en) Image rendering method and apparatus, computer device, computer-readable storage medium and computer program product
CN112188262A (en) Image processing method, device and system and computer readable medium
CN115908672A (en) Three-dimensional scene rendering acceleration method, system, medium, device and terminal
CN103176788A (en) Method and device used for smooth transition of animation content of mobile phone desktop

Legal Events

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

Effective date of registration: 20200811

Address after: No.1133 Jimei Avenue, Jimei District, Xiamen City, Fujian Province

Co-patentee after: MIGU CULTURE TECHNOLOGY Co.,Ltd.

Patentee after: MIGU COMIC Co.,Ltd.

Co-patentee after: CHINA MOBILE COMMUNICATIONS GROUP Co.,Ltd.

Address before: 350003 No. 140 East Lake Road, Gulou District, Fujian, Fuzhou

Patentee before: CHINA MOBILE GROUP FUJIAN Co.,Ltd.