ai_bmp.cpp File Reference

(r1785/r1313)

#include "camtypes.h"
#include "ai_bmp.h"
#include "page.h"
#include "ai5_eps.h"
#include "progress.h"
#include "nodebmp.h"

Go to the source code of this file.

Defines

#define new   CAM_DEBUG_NEW

Functions

 DECLARE_SOURCE ("$Revision")
bool CharToHex (const char &cDigit, BYTE &nNum)
 Converts a hex character to a numeric byte.
BYTE ColourValueToByte (const double &Value)
 Converts a colour value from a double to a BYTE.


Define Documentation

#define new   CAM_DEBUG_NEW
 

Definition at line 116 of file ai_bmp.cpp.


Function Documentation

bool CharToHex const char &  cDigit,
BYTE &  nNum
[inline]
 

Converts a hex character to a numeric byte.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/03/00
Parameters:
cDigit - the hex character (0-9,A-F) [INPUTS]
nNum the original value with the hex character ORred into it [OUTPUTS]
Returns:
true if the character were valid false otherwise

Definition at line 523 of file ai_bmp.cpp.

00524 {
00525     char ch = camToupper(cDigit);
00526 
00527     if ( (ch >= '0') && (ch <= '9') )
00528     {
00529         nNum |= (BYTE) (ch - '0');
00530     }
00531     else if ((ch >= 'A') && (ch <= 'F'))
00532     {
00533         nNum |= (BYTE) (ch - 'A') + 10;
00534     }
00535     else
00536     {
00537         // Error in hex data
00538         return false;
00539     }
00540     return true;
00541 }

BYTE ColourValueToByte const double &  Value  ) 
 

Converts a colour value from a double to a BYTE.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/03/00
Parameters:
Value - The colour value, as a double. [INPUTS]
Returns:
BYTE - The colour value, as a byte.

Definition at line 558 of file ai_bmp.cpp.

00559 {
00560     return BYTE(floor(Value * double(255) + 0.5));
00561 }

DECLARE_SOURCE "$Revision"   ) 
 


Generated on Sat Nov 10 03:49:03 2007 for Camelot by  doxygen 1.4.4