CN104574483A - Method and device for generating customizable dynamic graphs - Google Patents

Method and device for generating customizable dynamic graphs Download PDF

Info

Publication number
CN104574483A
CN104574483A CN201410854766.6A CN201410854766A CN104574483A CN 104574483 A CN104574483 A CN 104574483A CN 201410854766 A CN201410854766 A CN 201410854766A CN 104574483 A CN104574483 A CN 104574483A
Authority
CN
China
Prior art keywords
pixel
frame
static images
characteristic area
mapped
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201410854766.6A
Other languages
Chinese (zh)
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.)
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing 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 Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201410854766.6A priority Critical patent/CN104574483A/en
Publication of CN104574483A publication Critical patent/CN104574483A/en
Priority to PCT/CN2015/095933 priority patent/WO2016107356A1/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation
    • G06T13/802D [Two Dimensional] animation, e.g. using sprites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/001Texturing; Colouring; Generation of texture or colour

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the invention provides a method and device for generating customizable dynamic graphs. The method includes the steps that dynamic information is read from dynamic interaction files; the dynamic interaction files comprise script objects and static images; at least part of pixel points in the static images are mapped to distorted images of one frame or multiple frames through the script objects according to the dynamic information so as to drive the dynamic images to change frame by frame. According to the method and device, the customizable dynamic graphs are achieved through the dynamic information, the dynamic effect can be assigned by users, and the dynamic effect mode is richened; due to the fact that the static images are small in size change, only information, such as the dynamic information and the scrip objects with the size being smaller is added, and the size is reduced greatly while the dynamic effect is guaranteed.

Description

