2009-04-27 14:48:12 +00:00
|
|
|
/*
|
|
|
|
* Cogl
|
2008-10-30 17:57:41 +00:00
|
|
|
*
|
2009-04-27 14:48:12 +00:00
|
|
|
* An object oriented GL/GLES Abstraction/Utility Layer
|
|
|
|
*
|
|
|
|
* Copyright (C) 2008,2009 Intel Corporation.
|
2008-10-30 17:57:41 +00: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 12:56:10 +00:00
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*
|
2008-10-30 17:57:41 +00:00
|
|
|
*/
|
|
|
|
|
2010-02-09 14:41:37 +00:00
|
|
|
/**
|
|
|
|
* SECTION:cogl-color
|
|
|
|
* @short_description: A generic color definition
|
|
|
|
*
|
|
|
|
* #CoglColor is a simple structure holding the definition of a color such
|
|
|
|
* that it can be efficiently used by GL
|
|
|
|
*
|
|
|
|
* Since: 1.0
|
|
|
|
*/
|
|
|
|
|
2008-10-30 17:04:34 +00:00
|
|
|
#if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
|
|
|
#error "Only <cogl/cogl.h> can be included directly."
|
|
|
|
#endif
|
|
|
|
|
2008-10-30 16:50:07 +00:00
|
|
|
#ifndef __COGL_COLOR_H__
|
|
|
|
#define __COGL_COLOR_H__
|
|
|
|
|
2008-10-30 17:25:00 +00:00
|
|
|
#include <cogl/cogl-types.h>
|
2008-10-30 16:50:07 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2010-02-09 14:41:37 +00:00
|
|
|
/**
|
|
|
|
* cogl_color_new:
|
|
|
|
*
|
|
|
|
* Creates a new (empty) color
|
|
|
|
*
|
|
|
|
* Return value: a newly-allocated #CoglColor. Use cogl_color_free()
|
|
|
|
* to free the allocated resources
|
|
|
|
*
|
|
|
|
* Since: 1.0
|
|
|
|
*/
|
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-10 01:57:32 +00:00
|
|
|
CoglColor *
|
|
|
|
cogl_color_new (void);
|
2010-02-09 14:41:37 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_color_copy:
|
|
|
|
* @color: the color to copy
|
|
|
|
*
|
|
|
|
* Creates a copy of @color
|
|
|
|
*
|
|
|
|
* Return value: a newly-allocated #CoglColor. Use cogl_color_free()
|
|
|
|
* to free the allocate resources
|
|
|
|
*
|
|
|
|
* Since: 1.0
|
|
|
|
*/
|
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-10 01:57:32 +00:00
|
|
|
CoglColor *
|
|
|
|
cogl_color_copy (const CoglColor *color);
|
2010-02-09 14:41:37 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_color_free:
|
|
|
|
* @color: the color to free
|
|
|
|
*
|
|
|
|
* Frees the resources allocated by cogl_color_new() and cogl_color_copy()
|
|
|
|
*
|
|
|
|
* Since: 1.0
|
|
|
|
*/
|
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-10 01:57:32 +00:00
|
|
|
void
|
|
|
|
cogl_color_free (CoglColor *color);
|
2008-11-12 13:57:58 +00:00
|
|
|
|
2010-06-10 13:17:42 +00:00
|
|
|
/**
|
|
|
|
* cogl_color_init_from_4ub:
|
|
|
|
* @color: A pointer to a #CoglColor to initialize
|
|
|
|
* @red: value of the red channel, between 0 and 255
|
|
|
|
* @green: value of the green channel, between 0 and 255
|
|
|
|
* @blue: value of the blue channel, between 0 and 255
|
|
|
|
* @alpha: value of the alpha channel, between 0 and 255
|
|
|
|
*
|
|
|
|
* Sets the values of the passed channels into a #CoglColor.
|
|
|
|
*
|
|
|
|
* Since: 1.4
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
cogl_color_init_from_4ub (CoglColor *color,
|
Switch use of primitive glib types to c99 equivalents
The coding style has for a long time said to avoid using redundant glib
data types such as gint or gchar etc because we feel that they make the
code look unnecessarily foreign to developers coming from outside of the
Gnome developer community.
Note: When we tried to find the historical rationale for the types we
just found that they were apparently only added for consistent syntax
highlighting which didn't seem that compelling.
Up until now we have been continuing to use some of the platform
specific type such as gint{8,16,32,64} and gsize but this patch switches
us over to using the standard c99 equivalents instead so we can further
ensure that our code looks familiar to the widest range of C developers
who might potentially contribute to Cogl.
So instead of using the gint{8,16,32,64} and guint{8,16,32,64} types this
switches all Cogl code to instead use the int{8,16,32,64}_t and
uint{8,16,32,64}_t c99 types instead.
Instead of gsize we now use size_t
For now we are not going to use the c99 _Bool type and instead we have
introduced a new CoglBool type to use instead of gboolean.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit 5967dad2400d32ca6319cef6cb572e81bf2c15f0)
2012-04-16 20:56:40 +00:00
|
|
|
uint8_t red,
|
|
|
|
uint8_t green,
|
|
|
|
uint8_t blue,
|
|
|
|
uint8_t alpha);
|
2010-06-10 13:17:42 +00:00
|
|
|
|
2008-10-30 16:50:07 +00:00
|
|
|
/**
|
|
|
|
* cogl_color_set_from_4ub:
|
2010-06-10 13:17:42 +00:00
|
|
|
* @color: A pointer to a #CoglColor to initialize
|
2008-10-30 16:50:07 +00:00
|
|
|
* @red: value of the red channel, between 0 and 255
|
|
|
|
* @green: value of the green channel, between 0 and 255
|
|
|
|
* @blue: value of the blue channel, between 0 and 255
|
|
|
|
* @alpha: value of the alpha channel, between 0 and 255
|
|
|
|
*
|
2008-11-12 13:57:58 +00:00
|
|
|
* Sets the values of the passed channels into a #CoglColor.
|
2008-10-30 16:50:07 +00:00
|
|
|
*
|
|
|
|
* Since: 1.0
|
2010-06-10 13:17:42 +00:00
|
|
|
* Deprecated: 1.4: Use cogl_color_init_from_4ub instead.
|
2008-10-30 16:50:07 +00: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-10 01:57:32 +00:00
|
|
|
void
|
2010-06-10 13:17:42 +00:00
|
|
|
cogl_color_set_from_4ub (CoglColor *color,
|
Switch use of primitive glib types to c99 equivalents
The coding style has for a long time said to avoid using redundant glib
data types such as gint or gchar etc because we feel that they make the
code look unnecessarily foreign to developers coming from outside of the
Gnome developer community.
Note: When we tried to find the historical rationale for the types we
just found that they were apparently only added for consistent syntax
highlighting which didn't seem that compelling.
Up until now we have been continuing to use some of the platform
specific type such as gint{8,16,32,64} and gsize but this patch switches
us over to using the standard c99 equivalents instead so we can further
ensure that our code looks familiar to the widest range of C developers
who might potentially contribute to Cogl.
So instead of using the gint{8,16,32,64} and guint{8,16,32,64} types this
switches all Cogl code to instead use the int{8,16,32,64}_t and
uint{8,16,32,64}_t c99 types instead.
Instead of gsize we now use size_t
For now we are not going to use the c99 _Bool type and instead we have
introduced a new CoglBool type to use instead of gboolean.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit 5967dad2400d32ca6319cef6cb572e81bf2c15f0)
2012-04-16 20:56:40 +00:00
|
|
|
uint8_t red,
|
|
|
|
uint8_t green,
|
|
|
|
uint8_t blue,
|
|
|
|
uint8_t alpha);
|
2008-10-30 16:50:07 +00:00
|
|
|
|
2010-06-10 13:17:42 +00:00
|
|
|
/**
|
|
|
|
* cogl_color_init_from_4f:
|
|
|
|
* @color: A pointer to a #CoglColor to initialize
|
|
|
|
* @red: value of the red channel, between 0 and %1.0
|
|
|
|
* @green: value of the green channel, between 0 and %1.0
|
|
|
|
* @blue: value of the blue channel, between 0 and %1.0
|
|
|
|
* @alpha: value of the alpha channel, between 0 and %1.0
|
|
|
|
*
|
|
|
|
* Sets the values of the passed channels into a #CoglColor
|
|
|
|
*
|
|
|
|
* Since: 1.4
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
cogl_color_init_from_4f (CoglColor *color,
|
|
|
|
float red,
|
|
|
|
float green,
|
|
|
|
float blue,
|
|
|
|
float alpha);
|
|
|
|
|
2008-11-12 13:57:58 +00:00
|
|
|
/**
|
2009-01-20 16:20:54 +00:00
|
|
|
* cogl_color_set_from_4f:
|
2010-06-10 13:17:42 +00:00
|
|
|
* @color: A pointer to a #CoglColor to initialize
|
2009-01-20 16:20:54 +00:00
|
|
|
* @red: value of the red channel, between 0 and %1.0
|
|
|
|
* @green: value of the green channel, between 0 and %1.0
|
|
|
|
* @blue: value of the blue channel, between 0 and %1.0
|
|
|
|
* @alpha: value of the alpha channel, between 0 and %1.0
|
2008-11-12 13:57:58 +00:00
|
|
|
*
|
|
|
|
* Sets the values of the passed channels into a #CoglColor
|
|
|
|
*
|
|
|
|
* Since: 1.0
|
2010-06-10 13:17:42 +00:00
|
|
|
* Deprecated: 1.4: Use cogl_color_init_from_4f instead.
|
2008-11-12 13:57:58 +00: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-10 01:57:32 +00:00
|
|
|
void
|
2010-06-10 13:17:42 +00:00
|
|
|
cogl_color_set_from_4f (CoglColor *color,
|
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-10 01:57:32 +00:00
|
|
|
float red,
|
|
|
|
float green,
|
|
|
|
float blue,
|
|
|
|
float alpha);
|
2008-11-12 13:57:58 +00:00
|
|
|
|
2010-06-10 13:17:42 +00:00
|
|
|
/**
|
|
|
|
* cogl_color_init_from_4fv:
|
|
|
|
* @color: A pointer to a #CoglColor to initialize
|
|
|
|
* @color_array: a pointer to an array of 4 float color components
|
|
|
|
*
|
|
|
|
* Sets the values of the passed channels into a #CoglColor
|
|
|
|
*
|
|
|
|
* Since: 1.4
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
cogl_color_init_from_4fv (CoglColor *color,
|
|
|
|
float *color_array);
|
|
|
|
|
2008-10-30 16:50:07 +00:00
|
|
|
/**
|
|
|
|
* cogl_color_get_red_byte:
|
|
|
|
* @color: a #CoglColor
|
|
|
|
*
|
|
|
|
* Retrieves the red channel of @color as a byte value
|
|
|
|
* between 0 and 255
|
|
|
|
*
|
|
|
|
* Return value: the red channel of the passed color
|
|
|
|
*
|
|
|
|
* Since: 1.0
|
|
|
|
*/
|
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-10 01:57:32 +00:00
|
|
|
unsigned char
|
|
|
|
cogl_color_get_red_byte (const CoglColor *color);
|
2008-10-30 16:50:07 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_color_get_green_byte:
|
|
|
|
* @color: a #CoglColor
|
|
|
|
*
|
|
|
|
* Retrieves the green channel of @color as a byte value
|
|
|
|
* between 0 and 255
|
|
|
|
*
|
|
|
|
* Return value: the green channel of the passed color
|
|
|
|
*
|
|
|
|
* Since: 1.0
|
|
|
|
*/
|
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-10 01:57:32 +00:00
|
|
|
unsigned char
|
|
|
|
cogl_color_get_green_byte (const CoglColor *color);
|
2008-10-30 16:50:07 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_color_get_blue_byte:
|
|
|
|
* @color: a #CoglColor
|
|
|
|
*
|
|
|
|
* Retrieves the blue channel of @color as a byte value
|
|
|
|
* between 0 and 255
|
|
|
|
*
|
|
|
|
* Return value: the blue channel of the passed color
|
|
|
|
*
|
|
|
|
* Since: 1.0
|
|
|
|
*/
|
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-10 01:57:32 +00:00
|
|
|
unsigned char
|
|
|
|
cogl_color_get_blue_byte (const CoglColor *color);
|
2008-10-30 16:50:07 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_color_get_alpha_byte:
|
|
|
|
* @color: a #CoglColor
|
|
|
|
*
|
|
|
|
* Retrieves the alpha channel of @color as a byte value
|
|
|
|
* between 0 and 255
|
|
|
|
*
|
|
|
|
* Return value: the alpha channel of the passed color
|
|
|
|
*
|
|
|
|
* Since: 1.0
|
|
|
|
*/
|
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-10 01:57:32 +00:00
|
|
|
unsigned char
|
|
|
|
cogl_color_get_alpha_byte (const CoglColor *color);
|
2008-10-30 16:50:07 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_color_get_red_float:
|
|
|
|
* @color: a #CoglColor
|
|
|
|
*
|
|
|
|
* Retrieves the red channel of @color as a floating point
|
|
|
|
* value between 0.0 and 1.0
|
|
|
|
*
|
|
|
|
* Return value: the red channel of the passed color
|
|
|
|
*
|
|
|
|
* Since: 1.0
|
|
|
|
*/
|
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-10 01:57:32 +00:00
|
|
|
float
|
|
|
|
cogl_color_get_red_float (const CoglColor *color);
|
2008-10-30 16:50:07 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_color_get_green_float:
|
|
|
|
* @color: a #CoglColor
|
|
|
|
*
|
|
|
|
* Retrieves the green channel of @color as a floating point
|
|
|
|
* value between 0.0 and 1.0
|
|
|
|
*
|
|
|
|
* Return value: the green channel of the passed color
|
|
|
|
*
|
|
|
|
* Since: 1.0
|
|
|
|
*/
|
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-10 01:57:32 +00:00
|
|
|
float
|
|
|
|
cogl_color_get_green_float (const CoglColor *color);
|
2008-10-30 16:50:07 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_color_get_blue_float:
|
|
|
|
* @color: a #CoglColor
|
|
|
|
*
|
|
|
|
* Retrieves the blue channel of @color as a floating point
|
|
|
|
* value between 0.0 and 1.0
|
|
|
|
*
|
|
|
|
* Return value: the blue channel of the passed color
|
|
|
|
*
|
|
|
|
* Since: 1.0
|
|
|
|
*/
|
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-10 01:57:32 +00:00
|
|
|
float
|
|
|
|
cogl_color_get_blue_float (const CoglColor *color);
|
2008-10-30 16:50:07 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_color_get_alpha_float:
|
|
|
|
* @color: a #CoglColor
|
|
|
|
*
|
|
|
|
* Retrieves the alpha channel of @color as a floating point
|
|
|
|
* value between 0.0 and 1.0
|
|
|
|
*
|
|
|
|
* Return value: the alpha channel of the passed color
|
|
|
|
*
|
|
|
|
* Since: 1.0
|
|
|
|
*/
|
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-10 01:57:32 +00:00
|
|
|
float
|
|
|
|
cogl_color_get_alpha_float (const CoglColor *color);
|
2008-10-30 16:50:07 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_color_get_red:
|
|
|
|
* @color: a #CoglColor
|
|
|
|
*
|
|
|
|
* Retrieves the red channel of @color as a fixed point
|
2009-01-20 16:20:54 +00:00
|
|
|
* value between 0 and %1.0.
|
2008-10-30 16:50:07 +00:00
|
|
|
*
|
|
|
|
* Return value: the red channel of the passed color
|
|
|
|
*
|
|
|
|
* Since: 1.0
|
|
|
|
*/
|
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-10 01:57:32 +00:00
|
|
|
float
|
|
|
|
cogl_color_get_red (const CoglColor *color);
|
2008-10-30 16:50:07 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_color_get_green:
|
|
|
|
* @color: a #CoglColor
|
|
|
|
*
|
|
|
|
* Retrieves the green channel of @color as a fixed point
|
2009-01-20 16:20:54 +00:00
|
|
|
* value between 0 and %1.0.
|
2008-10-30 16:50:07 +00:00
|
|
|
*
|
|
|
|
* Return value: the green channel of the passed color
|
|
|
|
*
|
|
|
|
* Since: 1.0
|
|
|
|
*/
|
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-10 01:57:32 +00:00
|
|
|
float
|
|
|
|
cogl_color_get_green (const CoglColor *color);
|
2008-10-30 16:50:07 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_color_get_blue:
|
|
|
|
* @color: a #CoglColor
|
|
|
|
*
|
|
|
|
* Retrieves the blue channel of @color as a fixed point
|
2009-01-20 16:20:54 +00:00
|
|
|
* value between 0 and %1.0.
|
2008-10-30 16:50:07 +00:00
|
|
|
*
|
|
|
|
* Return value: the blue channel of the passed color
|
|
|
|
*
|
|
|
|
* Since: 1.0
|
|
|
|
*/
|
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-10 01:57:32 +00:00
|
|
|
float
|
|
|
|
cogl_color_get_blue (const CoglColor *color);
|
2008-10-30 16:50:07 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_color_get_alpha:
|
|
|
|
* @color: a #CoglColor
|
|
|
|
*
|
|
|
|
* Retrieves the alpha channel of @color as a fixed point
|
2009-01-20 16:20:54 +00:00
|
|
|
* value between 0 and %1.0.
|
2008-10-30 16:50:07 +00:00
|
|
|
*
|
|
|
|
* Return value: the alpha channel of the passed color
|
|
|
|
*
|
|
|
|
* Since: 1.0
|
|
|
|
*/
|
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-10 01:57:32 +00:00
|
|
|
float
|
|
|
|
cogl_color_get_alpha (const CoglColor *color);
|
2008-10-30 16:50:07 +00:00
|
|
|
|
2010-06-06 22:03:26 +00:00
|
|
|
/**
|
|
|
|
* cogl_color_set_red_byte:
|
|
|
|
* @color: a #CoglColor
|
|
|
|
* @red: a byte value between 0 and 255
|
|
|
|
*
|
|
|
|
* Sets the red channel of @color to @red.
|
|
|
|
*
|
|
|
|
* Since: 1.4
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
cogl_color_set_red_byte (CoglColor *color,
|
|
|
|
unsigned char red);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_color_set_green_byte:
|
|
|
|
* @color: a #CoglColor
|
|
|
|
* @green: a byte value between 0 and 255
|
|
|
|
*
|
|
|
|
* Sets the green channel of @color to @green.
|
|
|
|
*
|
|
|
|
* Since: 1.4
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
cogl_color_set_green_byte (CoglColor *color,
|
|
|
|
unsigned char green);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_color_set_blue_byte:
|
|
|
|
* @color: a #CoglColor
|
|
|
|
* @blue: a byte value between 0 and 255
|
|
|
|
*
|
|
|
|
* Sets the blue channel of @color to @blue.
|
|
|
|
*
|
|
|
|
* Since: 1.4
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
cogl_color_set_blue_byte (CoglColor *color,
|
|
|
|
unsigned char blue);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_color_set_alpha_byte:
|
|
|
|
* @color: a #CoglColor
|
|
|
|
* @alpha: a byte value between 0 and 255
|
|
|
|
*
|
|
|
|
* Sets the alpha channel of @color to @alpha.
|
|
|
|
*
|
|
|
|
* Since: 1.4
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
cogl_color_set_alpha_byte (CoglColor *color,
|
|
|
|
unsigned char alpha);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_color_set_red_float:
|
|
|
|
* @color: a #CoglColor
|
|
|
|
* @red: a float value between 0.0f and 1.0f
|
|
|
|
*
|
|
|
|
* Sets the red channel of @color to @red.
|
|
|
|
*
|
|
|
|
* since: 1.4
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
cogl_color_set_red_float (CoglColor *color,
|
|
|
|
float red);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_color_set_green_float:
|
|
|
|
* @color: a #CoglColor
|
|
|
|
* @green: a float value between 0.0f and 1.0f
|
|
|
|
*
|
|
|
|
* Sets the green channel of @color to @green.
|
|
|
|
*
|
|
|
|
* since: 1.4
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
cogl_color_set_green_float (CoglColor *color,
|
|
|
|
float green);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_color_set_blue_float:
|
|
|
|
* @color: a #CoglColor
|
|
|
|
* @blue: a float value between 0.0f and 1.0f
|
|
|
|
*
|
|
|
|
* Sets the blue channel of @color to @blue.
|
|
|
|
*
|
|
|
|
* since: 1.4
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
cogl_color_set_blue_float (CoglColor *color,
|
|
|
|
float blue);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_color_set_alpha_float:
|
|
|
|
* @color: a #CoglColor
|
|
|
|
* @alpha: a float value between 0.0f and 1.0f
|
|
|
|
*
|
|
|
|
* Sets the alpha channel of @color to @alpha.
|
|
|
|
*
|
|
|
|
* since: 1.4
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
cogl_color_set_alpha_float (CoglColor *color,
|
|
|
|
float alpha);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_color_set_red:
|
|
|
|
* @color: a #CoglColor
|
|
|
|
* @red: a float value between 0.0f and 1.0f
|
|
|
|
*
|
|
|
|
* Sets the red channel of @color to @red.
|
|
|
|
*
|
|
|
|
* Since: 1.4
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
cogl_color_set_red (CoglColor *color,
|
|
|
|
float red);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_color_set_green:
|
|
|
|
* @color: a #CoglColor
|
|
|
|
* @green: a float value between 0.0f and 1.0f
|
|
|
|
*
|
|
|
|
* Sets the green channel of @color to @green.
|
|
|
|
*
|
|
|
|
* Since: 1.4
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
cogl_color_set_green (CoglColor *color,
|
Switch use of primitive glib types to c99 equivalents
The coding style has for a long time said to avoid using redundant glib
data types such as gint or gchar etc because we feel that they make the
code look unnecessarily foreign to developers coming from outside of the
Gnome developer community.
Note: When we tried to find the historical rationale for the types we
just found that they were apparently only added for consistent syntax
highlighting which didn't seem that compelling.
Up until now we have been continuing to use some of the platform
specific type such as gint{8,16,32,64} and gsize but this patch switches
us over to using the standard c99 equivalents instead so we can further
ensure that our code looks familiar to the widest range of C developers
who might potentially contribute to Cogl.
So instead of using the gint{8,16,32,64} and guint{8,16,32,64} types this
switches all Cogl code to instead use the int{8,16,32,64}_t and
uint{8,16,32,64}_t c99 types instead.
Instead of gsize we now use size_t
For now we are not going to use the c99 _Bool type and instead we have
introduced a new CoglBool type to use instead of gboolean.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit 5967dad2400d32ca6319cef6cb572e81bf2c15f0)
2012-04-16 20:56:40 +00:00
|
|
|
float green);
|
2010-06-06 22:03:26 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_color_set_blue:
|
|
|
|
* @color: a #CoglColor
|
|
|
|
* @blue: a float value between 0.0f and 1.0f
|
|
|
|
*
|
|
|
|
* Sets the blue channel of @color to @blue.
|
|
|
|
*
|
|
|
|
* Since: 1.4
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
cogl_color_set_blue (CoglColor *color,
|
Switch use of primitive glib types to c99 equivalents
The coding style has for a long time said to avoid using redundant glib
data types such as gint or gchar etc because we feel that they make the
code look unnecessarily foreign to developers coming from outside of the
Gnome developer community.
Note: When we tried to find the historical rationale for the types we
just found that they were apparently only added for consistent syntax
highlighting which didn't seem that compelling.
Up until now we have been continuing to use some of the platform
specific type such as gint{8,16,32,64} and gsize but this patch switches
us over to using the standard c99 equivalents instead so we can further
ensure that our code looks familiar to the widest range of C developers
who might potentially contribute to Cogl.
So instead of using the gint{8,16,32,64} and guint{8,16,32,64} types this
switches all Cogl code to instead use the int{8,16,32,64}_t and
uint{8,16,32,64}_t c99 types instead.
Instead of gsize we now use size_t
For now we are not going to use the c99 _Bool type and instead we have
introduced a new CoglBool type to use instead of gboolean.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit 5967dad2400d32ca6319cef6cb572e81bf2c15f0)
2012-04-16 20:56:40 +00:00
|
|
|
float blue);
|
2010-06-06 22:03:26 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_color_set_alpha:
|
|
|
|
* @color: a #CoglColor
|
|
|
|
* @alpha: a float value between 0.0f and 1.0f
|
|
|
|
*
|
|
|
|
* Sets the alpha channel of @color to @alpha.
|
|
|
|
*
|
|
|
|
* Since: 1.4
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
cogl_color_set_alpha (CoglColor *color,
|
Switch use of primitive glib types to c99 equivalents
The coding style has for a long time said to avoid using redundant glib
data types such as gint or gchar etc because we feel that they make the
code look unnecessarily foreign to developers coming from outside of the
Gnome developer community.
Note: When we tried to find the historical rationale for the types we
just found that they were apparently only added for consistent syntax
highlighting which didn't seem that compelling.
Up until now we have been continuing to use some of the platform
specific type such as gint{8,16,32,64} and gsize but this patch switches
us over to using the standard c99 equivalents instead so we can further
ensure that our code looks familiar to the widest range of C developers
who might potentially contribute to Cogl.
So instead of using the gint{8,16,32,64} and guint{8,16,32,64} types this
switches all Cogl code to instead use the int{8,16,32,64}_t and
uint{8,16,32,64}_t c99 types instead.
Instead of gsize we now use size_t
For now we are not going to use the c99 _Bool type and instead we have
introduced a new CoglBool type to use instead of gboolean.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit 5967dad2400d32ca6319cef6cb572e81bf2c15f0)
2012-04-16 20:56:40 +00:00
|
|
|
float alpha);
|
2010-06-06 22:03:26 +00:00
|
|
|
|
2009-05-09 18:39:01 +00:00
|
|
|
/**
|
|
|
|
* cogl_color_premultiply:
|
|
|
|
* @color: the color to premultiply
|
|
|
|
*
|
|
|
|
* Converts a non-premultiplied color to a pre-multiplied color. For
|
|
|
|
* example, semi-transparent red is (1.0, 0, 0, 0.5) when non-premultiplied
|
|
|
|
* and (0.5, 0, 0, 0.5) when premultiplied.
|
|
|
|
*
|
|
|
|
* Since: 1.0
|
|
|
|
*/
|
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-10 01:57:32 +00:00
|
|
|
void
|
|
|
|
cogl_color_premultiply (CoglColor *color);
|
2009-05-09 18:39:01 +00:00
|
|
|
|
2010-06-06 21:57:02 +00:00
|
|
|
/**
|
|
|
|
* cogl_color_unpremultiply:
|
|
|
|
* @color: the color to unpremultiply
|
|
|
|
*
|
|
|
|
* Converts a pre-multiplied color to a non-premultiplied color. For
|
|
|
|
* example, semi-transparent red is (0.5, 0, 0, 0.5) when premultiplied
|
|
|
|
* and (1.0, 0, 0, 0.5) when non-premultiplied.
|
|
|
|
*
|
|
|
|
* Since: 1.4
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
cogl_color_unpremultiply (CoglColor *color);
|
|
|
|
|
2009-06-05 11:58:31 +00:00
|
|
|
/**
|
|
|
|
* cogl_color_equal:
|
|
|
|
* @v1: a #CoglColor
|
|
|
|
* @v2: a #CoglColor
|
|
|
|
*
|
|
|
|
* Compares two #CoglColor<!-- -->s and checks if they are the same.
|
|
|
|
*
|
|
|
|
* This function can be passed to g_hash_table_new() as the @key_equal_func
|
|
|
|
* parameter, when using #CoglColor<!-- -->s as keys in a #GHashTable.
|
|
|
|
*
|
|
|
|
* Return value: %TRUE if the two colors are the same.
|
|
|
|
*
|
|
|
|
* Since: 1.0
|
|
|
|
*/
|
Switch use of primitive glib types to c99 equivalents
The coding style has for a long time said to avoid using redundant glib
data types such as gint or gchar etc because we feel that they make the
code look unnecessarily foreign to developers coming from outside of the
Gnome developer community.
Note: When we tried to find the historical rationale for the types we
just found that they were apparently only added for consistent syntax
highlighting which didn't seem that compelling.
Up until now we have been continuing to use some of the platform
specific type such as gint{8,16,32,64} and gsize but this patch switches
us over to using the standard c99 equivalents instead so we can further
ensure that our code looks familiar to the widest range of C developers
who might potentially contribute to Cogl.
So instead of using the gint{8,16,32,64} and guint{8,16,32,64} types this
switches all Cogl code to instead use the int{8,16,32,64}_t and
uint{8,16,32,64}_t c99 types instead.
Instead of gsize we now use size_t
For now we are not going to use the c99 _Bool type and instead we have
introduced a new CoglBool type to use instead of gboolean.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit 5967dad2400d32ca6319cef6cb572e81bf2c15f0)
2012-04-16 20:56:40 +00:00
|
|
|
CoglBool
|
|
|
|
cogl_color_equal (const void *v1, const void *v2);
|
2009-06-05 11:58:31 +00:00
|
|
|
|
2008-10-30 16:50:07 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __COGL_COLOR_H__ */
|