Pixdata

A gdkpixbuf.Pixdata contains pixbuf information in a form suitable for serialization and streaming.

Constructors

this
this(GdkPixdata* gdkPixdata, bool ownedRef)

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

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Members

Functions

deserialize
bool deserialize(ubyte[] stream)

Deserializes (reconstruct) a gdkpixbuf.Pixdata structure from a byte stream. The byte stream consists of a straightforward writeout of the gdkpixbuf.Pixdata 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, bool useRle)

Converts a gdk.Pixbuf to a gdkpixbuf.Pixdata If use_rle is TRUE, the pixel data is run-length encoded into newly-allocated memory and a pointer to that memory is returned.

getPixdataStruct
GdkPixdata* getPixdataStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

serialize
ubyte[] serialize()

Serializes a gdkpixbuf.Pixdata structure into a byte stream. The byte stream consists of a straightforward writeout of the gdkpixbuf.Pixdata 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.

Properties

height
uint height [@property getter]
uint height [@property setter]

Height of the image in pixels.

length
int length [@property getter]
int length [@property setter]

less than 1 to disable length checks, otherwise GDK_PIXDATA_HEADER_LENGTH + length of pixel_data.

magic
uint magic [@property getter]
uint magic [@property setter]

magic number. A valid gdkpixbuf.Pixdata structure must have GDK_PIXBUF_MAGIC_NUMBER here.

pixdataType
uint pixdataType [@property getter]
uint pixdataType [@property setter]

information about colorspace, sample width and encoding, in a GdkPixdataType

rowstride
uint rowstride [@property getter]
uint rowstride [@property setter]

Distance in bytes between rows.

width
uint width [@property getter]
uint width [@property setter]

Width of the image in pixels.

Variables

gdkPixdata
GdkPixdata* gdkPixdata;

the main Gtk struct