scbcolor.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _ScbColor

Typedefs

typedef enum _ScbDevColor ScbDevColor
typedef struct _ScbColor ScbColor
typedef ScbColorScbColorPtr

Enumerations

enum  _ScbDevColor {
  ERSCRIBBLE_DEV_COLOR_WHITE = 0, ERSCRIBBLE_DEV_COLOR_LIGHT_GRAY = 1, ERSCRIBBLE_DEV_COLOR_DARK_GRAY = 2, ERSCRIBBLE_DEV_COLOR_BLACK = 3,
  ERSCRIBBLE_DEV_COLOR_UNKNOWN = 0xffffffff
}

Functions

ScbDevColor erscribble_color_to_dev_color (ScbColorPtr ptr)
void erscribble_dev_color_to_color (ScbColorPtr ptr, const ScbDevColor color)

Typedef Documentation

typedef struct _ScbColor ScbColor

Definition at line 75 of file scbcolor.h.

typedef enum _ScbDevColor ScbDevColor

Copyright (C) 2008 iRex Technologies B.V. All rights reserved.


Enumeration Type Documentation

Copyright (C) 2008 iRex Technologies B.V. All rights reserved.

Enumerator:
ERSCRIBBLE_DEV_COLOR_WHITE 
ERSCRIBBLE_DEV_COLOR_LIGHT_GRAY 
ERSCRIBBLE_DEV_COLOR_DARK_GRAY 
ERSCRIBBLE_DEV_COLOR_BLACK 
ERSCRIBBLE_DEV_COLOR_UNKNOWN 

Definition at line 57 of file scbcolor.h.


Function Documentation

ScbDevColor erscribble_color_to_dev_color ( ScbColorPtr  ptr  ) 

Definition at line 115 of file scbcolor.c.

References _ScbColor::blue, ERSCRIBBLE_DEV_COLOR_BLACK, ERSCRIBBLE_DEV_COLOR_DARK_GRAY, ERSCRIBBLE_DEV_COLOR_LIGHT_GRAY, ERSCRIBBLE_DEV_COLOR_UNKNOWN, ERSCRIBBLE_DEV_COLOR_WHITE, _ScbColor::green, and _ScbColor::red.

00116 {
00117     if (NULL == ptr) return ERSCRIBBLE_DEV_COLOR_UNKNOWN;
00118     if (0 == ptr->red && 0 == ptr->green && 0 == ptr->blue)
00119     {
00120         return ERSCRIBBLE_DEV_COLOR_BLACK;
00121     }
00122     else if (0xff == ptr->red && 0xff == ptr->green && 0xff == ptr->blue)
00123     {
00124         return ERSCRIBBLE_DEV_COLOR_WHITE;
00125     }
00126     else if (0xaa == ptr->red && 0xaa == ptr->green && 0xaa == ptr->blue)
00127     {
00128         return ERSCRIBBLE_DEV_COLOR_LIGHT_GRAY;
00129     }
00130     else if (0x55 == ptr->red && 0x55 == ptr->green && 0x55 == ptr->blue)
00131     {
00132         return ERSCRIBBLE_DEV_COLOR_DARK_GRAY;
00133     }
00134     return ERSCRIBBLE_DEV_COLOR_UNKNOWN;
00135 }

void erscribble_dev_color_to_color ( ScbColorPtr  ptr,
const ScbDevColor  color 
)

Definition at line 138 of file scbcolor.c.

References erscribble_color_set_black(), erscribble_color_set_dark_gray(), erscribble_color_set_light_gray(), erscribble_color_set_white(), ERSCRIBBLE_DEV_COLOR_DARK_GRAY, ERSCRIBBLE_DEV_COLOR_LIGHT_GRAY, and ERSCRIBBLE_DEV_COLOR_WHITE.

00139 {
00140     if (NULL == ptr) return;
00141     switch(color)
00142     {
00143     case  ERSCRIBBLE_DEV_COLOR_WHITE :
00144 
00145         erscribble_color_set_white(ptr);
00146 
00147         break;
00148     case ERSCRIBBLE_DEV_COLOR_LIGHT_GRAY :
00149 
00150         erscribble_color_set_light_gray(ptr);
00151 
00152         break;
00153     case ERSCRIBBLE_DEV_COLOR_DARK_GRAY :
00154 
00155         erscribble_color_set_dark_gray(ptr);
00156 
00157         break;
00158     default:
00159 
00160         erscribble_color_set_black(ptr);
00161 
00162         break;
00163     }
00164 }

Here is the call graph for this function:

Generated by  doxygen 1.6.2-20100208