Pixdata

A pixel buffer suitable for serialization and streaming.

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 a GdkPixbuf, use gdk_pixbuf_from_pixdata().

More...

Constructors

this
this(GdkPixdata* gdkPixdata, bool ownedRef)

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

Destructor

~this
~this()
Undocumented in source.

Members

Functions

deserialize
bool deserialize(ubyte[] stream)

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

fromPixbuf
ubyte[] fromPixbuf(Pixbuf pixbuf, bool useRle)

Converts a GdkPixbuf to a GdkPixdata.

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 #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.

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 plus the length of pixel_data

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

magic number. A valid GdkPixdata 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

ownedRef
bool ownedRef;
Undocumented in source.

Detailed Description

Deprecated: GdkPixdata should not be used any more. GResource should be used to save the original compressed images inside the program's binary

Meta