A kind of method and apparatus generating customizable Dynamic Graph
Technical field
The present invention relates to technical field of image processing, particularly relate to and a kind ofly generate the method for customizable Dynamic Graph and a kind of device generating customizable Dynamic Graph.
Background technology
Along with the development of computing machine science and technology, especially mobile device is extensively universal, and computer based is widely used the various aspects entering people's life.
Picture browsing on internet occupies a big chunk of user's visit capacity, and along with the development of mobile Internet, user becomes trend just day by day at browsing pictures on mobile phone.But traditional Internet picture major part is all static images, lack dynamic effect.
Conventional dynamic picture generally adopts GIF form, but GIF figure is by the plurality of pictures existed in advance, after synthesis, carries out playing according to every frame period time of having specified.Picture volume size, along with outside the increase of broadcasting frame number geometry multiple, plays form single.
Summary of the invention
In view of the above problems, propose the present invention in case provide a kind of overcome the problems referred to above or solve the problem at least in part a kind ofly generate the method for customizable Dynamic Graph and corresponding a kind of device generating customizable Dynamic Graph.
According to one aspect of the present invention, provide a kind of method generating customizable Dynamic Graph, comprising:
Multidate information is read from dynamic mutual files; Described dynamic interaction file comprises scripting object and static images;
According to described multidate information, at least part of pixel in described static images is mapped in a frame or multiframe distortion picture by described scripting object, changes frame by frame to drive described static images.
Alternatively, described multidate information comprises characteristic area, unique point, one or more reference point;
Describedly according to described multidate information, at least part of pixel in described static images to be mapped in a frame or multiframe distortion picture by described scripting object, to comprise with the step driving described static images to change frame by frame:
The pixel of described static images is mapped in a frame or multiframe distortion picture according to described unique point and described one or more reference point by described scripting object.
Alternatively, described characteristic area comprises convex domain, and described unique point comprises focus point.
It is alternatively, described that by described scripting object, according to described unique point and described one or more reference point, by the pixel of described static images, the step be mapped in a frame or multiframe distortion picture comprises:
Distortion picture is generated by described scripting object;
Pixel on the first line in described characteristic area is mapped on the second line;
Copy the pixel on described second line to same position in described distortion picture;
Wherein, described first line is the line between described unique point and marginal point, and described second line is the line of current reference point and marginal point, and described marginal point is the coordinate points on described characteristic area edge.
Alternatively, described the step that pixel on the first line in described characteristic area is mapped on the second line to be comprised:
Calculate the pixel in described characteristic area on the first line, the relative position on the first line;
According to described relative position, described pixel is copied on the second line.
It is alternatively, described that according to described unique point and described one or more reference point, by the pixel of described static images, the step be mapped in a frame or multiframe distortion picture also comprises:
Pixel outside described characteristic area is mapped to the same position in described distortion picture.
It is alternatively, described that according to described unique point and described one or more reference point, by the pixel of described static images, the step be mapped in a frame or multiframe distortion picture also comprises:
Pixel overlap-add procedure is carried out to the pixel of location overlap in distortion picture.
It is alternatively, described that according to described unique point and described one or more reference point, by the pixel of described static images, the step be mapped in a frame or multiframe distortion picture also comprises:
Pixel interpolation processing is carried out to the blank position in distortion picture.
Alternatively, described multidate information comprises the direction of motion of at least part of pixel in characteristic area, described characteristic area;
Describedly according to described multidate information, at least part of pixel in described static images to be mapped in a frame or multiframe distortion picture by described scripting object, to comprise with the step driving described static images to change frame by frame:
By described scripting object in described direction of motion, according to preset mode, texture is carried out at least part of pixel in described characteristic area, produce the dynamic effect comprising a frame or multiframe change picture.
Alternatively, described by described scripting object in described direction of motion, according to preset mode, texture is carried out at least part of pixel in described characteristic area, produces the step of dynamic effect comprising a frame or the change of multiframe distortion picture and comprise:
Described characteristic area is divided one or more graphing; Have multiple summit in each graphing, each summit has texture coordinate;
In described direction of motion, move the summit of each drawing image at one or more time point according to preset mode;
For each graphing, use graphic plotting interface to carry out texture according to the texture coordinate on each summit to the pixel in graphing, produce the dynamic effect comprising a frame or the change of multiframe distortion picture.
Alternatively, described preset mode comprises simple harmonic motion pattern and/or damped vibration pattern;
Described in described direction of motion, the step moving the summit of each drawing image according to preset mode at one or more time point comprises:
In described direction of motion, move the summit of each drawing image according to simple harmonic motion pattern and/or damped vibration pattern at one or more time point.
Alternatively, described in described direction of motion, the step moving the summit of each drawing image according to simple harmonic motion pattern and/or damped vibration pattern at one or more time point comprises:
Determine the acceleration on the summit of each drawing image; The summit of each drawing image has original coordinates;
According to described acceleration and/or default ratio of damping, calculate the displacement on the summit of moving each drawing image in one or more time point along described direction of motion;
The coordinates of targets on the summit of each drawing image is calculated by described original coordinates and described displacement.
According to a further aspect in the invention, provide a kind of device generating customizable Dynamic Graph, comprising:
Read module, is suitable for reading multidate information from dynamic mutual files; Described dynamic interaction file comprises scripting object and static images;
Mapping block, is suitable for being mapped in a frame or multiframe distortion picture at least part of pixel in described static images according to described multidate information by described scripting object, changes frame by frame to drive described static images.
Alternatively, described multidate information comprises characteristic area, unique point, one or more reference point; Described mapping block is also suitable for:
The pixel of described static images is mapped in a frame or multiframe distortion picture according to described unique point and described one or more reference point by described scripting object.
Alternatively, described characteristic area comprises convex domain, and described unique point comprises focus point.
Alternatively, described mapping block is also suitable for:
Distortion picture is generated by described scripting object;
Pixel on the first line in described characteristic area is mapped on the second line;
Copy the pixel on described second line to same position in described distortion picture;
Wherein, described first line is the line between described unique point and marginal point, and described second line is the line of current reference point and marginal point, and described marginal point is the coordinate points on described characteristic area edge.
Alternatively, described mapping block is also suitable for:
Calculate the pixel in described characteristic area on the first line, the relative position on the first line;
According to described relative position, described pixel is copied on the second line.
Alternatively, described mapping block is also suitable for:
Pixel outside described characteristic area is mapped to the same position in described distortion picture.
Alternatively, described mapping block is also suitable for:
Pixel overlap-add procedure is carried out to the pixel of location overlap in distortion picture.
Alternatively, described mapping block is also suitable for:
Pixel interpolation processing is carried out to the blank position in distortion picture.
Alternatively, described multidate information comprises the direction of motion of at least part of pixel in characteristic area, described characteristic area; Described mapping block is also suitable for:
By described scripting object in described direction of motion, according to preset mode, texture is carried out at least part of pixel in described characteristic area, produce the dynamic effect comprising a frame or multiframe change picture.
Alternatively, described mapping block is also suitable for:
Described characteristic area is divided one or more graphing; Have multiple summit in each graphing, each summit has texture coordinate;
In described direction of motion, move the summit of each drawing image at one or more time point according to preset mode;
For each graphing, use graphic plotting interface to carry out texture according to the texture coordinate on each summit to the pixel in graphing, produce the dynamic effect comprising a frame or the change of multiframe distortion picture.
Alternatively, described preset mode comprises simple harmonic motion pattern and/or damped vibration pattern; Described mapping block is also suitable for:
In described direction of motion, move the summit of each drawing image according to simple harmonic motion pattern and/or damped vibration pattern at one or more time point.
Alternatively, described mapping block is also suitable for:
Determine the acceleration on the summit of each drawing image; The summit of each drawing image has original coordinates;
According to described acceleration and/or default ratio of damping, calculate the displacement on the summit of moving each drawing image in one or more time point along described direction of motion;
The coordinates of targets on the summit of each drawing image is calculated by described original coordinates and described displacement.
The embodiment of the present invention is to the multidate information in dynamic interaction file, scripting object and static images, be mapped in a frame or multiframe distortion picture according to multidate information at least part of pixel in static images by described scripting object, change frame by frame to drive static images, customizable Dynamic Graph is achieved by multidate information, dynamic effect can be specified by user, enrich the form of dynamic effect, because the size variation of static images own is very little, merely add as multidate information, the information of scripting object equal-volume very little (a few K size), while guarantee dynamic effect, greatly reduce volume size.
The pixel of static images is mapped in a frame or multiframe distortion picture based on one or more reference point by the embodiment of the present invention, generate dynamic effect, calculating simply, without the need to relying on third party's kit, library file or instrument, playing up formation speed fast, few to resource consumption, easily cross-platform.
The present invention is based on direction of motion and at least part of pixel in characteristic area is carried out texture, produce the dynamic effect comprising a frame or the change of multiframe distortion picture, on the one hand, dynamic effect is generated to characteristic area, decrease the volume of dynamic effect, decrease bandwidth occupancy during transmission, convenient transmission, on the other hand, because texture efficiency is very high, decrease and generate the consuming time of dynamic effect, all can produce dynamic effect soon for the picture etc. in network picture or system photograph album, generate dynamic effect quickly and easily.
Above-mentioned explanation is only the general introduction of technical solution of the present invention, in order to technological means of the present invention can be better understood, and can be implemented according to the content of instructions, and can become apparent, below especially exemplified by the specific embodiment of the present invention to allow above and other objects of the present invention, feature and advantage.
Accompanying drawing explanation
By reading hereafter detailed description of the preferred embodiment, various other advantage and benefit will become cheer and bright for those of ordinary skill in the art.Accompanying drawing only for illustrating the object of preferred implementation, and does not think limitation of the present invention.And in whole accompanying drawing, represent identical parts by identical reference symbol.In the accompanying drawings:
Fig. 1 shows a kind of according to an embodiment of the invention flow chart of steps generating the embodiment of the method for customizable Dynamic Graph;
Fig. 2 shows a kind of according to an embodiment of the invention exemplary plot of static images;
Fig. 3 shows a kind of according to an embodiment of the invention exemplary plot of selected characteristic region in static images;
Fig. 4 A and Fig. 4 B shows a kind of according to an embodiment of the invention Mapping Examples figure of pixel;
Fig. 5 A and Fig. 5 B shows a kind of according to an embodiment of the invention exemplary plot of warp image; And
Fig. 6 shows a kind of according to an embodiment of the invention structured flowchart of the dynamic interaction device embodiment based on static images.
Embodiment
Below with reference to accompanying drawings exemplary embodiment of the present disclosure is described in more detail.Although show exemplary embodiment of the present disclosure in accompanying drawing, however should be appreciated that can realize the disclosure in a variety of manners and not should limit by the embodiment set forth here.On the contrary, provide these embodiments to be in order to more thoroughly the disclosure can be understood, and complete for the scope of the present disclosure can be conveyed to those skilled in the art.
With reference to Fig. 1, show a kind of according to an embodiment of the invention flow chart of steps generating the embodiment of the method for customizable Dynamic Graph, specifically can comprise the steps:
Step 101, reads multidate information from dynamic mutual files;
It should be noted that, the embodiment of the present invention can be applied in mobile device, such as, mobile phone, PDA (Personal Digital Assistant, personal digital assistant), laptop computer, palm PC etc., also can be applied in fixed equipment, such as, PC (Personal Computer, PC), notebook computer etc., the embodiment of the present invention is not limited this.
These mobile devices or fixed equipment generally can support the operating system comprising Android (Android), IOS, WindowsPhone or windows etc., usually can store dynamic interaction file.
Wherein, described dynamic interaction file can comprise multidate information, scripting object and static images;
Static images, for dynamic picture, namely can not have the picture of dynamic effect.
This static images can comprise the forms such as JPG, JPEG, PNG, BMP, and the embodiment of the present invention is not limited this.
In embodiments of the present invention, in static images, some regions are as characteristic area, and this characteristic area can be the shapes such as polygon, circle, ellipse, can carry out the generation of dynamic effect for the view data in this characteristic area.
Multidate information can for being mapped to the configuration information of a frame or multiframe warp image by the characteristic area of static images, such as XML (Extensible Markup Language, extendible identifiable language), json (Javascript Object Notation, data interchange language) etc.
Can be as follows with the example of the configuration information of json design:
Such as, for static images as shown in Figure 2, the characteristic area in this static images can be elliptical region as shown in Figure 3.
Step 102, is mapped in a frame or multiframe distortion picture at least part of pixel in described static images according to described multidate information by described scripting object, changes frame by frame to drive described static images.
After this multidate information of reading, scripting object can be used to map this static images according to this multidate information, to produce the dynamic effect changed frame by frame.
The embodiment of the present invention is to the multidate information in dynamic interaction file, scripting object and static images, be mapped in a frame or multiframe distortion picture according to multidate information at least part of pixel in static images by described scripting object, change frame by frame to drive static images, customizable Dynamic Graph is achieved by multidate information, dynamic effect can be specified by user, enrich the form of dynamic effect, because the size variation of static images own is very little, merely add as multidate information, the information of scripting object equal-volume very little (a few K size), while guarantee dynamic effect, greatly reduce volume size.
In a kind of embodiment of the present invention, described multidate information can comprise characteristic area, unique point, one or more reference point; Then in embodiments of the present invention, step 102 can comprise following sub-step:
Sub-step S11, is mapped to the pixel of described static images in a frame or multiframe distortion picture according to described unique point and described one or more reference point by described scripting object.
In embodiments of the present invention, can take unique point as benchmark, using reference point as the amplitude reference of distortion, static images be mapped, to generate distortion picture.
Pixel in characteristic area in static images can point to the direction mapping of reference point along unique point, cause the distortion of static images.When reference point, to depart from unique point larger, and the amplitude of distortion can be larger, and when reference point, to depart from unique point less, and the amplitude of distortion can be less, especially, when unique point overlaps with reference point, can not produce distortion in distortion picture.
In a kind of alternate exemplary of the embodiment of the present invention, described characteristic area can comprise convex domain, and described unique point can comprise focus point.
Convex domain, can refer to that figure is toward evagination, the place do not fallen in from geometrically seeing.
Algebraically can define convex domain like this: appoint in set and get two somes a, b, t*a+ (1-t) * b is had still to belong to this set, wherein 0<t<1, the meaning of this expression formula can be that the straight-line segment of connection two some ab is also in set.
Center of gravity geometrically, is also called geometric center, and when object is homogeneous (density is definite value), barycenter is equal to the centre of form, e.g., and the intersection point of Atria bar center line.
In a kind of embodiment of the present invention, sub-step S11 can comprise following sub-step:
Sub-step S111, generates distortion picture by described scripting object;
In embodiments of the present invention, the original state of distortion picture can be blank.
Sub-step S112, is mapped to the pixel on the first line in described characteristic area on the second line;
Wherein, described first line can be the line between described unique point and marginal point, and described second line can be the line of current reference point and marginal point, and described marginal point can be the coordinate points on described characteristic area edge.
In the embodiment of the present invention, for the pixel in characteristic area, can map according to reference point.
It should be noted that, if characteristic area is convex domain, reference point is the pixel in characteristic area, then the pixel after mapping can be positioned at characteristic area, pixel in realization character region maps in characteristic area, and can not be mapped to outside characteristic area.
Such as, as shown in Figure 4 A, C0 is unique point (as focus point), and C1 can be reference point, and E can marginal point, then C0E can be the first line, C1E can be the second line, in the embodiment of the present invention, and can by the pixel P0 on the first line C0E, be mapped on the second line C1E, obtain the some P1 be mapped to.
In a kind of embodiment of the present invention, sub-step S112 can comprise following sub-step:
Sub-step S1121, calculates the pixel on the first line in described characteristic area, the relative position on the first line;
Sub-step S1122, according to described relative position, copies to described pixel on the second line.
In actual applications, the relative position of pixel can be expressed with proportionate relationship.
Such as, in one example, as shown in Figure 4 A, the ratio of line segment C0P0 and line segment C0E, as ratio R, can as the relative position of pixel P0 on the first line C0E.According to ratio R, try to achieve the some P1 on line segment C1E, make the ratio of line segment C1P1 and the second line C1E be R.
Certainly, can also adopt ratio expression relative position between other line segment comprising pixel and first lines in the embodiment of the present invention, the embodiment of the present invention is not limited this.
Sub-step S113, copies the pixel on described second line to same position in described distortion picture;
If determine the position of pixel on the second line, then can be copied to the same position in distortion picture, the distortion carrying out image maps.
In a kind of embodiment of the present invention, sub-step S11 can comprise following sub-step:
Sub-step S114, the pixel outside described characteristic area is mapped to the same position in described distortion picture.
In the embodiment of the present invention, if pixel is outside convex characteristic area on static images, then can be copied directly to same position corresponding on distortion picture, produce distortion.
Certainly, the embodiment of the present invention also can not map the pixel outside characteristic area, and the pixel only in feature based region maps, and the embodiment of the present invention is not limited this.
In a kind of embodiment of the present invention, sub-step S11 can comprise following sub-step:
Sub-step S115, carries out pixel overlap-add procedure to the pixel of location overlap in distortion picture.
In embodiments of the present invention, produce distortion because static images carries out mapping, the region that pixel is comparatively concentrated in distortion picture, may produce the situation of the location overlap of pixel.
For the situation of the location overlap of pixel, the embodiment of the present invention can carry out pixel overlap-add procedure.
Such as, if application rgb color pattern, then can obtain color miscellaneous by the change of red (R), green (G) to pixel, indigo plant (B) three Color Channels and their superpositions each other.
Certainly, in order to reduce calculated amount further, also the pixel of a pixel (as random selecting pixel, choosing the pixel finally copying this position to) as this position can be chosen from the pixel of superposition, other modes can also be adopted to choose the pixel of this position, and the embodiment of the present invention is not limited this.
In a kind of embodiment of the present invention, sub-step S11 can comprise following sub-step:
Sub-step S116, carries out pixel interpolation processing to the blank position in distortion picture.
In embodiments of the present invention, distortion is produced because static images carries out mapping, the region that pixel is comparatively sparse in distortion picture, may be assigned by some pixel and (namely not have pixel to be mapped to this position, the pixel of this position is virgin state, as white), produce the situation of blank position.
For the situation of the blank position in distortion picture, the embodiment of the present invention can carry out pixel interpolation processing, with completion distortion picture.
Such as, for the pixel Px be not assigned, the pixel Py (pixel, the pixel of below, the pixel in left side, the pixel etc. on right side as top) of its nearest assignment of selected distance, is assigned to pixel Px by the value of pixel Py.
In actual applications, when reference point (C1 as shown in Figure 4 A) moves to some positions time, a distortion picture can be mapped out according to the position of reference point (C1 as shown in Figure 4 A), along with reference point (C1 as shown in Figure 4 A) moves to different positions, distortion picture also changes, distortion picture can Continuous Play, thus formative dynamics effect.
As shown in Figure 5A, if reference point (C1 as shown in Figure 4 A) is in the left side of unique point (C0 as shown in Figure 4 A), then in characteristic image, entirety can toward left side distortion; Shown in Fig. 5 B, if reference point is on the right side of unique point (C0 as shown in Figure 4 A), then in characteristic image, entirety can be turned right distortion.
Further, reference point from the position of unique point, can distribute in unique point both sides, finally overlap with unique point, the distortion picture that then characteristic area maps out can be corresponding along the interactive operation event of specifying direction distortion back and forth, produce shake effect, and finally static.
Such as, as shown in Figure 4 A, it is mobile that reference Point C 1 does concussion in the X-direction through focus point C0, reference Point C 1 often moves to a position will generate a distortion picture, distortion picture is play frame by frame, and the image table that can produce in characteristic area as fig. 5 a and fig. 5b reveals the dynamic effect of left and right vibrations.
The pixel of static images is mapped in a frame or multiframe distortion picture based on one or more reference point by the embodiment of the present invention, generate dynamic effect, calculating simply, without the need to relying on third party's kit, library file or instrument, playing up formation speed fast, few to resource consumption, easily cross-platform.
In a kind of embodiment of the present invention, described multidate information can comprise the direction of motion of at least part of pixel in characteristic area, described characteristic area; Then in embodiments of the present invention, step 102 can comprise following sub-step:
Sub-step S21, by described scripting object in described direction of motion, carries out texture according to preset mode at least part of pixel in described characteristic area, produces the dynamic effect comprising a frame or multiframe change picture.
In embodiments of the present invention, using direction of motion (comprising acceleration) as the amplitude reference of distortion, static images can be mapped, to generate distortion picture.
Pixel in characteristic area in static images can map along direction of motion, causes the distortion of static images.
When the amplitude of direction of motion larger (amplitude as acceleration is larger, click the position of screen from characteristic area center more away from), the amplitude of distortion can be larger, when the amplitude of direction of motion less (amplitude as acceleration is less, click the position of screen from characteristic area center more close to), the amplitude of distortion can be less.
In a kind of embodiment of the present invention, sub-step S21 can comprise following sub-step:
Sub-step S211, divides one or more graphing by described characteristic area;
In embodiments of the present invention, can the mode of Graphics Application, namely can based on the generation dynamic effect of grid.
Specifically, characteristic area can be divided into one or more graphing, be chosen as the grid (i.e. graphing) of triangle or other shapes, triangle is adopted to be because graphic plotting interface, as OpenGL (Open Graphics Library), there is high efficiency accelerating algorithm for leg-of-mutton graph rendering.
Can have multiple summit in each graphing, each graphing (as triangle) can be represented by summit (as three summits), and except the two-dimensional coordinate of correspondence, each summit can have the texture coordinate of static images.
In one embodiment, one or more graphing can be divided to the central area of characteristic area, to simulate the shake effect (the approximate balloon filling water) being similar to physics water polo.
Sub-step S212, in described direction of motion, moves the summit of each drawing image at one or more time point according to preset mode;
In embodiments of the present invention, can according to preset mode, the summit of each graphing is moved along the equidirectional of this direction of motion, reverse direction.
In a kind of embodiment of the present invention, described preset mode comprises simple harmonic motion pattern and/or damped vibration pattern; Then in embodiments of the present invention, sub-step S212 can comprise following sub-step:
Sub-step S2121, in described direction of motion, moves the summit of each drawing image according to simple harmonic motion pattern and/or damped vibration pattern at one or more time point.
Simple harmonic motion, or simple harmonic oscillation, resonance, SHM (Simple Harmonic Motion), when can refer to that object (summit as each graphing) carries out simple harmonic motion, power suffered by object (summit as each graphing) is directly proportional with displacement, and power always points to equilibrium position.
Damped vibration can refer to the vibrations under drag effect, when drag size can be ignored, can be described as simple harmonic motion.Be subject to the effect of resistance in vibration processes, amplitude reduces gradually, and energy loses gradually, until vibration stops.
In a kind of alternate exemplary of the embodiment of the present invention, sub-step S2121 can comprise following sub-step:
Sub-step S21211, determines the acceleration on the summit of each drawing image;
In embodiments of the present invention, the acceleration that can formerly set, or the acceleration preset is as the initial acceleration in the summit of each graphing.
Sub-step S21212, according to described acceleration and/or default ratio of damping, calculates the displacement on the summit of moving each drawing image in one or more time point along described direction of motion;
For simple harmonic motion, can according to the power suffered by the summit of each graphing of this acceleration simulation, this power points to equilibrium position, and build spring model, simple harmonic motion is carried out along direction of motion in the summit of simulating each graphing.
For damped vibration, the resistance suffered by summit can simulating each graphing according to this damping system, damped vibration is carried out along direction of motion in the summit of simulating each graphing.
Displacement in one or more time point can be gone out by kinematics formulae discovery based on acceleration, ratio of damping, direction of motion.
Sub-step S21213, is calculated the coordinates of targets on the summit of each drawing image by described original coordinates and described displacement.
In embodiments of the present invention, the summit of each graphing can have original coordinates, and the original two-dimensional coordinate namely in static images, along direction of motion, this displacement in interpolation, then can obtain the position (i.e. coordinates of targets) on the summit of each graphing after moving.
Sub-step S213, for each graphing, uses graphic plotting interface to carry out texture according to the texture coordinate on each summit to the pixel in graphing, produces the dynamic effect comprising a frame or the change of multiframe distortion picture.
In specific implementation, graphic plotting interface can adopt OpenGL, and it can provide texture (Texture Mapping), is namely the process texture pixel in texture space being mapped to the pixel in screen space.
Usually, the step of use texture can be as follows:
The first step: definition texture object
const int TexNumber4;
GLuint mes_Texture [TexNumber]; // definition texture object array
Second step: generate texture object array
glGenTextures(TexNumber,m_Texture);
3rd step: by using glBindTexture to select texture object, carried out the definition of this texture object.
glBindTexture(GL_TEXTURE 2D,m_Texture[0]);
glTexImage2D(GL_TEXTURE_2D,0,3,mes_Texmapl.GetWidth(),mee_Texmapl.GetHeight(),0,GL_BGR_EXT,GL_UNSIGNED_BYTE,mse_Texmapl.GetDibBitsl'trQ);
4th step: by glBindTexture before drafting scenery, for this scenery loads corresponding texture.
glBindTexture(GLes_TEXTURE_2D,mse_Texture[0]);
5th step: called glDeleteTextures and delete texture object before EOP (end of program).
glDeleteTextures(TexNumber,mee_Texture)。
In one example, as shown in Figure 4 B, graphing is triangle, it comprises one or more pixel, wherein, summit has texture coordinate in the texture space, the texture coordinate of summit a is (0.2, 0.8), the texture coordinate of summit b is (0.4, 0.2), the texture coordinate of summit c is (0.8, 0.4), the summit of this graphing movement is moved, graphing is deformed, carry out OpenGL texture to obtaining object space, after playing up out, graphing creates stretching, the effects such as compression, characteristic area will present the phenomenon of movement.
As shown in Figure 5A, if the direction of motion of at least part of pixel in fortune characteristic area is toward the left side of characteristic area, then in characteristic image, entirety can toward left side distortion; Shown in Fig. 5 B, if the direction of motion of at least part of pixel in characteristic area is toward the right side of characteristic area, then in characteristic image, entirety can be turned right distortion.
By the texture of OpenGL, by the simple harmonic motion of the summit of the graphing of the characteristic area near central regions of static images simulation spring, picture can be drawn high by the carrying out of rule, produces the shake effect being similar to elastic force water polo.
Further, the direction of motion of at least part of pixel in characteristic area can the both sides of characteristic area (as left side and right side, above and below), then according to simple harmonic motion pattern and/or damped vibration pattern, the distortion picture that characteristic area maps out can distortion back and forth, produce shake effect, and finally static.
Such as, the direction of motion of at least part of pixel in characteristic area is that left and right slidably reciprocates, make at least part of pixel in characteristic area mobile along horizontal axis being done concussion, in characteristic area, the summit of each graphing moves to a position at each time point and will generate a distortion picture, distortion picture is play frame by frame, and the image table that can produce in characteristic area as fig. 5 a and fig. 5b reveals the dynamic effect of left and right vibrations.
The present invention is based on direction of motion and at least part of pixel in characteristic area is carried out texture, produce the dynamic effect comprising a frame or the change of multiframe distortion picture, on the one hand, dynamic effect is generated to characteristic area, decrease the volume of dynamic effect, decrease bandwidth occupancy during transmission, convenient transmission, on the other hand, because texture efficiency is very high, decrease and generate dynamic effect consuming time, for the generation dynamic effect that the picture in network picture or system photograph album etc. all can be very fast, generate dynamic effect quickly and easily.
For embodiment of the method, in order to simple description, therefore it is all expressed as a series of combination of actions, but those skilled in the art should know, the embodiment of the present invention is not by the restriction of described sequence of movement, because according to the embodiment of the present invention, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in instructions all belongs to preferred embodiment, and involved action might not be that the embodiment of the present invention is necessary.
With reference to Fig. 6, show a kind of according to an embodiment of the invention structured flowchart generating the device embodiment of customizable Dynamic Graph, specifically can comprise as lower module:
Read module 601, is suitable for reading multidate information from dynamic mutual files; Described dynamic interaction file comprises scripting object and static images;
Mapping block 602, is suitable for being mapped in a frame or multiframe distortion picture at least part of pixel in described static images according to described multidate information by described scripting object, changes frame by frame to drive described static images.
In a kind of embodiment of the present invention, described multidate information can comprise characteristic area, unique point, one or more reference point; Described mapping block 602 can also be suitable for:
The pixel of described static images is mapped in a frame or multiframe distortion picture according to described unique point and described one or more reference point by described scripting object.
In a kind of alternate exemplary of the embodiment of the present invention, described characteristic area can comprise convex domain, and described unique point can comprise focus point.
In a kind of embodiment of the present invention, described mapping block 602 can also be suitable for:
Distortion picture is generated by described scripting object;
Pixel on the first line in described characteristic area is mapped on the second line;
Copy the pixel on described second line to same position in described distortion picture;
Wherein, described first line is the line between described unique point and marginal point, and described second line is the line of current reference point and marginal point, and described marginal point is the coordinate points on described characteristic area edge.
In a kind of embodiment of the present invention, described mapping block 602 can also be suitable for:
Calculate the pixel in described characteristic area on the first line, the relative position on the first line;
According to described relative position, described pixel is copied on the second line.
In a kind of embodiment of the present invention, described mapping block 602 can also be suitable for:
Pixel outside described characteristic area is mapped to the same position in described distortion picture.
In a kind of embodiment of the present invention, described mapping block 602 can also be suitable for:
Pixel overlap-add procedure is carried out to the pixel of location overlap in distortion picture.
In a kind of embodiment of the present invention, described mapping block 602 can also be suitable for:
Pixel interpolation processing is carried out to the blank position in distortion picture.
In a kind of embodiment of the present invention, described multidate information comprises the direction of motion of at least part of pixel in characteristic area, described characteristic area; , described mapping block 602 can also be suitable for:
By described scripting object in described direction of motion, according to preset mode, texture is carried out at least part of pixel in described characteristic area, produce the dynamic effect comprising a frame or multiframe change picture.
In a kind of embodiment of the present invention, described mapping block 602 can also be suitable for:
Described characteristic area is divided one or more graphing; Have multiple summit in each graphing, each summit has texture coordinate;
In described direction of motion, move the summit of each drawing image at one or more time point according to preset mode;
For each graphing, use graphic plotting interface to carry out texture according to the texture coordinate on each summit to the pixel in graphing, produce the dynamic effect comprising a frame or the change of multiframe distortion picture.
In a kind of embodiment of the present invention, described preset mode comprises simple harmonic motion pattern and/or damped vibration pattern; Described mapping block 602 can also be suitable for:
In described direction of motion, move the summit of each drawing image according to simple harmonic motion pattern and/or damped vibration pattern at one or more time point.
In a kind of embodiment of the present invention, described mapping block 602 can also be suitable for:
Determine the acceleration on the summit of each drawing image; The summit of each drawing image has original coordinates;
According to described acceleration and/or default ratio of damping, calculate the displacement on the summit of moving each drawing image in one or more time point along described direction of motion;
The coordinates of targets on the summit of each drawing image is calculated by described original coordinates and described displacement.
For device embodiment, due to itself and embodiment of the method basic simlarity, so description is fairly simple, relevant part illustrates see the part of embodiment of the method.
Intrinsic not relevant to any certain computer, virtual system or miscellaneous equipment with display at this algorithm provided.Various general-purpose system also can with use based on together with this teaching.According to description above, the structure constructed required by this type systematic is apparent.In addition, the present invention is not also for any certain programmed language.It should be understood that and various programming language can be utilized to realize content of the present invention described here, and the description done language-specific is above to disclose preferred forms of the present invention.
In instructions provided herein, describe a large amount of detail.But can understand, embodiments of the invention can be put into practice when not having these details.In some instances, be not shown specifically known method, structure and technology, so that not fuzzy understanding of this description.
Similarly, be to be understood that, in order to simplify the disclosure and to help to understand in each inventive aspect one or more, in the description above to exemplary embodiment of the present invention, each feature of the present invention is grouped together in single embodiment, figure or the description to it sometimes.But, the method for the disclosure should be construed to the following intention of reflection: namely the present invention for required protection requires feature more more than the feature clearly recorded in each claim.Or rather, as claims below reflect, all features of disclosed single embodiment before inventive aspect is to be less than.Therefore, the claims following embodiment are incorporated to this embodiment thus clearly, and wherein each claim itself is as independent embodiment of the present invention.
Those skilled in the art are appreciated that and adaptively can change the module in the equipment in embodiment and they are arranged in one or more equipment different from this embodiment.Module in embodiment or unit or assembly can be combined into a module or unit or assembly, and multiple submodule or subelement or sub-component can be put them in addition.Except at least some in such feature and/or process or unit be mutually repel except, any combination can be adopted to combine all processes of all features disclosed in this instructions (comprising adjoint claim, summary and accompanying drawing) and so disclosed any method or equipment or unit.Unless expressly stated otherwise, each feature disclosed in this instructions (comprising adjoint claim, summary and accompanying drawing) can by providing identical, alternative features that is equivalent or similar object replaces.
In addition, those skilled in the art can understand, although embodiments more described herein to comprise in other embodiment some included feature instead of further feature, the combination of the feature of different embodiment means and to be within scope of the present invention and to form different embodiments.Such as, in the following claims, the one of any of embodiment required for protection can use with arbitrary array mode.
All parts embodiment of the present invention with hardware implementing, or can realize with the software module run on one or more processor, or realizes with their combination.It will be understood by those of skill in the art that the some or all functions that microprocessor or digital signal processor (DSP) can be used in practice to realize according to the some or all parts in the equipment of the customizable Dynamic Graph of the generation of the embodiment of the present invention.The present invention can also be embodied as part or all equipment for performing method as described herein or device program (such as, computer program and computer program).Realizing program of the present invention and can store on a computer-readable medium like this, or the form of one or more signal can be had.Such signal can be downloaded from internet website and obtain, or provides on carrier signal, or provides with any other form.
The present invention will be described instead of limit the invention to it should be noted above-described embodiment, and those skilled in the art can design alternative embodiment when not departing from the scope of claims.In the claims, any reference symbol between bracket should be configured to limitations on claims.Word " comprises " not to be got rid of existence and does not arrange element in the claims or step.Word "a" or "an" before being positioned at element is not got rid of and be there is multiple such element.The present invention can by means of including the hardware of some different elements and realizing by means of the computing machine of suitably programming.In the unit claim listing some devices, several in these devices can be carry out imbody by same hardware branch.Word first, second and third-class use do not represent any order.Can be title by these word explanations.

Claims (10)

1. generate a method for customizable Dynamic Graph, comprising:
Multidate information is read from dynamic mutual files; Described dynamic interaction file comprises scripting object and static images;
According to described multidate information, at least part of pixel in described static images is mapped in a frame or multiframe distortion picture by described scripting object, changes frame by frame to drive described static images.
2. the method for claim 1, is characterized in that, described multidate information comprises characteristic area, unique point, one or more reference point;
Describedly according to described multidate information, at least part of pixel in described static images to be mapped in a frame or multiframe distortion picture by described scripting object, to comprise with the step driving described static images to change frame by frame:
The pixel of described static images is mapped in a frame or multiframe distortion picture according to described unique point and described one or more reference point by described scripting object.
3. the method as described in any one of claim 1-2, is characterized in that, described characteristic area comprises convex domain, and described unique point comprises focus point.
4. the method as described in any one of claim 1-3, is characterized in that, described by described scripting object, according to described unique point and described one or more reference point, by the pixel of described static images, the step be mapped in a frame or multiframe distortion picture comprises:
Distortion picture is generated by described scripting object;
Pixel on the first line in described characteristic area is mapped on the second line;
Copy the pixel on described second line to same position in described distortion picture;
Wherein, described first line is the line between described unique point and marginal point, and described second line is the line of current reference point and marginal point, and described marginal point is the coordinate points on described characteristic area edge.
5. the method as described in any one of claim 1-4, is characterized in that, describedly the step that pixel on the first line in described characteristic area is mapped on the second line is comprised:
Calculate the pixel in described characteristic area on the first line, the relative position on the first line;
According to described relative position, described pixel is copied on the second line.
6. the method as described in any one of claim 1-5, is characterized in that, described according to described unique point and described one or more reference point, by the pixel of described static images, the step be mapped in a frame or multiframe distortion picture also comprises:
Pixel outside described characteristic area is mapped to the same position in described distortion picture.
7. the method as described in any one of claim 1-6, is characterized in that, described according to described unique point and described one or more reference point, by the pixel of described static images, the step be mapped in a frame or multiframe distortion picture also comprises:
Pixel overlap-add procedure is carried out to the pixel of location overlap in distortion picture.
8. the method as described in any one of claim 1-7, is characterized in that, described according to described unique point and described one or more reference point, by the pixel of described static images, the step be mapped in a frame or multiframe distortion picture also comprises:
Pixel interpolation processing is carried out to the blank position in distortion picture.
9. the method as described in any one of claim 1-8, is characterized in that, described multidate information comprises the direction of motion of at least part of pixel in characteristic area, described characteristic area;
Describedly according to described multidate information, at least part of pixel in described static images to be mapped in a frame or multiframe distortion picture by described scripting object, to comprise with the step driving described static images to change frame by frame:
By described scripting object in described direction of motion, according to preset mode, texture is carried out at least part of pixel in described characteristic area, produce the dynamic effect comprising a frame or multiframe change picture.
10. generate a device for customizable Dynamic Graph, comprising:
Read module, is suitable for reading multidate information from dynamic mutual files; Described dynamic interaction file comprises scripting object and static images;
Mapping block, is suitable for being mapped in a frame or multiframe distortion picture at least part of pixel in described static images according to described multidate information by described scripting object, changes frame by frame to drive described static images.
CN201410854766.6A 2014-12-31 2014-12-31 Method and device for generating customizable dynamic graphs Pending CN104574483A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201410854766.6A CN104574483A (en) 2014-12-31 2014-12-31 Method and device for generating customizable dynamic graphs
PCT/CN2015/095933 WO2016107356A1 (en) 2014-12-31 2015-11-30 Static picture-based dynamic interaction method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410854766.6A CN104574483A (en) 2014-12-31 2014-12-31 Method and device for generating customizable dynamic graphs

Publications (1)

Publication Number Publication Date
CN104574483A true CN104574483A (en) 2015-04-29

Family

ID=53090449

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410854766.6A Pending CN104574483A (en) 2014-12-31 2014-12-31 Method and device for generating customizable dynamic graphs

Country Status (1)

Country Link
CN (1) CN104574483A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105405155A (en) * 2015-10-21 2016-03-16 努比亚技术有限公司 Information processing method and mobile terminal
WO2016107356A1 (en) * 2014-12-31 2016-07-07 北京奇虎科技有限公司 Static picture-based dynamic interaction method and device
CN107644451A (en) * 2016-07-20 2018-01-30 腾讯科技(深圳)有限公司 Animated show method and apparatus
CN110569095A (en) * 2019-08-09 2019-12-13 华为技术有限公司 Method and electronic equipment for displaying page elements

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101276405A (en) * 2007-03-30 2008-10-01 三星电子株式会社 Mobile terminal and method for displaying image using focus information thereo
CN103929634A (en) * 2013-01-11 2014-07-16 三星电子株式会社 3d-animation Effect Generation Method And System
CN104247390A (en) * 2012-03-06 2014-12-24 苹果公司 User interface tools for cropping and straightening image

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101276405A (en) * 2007-03-30 2008-10-01 三星电子株式会社 Mobile terminal and method for displaying image using focus information thereo
CN104247390A (en) * 2012-03-06 2014-12-24 苹果公司 User interface tools for cropping and straightening image
CN103929634A (en) * 2013-01-11 2014-07-16 三星电子株式会社 3d-animation Effect Generation Method And System

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016107356A1 (en) * 2014-12-31 2016-07-07 北京奇虎科技有限公司 Static picture-based dynamic interaction method and device
CN105405155A (en) * 2015-10-21 2016-03-16 努比亚技术有限公司 Information processing method and mobile terminal
CN107644451A (en) * 2016-07-20 2018-01-30 腾讯科技(深圳)有限公司 Animated show method and apparatus
CN107644451B (en) * 2016-07-20 2021-04-06 腾讯科技(深圳)有限公司 Animation display method and device
CN110569095A (en) * 2019-08-09 2019-12-13 华为技术有限公司 Method and electronic equipment for displaying page elements
WO2021027725A1 (en) * 2019-08-09 2021-02-18 华为技术有限公司 Method for displaying page elements and electronic device
US11675478B2 (en) 2019-08-09 2023-06-13 Honor Device Co., Ltd. Method for displaying page elements and electronic device
US11989388B2 (en) 2019-08-09 2024-05-21 Honor Device Co., Ltd. Method for displaying page elements and electronic device

Similar Documents

Publication Publication Date Title
CN104571887A (en) Static picture based dynamic interaction method and device
CN104574484A (en) Method and device for generating picture dynamic effect on basis of interaction operation
US8610714B2 (en) Systems, methods, and computer-readable media for manipulating graphical objects
US9378593B2 (en) Garment simulation using thread and data level parallelism
US9652880B2 (en) 2D animation from a 3D mesh
KR20140030098A (en) Animated page turning
KR20080090671A (en) Apparatus and method for mapping textures to object model
CN110738722B (en) Thermodynamic diagram texture generation method, device and equipment
CN110969685A (en) Customizable rendering pipeline using rendering maps
KR102454893B1 (en) Graphic Processing Apparatus and Operating Method thereof
CN104574483A (en) Method and device for generating customizable dynamic graphs
WO2014188235A1 (en) Creation of a cinemagraph file
JP2023519728A (en) 2D image 3D conversion method, apparatus, equipment, and computer program
CN104574473A (en) Method and device for generating dynamic effect on basis of static image
CN107707965A (en) The generation method and device of a kind of barrage
CN110930492A (en) Model rendering method and device, computer readable medium and electronic equipment
CN105678829B (en) Two-dimensional and three-dimensional combined digital building exhibition method
EP4083794B1 (en) Rendering of persistent particle trails for dynamic displays
Zhao et al. Visual analysis of three-dimensional flow field based on WebVR
CN111681307B (en) Implementation method of dynamic three-dimensional coordinate axis applied to three-dimensional software
KR101630257B1 (en) 3D image providing system and providing method thereof
WO2016107356A1 (en) Static picture-based dynamic interaction method and device
JP2015106265A (en) Information processing apparatus and parameter setting method
Liu A novel Mesa-based OpenGL implementation on an FPGA-based embedded system
US20240020891A1 (en) Vector Object Jitter Application

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20150429

RJ01 Rejection of invention patent application after publication