Struct

CdkPixdataPixdata

deprecated: 2.32 

Description [src]

struct CdkPixdata {
  guint32 magic;
  gint32 length;
  guint32 pixdata_type;
  guint32 rowstride;
  guint32 width;
  guint32 height;
  guint8 pixel_data[];
}

A pixel buffer suitable for serialization and streaming.

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

CdkPixbuf includes a utility named cdk-pixbuf-csource, which can be used to convert image files into CdkPixdata structures suitable for inclusion in C sources. To convert the CdkPixdata structures back into a CdkPixbuf, use cdk_pixbuf_from_pixdata().

Structure members
magic: guint32

Magic number. A valid CdkPixdata structure must have CDK_PIXBUF_MAGIC_NUMBER here.

length: gint32

Less than 1 to disable length checks, otherwise CDK_PIXDATA_HEADER_LENGTH plus the length of pixel_data.

pixdata_type: guint32

Information about colorspace, sample width and encoding, in a CdkPixdataType.

rowstride: guint32

Distance in bytes between rows.

width: guint32

Width of the image in pixels.

height: guint32

Height of the image in pixels.

pixel_data: guint8

width x height pixels, encoded according to pixdata_type and rowstride.

Deprecated since: 2.32.

CdkPixdata should not be used any more. GResource should be used to save the original compressed images inside the program’s binary.

Instance methods

cdk_pixdata_deserialize

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

deprecated: 2.32 

cdk_pixdata_from_pixbuf

Converts a CdkPixbuf to a CdkPixdata.

deprecated: 2.32 

cdk_pixdata_serialize

Serializes a CdkPixdata structure into a byte stream. The byte stream consists of a straightforward writeout of the CdkPixdata fields in network byte order, plus the pixel_data bytes the structure points to.

deprecated: 2.32 

cdk_pixdata_to_csource

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

deprecated: 2.32