Coconut Data Framework  beta
Functions
CNColorTable.h File Reference

Define Color table. More...

#import "CNColor.h"

Go to the source code of this file.

Functions

void CNSetupColorTable (struct CNResource *resource)
 Initialize global color table.
struct CNColorCNAllocateColor (GLfloat r, GLfloat g, GLfloat b, GLfloat a)
 Allocate CNColor object.
static struct CNColorCNBasicIdToColor (CNBasicColorId colorid)
 Get color by basic-color-id.
static GLfloat CNColor16PartToColorPart (unsigned int src)
 Convert part of CNColor16 to CNColor.
static struct CNColorCNColor16ToColor (CNColor16 src)
 Convert CNColor16 to CNColor.

Detailed Description

Define Color table.

Copyright
Copyright (C) 2012 Steel Wheels Project

Function Documentation

void CNSetupColorTable ( struct CNResource *  resource)

Initialize global color table.

Parameters:
resourceResource to allocate the tabl
struct CNColor* CNAllocateColor ( GLfloat  r,
GLfloat  g,
GLfloat  b,
GLfloat  a 
) [read]

Allocate CNColor object.

Returns:
Allocated color
Parameters:
rRed part of color
gGreen part of color
bBlue part of color
aAlpha part of color
Note
All CNColor object must be allocated by this function.

Referenced by CNColor16ToColor().

static struct CNColor* CNBasicIdToColor ( CNBasicColorId  colorid) [static, read]

Get color by basic-color-id.

Returns:
Color
Parameters:
coloridSource basic color id
static GLfloat CNColor16PartToColorPart ( unsigned int  src) [inline, static]

Convert part of CNColor16 to CNColor.

Returns:
CNColor object
Parameters:
srcSource the part of CNColor16 data

Referenced by CNColor16ToColor().

static struct CNColor* CNColor16ToColor ( CNColor16  src) [static, read]

Convert CNColor16 to CNColor.

Returns:
CNColor object
Parameters:
srcSource CNColor16 data

References CNAllocateColor(), and CNColor16PartToColorPart().