/usr/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixdata.h is in libgdk-pixbuf2.0-dev 2.30.7-0ubuntu1.8.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | /* GdkPixbuf library - GdkPixdata - functions for inlined pixbuf handling
* Copyright (C) 1999, 2001 Tim Janik
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GDK_PIXDATA_H__
#define __GDK_PIXDATA_H__
#include <gdk-pixbuf/gdk-pixbuf.h>
G_BEGIN_DECLS
/**
* 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 */
GDK_PIXDATA_COLOR_TYPE_RGB = 0x01,
GDK_PIXDATA_COLOR_TYPE_RGBA = 0x02,
GDK_PIXDATA_COLOR_TYPE_MASK = 0xff,
/* width, support 8bits only currently */
GDK_PIXDATA_SAMPLE_WIDTH_8 = 0x01 << 16,
GDK_PIXDATA_SAMPLE_WIDTH_MASK = 0x0f << 16,
/* encoding */
GDK_PIXDATA_ENCODING_RAW = 0x01 << 24,
GDK_PIXDATA_ENCODING_RLE = 0x02 << 24,
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: Distance in bytes between rows.
* @width: Width of the image in pixels.
* @height: Height of the image in pixels.
* @pixel_data: (array) (element-type guint8): @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
{
guint32 magic; /* GDK_PIXBUF_MAGIC_NUMBER */
gint32 length; /* <1 to disable length checks, otherwise:
* GDK_PIXDATA_HEADER_LENGTH + pixel_data length
*/
guint32 pixdata_type; /* GdkPixdataType */
guint32 rowstride;
guint32 width;
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 */
guint8* gdk_pixdata_serialize (const GdkPixdata *pixdata,
guint *stream_length_p);
gboolean gdk_pixdata_deserialize (GdkPixdata *pixdata,
guint stream_length,
const guint8 *stream,
GError **error);
gpointer gdk_pixdata_from_pixbuf (GdkPixdata *pixdata,
const GdkPixbuf *pixbuf,
gboolean use_rle);
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 */
GDK_PIXDATA_DUMP_PIXDATA_STREAM = 0,
GDK_PIXDATA_DUMP_PIXDATA_STRUCT = 1,
GDK_PIXDATA_DUMP_MACROS = 2,
/* type of variables to use */
GDK_PIXDATA_DUMP_GTYPES = 0,
GDK_PIXDATA_DUMP_CTYPES = 1 << 8,
GDK_PIXDATA_DUMP_STATIC = 1 << 9,
GDK_PIXDATA_DUMP_CONST = 1 << 10,
/* save RLE decoder macro? */
GDK_PIXDATA_DUMP_RLE_DECODER = 1 << 16
} GdkPixdataDumpType;
GString* gdk_pixdata_to_csource (GdkPixdata *pixdata,
const gchar *name,
GdkPixdataDumpType dump_type);
G_END_DECLS
#endif /* __GDK_PIXDATA_H__ */
|