diff options
author | Matthias Clasen <matthiasc@src.gnome.org> | 2001-10-16 21:18:10 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2001-10-16 21:18:10 +0000 |
commit | 4fc79615d0ce3ac8d3a318e2adfc6feecd351367 (patch) | |
tree | 3260e0dd92770722a1154b20f0818390980c166f /gdk-pixbuf/gdk-pixdata.h | |
parent | 1ebe3b518b7fe1ac64d96aa4ee025d6aac435442 (diff) | |
download | gtk+-4fc79615d0ce3ac8d3a318e2adfc6feecd351367.tar.gz |
Documentation. Spelling fixes.
* gdk-pixdata.c, gdk-pixdata.h: Documentation.
* gdk-pixbuf-csource.1: Spelling fixes.
Diffstat (limited to 'gdk-pixbuf/gdk-pixdata.h')
-rw-r--r-- | gdk-pixbuf/gdk-pixdata.h | 77 |
1 files changed, 76 insertions, 1 deletions
diff --git a/gdk-pixbuf/gdk-pixdata.h b/gdk-pixbuf/gdk-pixdata.h index 92ef3ecec7..a51720099e 100644 --- a/gdk-pixbuf/gdk-pixdata.h +++ b/gdk-pixbuf/gdk-pixdata.h @@ -25,9 +25,33 @@ extern "C" { #endif /* __cplusplus */ - +/** + * GDK_PIXBUF_MAGIC_NUMBER: + * + * Magic number for #GdkPixdata structures. + **/ #define GDK_PIXBUF_MAGIC_NUMBER (0x47646b50) /* 'GdkP' */ +/** + * GdkPixdataType: + * @GDK_PIXDATA_COLOR_TYPE_RGB: each pixel has red, green and blue samples. + * @GDK_PIXDATA_COLOR_TYPE_RGBA: each pixel has red, green and blue samples + * and an alpha value. + * @GDK_PIXDATA_COLOR_TYPE_MASK: mask for the colortype flags of the enum. + * @GDK_PIXDATA_SAMPLE_WIDTH_8: each sample has 8 bits. + * @GDK_PIXDATA_SAMPLE_WIDTH_MASK: mask for the sample width flags of the enum. + * @GDK_PIXDATA_ENCODING_RAW: the pixel data is in raw form. + * @GDK_PIXDATA_ENCODING_RLE: the pixel data is run-length encoded. Runs may + * be up to 127 bytes long; their length is stored in a single byte + * preceding the pixel data for the run. If a run is constant, its length + * byte has the high bit set and the pixel data consists of a single pixel + * which must be repeated. + * @GDK_PIXDATA_ENCODING_MASK: mask for the encoding flags of the enum. + * + * An enumeration containing three sets of flags for a #GdkPixdata struct: + * one for the used colorspace, one for the width of the samples and one + * for the encoding of the pixel data. + **/ typedef enum { /* colorspace + alpha */ @@ -43,6 +67,23 @@ typedef enum GDK_PIXDATA_ENCODING_MASK = 0x0f << 24 } GdkPixdataType; +/** + * GdkPixdata: + * @magic: magic number. A valid #GdkPixdata structure must have + * #GDK_PIXBUF_MAGIC_NUMBER here. + * @length: less than 1 to disable length checks, otherwise + * #GDK_PIXDATA_HEADER_LENGTH + length of @pixel_data. + * @pixdata_type: information about colorspace, sample width and + * encoding, in a #GdkPixdataType. + * @rowstride: padding used in @pixel_data or 0 to indicate no padding. + * @width: the width. + * @height: the height. + * @pixel_data: @width x @height pixels, encoded according to @pixdata_type + * and @rowstride. + * + * A #GdkPixdata contains pixbuf information in a form suitable for + * serialization and streaming. + **/ typedef struct _GdkPixdata GdkPixdata; struct _GdkPixdata { @@ -56,6 +97,12 @@ struct _GdkPixdata guint32 height; guint8 *pixel_data; }; + +/** + * GDK_PIXDATA_HEADER_LENGTH: + * + * The length of a #GdkPixdata structure without the @pixel_data pointer. + **/ #define GDK_PIXDATA_HEADER_LENGTH (4 + 4 + 4 + 4 + 4 + 4) /* the returned stream is plain htonl of GdkPixdata members + pixel_data */ @@ -71,6 +118,34 @@ gpointer gdk_pixdata_from_pixbuf (GdkPixdata *pixdata, GdkPixbuf* gdk_pixbuf_from_pixdata (const GdkPixdata *pixdata, gboolean copy_pixels, GError **error); +/** + * GdkPixdataDumpType: + * @GDK_PIXDATA_DUMP_PIXDATA_STREAM: Generate pixbuf data stream (a single + * string containing a serialized #GdkPixdata structure in network byte + * order). + * @GDK_PIXDATA_DUMP_PIXDATA_STRUCT: Generate #GdkPixdata structure (needs + * the #GdkPixdata structure definition from gdk-pixdata.h). + * @GDK_PIXDATA_DUMP_MACROS: Generate <function>*_ROWSTRIDE</function>, + * <function>*_WIDTH</function>, <function>*_HEIGHT</function>, + * <function>*_BYTES_PER_PIXEL</function> and + * <function>*_RLE_PIXEL_DATA</function> or <function>*_PIXEL_DATA</function> + * macro definitions for the image. + * @GDK_PIXDATA_DUMP_GTYPES: Generate GLib data types instead of + * standard C data types. + * @GDK_PIXDATA_DUMP_CTYPES: Generate standard C data types instead of + * GLib data types. + * @GDK_PIXDATA_DUMP_STATIC: Generate static symbols. + * @GDK_PIXDATA_DUMP_CONST: Generate const symbols. + * @GDK_PIXDATA_DUMP_RLE_DECODER: Provide a <function>*_RUN_LENGTH_DECODE(image_buf, rle_data, size, bpp)</function> + * macro definition to decode run-length encoded image data. + * + * An enumeration which is used by gdk_pixdata_to_csource() to + * determine the form of C source to be generated. The three values + * @GDK_PIXDATA_DUMP_PIXDATA_STREAM, @GDK_PIXDATA_DUMP_PIXDATA_STRUCT + * and @GDK_PIXDATA_DUMP_MACROS are mutually exclusive, as are + * @GDK_PIXBUF_DUMP_GTYPES and @GDK_PIXBUF_DUMP_CTYPES. The remaining + * elements are optional flags that can be freely added. + **/ typedef enum { /* type of source to save */ |