RenColorFormat
REN_COLOR_FORMAT_RGB
REN_COLOR_FORMAT_RGBA
REN_COLOR_FORMAT_DEPTH
Represents a color format, with components in a specific order. "R" means red, "G" means green, "B" means blue and "A" means alpha.
RenColor* ren_color_new( |
RenColorFormat format, |
RenType type) ; |
Define a new color. Color data will be internally allocated, in the
format specified by format
and
type
. Any value for format
is valid. Valid values for type
are unsigned
integers up to 32 bit and floating point types.
RenColor* ren_color_ref( |
RenColor* color) ; |
Increases the reference count of the Color instance and then returns it.
void ren_color_unref( |
RenColor* color) ; |
Decreases the reference count of the Color instance. When its reference count drops to 0, it will be destroyed automatically.
void* ren_color_begin_edit( |
RenColor* color) ; |
Get the internal data of the color with the intention of modifying it. This function may lock while some other thread is already using the data.
void ren_color_end_edit( |
RenColor* color) ; |
Mark an end of modifying the internal data. The pointer received with
ren_color_begin_edit
must not be used anymore.
ren_size ren_color_format_sizeof( |
RenColorFormat format, |
RenType type) ; |
Returns in bytes the size of the color format used together with
type
. A Color instance created with this format
will have internal data (as returned with
ren_color_begin_edit
) of this size. The valid
values for format
and type
are the same as in ren_color_new
.