[cogl] Tweak documentation for the CoglTexture interface
- From: Neil Roberts <nroberts src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl] Tweak documentation for the CoglTexture interface
- Date: Mon, 20 Jan 2014 14:32:21 +0000 (UTC)
commit 2f12c4329c519fa14b927b2dcd708dddcc903c32
Author: Neil Roberts <neil linux intel com>
Date: Wed Jan 15 16:43:55 2014 +0000
Tweak documentation for the CoglTexture interface
The following changes are made to the documentation for CoglTexture:
• The description of the default value for the components property is
changed to say that it is always RGBA for textures created by the
‘_with_size’ textures. Previously it said that the default is based
on the pixel format used the first time data is set on the texture,
but this is only true if the data is set using a constructor.
• Added documentation for the CoglTextureComponents enum.
• Changed it to say that it _specifies_ what components are required
for sampling rather than determinging [sic] them.
• Added ‘Since: 1.18’ to
cogl_texture_{set,get}_{components,premultiplied}
• Changed the since tag for CoglTextureError from 2.0 to 1.8.
• Added documentation for COGL_TEXTURE_ERROR_{FORMAT,TYPE}.
• Added the following to the cogl2-sections.txt file:
COGL_TEXTURE_ERROR
CoglTextureError
cogl_texture_allocate
cogl_texture_set_components
cogl_texture_get_components
cogl_texture_set_premultiplied
cogl_texture_get_premultiplied
Reviewed-by: Robert Bragg <robert linux intel com>
cogl/cogl-texture.h | 45 ++++++++++++++++++++++++--------
doc/reference/cogl2/cogl2-sections.txt | 10 +++++++
2 files changed, 44 insertions(+), 11 deletions(-)
---
diff --git a/cogl/cogl-texture.h b/cogl/cogl-texture.h
index b77cf9b..5c2613e 100644
--- a/cogl/cogl-texture.h
+++ b/cogl/cogl-texture.h
@@ -76,7 +76,7 @@ COGL_BEGIN_DECLS
*
* #CoglError domain for texture errors.
*
- * Since: 2.0
+ * Since: 1.8
* Stability: Unstable
*/
#define COGL_TEXTURE_ERROR (cogl_texture_error_domain ())
@@ -85,10 +85,13 @@ COGL_BEGIN_DECLS
/**
* CoglTextureError:
* @COGL_TEXTURE_ERROR_SIZE: Unsupported size
+ * @COGL_TEXTURE_ERROR_FORMAT: Unsupported format
+ * @COGL_TEXTURE_ERROR_TYPE: A primitive texture type that is
+ * unsupported by the driver was used
*
* Error codes that can be thrown when allocating textures.
*
- * Since: 2.0
+ * Since: 1.8
* Stability: Unstable
*/
typedef enum {
@@ -130,6 +133,17 @@ uint32_t cogl_texture_error_domain (void);
CoglBool
cogl_is_texture (void *object);
+/**
+ * CoglTextureComponents:
+ * @COGL_TEXTURE_COMPONENTS_A: Only the alpha component
+ * @COGL_TEXTURE_COMPONENTS_RGB: Red, green and blue components
+ * @COGL_TEXTURE_COMPONENTS_RGBA: Red, green, blue and alpha components
+ * @COGL_TEXTURE_COMPONENTS_DEPTH: Only a depth component
+ *
+ * See cogl_texture_set_components().
+ *
+ * Since: 1.18
+ */
typedef enum _CoglTextureComponents
{
COGL_TEXTURE_COMPONENTS_A = 1,
@@ -142,15 +156,18 @@ typedef enum _CoglTextureComponents
* cogl_texture_set_components:
* @texture: a #CoglTexture pointer.
*
- * Affects the internal storage format for this texture by
- * determinging what components will be required for sampling later.
+ * Affects the internal storage format for this texture by specifying
+ * what components will be required for sampling later.
*
* This api affects how data is uploaded to the GPU since unused
* components can potentially be discarded from source data.
*
- * By default the required components are automatically determined
- * using the format of the source data that is first uploaded to
- * the given @texture.
+ * For textures created by the ‘_with_size’ constructors the default
+ * is %COGL_TEXTURE_COMPONENTS_RGBA. The other constructors which take
+ * a %CoglBitmap or a data pointer default to the same components as
+ * the pixel format of the data.
+ *
+ * Since: 1.18
*/
void
cogl_texture_set_components (CoglTexture *texture,
@@ -163,9 +180,12 @@ cogl_texture_set_components (CoglTexture *texture,
* Queries what components the given @texture stores internally as set
* via cogl_texture_set_components().
*
- * By default the required components are automatically determined
- * using the format of the source data that is first uploaded to
- * the given @texture.
+ * For textures created by the ‘_with_size’ constructors the default
+ * is %COGL_TEXTURE_COMPONENTS_RGBA. The other constructors which take
+ * a %CoglBitmap or a data pointer default to the same components as
+ * the pixel format of the data.
+ *
+ * Since: 1.18
*/
CoglTextureComponents
cogl_texture_get_components (CoglTexture *texture);
@@ -177,7 +197,7 @@ cogl_texture_get_components (CoglTexture *texture);
* components are pre-multiplied by an alpha
* component.
*
- * Affects the internal storage format for this texture by determining
+ * Affects the internal storage format for this texture by specifying
* whether red, green and blue color components should be stored as
* pre-multiplied alpha values.
*
@@ -198,6 +218,8 @@ cogl_texture_get_components (CoglTexture *texture);
* converted.
*
* By default the @premultipled state is @TRUE.
+ *
+ * Since: 1.18
*/
void
cogl_texture_set_premultiplied (CoglTexture *texture,
@@ -216,6 +238,7 @@ cogl_texture_set_premultiplied (CoglTexture *texture,
* Return value: %TRUE if red, green and blue components are
* internally stored pre-multiplied by the alpha
* value or %FALSE if not.
+ * Since: 1.18
*/
CoglBool
cogl_texture_get_premultiplied (CoglTexture *texture);
diff --git a/doc/reference/cogl2/cogl2-sections.txt b/doc/reference/cogl2/cogl2-sections.txt
index b12e89a..7cd53d0 100644
--- a/doc/reference/cogl2/cogl2-sections.txt
+++ b/doc/reference/cogl2/cogl2-sections.txt
@@ -336,6 +336,11 @@ CoglTexture
cogl_is_texture
<SUBSECTION>
+COGL_TEXTURE_ERROR
+CoglTextureError
+
+<SUBSECTION>
+cogl_texture_allocate
cogl_texture_get_width
cogl_texture_get_height
cogl_texture_is_sliced
@@ -343,6 +348,11 @@ cogl_texture_get_data
cogl_texture_set_data
cogl_texture_set_region
CoglTextureType
+CoglTextureComponents
+cogl_texture_set_components
+cogl_texture_get_components
+cogl_texture_set_premultiplied
+cogl_texture_get_premultiplied
<SUBSECTION Private>
COGL_TEXTURE_MAX_WASTE
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]