Name
Animations -- Animated images.
Description
The gdk-pixbuf library provides a simple mechanism to load and represent
animations. An animation is conceptually a series of frames to be displayed
over time. Each frame is the same size. The animation may not be represented
as a series of frames internally; for example, it may be stored as a
sprite and instructions for moving the sprite around a background. To display
an animation you don't need to understand its representation, however; you just
ask gdk-pixbuf what should be displayed at a given point in time.
Details
enum GdkPixbufFrameAction
typedef enum {
/* Keep this frame and composite next frame over it */
/* (GIF disposal method 1) */
GDK_PIXBUF_FRAME_RETAIN,
/* Revert to background color before compositing next frame */
/* (GIF disposal method 2) */
GDK_PIXBUF_FRAME_DISPOSE,
/* Revert to previously-displayed composite image after
* displaying this frame
*/
/* (GIF disposal method 3) */
GDK_PIXBUF_FRAME_REVERT
} GdkPixbufFrameAction; |
struct GdkPixbufFrame
struct GdkPixbufFrame {
/* The pixbuf with this frame's image data */
GdkPixbuf *pixbuf;
/* Offsets for overlaying onto the GIF graphic area */
int x_offset;
int y_offset;
/* Frame duration in ms */
int delay_time;
/* Sum of preceding delay times */
int elapsed;
/* Overlay mode */
GdkPixbufFrameAction action;
/* TRUE if the pixbuf has been modified since
* the last frame composite operation
*/
gboolean need_recomposite;
/* TRUE if the background for this frame is transparent */
gboolean bg_transparent;
/* The below reflects the "use hell of a lot of RAM"
* philosophy of coding
*/
/* Cached composite image (the image you actually display
* for this frame)
*/
GdkPixbuf *composited;
/* Cached revert image (the contents of the area
* covered by the frame prior to compositing;
* same size as pixbuf, not as the composite image; only
* used for FRAME_REVERT frames)
*/
GdkPixbuf *revert;
}; |
struct GdkPixbufAnimation
struct GdkPixbufAnimation; |
This object describes an animation.
gdk_pixbuf_animation_new_from_file ()
GdkPixbufAnimation* gdk_pixbuf_animation_new_from_file
(const char *filename,
GError **error); |
Creates a new animation by loading it from a file. The file format is
detected automatically. If the file's format does not support multi-frame
images, then an animation with a single frame will be created. Possible errors
are in the GDK_PIXBUF_ERROR and G_FILE_ERROR domains.
gdk_pixbuf_animation_ref ()
Adds a reference to an animation. Deprecated; use
g_object_ref(). The reference must be released afterwards using
g_object_unref().
gdk_pixbuf_animation_unref ()
Removes a reference from an animation. Deprecated; use g_object_unref().
gdk_pixbuf_animation_get_width ()
Queries the width of the bounding box of a pixbuf animation.
gdk_pixbuf_animation_get_height ()
Queries the height of the bounding box of a pixbuf animation.