scbcolor.c File Reference

#include <stdio.h>
#include "scbcolor.h"
#include "scblog.h"
#include "scbtype.h"
#include "scbconfig.h"
Include dependency graph for scbcolor.c:

Go to the source code of this file.

Functions

void trace (const char *arg,...)
void erscribble_color_set_white (ScbColorPtr ptr)
void erscribble_color_set_black (ScbColorPtr ptr)
void erscribble_color_set_light_gray (ScbColorPtr ptr)
void erscribble_color_set_dark_gray (ScbColorPtr ptr)
ScbDevColor erscribble_color_to_dev_color (ScbColorPtr ptr)
void erscribble_dev_color_to_color (ScbColorPtr ptr, const ScbDevColor color)

Function Documentation

void erscribble_color_set_black ( ScbColorPtr  ptr  ) 

Definition at line 85 of file scbcolor.c.

References _ScbColor::blue, _ScbColor::green, _ScbColor::pixel, and _ScbColor::red.

Referenced by erscribble_dev_color_to_color().

00086 {
00087     if (NULL == ptr) return;
00088     ptr->red    = 0;
00089     ptr->green  = 0;
00090     ptr->blue   = 0;
00091     ptr->pixel  = 0;
00092 }

Here is the caller graph for this function:

void erscribble_color_set_dark_gray ( ScbColorPtr  ptr  ) 

Definition at line 105 of file scbcolor.c.

References _ScbColor::blue, _ScbColor::green, _ScbColor::pixel, and _ScbColor::red.

Referenced by erscribble_dev_color_to_color().

00106 {
00107     if (NULL == ptr) return;
00108     ptr->red    = 0x55;
00109     ptr->green  = 0x55;
00110     ptr->blue   = 0x55;
00111     ptr->pixel  = 0x5555;
00112 }

Here is the caller graph for this function:

void erscribble_color_set_light_gray ( ScbColorPtr  ptr  ) 

Definition at line 95 of file scbcolor.c.

References _ScbColor::blue, _ScbColor::green, _ScbColor::pixel, and _ScbColor::red.

Referenced by erscribble_dev_color_to_color().

00096 {
00097     if (NULL == ptr) return;
00098     ptr->red    = 0xaa;
00099     ptr->green  = 0xaa;
00100     ptr->blue   = 0xaa;
00101     ptr->pixel  = 0xaaaa;
00102 }

Here is the caller graph for this function:

void erscribble_color_set_white ( ScbColorPtr  ptr  ) 

Definition at line 75 of file scbcolor.c.

References _ScbColor::blue, _ScbColor::green, _ScbColor::pixel, and _ScbColor::red.

Referenced by erscribble_dev_color_to_color().

00076 {
00077     if (NULL == ptr) return;
00078     ptr->red    = 0xff;
00079     ptr->green  = 0xff;
00080     ptr->blue   = 0xff;
00081     ptr->pixel  = 0xffff;
00082 }

Here is the caller graph for this function:

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:

void trace ( const char *  arg,
  ... 
)

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

Definition at line 68 of file scbcolor.c.

00069 {
00070     // TODO: replace this function with macro
00071     printf("%s\n", arg);
00072 }

Generated by  doxygen 1.6.2-20100208