Pixdata

Using GdkPixdata, images can be compiled into an application, making it unnecessary to refer to external image files at runtime. GdkPixBuf 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.

Constructors

this
this(GdkPixdata* gdkPixdata)

Sets our main struct and passes it to the parent class

Members

Functions

deserialize
int deserialize(ubyte[] stream)

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_ERROR_CORRUPT_IMAGE or GDK_PIXBUF_ERROR_UNKNOWN_TYPE.

fromPixbuf
void* 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.

gdkPixbufFromPixdata
Pixbuf gdkPixbufFromPixdata(int copyPixels)

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.

getPixdataStruct
GdkPixdata* getPixdataStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getStruct
void* getStruct()

the main Gtk struct as a void*

serialize
ubyte[] serialize()

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.

toCsource
StringG toCsource(string name, GdkPixdataDumpType dumpType)

Generates C source code suitable for compiling images directly into programs. gdk-pixbuf ships with a program called gdk-pixbuf-csource which offers a command line interface to this function.

Variables

gdkPixdata
GdkPixdata* gdkPixdata;

the main Gtk struct

Meta