Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

cr-rgb.h File Reference

#include <stdio.h>
#include <glib.h>
#include "cr-utils.h"

Go to the source code of this file.

Data Structures

struct  _CRRgb

Functions

CRRgbcr_rgb_new (void)
 The default constructor of CRRgb.

CRRgbcr_rgb_new_with_vals (gulong a_red, gulong a_green, gulong a_blue, gboolean a_is_percentage)
 A constructor of CRRgb.

enum CRStatus cr_rgb_set (CRRgb *a_this, gulong a_red, gulong a_green, gulong a_blue, gboolean a_is_percentage)
 Sets rgb values to the RGB.

enum CRStatus cr_rgb_set_from_rgb (CRRgb *a_this, CRRgb *a_rgb)
 Sets the rgb from an other one.

enum CRStatus cr_rgb_set_from_name (CRRgb *a_this, const guchar *a_color_name)
enum CRStatus cr_rgb_set_from_hex_str (CRRgb *a_this, const guchar *a_hex_value)
guchar * cr_rgb_to_string (CRRgb *a_this)
 Serialises the rgb into a zero terminated string.

void cr_rgb_dump (CRRgb *a_this, FILE *a_fp)
 Dumps the current instance of CRRgb to a file.

void cr_rgb_destroy (CRRgb *a_this)
 Destructor of CRRgb.


Variables

typedefG_BEGIN_DECLS struct
_CRRgb 
CRRgb


Function Documentation

void cr_rgb_destroy CRRgb a_this  ) 
 

Destructor of CRRgb.

Parameters:
a_this the "this pointer" of the current instance of CRRgb.

Definition at line 479 of file cr-rgb.c.

void cr_rgb_dump CRRgb a_this,
FILE *  a_fp
 

Dumps the current instance of CRRgb to a file.

Parameters:
a_this the "this pointer" of the current instance of CRRgb.
a_fp the destination file pointer.

Definition at line 289 of file cr-rgb.c.

References cr_rgb_to_string().

CRRgb* cr_rgb_new void   ) 
 

The default constructor of CRRgb.

Returns:
the newly built instance of CRRgb

Definition at line 187 of file cr-rgb.c.

References cr_utils_trace_info, and CRRgb.

Referenced by cr_rgb_new_with_vals().

CRRgb* cr_rgb_new_with_vals gulong  a_red,
gulong  a_green,
gulong  a_blue,
gboolean  a_is_percentage
 

A constructor of CRRgb.

Parameters:
a_red the red component of the color.
a_green the green component of the color.
a_blue the blue component of the color.
a_unit the unit of the rgb values. (either percentage or integer values)
Returns:
the newly built instance of CRRgb.

Definition at line 215 of file cr-rgb.c.

References cr_rgb_new(), and CRRgb.

enum CRStatus cr_rgb_set CRRgb a_this,
gulong  a_red,
gulong  a_green,
gulong  a_blue,
gboolean  a_is_percentage
 

Sets rgb values to the RGB.

If the rgb values are percentages, make sure that the sum of the 3 values makes 100%.

Parameters:
a_this the current instance of CRRgb.
a_red the red value.
a_green the green value.
a_blue the blue value.
Returns:
CR_OK upon successfull completion, an error code otherwise.

Definition at line 317 of file cr-rgb.c.

References CR_BAD_PARAM_ERROR, and CR_OK.

Referenced by cr_rgb_set_from_hex_str(), and cr_rgb_set_from_rgb().

enum CRStatus cr_rgb_set_from_hex_str CRRgb a_this,
const guchar *  a_hex_value
 

Definition at line 395 of file cr-rgb.c.

References CR_BAD_PARAM_ERROR, CR_OK, cr_rgb_set(), CR_UNKNOWN_TYPE_ERROR, and CRStatus.

enum CRStatus cr_rgb_set_from_name CRRgb a_this,
const guchar *  a_color_name
 

Definition at line 370 of file cr-rgb.c.

References CR_BAD_PARAM_ERROR, CR_OK, cr_rgb_set_from_rgb(), CR_UNKNOWN_TYPE_ERROR, CRStatus, and name.

enum CRStatus cr_rgb_set_from_rgb CRRgb a_this,
CRRgb a_rgb
 

Sets the rgb from an other one.

Parameters:
a_this the current instance of CRRgb.
a_rgb the rgb to "copy"
Returns:
CR_OK upon successfull completion, an error code otherwise.

Definition at line 357 of file cr-rgb.c.

References CR_BAD_PARAM_ERROR, CR_OK, and cr_rgb_set().

Referenced by cr_rgb_set_from_name().

guchar* cr_rgb_to_string CRRgb a_this  ) 
 

Serialises the rgb into a zero terminated string.

Parameters:
a_this the instance of CRRgb to serialize.
Returns:
the zero terminated string containing the serialised rgb. MUST BE FREED by the caller using g_free().

Definition at line 239 of file cr-rgb.c.

Referenced by cr_rgb_dump(), and cr_term_to_string().


Variable Documentation

typedefG_BEGIN_DECLS struct _CRRgb CRRgb
 

Definition at line 37 of file cr-rgb.h.

Referenced by cr_rgb_new(), cr_rgb_new_with_vals(), and cr_tknzr_get_next_token().


Generated on Wed Oct 1 01:36:51 2003 for Libcroco by doxygen 1.3.3