gdkpixbuf.Pixdata.Pixdata Class Reference

List of all members.

Detailed Description

Description Using GdkPixdata, images can be compiled into an application, making it unnecessary to refer to external image files at runtime.

gdk-pixbuf includes a utility named gdk-pixbuf-csource, which can be used to convert image files into GdkPixdata structures suitable for inclusion in C sources. To convert the GdkPixdata structures back into GdkPixbufs, use gdk_pixbuf_from_pixdata.


Public Member Functions

GdkPixdatagetPixdataStruct ()
 this (GdkPixdata *gdkPixdata)
 Sets our main struct and passes it to the parent class.
void * fromPixbuf (Pixbuf pixbuf, int useRle)
 Converts a GdkPixbuf to a GdkPixdata.
Pixbuf gdkPixbufFromPixdata (int copyPixels, GError **error)
 Converts a GdkPixdata to a GdkPixbuf.
byte * serialize (uint *streamLengthP)
 Serializes a GdkPixdata structure into a byte stream.
int deserialize (uint streamLength, byte *stream, GError **error)
 Deserializes (reconstruct) a GdkPixdata structure from a byte stream.
StringG toCsource (char[] name, GdkPixdataDumpType dumpType)
 Generates C source code suitable for compiling images directly into programs.

Protected Member Functions

void * getStruct ()
 the main Gtk struct as a void*

Protected Attributes

GdkPixdatagdkPixdata
 the main Gtk struct


Constructor & Destructor Documentation

gdkpixbuf.Pixdata.Pixdata.this ( GdkPixdata gdkPixdata  ) 

Sets our main struct and passes it to the parent class.


Member Function Documentation

int gdkpixbuf.Pixdata.Pixdata.deserialize ( uint  streamLength,
byte *  stream,
GError **  error 
)

Deserializes (reconstruct) a GdkPixdata structure from a byte stream.

The byte stream consists of a straightforward writeout of the GdkPixdata fields in network byte order, plus the pixel_data bytes the structure points to. The pixdata contents are reconstructed byte by byte and are checked for validity. This function may fail with GDK_PIXBUF_CORRUPT_IMAGE or GDK_PIXBUF_ERROR_UNKNOWN_TYPE. pixdata: a GdkPixdata structure to be filled in. stream_length: length of the stream used for deserialization. stream: stream of bytes containing a serialized GdkPixdata structure. error: GError location to indicate failures (maybe NULL to ignore errors). Returns: Upon successful deserialization TRUE is returned, FALSE otherwise.

void* gdkpixbuf.Pixdata.Pixdata.fromPixbuf ( Pixbuf  pixbuf,
int  useRle 
)

Converts a GdkPixbuf to a GdkPixdata.

If use_rle is TRUE, the pixel data is run-length encoded into newly-allocated memory and a pointer to that memory is returned. pixdata: a GdkPixdata to fill. pixbuf: the data to fill pixdata with. use_rle: whether to use run-length encoding for the pixel data. Returns: If ure_rle is TRUE, a pointer to the newly-allocated memory for the run-length encoded pixel data, otherwise NULL.

Pixbuf gdkpixbuf.Pixdata.Pixdata.gdkPixbufFromPixdata ( int  copyPixels,
GError **  error 
)

Converts a GdkPixdata to a GdkPixbuf.

If copy_pixels is TRUE or if the pixel data is run-length-encoded, the pixel data is copied into newly-allocated memory; otherwise it is reused. pixdata: a GdkPixdata to convert into a GdkPixbuf. copy_pixels: whether to copy raw pixel data; run-length encoded pixel data is always copied. error: location to store possible errors. Returns: a new GdkPixbuf.

GdkPixdata* gdkpixbuf.Pixdata.Pixdata.getPixdataStruct (  ) 

void* gdkpixbuf.Pixdata.Pixdata.getStruct (  )  [protected]

the main Gtk struct as a void*

byte* gdkpixbuf.Pixdata.Pixdata.serialize ( uint streamLengthP  ) 

Serializes a GdkPixdata structure into a byte stream.

The byte stream consists of a straightforward writeout of the GdkPixdata fields in network byte order, plus the pixel_data bytes the structure points to. pixdata: a valid GdkPixdata structure to serialize. stream_length_p: location to store the resulting stream length in. Returns: A newly-allocated string containing the serialized GdkPixdata structure.

StringG gdkpixbuf.Pixdata.Pixdata.toCsource ( char[]  name,
GdkPixdataDumpType  dumpType 
)

Generates C source code suitable for compiling images directly into programs.

GTK+ ships with a program called gdk-pixbuf-csource which offers a command line interface to this function. pixdata: a GdkPixdata to convert to C source. name: used for naming generated data structures or macros. dump_type: a GdkPixdataDumpType determining the kind of C source to be generated. Returns: a newly-allocated string containing the C source form of pixdata.


Member Data Documentation

GdkPixdata* gdkpixbuf.Pixdata.Pixdata.gdkPixdata [protected]

the main Gtk struct


SourceForge.net Logo DSource.org Logo digitalmars.com Logo