2009-04-27 10:48:12 -04:00
|
|
|
/*
|
|
|
|
* Cogl
|
2008-10-30 13:57:41 -04:00
|
|
|
*
|
2009-04-27 10:48:12 -04:00
|
|
|
* An object oriented GL/GLES Abstraction/Utility Layer
|
|
|
|
*
|
cogl: improves header and coding style consistency
We've had complaints that our Cogl code/headers are a bit "special" so
this is a first pass at tidying things up by giving them some
consistency. These changes are all consistent with how new code in Cogl
is being written, but the style isn't consistently applied across all
code yet.
There are two parts to this patch; but since each one required a large
amount of effort to maintain tidy indenting it made sense to combine the
changes to reduce the time spent re indenting the same lines.
The first change is to use a consistent style for declaring function
prototypes in headers. Cogl headers now consistently use this style for
prototypes:
return_type
cogl_function_name (CoglType arg0,
CoglType arg1);
Not everyone likes this style, but it seems that most of the currently
active Cogl developers agree on it.
The second change is to constrain the use of redundant glib data types
in Cogl. Uses of gint, guint, gfloat, glong, gulong and gchar have all
been replaced with int, unsigned int, float, long, unsigned long and char
respectively. When talking about pixel data; use of guchar has been
replaced with guint8, otherwise unsigned char can be used.
The glib types that we continue to use for portability are gboolean,
gint{8,16,32,64}, guint{8,16,32,64} and gsize.
The general intention is that Cogl should look palatable to the widest
range of C programmers including those outside the Gnome community so
- especially for the public API - we want to minimize the number of
foreign looking typedefs.
2010-02-09 20:57:32 -05:00
|
|
|
* Copyright (C) 2007,2008,2009,2010 Intel Corporation.
|
2008-10-30 13:57:41 -04:00
|
|
|
*
|
|
|
|
* 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
|
2010-03-01 07:56:10 -05:00
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*
|
2008-10-30 13:57:41 -04:00
|
|
|
*/
|
|
|
|
|
2008-10-30 13:25:00 -04:00
|
|
|
#if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
|
|
|
#error "Only <cogl/cogl.h> can be included directly."
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __COGL_TEXTURE_H__
|
|
|
|
#define __COGL_TEXTURE_H__
|
|
|
|
|
2012-02-17 16:46:39 -05:00
|
|
|
/* We forward declare the CoglTexture type here to avoid some circular
|
|
|
|
* dependency issues with the following headers.
|
|
|
|
*/
|
|
|
|
typedef struct _CoglTexture CoglTexture;
|
|
|
|
|
2008-10-30 13:25:00 -04:00
|
|
|
#include <cogl/cogl-types.h>
|
2010-01-05 12:54:45 -05:00
|
|
|
#include <cogl/cogl-defines.h>
|
2011-08-24 16:30:34 -04:00
|
|
|
#if defined (COGL_ENABLE_EXPERIMENTAL_API)
|
|
|
|
#include <cogl/cogl-pixel-buffer.h>
|
|
|
|
#endif
|
2011-09-08 19:40:06 -04:00
|
|
|
#include <cogl/cogl-bitmap.h>
|
2008-10-30 13:25:00 -04:00
|
|
|
|
2009-05-06 05:35:28 -04:00
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2008-10-30 13:25:00 -04:00
|
|
|
/**
|
|
|
|
* SECTION:cogl-texture
|
|
|
|
* @short_description: Fuctions for creating and manipulating textures
|
|
|
|
*
|
2011-08-24 16:30:34 -04:00
|
|
|
* Cogl allows creating and manipulating textures using a uniform
|
2008-10-30 13:25:00 -04:00
|
|
|
* API that tries to hide all the various complexities of creating,
|
|
|
|
* loading and manipulating textures.
|
|
|
|
*/
|
|
|
|
|
2011-08-24 16:30:34 -04:00
|
|
|
#define COGL_TEXTURE(X) ((CoglTexture *)X)
|
|
|
|
|
[cogl] Remove max_waste argument from Texture ctors
The CoglTexture constructors expose the "max-waste" argument for
controlling the maximum amount of wasted areas for slicing or,
if set to -1, disables slicing.
Slicing is really relevant only for large images that are never
repeated, so it's a useful feature only in controlled use cases.
Specifying the amount of wasted area is, on the other hand, just
a way to mess up this feature; 99% the times, you either pull this
number out of thin air, hoping it's right, or you try to do the
right thing and you choose the wrong number anyway.
Instead, we can use the CoglTextureFlags to control whether the
texture should not be sliced (useful for Clutter-GST and for the
texture-from-pixmap actors) and provide a reasonable value for
enabling the slicing ourself. At some point, we might even
provide a way to change the default at compile time or at run time,
for particular platforms.
Since max_waste is gone, the :tile-waste property of ClutterTexture
becomes read-only, and it proxies the cogl_texture_get_max_waste()
function.
Inside Clutter, the only cases where the max_waste argument was
not set to -1 are in the Pango glyph cache (which is a POT texture
anyway) and inside the test cases where we want to force slicing;
for the latter we can create larger textures that will be bigger than
the threshold we set.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Signed-off-by: Robert Bragg <robert@linux.intel.com>
Signed-off-by: Neil Roberts <neil@linux.intel.com>
2009-05-23 14:18:18 -04:00
|
|
|
#define COGL_TEXTURE_MAX_WASTE 127
|
|
|
|
|
2011-05-16 19:05:54 -04:00
|
|
|
/**
|
|
|
|
* COGL_TEXTURE_ERROR:
|
|
|
|
*
|
|
|
|
* #GError domain for texture errors.
|
|
|
|
*
|
|
|
|
* Since: 2.0
|
|
|
|
* Stability: Unstable
|
|
|
|
*/
|
|
|
|
#define COGL_TEXTURE_ERROR (cogl_texture_error_quark ())
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* CoglTextureError:
|
|
|
|
* @COGL_TEXTURE_ERROR_SIZE: Unsupported size
|
|
|
|
*
|
|
|
|
* Error codes that can be thrown when allocating textures.
|
|
|
|
*
|
|
|
|
* Since: 2.0
|
|
|
|
* Stability: Unstable
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
COGL_TEXTURE_ERROR_SIZE,
|
2011-05-24 17:34:10 -04:00
|
|
|
COGL_TEXTURE_ERROR_FORMAT,
|
2011-10-14 04:25:12 -04:00
|
|
|
COGL_TEXTURE_ERROR_BAD_PARAMETER,
|
|
|
|
COGL_TEXTURE_ERROR_TYPE
|
2011-05-16 19:05:54 -04:00
|
|
|
} CoglTextureError;
|
|
|
|
|
2012-02-09 06:19:04 -05:00
|
|
|
/**
|
|
|
|
* CoglTextureType:
|
|
|
|
* @COGL_TEXTURE_TYPE_2D: A #CoglTexture2D
|
|
|
|
* @COGL_TEXTURE_TYPE_3D: A #CoglTexture3D
|
|
|
|
* @COGL_TEXTURE_TYPE_RECTANGLE: A #CoglTextureRectangle
|
|
|
|
*
|
|
|
|
* Constants representing the underlying hardware texture type of a
|
|
|
|
* #CoglTexture.
|
|
|
|
*
|
|
|
|
* Stability: unstable
|
|
|
|
* Since: 1.10
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
COGL_TEXTURE_TYPE_2D,
|
|
|
|
COGL_TEXTURE_TYPE_3D,
|
|
|
|
COGL_TEXTURE_TYPE_RECTANGLE
|
|
|
|
} CoglTextureType;
|
|
|
|
|
2011-05-16 19:05:54 -04:00
|
|
|
GQuark cogl_texture_error_quark (void);
|
|
|
|
|
2008-10-30 13:25:00 -04:00
|
|
|
/**
|
|
|
|
* cogl_texture_new_with_size:
|
|
|
|
* @width: width of texture in pixels.
|
|
|
|
* @height: height of texture in pixels.
|
2009-01-18 09:51:19 -05:00
|
|
|
* @flags: Optional flags for the texture, or %COGL_TEXTURE_NONE
|
2008-10-30 13:25:00 -04:00
|
|
|
* @internal_format: the #CoglPixelFormat to use for the GPU storage of the
|
2009-01-18 09:51:19 -05:00
|
|
|
* texture.
|
2008-10-30 13:25:00 -04:00
|
|
|
*
|
2011-08-24 16:30:34 -04:00
|
|
|
* Creates a new #CoglTexture with the specified dimensions and pixel format.
|
2008-10-30 13:25:00 -04:00
|
|
|
*
|
2011-08-24 16:30:34 -04:00
|
|
|
* Return value: A newly created #CoglTexture or %NULL on failure
|
2008-10-30 13:25:00 -04:00
|
|
|
*
|
2009-01-18 09:51:19 -05:00
|
|
|
* Since: 0.8
|
2008-10-30 13:25:00 -04:00
|
|
|
*/
|
2011-08-24 16:30:34 -04:00
|
|
|
CoglTexture *
|
cogl: improves header and coding style consistency
We've had complaints that our Cogl code/headers are a bit "special" so
this is a first pass at tidying things up by giving them some
consistency. These changes are all consistent with how new code in Cogl
is being written, but the style isn't consistently applied across all
code yet.
There are two parts to this patch; but since each one required a large
amount of effort to maintain tidy indenting it made sense to combine the
changes to reduce the time spent re indenting the same lines.
The first change is to use a consistent style for declaring function
prototypes in headers. Cogl headers now consistently use this style for
prototypes:
return_type
cogl_function_name (CoglType arg0,
CoglType arg1);
Not everyone likes this style, but it seems that most of the currently
active Cogl developers agree on it.
The second change is to constrain the use of redundant glib data types
in Cogl. Uses of gint, guint, gfloat, glong, gulong and gchar have all
been replaced with int, unsigned int, float, long, unsigned long and char
respectively. When talking about pixel data; use of guchar has been
replaced with guint8, otherwise unsigned char can be used.
The glib types that we continue to use for portability are gboolean,
gint{8,16,32,64}, guint{8,16,32,64} and gsize.
The general intention is that Cogl should look palatable to the widest
range of C programmers including those outside the Gnome community so
- especially for the public API - we want to minimize the number of
foreign looking typedefs.
2010-02-09 20:57:32 -05:00
|
|
|
cogl_texture_new_with_size (unsigned int width,
|
|
|
|
unsigned int height,
|
|
|
|
CoglTextureFlags flags,
|
|
|
|
CoglPixelFormat internal_format);
|
2008-10-30 13:25:00 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_texture_new_from_file:
|
|
|
|
* @filename: the file to load
|
2009-01-18 09:51:19 -05:00
|
|
|
* @flags: Optional flags for the texture, or %COGL_TEXTURE_NONE
|
2008-10-30 13:25:00 -04:00
|
|
|
* @internal_format: the #CoglPixelFormat to use for the GPU storage of the
|
2009-11-19 08:55:10 -05:00
|
|
|
* texture. If %COGL_PIXEL_FORMAT_ANY is given then a premultiplied
|
2009-06-11 09:31:01 -04:00
|
|
|
* format similar to the format of the source data will be used. The
|
|
|
|
* default blending equations of Cogl expect premultiplied color data;
|
|
|
|
* the main use of passing a non-premultiplied format here is if you
|
|
|
|
* have non-premultiplied source data and are going to adjust the blend
|
|
|
|
* mode (see cogl_material_set_blend()) or use the data for something
|
|
|
|
* other than straight blending.
|
2009-01-18 09:51:19 -05:00
|
|
|
* @error: return location for a #GError or %NULL
|
2008-10-30 13:25:00 -04:00
|
|
|
*
|
2011-08-24 16:30:34 -04:00
|
|
|
* Creates a #CoglTexture from an image file.
|
2008-10-30 13:25:00 -04:00
|
|
|
*
|
2011-08-24 16:30:34 -04:00
|
|
|
* Return value: A newly created #CoglTexture or %NULL on failure
|
2009-01-18 09:51:19 -05:00
|
|
|
*
|
|
|
|
* Since: 0.8
|
2008-10-30 13:25:00 -04:00
|
|
|
*/
|
2011-08-24 16:30:34 -04:00
|
|
|
CoglTexture *
|
cogl: improves header and coding style consistency
We've had complaints that our Cogl code/headers are a bit "special" so
this is a first pass at tidying things up by giving them some
consistency. These changes are all consistent with how new code in Cogl
is being written, but the style isn't consistently applied across all
code yet.
There are two parts to this patch; but since each one required a large
amount of effort to maintain tidy indenting it made sense to combine the
changes to reduce the time spent re indenting the same lines.
The first change is to use a consistent style for declaring function
prototypes in headers. Cogl headers now consistently use this style for
prototypes:
return_type
cogl_function_name (CoglType arg0,
CoglType arg1);
Not everyone likes this style, but it seems that most of the currently
active Cogl developers agree on it.
The second change is to constrain the use of redundant glib data types
in Cogl. Uses of gint, guint, gfloat, glong, gulong and gchar have all
been replaced with int, unsigned int, float, long, unsigned long and char
respectively. When talking about pixel data; use of guchar has been
replaced with guint8, otherwise unsigned char can be used.
The glib types that we continue to use for portability are gboolean,
gint{8,16,32,64}, guint{8,16,32,64} and gsize.
The general intention is that Cogl should look palatable to the widest
range of C programmers including those outside the Gnome community so
- especially for the public API - we want to minimize the number of
foreign looking typedefs.
2010-02-09 20:57:32 -05:00
|
|
|
cogl_texture_new_from_file (const char *filename,
|
|
|
|
CoglTextureFlags flags,
|
|
|
|
CoglPixelFormat internal_format,
|
|
|
|
GError **error);
|
2008-10-30 13:25:00 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_texture_new_from_data:
|
2009-01-18 09:51:19 -05:00
|
|
|
* @width: width of texture in pixels
|
|
|
|
* @height: height of texture in pixels
|
|
|
|
* @flags: Optional flags for the texture, or %COGL_TEXTURE_NONE
|
2008-10-30 13:25:00 -04:00
|
|
|
* @format: the #CoglPixelFormat the buffer is stored in in RAM
|
2009-01-18 09:51:19 -05:00
|
|
|
* @internal_format: the #CoglPixelFormat that will be used for storing
|
2009-06-11 09:31:01 -04:00
|
|
|
* the buffer on the GPU. If COGL_PIXEL_FORMAT_ANY is given then a
|
|
|
|
* premultiplied format similar to the format of the source data will
|
|
|
|
* be used. The default blending equations of Cogl expect premultiplied
|
|
|
|
* color data; the main use of passing a non-premultiplied format here
|
|
|
|
* is if you have non-premultiplied source data and are going to adjust
|
|
|
|
* the blend mode (see cogl_material_set_blend()) or use the data for
|
|
|
|
* something other than straight blending.
|
2009-01-18 09:51:19 -05:00
|
|
|
* @rowstride: the memory offset in bytes between the starts of
|
|
|
|
* scanlines in @data
|
|
|
|
* @data: pointer the memory region where the source buffer resides
|
2008-10-30 13:25:00 -04:00
|
|
|
*
|
2011-08-24 16:30:34 -04:00
|
|
|
* Creates a new #CoglTexture based on data residing in memory.
|
2008-10-30 13:25:00 -04:00
|
|
|
*
|
2011-08-24 16:30:34 -04:00
|
|
|
* Return value: A newly created #CoglTexture or %NULL on failure
|
2008-10-30 13:25:00 -04:00
|
|
|
*
|
2009-01-18 09:51:19 -05:00
|
|
|
* Since: 0.8
|
2008-10-30 13:25:00 -04:00
|
|
|
*/
|
2011-08-24 16:30:34 -04:00
|
|
|
CoglTexture *
|
cogl: improves header and coding style consistency
We've had complaints that our Cogl code/headers are a bit "special" so
this is a first pass at tidying things up by giving them some
consistency. These changes are all consistent with how new code in Cogl
is being written, but the style isn't consistently applied across all
code yet.
There are two parts to this patch; but since each one required a large
amount of effort to maintain tidy indenting it made sense to combine the
changes to reduce the time spent re indenting the same lines.
The first change is to use a consistent style for declaring function
prototypes in headers. Cogl headers now consistently use this style for
prototypes:
return_type
cogl_function_name (CoglType arg0,
CoglType arg1);
Not everyone likes this style, but it seems that most of the currently
active Cogl developers agree on it.
The second change is to constrain the use of redundant glib data types
in Cogl. Uses of gint, guint, gfloat, glong, gulong and gchar have all
been replaced with int, unsigned int, float, long, unsigned long and char
respectively. When talking about pixel data; use of guchar has been
replaced with guint8, otherwise unsigned char can be used.
The glib types that we continue to use for portability are gboolean,
gint{8,16,32,64}, guint{8,16,32,64} and gsize.
The general intention is that Cogl should look palatable to the widest
range of C programmers including those outside the Gnome community so
- especially for the public API - we want to minimize the number of
foreign looking typedefs.
2010-02-09 20:57:32 -05:00
|
|
|
cogl_texture_new_from_data (unsigned int width,
|
|
|
|
unsigned int height,
|
|
|
|
CoglTextureFlags flags,
|
|
|
|
CoglPixelFormat format,
|
|
|
|
CoglPixelFormat internal_format,
|
|
|
|
unsigned int rowstride,
|
|
|
|
const guint8 *data);
|
2008-10-30 13:25:00 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_texture_new_from_foreign:
|
2009-07-30 07:06:02 -04:00
|
|
|
* @gl_handle: opengl handle of foreign texture.
|
|
|
|
* @gl_target: opengl target type of foreign texture
|
2008-10-30 13:25:00 -04:00
|
|
|
* @width: width of foreign texture
|
|
|
|
* @height: height of foreign texture.
|
2010-02-16 09:53:10 -05:00
|
|
|
* @x_pot_waste: horizontal waste on the right hand edge of the texture.
|
|
|
|
* @y_pot_waste: vertical waste on the bottom edge of the texture.
|
2008-10-30 13:25:00 -04:00
|
|
|
* @format: format of the foreign texture.
|
|
|
|
*
|
2011-08-24 16:30:34 -04:00
|
|
|
* Creates a #CoglTexture based on an existing OpenGL texture; the
|
2010-02-16 09:53:10 -05:00
|
|
|
* width, height and format are passed along since it is not always
|
|
|
|
* possible to query these from OpenGL.
|
|
|
|
*
|
|
|
|
* The waste arguments allow you to create a Cogl texture that maps to
|
|
|
|
* a region smaller than the real OpenGL texture. For instance if your
|
|
|
|
* hardware only supports power-of-two textures you may load a
|
|
|
|
* non-power-of-two image into a larger power-of-two texture and use
|
|
|
|
* the waste arguments to tell Cogl which region should be mapped to
|
|
|
|
* the texture coordinate range [0:1].
|
2008-10-30 13:25:00 -04:00
|
|
|
*
|
2011-08-24 16:30:34 -04:00
|
|
|
* Return value: A newly created #CoglTexture or %NULL on failure
|
2008-10-30 13:25:00 -04:00
|
|
|
*
|
2009-01-18 09:51:19 -05:00
|
|
|
* Since: 0.8
|
2008-10-30 13:25:00 -04:00
|
|
|
*/
|
2011-08-24 16:30:34 -04:00
|
|
|
CoglTexture *
|
cogl: improves header and coding style consistency
We've had complaints that our Cogl code/headers are a bit "special" so
this is a first pass at tidying things up by giving them some
consistency. These changes are all consistent with how new code in Cogl
is being written, but the style isn't consistently applied across all
code yet.
There are two parts to this patch; but since each one required a large
amount of effort to maintain tidy indenting it made sense to combine the
changes to reduce the time spent re indenting the same lines.
The first change is to use a consistent style for declaring function
prototypes in headers. Cogl headers now consistently use this style for
prototypes:
return_type
cogl_function_name (CoglType arg0,
CoglType arg1);
Not everyone likes this style, but it seems that most of the currently
active Cogl developers agree on it.
The second change is to constrain the use of redundant glib data types
in Cogl. Uses of gint, guint, gfloat, glong, gulong and gchar have all
been replaced with int, unsigned int, float, long, unsigned long and char
respectively. When talking about pixel data; use of guchar has been
replaced with guint8, otherwise unsigned char can be used.
The glib types that we continue to use for portability are gboolean,
gint{8,16,32,64}, guint{8,16,32,64} and gsize.
The general intention is that Cogl should look palatable to the widest
range of C programmers including those outside the Gnome community so
- especially for the public API - we want to minimize the number of
foreign looking typedefs.
2010-02-09 20:57:32 -05:00
|
|
|
cogl_texture_new_from_foreign (GLuint gl_handle,
|
|
|
|
GLenum gl_target,
|
|
|
|
GLuint width,
|
|
|
|
GLuint height,
|
|
|
|
GLuint x_pot_waste,
|
|
|
|
GLuint y_pot_waste,
|
|
|
|
CoglPixelFormat format);
|
2008-10-30 13:25:00 -04:00
|
|
|
|
2009-01-07 12:02:43 -05:00
|
|
|
/**
|
|
|
|
* cogl_texture_new_from_bitmap:
|
2011-08-24 16:30:34 -04:00
|
|
|
* @bitmap: A #CoglBitmap pointer
|
2009-01-18 09:51:19 -05:00
|
|
|
* @flags: Optional flags for the texture, or %COGL_TEXTURE_NONE
|
2009-01-07 12:02:43 -05:00
|
|
|
* @internal_format: the #CoglPixelFormat to use for the GPU storage of the
|
2009-01-18 09:51:19 -05:00
|
|
|
* texture
|
|
|
|
*
|
2011-08-24 16:30:34 -04:00
|
|
|
* Creates a #CoglTexture from a #CoglBitmap.
|
2009-01-07 12:02:43 -05:00
|
|
|
*
|
2011-08-24 16:30:34 -04:00
|
|
|
* Return value: A newly created #CoglTexture or %NULL on failure
|
2009-01-07 12:02:43 -05:00
|
|
|
*
|
2009-01-18 09:51:19 -05:00
|
|
|
* Since: 1.0
|
2009-01-07 12:02:43 -05:00
|
|
|
*/
|
2011-08-24 16:30:34 -04:00
|
|
|
CoglTexture *
|
|
|
|
cogl_texture_new_from_bitmap (CoglBitmap *bitmap,
|
cogl: improves header and coding style consistency
We've had complaints that our Cogl code/headers are a bit "special" so
this is a first pass at tidying things up by giving them some
consistency. These changes are all consistent with how new code in Cogl
is being written, but the style isn't consistently applied across all
code yet.
There are two parts to this patch; but since each one required a large
amount of effort to maintain tidy indenting it made sense to combine the
changes to reduce the time spent re indenting the same lines.
The first change is to use a consistent style for declaring function
prototypes in headers. Cogl headers now consistently use this style for
prototypes:
return_type
cogl_function_name (CoglType arg0,
CoglType arg1);
Not everyone likes this style, but it seems that most of the currently
active Cogl developers agree on it.
The second change is to constrain the use of redundant glib data types
in Cogl. Uses of gint, guint, gfloat, glong, gulong and gchar have all
been replaced with int, unsigned int, float, long, unsigned long and char
respectively. When talking about pixel data; use of guchar has been
replaced with guint8, otherwise unsigned char can be used.
The glib types that we continue to use for portability are gboolean,
gint{8,16,32,64}, guint{8,16,32,64} and gsize.
The general intention is that Cogl should look palatable to the widest
range of C programmers including those outside the Gnome community so
- especially for the public API - we want to minimize the number of
foreign looking typedefs.
2010-02-09 20:57:32 -05:00
|
|
|
CoglTextureFlags flags,
|
2011-08-24 16:30:34 -04:00
|
|
|
CoglPixelFormat internal_format);
|
2009-01-07 12:02:43 -05:00
|
|
|
|
2008-10-30 13:25:00 -04:00
|
|
|
/**
|
|
|
|
* cogl_is_texture:
|
2011-08-24 16:30:34 -04:00
|
|
|
* @object: A #CoglObject pointer
|
2008-10-30 13:25:00 -04:00
|
|
|
*
|
2011-08-24 16:30:34 -04:00
|
|
|
* Gets whether the given object references a texture object.
|
2008-10-30 13:25:00 -04:00
|
|
|
*
|
2009-11-19 08:55:10 -05:00
|
|
|
* Return value: %TRUE if the handle references a texture, and
|
2008-10-30 13:25:00 -04:00
|
|
|
* %FALSE otherwise
|
|
|
|
*/
|
cogl: improves header and coding style consistency
We've had complaints that our Cogl code/headers are a bit "special" so
this is a first pass at tidying things up by giving them some
consistency. These changes are all consistent with how new code in Cogl
is being written, but the style isn't consistently applied across all
code yet.
There are two parts to this patch; but since each one required a large
amount of effort to maintain tidy indenting it made sense to combine the
changes to reduce the time spent re indenting the same lines.
The first change is to use a consistent style for declaring function
prototypes in headers. Cogl headers now consistently use this style for
prototypes:
return_type
cogl_function_name (CoglType arg0,
CoglType arg1);
Not everyone likes this style, but it seems that most of the currently
active Cogl developers agree on it.
The second change is to constrain the use of redundant glib data types
in Cogl. Uses of gint, guint, gfloat, glong, gulong and gchar have all
been replaced with int, unsigned int, float, long, unsigned long and char
respectively. When talking about pixel data; use of guchar has been
replaced with guint8, otherwise unsigned char can be used.
The glib types that we continue to use for portability are gboolean,
gint{8,16,32,64}, guint{8,16,32,64} and gsize.
The general intention is that Cogl should look palatable to the widest
range of C programmers including those outside the Gnome community so
- especially for the public API - we want to minimize the number of
foreign looking typedefs.
2010-02-09 20:57:32 -05:00
|
|
|
gboolean
|
2011-08-24 16:30:34 -04:00
|
|
|
cogl_is_texture (void *object);
|
2008-10-30 13:25:00 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_texture_get_width:
|
2011-08-24 16:30:34 -04:00
|
|
|
* @texture a #CoglTexture pointer.
|
2008-12-23 11:29:29 -05:00
|
|
|
*
|
2009-11-19 08:55:10 -05:00
|
|
|
* Queries the width of a cogl texture.
|
2008-10-30 13:25:00 -04:00
|
|
|
*
|
2009-11-19 08:55:10 -05:00
|
|
|
* Return value: the width of the GPU side texture in pixels
|
2008-10-30 13:25:00 -04:00
|
|
|
*/
|
cogl: improves header and coding style consistency
We've had complaints that our Cogl code/headers are a bit "special" so
this is a first pass at tidying things up by giving them some
consistency. These changes are all consistent with how new code in Cogl
is being written, but the style isn't consistently applied across all
code yet.
There are two parts to this patch; but since each one required a large
amount of effort to maintain tidy indenting it made sense to combine the
changes to reduce the time spent re indenting the same lines.
The first change is to use a consistent style for declaring function
prototypes in headers. Cogl headers now consistently use this style for
prototypes:
return_type
cogl_function_name (CoglType arg0,
CoglType arg1);
Not everyone likes this style, but it seems that most of the currently
active Cogl developers agree on it.
The second change is to constrain the use of redundant glib data types
in Cogl. Uses of gint, guint, gfloat, glong, gulong and gchar have all
been replaced with int, unsigned int, float, long, unsigned long and char
respectively. When talking about pixel data; use of guchar has been
replaced with guint8, otherwise unsigned char can be used.
The glib types that we continue to use for portability are gboolean,
gint{8,16,32,64}, guint{8,16,32,64} and gsize.
The general intention is that Cogl should look palatable to the widest
range of C programmers including those outside the Gnome community so
- especially for the public API - we want to minimize the number of
foreign looking typedefs.
2010-02-09 20:57:32 -05:00
|
|
|
unsigned int
|
2011-08-24 16:30:34 -04:00
|
|
|
cogl_texture_get_width (CoglTexture *texture);
|
2008-10-30 13:25:00 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_texture_get_height:
|
2011-08-24 16:30:34 -04:00
|
|
|
* @texture a #CoglTexture pointer.
|
2008-12-23 11:29:29 -05:00
|
|
|
*
|
2009-11-19 08:55:10 -05:00
|
|
|
* Queries the height of a cogl texture.
|
2008-10-30 13:25:00 -04:00
|
|
|
*
|
2009-11-19 08:55:10 -05:00
|
|
|
* Return value: the height of the GPU side texture in pixels
|
2008-10-30 13:25:00 -04:00
|
|
|
*/
|
cogl: improves header and coding style consistency
We've had complaints that our Cogl code/headers are a bit "special" so
this is a first pass at tidying things up by giving them some
consistency. These changes are all consistent with how new code in Cogl
is being written, but the style isn't consistently applied across all
code yet.
There are two parts to this patch; but since each one required a large
amount of effort to maintain tidy indenting it made sense to combine the
changes to reduce the time spent re indenting the same lines.
The first change is to use a consistent style for declaring function
prototypes in headers. Cogl headers now consistently use this style for
prototypes:
return_type
cogl_function_name (CoglType arg0,
CoglType arg1);
Not everyone likes this style, but it seems that most of the currently
active Cogl developers agree on it.
The second change is to constrain the use of redundant glib data types
in Cogl. Uses of gint, guint, gfloat, glong, gulong and gchar have all
been replaced with int, unsigned int, float, long, unsigned long and char
respectively. When talking about pixel data; use of guchar has been
replaced with guint8, otherwise unsigned char can be used.
The glib types that we continue to use for portability are gboolean,
gint{8,16,32,64}, guint{8,16,32,64} and gsize.
The general intention is that Cogl should look palatable to the widest
range of C programmers including those outside the Gnome community so
- especially for the public API - we want to minimize the number of
foreign looking typedefs.
2010-02-09 20:57:32 -05:00
|
|
|
unsigned int
|
2011-08-24 16:30:34 -04:00
|
|
|
cogl_texture_get_height (CoglTexture *texture);
|
2008-10-30 13:25:00 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_texture_get_format:
|
2011-08-24 16:30:34 -04:00
|
|
|
* @texture a #CoglTexture pointer.
|
2008-12-23 11:29:29 -05:00
|
|
|
*
|
2009-11-19 08:55:10 -05:00
|
|
|
* Queries the #CoglPixelFormat of a cogl texture.
|
2008-10-30 13:25:00 -04:00
|
|
|
*
|
2009-11-19 08:55:10 -05:00
|
|
|
* Return value: the #CoglPixelFormat of the GPU side texture
|
2008-10-30 13:25:00 -04:00
|
|
|
*/
|
cogl: improves header and coding style consistency
We've had complaints that our Cogl code/headers are a bit "special" so
this is a first pass at tidying things up by giving them some
consistency. These changes are all consistent with how new code in Cogl
is being written, but the style isn't consistently applied across all
code yet.
There are two parts to this patch; but since each one required a large
amount of effort to maintain tidy indenting it made sense to combine the
changes to reduce the time spent re indenting the same lines.
The first change is to use a consistent style for declaring function
prototypes in headers. Cogl headers now consistently use this style for
prototypes:
return_type
cogl_function_name (CoglType arg0,
CoglType arg1);
Not everyone likes this style, but it seems that most of the currently
active Cogl developers agree on it.
The second change is to constrain the use of redundant glib data types
in Cogl. Uses of gint, guint, gfloat, glong, gulong and gchar have all
been replaced with int, unsigned int, float, long, unsigned long and char
respectively. When talking about pixel data; use of guchar has been
replaced with guint8, otherwise unsigned char can be used.
The glib types that we continue to use for portability are gboolean,
gint{8,16,32,64}, guint{8,16,32,64} and gsize.
The general intention is that Cogl should look palatable to the widest
range of C programmers including those outside the Gnome community so
- especially for the public API - we want to minimize the number of
foreign looking typedefs.
2010-02-09 20:57:32 -05:00
|
|
|
CoglPixelFormat
|
2011-08-24 16:30:34 -04:00
|
|
|
cogl_texture_get_format (CoglTexture *texture);
|
2008-10-30 13:25:00 -04:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_texture_get_rowstride:
|
2011-08-24 16:30:34 -04:00
|
|
|
* @texture a #CoglTexture pointer.
|
2008-12-23 11:29:29 -05:00
|
|
|
*
|
2011-11-01 15:05:32 -04:00
|
|
|
* Determines the bytes-per-pixel for the #CoglPixelFormat retrieved
|
|
|
|
* from cogl_texture_get_format() and multiplies that by the texture's
|
|
|
|
* width.
|
|
|
|
*
|
|
|
|
* <note>It's very unlikely that anyone would need to use this API to
|
|
|
|
* query the internal rowstride of a #CoglTexture which can just be
|
|
|
|
* considered an implementation detail. Actually it's not even useful
|
|
|
|
* internally since underlying drivers are free to use a different
|
|
|
|
* format</note>
|
|
|
|
*
|
|
|
|
* </note>This API is only here for backwards compatibility and
|
|
|
|
* shouldn't be used in new code. In particular please don't be
|
|
|
|
* mislead to pass the returned value to cogl_texture_get_data() for
|
|
|
|
* the rowstride, since you should be passing the rowstride you desire
|
|
|
|
* for your destination buffer not the rowstride of the source
|
|
|
|
* texture.</note>
|
|
|
|
*
|
|
|
|
* Return value: The bytes-per-pixel for the current format
|
|
|
|
* multiplied by the texture's width
|
|
|
|
*
|
|
|
|
* Deprecated: 1.10: There's no replacement for the API but there's
|
|
|
|
* also no known need for API either. It was just
|
|
|
|
* a mistake that it was ever published.
|
2008-10-30 13:25:00 -04:00
|
|
|
*/
|
cogl: improves header and coding style consistency
We've had complaints that our Cogl code/headers are a bit "special" so
this is a first pass at tidying things up by giving them some
consistency. These changes are all consistent with how new code in Cogl
is being written, but the style isn't consistently applied across all
code yet.
There are two parts to this patch; but since each one required a large
amount of effort to maintain tidy indenting it made sense to combine the
changes to reduce the time spent re indenting the same lines.
The first change is to use a consistent style for declaring function
prototypes in headers. Cogl headers now consistently use this style for
prototypes:
return_type
cogl_function_name (CoglType arg0,
CoglType arg1);
Not everyone likes this style, but it seems that most of the currently
active Cogl developers agree on it.
The second change is to constrain the use of redundant glib data types
in Cogl. Uses of gint, guint, gfloat, glong, gulong and gchar have all
been replaced with int, unsigned int, float, long, unsigned long and char
respectively. When talking about pixel data; use of guchar has been
replaced with guint8, otherwise unsigned char can be used.
The glib types that we continue to use for portability are gboolean,
gint{8,16,32,64}, guint{8,16,32,64} and gsize.
The general intention is that Cogl should look palatable to the widest
range of C programmers including those outside the Gnome community so
- especially for the public API - we want to minimize the number of
foreign looking typedefs.
2010-02-09 20:57:32 -05:00
|
|
|
unsigned int
|
2011-08-24 16:30:34 -04:00
|
|
|
cogl_texture_get_rowstride (CoglTexture *texture);
|
2008-10-30 13:25:00 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_texture_get_max_waste:
|
2011-08-24 16:30:34 -04:00
|
|
|
* @texture a #CoglTexture pointer.
|
2008-12-23 11:29:29 -05:00
|
|
|
*
|
2009-11-19 08:55:10 -05:00
|
|
|
* Queries the maximum wasted (unused) pixels in one dimension of a GPU side
|
2008-10-30 13:25:00 -04:00
|
|
|
* texture.
|
|
|
|
*
|
2009-11-19 08:55:10 -05:00
|
|
|
* Return value: the maximum waste
|
2008-10-30 13:25:00 -04:00
|
|
|
*/
|
cogl: improves header and coding style consistency
We've had complaints that our Cogl code/headers are a bit "special" so
this is a first pass at tidying things up by giving them some
consistency. These changes are all consistent with how new code in Cogl
is being written, but the style isn't consistently applied across all
code yet.
There are two parts to this patch; but since each one required a large
amount of effort to maintain tidy indenting it made sense to combine the
changes to reduce the time spent re indenting the same lines.
The first change is to use a consistent style for declaring function
prototypes in headers. Cogl headers now consistently use this style for
prototypes:
return_type
cogl_function_name (CoglType arg0,
CoglType arg1);
Not everyone likes this style, but it seems that most of the currently
active Cogl developers agree on it.
The second change is to constrain the use of redundant glib data types
in Cogl. Uses of gint, guint, gfloat, glong, gulong and gchar have all
been replaced with int, unsigned int, float, long, unsigned long and char
respectively. When talking about pixel data; use of guchar has been
replaced with guint8, otherwise unsigned char can be used.
The glib types that we continue to use for portability are gboolean,
gint{8,16,32,64}, guint{8,16,32,64} and gsize.
The general intention is that Cogl should look palatable to the widest
range of C programmers including those outside the Gnome community so
- especially for the public API - we want to minimize the number of
foreign looking typedefs.
2010-02-09 20:57:32 -05:00
|
|
|
int
|
2011-08-24 16:30:34 -04:00
|
|
|
cogl_texture_get_max_waste (CoglTexture *texture);
|
2008-10-30 13:25:00 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_texture_is_sliced:
|
2011-08-24 16:30:34 -04:00
|
|
|
* @texture a #CoglTexture pointer.
|
2008-12-23 11:29:29 -05:00
|
|
|
*
|
2009-11-19 08:55:10 -05:00
|
|
|
* Queries if a texture is sliced (stored as multiple GPU side tecture
|
2008-10-30 13:25:00 -04:00
|
|
|
* objects).
|
|
|
|
*
|
2009-11-19 08:55:10 -05:00
|
|
|
* Return value: %TRUE if the texture is sliced, %FALSE if the texture
|
|
|
|
* is stored as a single GPU texture
|
2008-10-30 13:25:00 -04:00
|
|
|
*/
|
cogl: improves header and coding style consistency
We've had complaints that our Cogl code/headers are a bit "special" so
this is a first pass at tidying things up by giving them some
consistency. These changes are all consistent with how new code in Cogl
is being written, but the style isn't consistently applied across all
code yet.
There are two parts to this patch; but since each one required a large
amount of effort to maintain tidy indenting it made sense to combine the
changes to reduce the time spent re indenting the same lines.
The first change is to use a consistent style for declaring function
prototypes in headers. Cogl headers now consistently use this style for
prototypes:
return_type
cogl_function_name (CoglType arg0,
CoglType arg1);
Not everyone likes this style, but it seems that most of the currently
active Cogl developers agree on it.
The second change is to constrain the use of redundant glib data types
in Cogl. Uses of gint, guint, gfloat, glong, gulong and gchar have all
been replaced with int, unsigned int, float, long, unsigned long and char
respectively. When talking about pixel data; use of guchar has been
replaced with guint8, otherwise unsigned char can be used.
The glib types that we continue to use for portability are gboolean,
gint{8,16,32,64}, guint{8,16,32,64} and gsize.
The general intention is that Cogl should look palatable to the widest
range of C programmers including those outside the Gnome community so
- especially for the public API - we want to minimize the number of
foreign looking typedefs.
2010-02-09 20:57:32 -05:00
|
|
|
gboolean
|
2011-08-24 16:30:34 -04:00
|
|
|
cogl_texture_is_sliced (CoglTexture *texture);
|
2008-10-30 13:25:00 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_texture_get_gl_texture:
|
2011-08-24 16:30:34 -04:00
|
|
|
* @texture a #CoglTexture pointer.
|
2009-09-07 06:44:44 -04:00
|
|
|
* @out_gl_handle: (out) (allow-none): pointer to return location for the
|
|
|
|
* textures GL handle, or %NULL.
|
|
|
|
* @out_gl_target: (out) (allow-none): pointer to return location for the
|
|
|
|
* GL target type, or %NULL.
|
2008-12-23 11:29:29 -05:00
|
|
|
*
|
2011-08-24 16:30:34 -04:00
|
|
|
* Queries the GL handles for a GPU side texture through its #CoglTexture.
|
2009-11-19 08:55:10 -05:00
|
|
|
*
|
|
|
|
* If the texture is spliced the data for the first sub texture will be
|
2008-10-30 13:25:00 -04:00
|
|
|
* queried.
|
|
|
|
*
|
2009-11-19 08:55:10 -05:00
|
|
|
* Return value: %TRUE if the handle was successfully retrieved, %FALSE
|
|
|
|
* if the handle was invalid
|
2008-10-30 13:25:00 -04:00
|
|
|
*/
|
cogl: improves header and coding style consistency
We've had complaints that our Cogl code/headers are a bit "special" so
this is a first pass at tidying things up by giving them some
consistency. These changes are all consistent with how new code in Cogl
is being written, but the style isn't consistently applied across all
code yet.
There are two parts to this patch; but since each one required a large
amount of effort to maintain tidy indenting it made sense to combine the
changes to reduce the time spent re indenting the same lines.
The first change is to use a consistent style for declaring function
prototypes in headers. Cogl headers now consistently use this style for
prototypes:
return_type
cogl_function_name (CoglType arg0,
CoglType arg1);
Not everyone likes this style, but it seems that most of the currently
active Cogl developers agree on it.
The second change is to constrain the use of redundant glib data types
in Cogl. Uses of gint, guint, gfloat, glong, gulong and gchar have all
been replaced with int, unsigned int, float, long, unsigned long and char
respectively. When talking about pixel data; use of guchar has been
replaced with guint8, otherwise unsigned char can be used.
The glib types that we continue to use for portability are gboolean,
gint{8,16,32,64}, guint{8,16,32,64} and gsize.
The general intention is that Cogl should look palatable to the widest
range of C programmers including those outside the Gnome community so
- especially for the public API - we want to minimize the number of
foreign looking typedefs.
2010-02-09 20:57:32 -05:00
|
|
|
gboolean
|
2011-08-24 16:30:34 -04:00
|
|
|
cogl_texture_get_gl_texture (CoglTexture *texture,
|
cogl: improves header and coding style consistency
We've had complaints that our Cogl code/headers are a bit "special" so
this is a first pass at tidying things up by giving them some
consistency. These changes are all consistent with how new code in Cogl
is being written, but the style isn't consistently applied across all
code yet.
There are two parts to this patch; but since each one required a large
amount of effort to maintain tidy indenting it made sense to combine the
changes to reduce the time spent re indenting the same lines.
The first change is to use a consistent style for declaring function
prototypes in headers. Cogl headers now consistently use this style for
prototypes:
return_type
cogl_function_name (CoglType arg0,
CoglType arg1);
Not everyone likes this style, but it seems that most of the currently
active Cogl developers agree on it.
The second change is to constrain the use of redundant glib data types
in Cogl. Uses of gint, guint, gfloat, glong, gulong and gchar have all
been replaced with int, unsigned int, float, long, unsigned long and char
respectively. When talking about pixel data; use of guchar has been
replaced with guint8, otherwise unsigned char can be used.
The glib types that we continue to use for portability are gboolean,
gint{8,16,32,64}, guint{8,16,32,64} and gsize.
The general intention is that Cogl should look palatable to the widest
range of C programmers including those outside the Gnome community so
- especially for the public API - we want to minimize the number of
foreign looking typedefs.
2010-02-09 20:57:32 -05:00
|
|
|
GLuint *out_gl_handle,
|
|
|
|
GLenum *out_gl_target);
|
2008-10-30 13:25:00 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_texture_get_data:
|
2011-08-24 16:30:34 -04:00
|
|
|
* @texture a #CoglTexture pointer.
|
2008-10-30 13:25:00 -04:00
|
|
|
* @format: the #CoglPixelFormat to store the texture as.
|
2011-11-01 15:05:32 -04:00
|
|
|
* @rowstride: the rowstride of @data in bytes or pass 0 to calculate
|
|
|
|
* from the bytes-per-pixel of @format multiplied by the
|
|
|
|
* @texture width.
|
|
|
|
* @data: memory location to write the @texture's contents, or %NULL
|
|
|
|
* to only query the data size through the return value.
|
2008-12-23 11:29:29 -05:00
|
|
|
*
|
2009-11-19 08:55:10 -05:00
|
|
|
* Copies the pixel data from a cogl texture to system memory.
|
2008-10-30 13:25:00 -04:00
|
|
|
*
|
2011-11-01 15:05:32 -04:00
|
|
|
* <note>Don't pass the value of cogl_texture_get_rowstride() as the
|
|
|
|
* @rowstride argument, the rowstride should be the rowstride you
|
|
|
|
* want for the destination @data buffer not the rowstride of the
|
|
|
|
* source texture</note>
|
|
|
|
*
|
|
|
|
* Return value: the size of the texture data in bytes
|
2008-10-30 13:25:00 -04:00
|
|
|
*/
|
cogl: improves header and coding style consistency
We've had complaints that our Cogl code/headers are a bit "special" so
this is a first pass at tidying things up by giving them some
consistency. These changes are all consistent with how new code in Cogl
is being written, but the style isn't consistently applied across all
code yet.
There are two parts to this patch; but since each one required a large
amount of effort to maintain tidy indenting it made sense to combine the
changes to reduce the time spent re indenting the same lines.
The first change is to use a consistent style for declaring function
prototypes in headers. Cogl headers now consistently use this style for
prototypes:
return_type
cogl_function_name (CoglType arg0,
CoglType arg1);
Not everyone likes this style, but it seems that most of the currently
active Cogl developers agree on it.
The second change is to constrain the use of redundant glib data types
in Cogl. Uses of gint, guint, gfloat, glong, gulong and gchar have all
been replaced with int, unsigned int, float, long, unsigned long and char
respectively. When talking about pixel data; use of guchar has been
replaced with guint8, otherwise unsigned char can be used.
The glib types that we continue to use for portability are gboolean,
gint{8,16,32,64}, guint{8,16,32,64} and gsize.
The general intention is that Cogl should look palatable to the widest
range of C programmers including those outside the Gnome community so
- especially for the public API - we want to minimize the number of
foreign looking typedefs.
2010-02-09 20:57:32 -05:00
|
|
|
int
|
2011-08-24 16:30:34 -04:00
|
|
|
cogl_texture_get_data (CoglTexture *texture,
|
|
|
|
CoglPixelFormat format,
|
|
|
|
unsigned int rowstride,
|
|
|
|
guint8 *data);
|
2008-10-30 13:25:00 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_texture_set_region:
|
2011-08-24 16:30:34 -04:00
|
|
|
* @texture a #CoglTexture.
|
2008-10-30 13:25:00 -04:00
|
|
|
* @src_x: upper left coordinate to use from source data.
|
|
|
|
* @src_y: upper left coordinate to use from source data.
|
|
|
|
* @dst_x: upper left destination horizontal coordinate.
|
|
|
|
* @dst_y: upper left destination vertical coordinate.
|
2011-11-22 07:06:40 -05:00
|
|
|
* @dst_width: width of destination region to write. (Must be less
|
|
|
|
* than or equal to @width)
|
|
|
|
* @dst_height: height of destination region to write. (Must be less
|
|
|
|
* than or equal to @height)
|
2008-10-30 13:25:00 -04:00
|
|
|
* @width: width of source data buffer.
|
|
|
|
* @height: height of source data buffer.
|
|
|
|
* @format: the #CoglPixelFormat used in the source buffer.
|
|
|
|
* @rowstride: rowstride of source buffer (computed from width if none
|
|
|
|
* specified)
|
|
|
|
* @data: the actual pixel data.
|
|
|
|
*
|
2011-11-22 07:06:40 -05:00
|
|
|
* Sets the pixels in a rectangular subregion of @texture from an in-memory
|
2008-12-23 11:29:29 -05:00
|
|
|
* buffer containing pixel data.
|
2008-10-30 13:25:00 -04:00
|
|
|
*
|
2011-11-22 07:06:40 -05:00
|
|
|
* <note>The region set can't be larger than the source @data</note>
|
|
|
|
*
|
2009-11-19 08:55:10 -05:00
|
|
|
* Return value: %TRUE if the subregion upload was successful, and
|
|
|
|
* %FALSE otherwise
|
2008-10-30 13:25:00 -04:00
|
|
|
*/
|
cogl: improves header and coding style consistency
We've had complaints that our Cogl code/headers are a bit "special" so
this is a first pass at tidying things up by giving them some
consistency. These changes are all consistent with how new code in Cogl
is being written, but the style isn't consistently applied across all
code yet.
There are two parts to this patch; but since each one required a large
amount of effort to maintain tidy indenting it made sense to combine the
changes to reduce the time spent re indenting the same lines.
The first change is to use a consistent style for declaring function
prototypes in headers. Cogl headers now consistently use this style for
prototypes:
return_type
cogl_function_name (CoglType arg0,
CoglType arg1);
Not everyone likes this style, but it seems that most of the currently
active Cogl developers agree on it.
The second change is to constrain the use of redundant glib data types
in Cogl. Uses of gint, guint, gfloat, glong, gulong and gchar have all
been replaced with int, unsigned int, float, long, unsigned long and char
respectively. When talking about pixel data; use of guchar has been
replaced with guint8, otherwise unsigned char can be used.
The glib types that we continue to use for portability are gboolean,
gint{8,16,32,64}, guint{8,16,32,64} and gsize.
The general intention is that Cogl should look palatable to the widest
range of C programmers including those outside the Gnome community so
- especially for the public API - we want to minimize the number of
foreign looking typedefs.
2010-02-09 20:57:32 -05:00
|
|
|
gboolean
|
2011-08-24 16:30:34 -04:00
|
|
|
cogl_texture_set_region (CoglTexture *texture,
|
cogl: improves header and coding style consistency
We've had complaints that our Cogl code/headers are a bit "special" so
this is a first pass at tidying things up by giving them some
consistency. These changes are all consistent with how new code in Cogl
is being written, but the style isn't consistently applied across all
code yet.
There are two parts to this patch; but since each one required a large
amount of effort to maintain tidy indenting it made sense to combine the
changes to reduce the time spent re indenting the same lines.
The first change is to use a consistent style for declaring function
prototypes in headers. Cogl headers now consistently use this style for
prototypes:
return_type
cogl_function_name (CoglType arg0,
CoglType arg1);
Not everyone likes this style, but it seems that most of the currently
active Cogl developers agree on it.
The second change is to constrain the use of redundant glib data types
in Cogl. Uses of gint, guint, gfloat, glong, gulong and gchar have all
been replaced with int, unsigned int, float, long, unsigned long and char
respectively. When talking about pixel data; use of guchar has been
replaced with guint8, otherwise unsigned char can be used.
The glib types that we continue to use for portability are gboolean,
gint{8,16,32,64}, guint{8,16,32,64} and gsize.
The general intention is that Cogl should look palatable to the widest
range of C programmers including those outside the Gnome community so
- especially for the public API - we want to minimize the number of
foreign looking typedefs.
2010-02-09 20:57:32 -05:00
|
|
|
int src_x,
|
|
|
|
int src_y,
|
|
|
|
int dst_x,
|
|
|
|
int dst_y,
|
|
|
|
unsigned int dst_width,
|
|
|
|
unsigned int dst_height,
|
|
|
|
int width,
|
|
|
|
int height,
|
|
|
|
CoglPixelFormat format,
|
|
|
|
unsigned int rowstride,
|
|
|
|
const guint8 *data);
|
2008-10-30 13:25:00 -04:00
|
|
|
|
2011-07-25 17:14:08 -04:00
|
|
|
#if defined (COGL_ENABLE_EXPERIMENTAL_API)
|
|
|
|
|
|
|
|
#define cogl_texture_set_region_from_bitmap \
|
|
|
|
cogl_texture_set_region_from_bitmap_EXP
|
|
|
|
/**
|
|
|
|
* cogl_texture_set_region_from_bitmap:
|
2011-08-24 16:30:34 -04:00
|
|
|
* @texture a #CoglTexture pointer
|
2011-07-25 17:14:08 -04:00
|
|
|
* @src_x: upper left coordinate to use from the source bitmap.
|
|
|
|
* @src_y: upper left coordinate to use from the source bitmap
|
|
|
|
* @dst_x: upper left destination horizontal coordinate.
|
|
|
|
* @dst_y: upper left destination vertical coordinate.
|
2011-11-22 07:06:40 -05:00
|
|
|
* @dst_width: width of destination region to write. (Must be less
|
|
|
|
* than or equal to the bitmap width)
|
|
|
|
* @dst_height: height of destination region to write. (Must be less
|
|
|
|
* than or equal to the bitmap height)
|
2011-07-25 17:14:08 -04:00
|
|
|
* @bitmap: The source bitmap to read from
|
|
|
|
*
|
|
|
|
* Copies a specified source region from @bitmap to the position
|
|
|
|
* (@src_x, @src_y) of the given destination texture @handle.
|
|
|
|
*
|
2011-11-22 07:06:40 -05:00
|
|
|
* <note>The region updated can't be larger than the source
|
|
|
|
* bitmap</note>
|
|
|
|
*
|
2011-07-25 17:14:08 -04:00
|
|
|
* Return value: %TRUE if the subregion upload was successful, and
|
|
|
|
* %FALSE otherwise
|
|
|
|
*
|
|
|
|
* Since: 1.8
|
|
|
|
* Stability: unstable
|
|
|
|
*/
|
|
|
|
gboolean
|
2011-08-24 16:30:34 -04:00
|
|
|
cogl_texture_set_region_from_bitmap (CoglTexture *texture,
|
2011-07-25 17:14:08 -04:00
|
|
|
int src_x,
|
|
|
|
int src_y,
|
|
|
|
int dst_x,
|
|
|
|
int dst_y,
|
|
|
|
unsigned int dst_width,
|
|
|
|
unsigned int dst_height,
|
|
|
|
CoglBitmap *bitmap);
|
|
|
|
#endif
|
|
|
|
|
2009-11-27 11:39:16 -05:00
|
|
|
/**
|
|
|
|
* cogl_texture_new_from_sub_texture:
|
2011-08-24 16:30:34 -04:00
|
|
|
* @full_texture: a #CoglTexture pointer
|
2010-01-18 04:22:04 -05:00
|
|
|
* @sub_x: X coordinate of the top-left of the subregion
|
|
|
|
* @sub_y: Y coordinate of the top-left of the subregion
|
|
|
|
* @sub_width: Width in pixels of the subregion
|
|
|
|
* @sub_height: Height in pixels of the subregion
|
2009-11-27 11:39:16 -05:00
|
|
|
*
|
|
|
|
* Creates a new texture which represents a subregion of another
|
|
|
|
* texture. The GL resources will be shared so that no new texture
|
|
|
|
* data is actually allocated.
|
|
|
|
*
|
2010-01-18 04:22:04 -05:00
|
|
|
* Sub textures have undefined behaviour texture coordinates outside
|
|
|
|
* of the range [0,1] are used. They also do not work with
|
|
|
|
* CoglVertexBuffers.
|
2009-11-27 11:39:16 -05:00
|
|
|
*
|
2010-02-12 05:08:51 -05:00
|
|
|
* The sub texture will keep a reference to the full texture so you do
|
|
|
|
* not need to keep one separately if you only want to use the sub
|
|
|
|
* texture.
|
|
|
|
*
|
2011-08-24 16:30:34 -04:00
|
|
|
* Return value: A newly created #CoglTexture or %NULL on failure
|
2009-11-27 11:39:16 -05:00
|
|
|
* Since: 1.2
|
|
|
|
*/
|
2011-08-24 16:30:34 -04:00
|
|
|
CoglTexture *
|
|
|
|
cogl_texture_new_from_sub_texture (CoglTexture *full_texture,
|
|
|
|
int sub_x,
|
|
|
|
int sub_y,
|
|
|
|
int sub_width,
|
|
|
|
int sub_height);
|
2009-11-27 11:39:16 -05:00
|
|
|
|
2009-11-19 08:55:10 -05:00
|
|
|
#ifndef COGL_DISABLE_DEPRECATED
|
|
|
|
|
2008-10-30 13:25:00 -04:00
|
|
|
/**
|
|
|
|
* cogl_texture_ref:
|
2011-08-24 16:30:34 -04:00
|
|
|
* @texture: a #CoglTexture.
|
2008-10-30 13:25:00 -04:00
|
|
|
*
|
|
|
|
* Increment the reference count for a cogl texture.
|
|
|
|
*
|
2011-08-24 16:30:34 -04:00
|
|
|
* Deprecated: 1.2: Use cogl_object_ref() instead
|
2009-11-19 08:55:10 -05:00
|
|
|
*
|
2011-08-24 16:30:34 -04:00
|
|
|
* Return value: the @texture pointer.
|
2008-10-30 13:25:00 -04:00
|
|
|
*/
|
2011-08-24 16:30:34 -04:00
|
|
|
void *
|
|
|
|
cogl_texture_ref (void *texture) G_GNUC_DEPRECATED;
|
2008-10-30 13:25:00 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_texture_unref:
|
2011-08-24 16:30:34 -04:00
|
|
|
* @texture: a #CoglTexture.
|
2008-10-30 13:25:00 -04:00
|
|
|
*
|
2009-11-19 08:55:10 -05:00
|
|
|
* Decrement the reference count for a cogl texture.
|
|
|
|
*
|
2011-08-24 16:30:34 -04:00
|
|
|
* Deprecated: 1.2: Use cogl_object_unref() instead
|
2008-10-30 13:25:00 -04:00
|
|
|
*/
|
cogl: improves header and coding style consistency
We've had complaints that our Cogl code/headers are a bit "special" so
this is a first pass at tidying things up by giving them some
consistency. These changes are all consistent with how new code in Cogl
is being written, but the style isn't consistently applied across all
code yet.
There are two parts to this patch; but since each one required a large
amount of effort to maintain tidy indenting it made sense to combine the
changes to reduce the time spent re indenting the same lines.
The first change is to use a consistent style for declaring function
prototypes in headers. Cogl headers now consistently use this style for
prototypes:
return_type
cogl_function_name (CoglType arg0,
CoglType arg1);
Not everyone likes this style, but it seems that most of the currently
active Cogl developers agree on it.
The second change is to constrain the use of redundant glib data types
in Cogl. Uses of gint, guint, gfloat, glong, gulong and gchar have all
been replaced with int, unsigned int, float, long, unsigned long and char
respectively. When talking about pixel data; use of guchar has been
replaced with guint8, otherwise unsigned char can be used.
The glib types that we continue to use for portability are gboolean,
gint{8,16,32,64}, guint{8,16,32,64} and gsize.
The general intention is that Cogl should look palatable to the widest
range of C programmers including those outside the Gnome community so
- especially for the public API - we want to minimize the number of
foreign looking typedefs.
2010-02-09 20:57:32 -05:00
|
|
|
void
|
2011-08-24 16:30:34 -04:00
|
|
|
cogl_texture_unref (void *texture) G_GNUC_DEPRECATED;
|
2008-10-30 13:25:00 -04:00
|
|
|
|
2009-11-19 08:55:10 -05:00
|
|
|
#endif /* COGL_DISABLE_DEPRECATED */
|
|
|
|
|
2008-10-30 13:25:00 -04:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __COGL_TEXTURE_H__ */
|