a sample in a bmp rgb (i.e. 24-bit) file
#include <BmpRGBSampleValue.h>
Public Member Functions | |
BmpRGBSampleValue (BYTE r, BYTE g, BYTE b) | |
BmpRGBSampleValue (RGBTriple t) | |
UWORD32 | calcDistance (const SampleValue *s) const |
SampleValue * | getNearestTargetSampleValue (EmbValue t) const |
std::string | getName (void) const |
BYTE | getRed (void) const |
BYTE | getGreen (void) const |
BYTE | getBlue (void) const |
Private Types | |
enum | COLOR { RED, GREEN, BLUE } |
enum | DIRECTION { UP, DOWN } |
Private Member Functions | |
UWORD32 | calcKey (const RGBTriple &rgb) const |
EmbValue | calcEValue (const RGBTriple &rgb) const |
BYTE | plus (BYTE a, BYTE b) const |
BYTE | minus (BYTE a, BYTE b) const |
void | addNTSVCandidates (std::vector< RGBTriple > &cands, const BYTE cube[3][2], COLOR fc, DIRECTION fd, COLOR i1, COLOR i2, EmbValue t) const |
Private Attributes | |
RGBTriple | Color |
enum BmpRGBSampleValue::COLOR [private] |
enum BmpRGBSampleValue::DIRECTION [private] |
BmpRGBSampleValue::BmpRGBSampleValue | ( | RGBTriple | t | ) |
void BmpRGBSampleValue::addNTSVCandidates | ( | std::vector< RGBTriple > & | cands, | |
const BYTE | cube[3][2], | |||
COLOR | fc, | |||
DIRECTION | fd, | |||
COLOR | i1, | |||
COLOR | i2, | |||
EmbValue | t | |||
) | const [private] |
add candidates for the nearest target sample value
cands | the candidates vector | |
cube | the color values describing the current search cube | |
fc | the fixed color | |
fd | the fixed side of the fixed color |
UWORD32 BmpRGBSampleValue::calcDistance | ( | const SampleValue * | s | ) | const [virtual] |
calculate the distance between the sample value s and this sample value
s | a sample value of the same type as this |
Reimplemented from BmpSampleValue.
BYTE BmpRGBSampleValue::getBlue | ( | void | ) | const [inline, virtual] |
get the blue color component
Implements BmpSampleValue.
BYTE BmpRGBSampleValue::getGreen | ( | void | ) | const [inline, virtual] |
get the green color component
Implements BmpSampleValue.
std::string BmpRGBSampleValue::getName | ( | void | ) | const [virtual] |
return a short name uniquely identifying this sample value
Implements SampleValue.
SampleValue * BmpRGBSampleValue::getNearestTargetSampleValue | ( | EmbValue | t | ) | const [virtual] |
get the nearest (with the least distance to this sample value) sample value whose embedded value equals the specified target
t | the target embedded value |
If two or more target sample values have equal distance each of them should be returned with equal probability.
The returned SampleValue object should be deleted by the callser.
Implements SampleValue.
BYTE BmpRGBSampleValue::getRed | ( | void | ) | const [inline, virtual] |
get the red color component
Implements BmpSampleValue.
substract the BYTE b from the BYTE a
add the BYTEs a and b
RGBTriple BmpRGBSampleValue::Color [private] |