1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>Common Types</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="Cogl 2.0 Reference Manual">
8 <link rel="up" href="cogl-utilities.html" title="Utilities">
9 <link rel="prev" href="cogl-2.0-experimental-Quaternions-(Rotations).html" title="Quaternions (Rotations)">
10 <link rel="next" href="cogl-integration.html" title="Binding and Integrating">
11 <meta name="generator" content="GTK-Doc V1.18.1 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
17 <td><a accesskey="p" href="cogl-2.0-experimental-Quaternions-(Rotations).html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="cogl-utilities.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">Cogl 2.0 Reference Manual</th>
21 <td><a accesskey="n" href="cogl-integration.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#cogl-2.0-experimental-Common-Types.synopsis" class="shortcut">Top</a>
26 <a href="#cogl-2.0-experimental-Common-Types.description" class="shortcut">Description</a>
29 <div class="refentry">
30 <a name="cogl-2.0-experimental-Common-Types"></a><div class="titlepage"></div>
31 <div class="refnamediv"><table width="100%"><tr>
33 <h2><span class="refentrytitle"><a name="cogl-2.0-experimental-Common-Types.top_of_page"></a>Common Types</span></h2>
36 <td valign="top" align="right"></td>
38 <div class="refsynopsisdiv">
39 <a name="cogl-2.0-experimental-Common-Types.synopsis"></a><h2>Synopsis</h2>
40 <pre class="synopsis"><span class="returnvalue">void</span> (<a class="link" href="cogl-2.0-experimental-Common-Types.html#CoglFuncPtr" title="CoglFuncPtr ()">*CoglFuncPtr</a>) (<em class="parameter"><code><span class="type">void</span></code></em>);
41 enum <a class="link" href="cogl-2.0-experimental-Common-Types.html#CoglPixelFormat" title="enum CoglPixelFormat">CoglPixelFormat</a>;
42 enum <a class="link" href="cogl-2.0-experimental-Common-Types.html#CoglBufferTarget" title="enum CoglBufferTarget">CoglBufferTarget</a>;
43 enum <a class="link" href="cogl-2.0-experimental-Common-Types.html#CoglBufferBit" title="enum CoglBufferBit">CoglBufferBit</a>;
44 enum <a class="link" href="cogl-2.0-experimental-Common-Types.html#CoglAttributeType" title="enum CoglAttributeType">CoglAttributeType</a>;
45 enum <a class="link" href="cogl-2.0-experimental-Common-Types.html#CoglColorMask" title="enum CoglColorMask">CoglColorMask</a>;
48 <div class="refsect1">
49 <a name="cogl-2.0-experimental-Common-Types.description"></a><h2>Description</h2>
51 <div class="refsect1">
52 <a name="cogl-2.0-experimental-Common-Types.details"></a><h2>Details</h2>
53 <div class="refsect2">
54 <a name="CoglFuncPtr"></a><h3>CoglFuncPtr ()</h3>
55 <pre class="programlisting"><span class="returnvalue">void</span> (*CoglFuncPtr) (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
57 The type used by cogl for function pointers, note that this type
58 is used as a generic catch-all cast for function pointers and the
59 actual arguments and return type may be different.
63 <div class="refsect2">
64 <a name="CoglPixelFormat"></a><h3>enum CoglPixelFormat</h3>
65 <pre class="programlisting">typedef enum {
66 /*< prefix=COGL_PIXEL_FORMAT >*/
67 COGL_PIXEL_FORMAT_ANY = 0,
68 COGL_PIXEL_FORMAT_A_8 = 1 | COGL_A_BIT,
70 COGL_PIXEL_FORMAT_RGB_565 = 4,
71 COGL_PIXEL_FORMAT_RGBA_4444 = 5 | COGL_A_BIT,
72 COGL_PIXEL_FORMAT_RGBA_5551 = 6 | COGL_A_BIT,
73 COGL_PIXEL_FORMAT_YUV = 7,
74 COGL_PIXEL_FORMAT_G_8 = 8,
76 COGL_PIXEL_FORMAT_RGB_888 = 2,
77 COGL_PIXEL_FORMAT_BGR_888 = (2 | COGL_BGR_BIT),
79 COGL_PIXEL_FORMAT_RGBA_8888 = (3 | COGL_A_BIT),
80 COGL_PIXEL_FORMAT_BGRA_8888 = (3 | COGL_A_BIT | COGL_BGR_BIT),
81 COGL_PIXEL_FORMAT_ARGB_8888 = (3 | COGL_A_BIT | COGL_AFIRST_BIT),
82 COGL_PIXEL_FORMAT_ABGR_8888 = (3 | COGL_A_BIT | COGL_BGR_BIT | COGL_AFIRST_BIT),
84 COGL_PIXEL_FORMAT_RGBA_1010102 = (13 | COGL_A_BIT),
85 COGL_PIXEL_FORMAT_BGRA_1010102 = (13 | COGL_A_BIT | COGL_BGR_BIT),
86 COGL_PIXEL_FORMAT_ARGB_2101010 = (13 | COGL_A_BIT | COGL_AFIRST_BIT),
87 COGL_PIXEL_FORMAT_ABGR_2101010 = (13 | COGL_A_BIT | COGL_BGR_BIT | COGL_AFIRST_BIT),
89 COGL_PIXEL_FORMAT_RGBA_8888_PRE = (3 | COGL_A_BIT | COGL_PREMULT_BIT),
90 COGL_PIXEL_FORMAT_BGRA_8888_PRE = (3 | COGL_A_BIT | COGL_PREMULT_BIT | COGL_BGR_BIT),
91 COGL_PIXEL_FORMAT_ARGB_8888_PRE = (3 | COGL_A_BIT | COGL_PREMULT_BIT | COGL_AFIRST_BIT),
92 COGL_PIXEL_FORMAT_ABGR_8888_PRE = (3 | COGL_A_BIT | COGL_PREMULT_BIT | COGL_BGR_BIT | COGL_AFIRST_BIT),
93 COGL_PIXEL_FORMAT_RGBA_4444_PRE = (COGL_PIXEL_FORMAT_RGBA_4444 | COGL_A_BIT | COGL_PREMULT_BIT),
94 COGL_PIXEL_FORMAT_RGBA_5551_PRE = (COGL_PIXEL_FORMAT_RGBA_5551 | COGL_A_BIT | COGL_PREMULT_BIT),
96 COGL_PIXEL_FORMAT_RGBA_1010102_PRE = (COGL_PIXEL_FORMAT_RGBA_1010102 | COGL_PREMULT_BIT),
97 COGL_PIXEL_FORMAT_BGRA_1010102_PRE = (COGL_PIXEL_FORMAT_BGRA_1010102 | COGL_PREMULT_BIT),
98 COGL_PIXEL_FORMAT_ARGB_2101010_PRE = (COGL_PIXEL_FORMAT_ARGB_2101010 | COGL_PREMULT_BIT),
99 COGL_PIXEL_FORMAT_ABGR_2101010_PRE = (COGL_PIXEL_FORMAT_ABGR_2101010 | COGL_PREMULT_BIT)
103 Pixel formats used by Cogl. For the formats with a byte per
104 component, the order of the components specify the order in
105 increasing memory addresses. So for example
106 <a class="link" href="cogl-2.0-experimental-Common-Types.html#COGL-PIXEL-FORMAT-RGB-888:CAPS"><code class="literal">COGL_PIXEL_FORMAT_RGB_888</code></a> would have the red component in the
107 lowest address, green in the next address and blue after that
108 regardless of the endianness of the system.
111 For the formats with non byte aligned components the component
112 order specifies the order within a 16-bit or 32-bit number from
113 most significant bit to least significant. So for
114 <a class="link" href="cogl-2.0-experimental-Common-Types.html#COGL-PIXEL-FORMAT-RGB-565:CAPS"><code class="literal">COGL_PIXEL_FORMAT_RGB_565</code></a>, the red component would be in bits
115 11-15, the green component would be in 6-11 and the blue component
116 would be in 1-5. Therefore the order in memory depends on the
117 endianness of the system.
120 When uploading a texture <a class="link" href="cogl-2.0-experimental-Common-Types.html#COGL-PIXEL-FORMAT-ANY:CAPS"><code class="literal">COGL_PIXEL_FORMAT_ANY</code></a> can be used as the
121 internal format. Cogl will try to pick the best format to use
122 internally and convert the texture data if necessary.
124 <div class="variablelist"><table border="0">
125 <col align="left" valign="top">
128 <td><p><a name="COGL-PIXEL-FORMAT-ANY:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_ANY</code></span></p></td>
133 <td><p><a name="COGL-PIXEL-FORMAT-A-8:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_A_8</code></span></p></td>
134 <td>8 bits alpha mask
138 <td><p><a name="COGL-PIXEL-FORMAT-RGB-565:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_RGB_565</code></span></p></td>
143 <td><p><a name="COGL-PIXEL-FORMAT-RGBA-4444:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_RGBA_4444</code></span></p></td>
148 <td><p><a name="COGL-PIXEL-FORMAT-RGBA-5551:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_RGBA_5551</code></span></p></td>
153 <td><p><a name="COGL-PIXEL-FORMAT-YUV:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_YUV</code></span></p></td>
154 <td>Not currently supported
158 <td><p><a name="COGL-PIXEL-FORMAT-G-8:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_G_8</code></span></p></td>
159 <td>Single luminance component
163 <td><p><a name="COGL-PIXEL-FORMAT-RGB-888:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_RGB_888</code></span></p></td>
168 <td><p><a name="COGL-PIXEL-FORMAT-BGR-888:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_BGR_888</code></span></p></td>
173 <td><p><a name="COGL-PIXEL-FORMAT-RGBA-8888:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_RGBA_8888</code></span></p></td>
178 <td><p><a name="COGL-PIXEL-FORMAT-BGRA-8888:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_BGRA_8888</code></span></p></td>
183 <td><p><a name="COGL-PIXEL-FORMAT-ARGB-8888:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_ARGB_8888</code></span></p></td>
188 <td><p><a name="COGL-PIXEL-FORMAT-ABGR-8888:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_ABGR_8888</code></span></p></td>
193 <td><p><a name="COGL-PIXEL-FORMAT-RGBA-1010102:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_RGBA_1010102</code></span></p></td>
194 <td>RGBA, 32 bits, 10 bpc
198 <td><p><a name="COGL-PIXEL-FORMAT-BGRA-1010102:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_BGRA_1010102</code></span></p></td>
199 <td>BGRA, 32 bits, 10 bpc
203 <td><p><a name="COGL-PIXEL-FORMAT-ARGB-2101010:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_ARGB_2101010</code></span></p></td>
204 <td>ARGB, 32 bits, 10 bpc
208 <td><p><a name="COGL-PIXEL-FORMAT-ABGR-2101010:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_ABGR_2101010</code></span></p></td>
209 <td>ABGR, 32 bits, 10 bpc
213 <td><p><a name="COGL-PIXEL-FORMAT-RGBA-8888-PRE:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_RGBA_8888_PRE</code></span></p></td>
214 <td>Premultiplied RGBA, 32 bits
218 <td><p><a name="COGL-PIXEL-FORMAT-BGRA-8888-PRE:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_BGRA_8888_PRE</code></span></p></td>
219 <td>Premultiplied BGRA, 32 bits
223 <td><p><a name="COGL-PIXEL-FORMAT-ARGB-8888-PRE:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_ARGB_8888_PRE</code></span></p></td>
224 <td>Premultiplied ARGB, 32 bits
228 <td><p><a name="COGL-PIXEL-FORMAT-ABGR-8888-PRE:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_ABGR_8888_PRE</code></span></p></td>
229 <td>Premultiplied ABGR, 32 bits
233 <td><p><a name="COGL-PIXEL-FORMAT-RGBA-4444-PRE:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_RGBA_4444_PRE</code></span></p></td>
234 <td>Premultiplied RGBA, 16 bits
238 <td><p><a name="COGL-PIXEL-FORMAT-RGBA-5551-PRE:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_RGBA_5551_PRE</code></span></p></td>
239 <td>Premultiplied RGBA, 16 bits
243 <td><p><a name="COGL-PIXEL-FORMAT-RGBA-1010102-PRE:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_RGBA_1010102_PRE</code></span></p></td>
244 <td>Premultiplied RGBA, 32 bits, 10 bpc
248 <td><p><a name="COGL-PIXEL-FORMAT-BGRA-1010102-PRE:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_BGRA_1010102_PRE</code></span></p></td>
249 <td>Premultiplied BGRA, 32 bits, 10 bpc
253 <td><p><a name="COGL-PIXEL-FORMAT-ARGB-2101010-PRE:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_ARGB_2101010_PRE</code></span></p></td>
254 <td>Premultiplied ARGB, 32 bits, 10 bpc
258 <td><p><a name="COGL-PIXEL-FORMAT-ABGR-2101010-PRE:CAPS"></a><span class="term"><code class="literal">COGL_PIXEL_FORMAT_ABGR_2101010_PRE</code></span></p></td>
259 <td>Premultiplied ABGR, 32 bits, 10 bpc
264 <p class="since">Since 0.8</p>
267 <div class="refsect2">
268 <a name="CoglBufferTarget"></a><h3>enum CoglBufferTarget</h3>
269 <pre class="programlisting">typedef enum {
270 COGL_WINDOW_BUFFER = (1 << 1),
271 COGL_OFFSCREEN_BUFFER = (1 << 2)
275 Target flags for FBOs.
277 <div class="variablelist"><table border="0">
278 <col align="left" valign="top">
281 <td><p><a name="COGL-WINDOW-BUFFER:CAPS"></a><span class="term"><code class="literal">COGL_WINDOW_BUFFER</code></span></p></td>
286 <td><p><a name="COGL-OFFSCREEN-BUFFER:CAPS"></a><span class="term"><code class="literal">COGL_OFFSCREEN_BUFFER</code></span></p></td>
292 <p class="since">Since 0.8</p>
295 <div class="refsect2">
296 <a name="CoglBufferBit"></a><h3>enum CoglBufferBit</h3>
297 <pre class="programlisting">typedef enum {
298 COGL_BUFFER_BIT_COLOR = 1L<<0,
299 COGL_BUFFER_BIT_DEPTH = 1L<<1,
300 COGL_BUFFER_BIT_STENCIL = 1L<<2
304 Types of auxiliary buffers
306 <div class="variablelist"><table border="0">
307 <col align="left" valign="top">
310 <td><p><a name="COGL-BUFFER-BIT-COLOR:CAPS"></a><span class="term"><code class="literal">COGL_BUFFER_BIT_COLOR</code></span></p></td>
311 <td>Selects the primary color buffer
315 <td><p><a name="COGL-BUFFER-BIT-DEPTH:CAPS"></a><span class="term"><code class="literal">COGL_BUFFER_BIT_DEPTH</code></span></p></td>
316 <td>Selects the depth buffer
320 <td><p><a name="COGL-BUFFER-BIT-STENCIL:CAPS"></a><span class="term"><code class="literal">COGL_BUFFER_BIT_STENCIL</code></span></p></td>
321 <td>Selects the stencil buffer
326 <p class="since">Since 1.0</p>
329 <div class="refsect2">
330 <a name="CoglAttributeType"></a><h3>enum CoglAttributeType</h3>
331 <pre class="programlisting">typedef enum {
332 COGL_ATTRIBUTE_TYPE_BYTE = 0x1400,
333 COGL_ATTRIBUTE_TYPE_UNSIGNED_BYTE = 0x1401,
334 COGL_ATTRIBUTE_TYPE_SHORT = 0x1402,
335 COGL_ATTRIBUTE_TYPE_UNSIGNED_SHORT = 0x1403,
336 COGL_ATTRIBUTE_TYPE_FLOAT = 0x1406
340 Data types for the components of a vertex attribute.
342 <div class="variablelist"><table border="0">
343 <col align="left" valign="top">
346 <td><p><a name="COGL-ATTRIBUTE-TYPE-BYTE:CAPS"></a><span class="term"><code class="literal">COGL_ATTRIBUTE_TYPE_BYTE</code></span></p></td>
347 <td>Data is the same size of a byte
351 <td><p><a name="COGL-ATTRIBUTE-TYPE-UNSIGNED-BYTE:CAPS"></a><span class="term"><code class="literal">COGL_ATTRIBUTE_TYPE_UNSIGNED_BYTE</code></span></p></td>
352 <td>Data is the same size of an
357 <td><p><a name="COGL-ATTRIBUTE-TYPE-SHORT:CAPS"></a><span class="term"><code class="literal">COGL_ATTRIBUTE_TYPE_SHORT</code></span></p></td>
358 <td>Data is the same size of a short integer
362 <td><p><a name="COGL-ATTRIBUTE-TYPE-UNSIGNED-SHORT:CAPS"></a><span class="term"><code class="literal">COGL_ATTRIBUTE_TYPE_UNSIGNED_SHORT</code></span></p></td>
363 <td>Data is the same size of
364 an unsigned short integer
368 <td><p><a name="COGL-ATTRIBUTE-TYPE-FLOAT:CAPS"></a><span class="term"><code class="literal">COGL_ATTRIBUTE_TYPE_FLOAT</code></span></p></td>
369 <td>Data is the same size of a float
374 <p class="since">Since 1.0</p>
377 <div class="refsect2">
378 <a name="CoglColorMask"></a><h3>enum CoglColorMask</h3>
379 <pre class="programlisting">typedef enum {
380 COGL_COLOR_MASK_NONE = 0,
381 COGL_COLOR_MASK_RED = 1L<<0,
382 COGL_COLOR_MASK_GREEN = 1L<<1,
383 COGL_COLOR_MASK_BLUE = 1L<<2,
384 COGL_COLOR_MASK_ALPHA = 1L<<3,
385 /* XXX: glib-mkenums is a perl script that can't cope if we split
386 * this onto multiple lines! *sigh* */
387 COGL_COLOR_MASK_ALL = (COGL_COLOR_MASK_RED | COGL_COLOR_MASK_GREEN | COGL_COLOR_MASK_BLUE | COGL_COLOR_MASK_ALPHA)
391 Defines a bit mask of color channels. This can be used with
392 <a class="link" href="cogl-2.0-experimental-Pipeline.html#cogl-pipeline-set-color-mask" title="cogl_pipeline_set_color_mask ()"><code class="function">cogl_pipeline_set_color_mask()</code></a> for example to define which color
393 channels should be written to the current framebuffer when
396 <div class="variablelist"><table border="0">
397 <col align="left" valign="top">
400 <td><p><a name="COGL-COLOR-MASK-NONE:CAPS"></a><span class="term"><code class="literal">COGL_COLOR_MASK_NONE</code></span></p></td>
401 <td>None of the color channels are masked
405 <td><p><a name="COGL-COLOR-MASK-RED:CAPS"></a><span class="term"><code class="literal">COGL_COLOR_MASK_RED</code></span></p></td>
406 <td>Masks the red color channel
410 <td><p><a name="COGL-COLOR-MASK-GREEN:CAPS"></a><span class="term"><code class="literal">COGL_COLOR_MASK_GREEN</code></span></p></td>
411 <td>Masks the green color channel
415 <td><p><a name="COGL-COLOR-MASK-BLUE:CAPS"></a><span class="term"><code class="literal">COGL_COLOR_MASK_BLUE</code></span></p></td>
416 <td>Masks the blue color channel
420 <td><p><a name="COGL-COLOR-MASK-ALPHA:CAPS"></a><span class="term"><code class="literal">COGL_COLOR_MASK_ALPHA</code></span></p></td>
421 <td>Masks the alpha color channel
425 <td><p><a name="COGL-COLOR-MASK-ALL:CAPS"></a><span class="term"><code class="literal">COGL_COLOR_MASK_ALL</code></span></p></td>
426 <td>All of the color channels are masked
436 Generated by GTK-Doc V1.18.1</div>