cd-color

cd-color — Color object data functionality

Synopsis

                    CdColorLab;
                    CdColorRGB;
                    CdColorRGB8;
                    CdColorXYZ;
                    CdColorYxy;
void                cd_color_clear_xyz                  (CdColorXYZ *dest);
void                cd_color_convert_rgb8_to_rgb        (const CdColorRGB8 *src,
                                                         CdColorRGB *dest);
void                cd_color_convert_rgb_to_rgb8        (const CdColorRGB *src,
                                                         CdColorRGB8 *dest);
void                cd_color_convert_xyz_to_yxy         (const CdColorXYZ *src,
                                                         CdColorYxy *dest);
void                cd_color_convert_yxy_to_xyz         (const CdColorYxy *src,
                                                         CdColorXYZ *dest);
void                cd_color_copy_rgb                   (const CdColorRGB *src,
                                                         CdColorRGB *dest);
void                cd_color_copy_xyz                   (const CdColorXYZ *src,
                                                         CdColorXYZ *dest);
void                cd_color_copy_yxy                   (const CdColorYxy *src,
                                                         CdColorYxy *dest);
CdColorRGB *        cd_color_rgb_dup                    (const CdColorRGB *src);
#define             cd_color_rgb_free
#define             cd_color_rgb_new
void                cd_color_set_rgb                    (CdColorRGB *dest,
                                                         gdouble R,
                                                         gdouble G,
                                                         gdouble B);
void                cd_color_set_xyz                    (CdColorXYZ *dest,
                                                         gdouble X,
                                                         gdouble Y,
                                                         gdouble Z);
void                cd_color_set_yxy                    (CdColorYxy *dest,
                                                         gdouble Y,
                                                         gdouble x,
                                                         gdouble y);
CdColorXYZ *        cd_color_xyz_dup                    (const CdColorXYZ *src);
#define             cd_color_xyz_free
#define             cd_color_xyz_new
CdColorYxy *        cd_color_yxy_dup                    (const CdColorYxy *src);
#define             cd_color_yxy_free
#define             cd_color_yxy_new

Description

Functions to manipulate color values.

Details

CdColorLab

typedef struct {
	gdouble	 L;
	gdouble	 a;
	gdouble	 b;
} CdColorLab;


CdColorRGB

typedef struct {
	gdouble	 R;
	gdouble	 G;
	gdouble	 B;
} CdColorRGB;


CdColorRGB8

typedef struct {
	guint8	 R;
	guint8	 G;
	guint8	 B;
} CdColorRGB8;


CdColorXYZ

typedef struct {
	gdouble	 X;
	gdouble	 Y;
	gdouble	 Z;
} CdColorXYZ;


CdColorYxy

typedef struct {
	gdouble	 Y;
	gdouble	 x;
	gdouble	 y;
} CdColorYxy;


cd_color_clear_xyz ()

void                cd_color_clear_xyz                  (CdColorXYZ *dest);

Initialises a color value.

dest :

the destination color

cd_color_convert_rgb8_to_rgb ()

void                cd_color_convert_rgb8_to_rgb        (const CdColorRGB8 *src,
                                                         CdColorRGB *dest);

Convert from one color format to another.

src :

the source color

dest :

the destination color

cd_color_convert_rgb_to_rgb8 ()

void                cd_color_convert_rgb_to_rgb8        (const CdColorRGB *src,
                                                         CdColorRGB8 *dest);

Convert from one color format to another.

src :

the source color

dest :

the destination color

cd_color_convert_xyz_to_yxy ()

void                cd_color_convert_xyz_to_yxy         (const CdColorXYZ *src,
                                                         CdColorYxy *dest);

Convert from one color format to another.

src :

the source color

dest :

the destination color

cd_color_convert_yxy_to_xyz ()

void                cd_color_convert_yxy_to_xyz         (const CdColorYxy *src,
                                                         CdColorXYZ *dest);

Convert from one color format to another.

src :

the source color

dest :

the destination color

cd_color_copy_rgb ()

void                cd_color_copy_rgb                   (const CdColorRGB *src,
                                                         CdColorRGB *dest);

Deep copies a color value.

src :

the source color

dest :

the destination color

cd_color_copy_xyz ()

void                cd_color_copy_xyz                   (const CdColorXYZ *src,
                                                         CdColorXYZ *dest);

Deep copies a color value.

src :

the source color

dest :

the destination color

cd_color_copy_yxy ()

void                cd_color_copy_yxy                   (const CdColorYxy *src,
                                                         CdColorYxy *dest);

Deep copies a color value.

src :

the source color

dest :

the destination color

cd_color_rgb_dup ()

CdColorRGB *        cd_color_rgb_dup                    (const CdColorRGB *src);

src :

Returns :


cd_color_rgb_free

#define		 cd_color_rgb_free			g_free


cd_color_rgb_new

#define		 cd_color_rgb_new()			g_new0 (CdColorRGB, 1)


cd_color_set_rgb ()

void                cd_color_set_rgb                    (CdColorRGB *dest,
                                                         gdouble R,
                                                         gdouble G,
                                                         gdouble B);

Initialises a color value.

dest :

the destination color

R :

component value

G :

component value

B :

component value

cd_color_set_xyz ()

void                cd_color_set_xyz                    (CdColorXYZ *dest,
                                                         gdouble X,
                                                         gdouble Y,
                                                         gdouble Z);

Initialises a color value.

dest :

the destination color

X :

component value

Y :

component value

Z :

component value

cd_color_set_yxy ()

void                cd_color_set_yxy                    (CdColorYxy *dest,
                                                         gdouble Y,
                                                         gdouble x,
                                                         gdouble y);

Initialises a color value.

dest :

the destination color

Y :

component value

x :

component value

y :

component value

cd_color_xyz_dup ()

CdColorXYZ *        cd_color_xyz_dup                    (const CdColorXYZ *src);

src :

Returns :


cd_color_xyz_free

#define		 cd_color_xyz_free			g_free


cd_color_xyz_new

#define		 cd_color_xyz_new()			g_new0 (CdColorXYZ, 1)


cd_color_yxy_dup ()

CdColorYxy *        cd_color_yxy_dup                    (const CdColorYxy *src);

src :

Returns :


cd_color_yxy_free

#define		 cd_color_yxy_free			g_free


cd_color_yxy_new

#define		 cd_color_yxy_new()			g_new0 (CdColorYxy, 1)