#include <SampleValue.h>
Inheritance diagram for SampleValue:
Public Member Functions | |
SampleValue (void) | |
virtual | ~SampleValue (void) |
virtual SampleValue * | getNearestTargetSampleValue (EmbValue t) const=0 |
virtual UWORD32 | calcDistance (const SampleValue *s) const=0 |
virtual std::string | getName (void) const=0 |
virtual bool | isNeighbour (const SampleValue *s) const |
EmbValue | getEmbeddedValue (void) const |
UWORD32 | getKey (void) const |
bool | operator== (const SampleValue &sv) const |
bool | operator!= (const SampleValue &sv) const |
bool | operator< (const SampleValue &sv) const |
UWORD32 | getNumEdges (EmbValue t) const |
void | setNumEdges (EmbValue t, UWORD32 ne) |
void | incNumEdges (EmbValue t) |
void | decNumEdges (EmbValue t) |
void | setLabel (unsigned long l) |
unsigned long | getLabel (void) const |
void | print (unsigned short spc=0) const |
Protected Attributes | |
EmbValue | EValue |
the bit that is embedded in this sample value - must be set in constructor of derived class | |
UWORD32 | Key |
the key of this sample value - must be different for two different sample values - must be set in constructor of derived class | |
Private Attributes | |
unsigned long | Label |
UWORD32 * | NumEdges |
For two sample values s1 and s2:
s1->calcDistance(s2) == s2->calcDistance(s1) is always true.
s1->isNeighbour(s2) == s2->isNeighbour(s1) is always true.
s1 and s2 are called opposite if s1->getBit() != s2->getBit()
s1 and s2 are called neighbours if s1->isNeighbour(s2) is true
s1->getKey() == s2->getKey() iff s1 == s2
s1 == s2 implies s1->getDistance(s2) == 0 BUT: s1->getDistance(s2) == 0 does not imply s1 == s2 example: 8-bit bmp palette image - same color value for two different indices
s1 == s2 implies s1->getBit() == s2->getBit()
s1->getDistance(s2) == 0 implies s1->getBit() == s2->getBit()
NOTE: SampleValue and all derived classes rely on the Globals object pointed to by the Globs pointer. This means that it must be set correctly before using any method of a SampleValue (or derived) object.
SampleValue::SampleValue | ( | void | ) |
SampleValue::~SampleValue | ( | void | ) | [virtual] |
virtual SampleValue* SampleValue::getNearestTargetSampleValue | ( | EmbValue | t | ) | const [pure 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 |
The returned SampleValue object should be deleted by the callser.
Implemented in AudioSampleValue< Type, ValueType >, BmpPaletteSampleValue, BmpRGBSampleValue, JpegSampleValue, WavPCMSampleValue, and DummySampleValue.
virtual UWORD32 SampleValue::calcDistance | ( | const SampleValue * | s | ) | const [pure virtual] |
calculate the distance between the sample value s and this sample value
s | a sample value of the same type as this |
Implemented in AudioSampleValue< Type, ValueType >, BmpRGBSampleValue, BmpSampleValue, JpegSampleValue, WavPCMSampleValue, and DummySampleValue.
virtual std::string SampleValue::getName | ( | void | ) | const [pure virtual] |
return a short name uniquely identifying this sample value
Implemented in AudioSampleValue< Type, ValueType >, BmpPaletteSampleValue, BmpRGBSampleValue, JpegSampleValue, WavPCMSampleValue, and DummySampleValue.
bool SampleValue::isNeighbour | ( | const SampleValue * | s | ) | const [virtual] |
is the sample value s a neighbour of this sample value ?
Reimplemented in DummySampleValue.
EmbValue SampleValue::getEmbeddedValue | ( | void | ) | const [inline] |
get the value that is embedded in this sample value (must be >=0 and <EmbValueModulus)
UWORD32 SampleValue::getKey | ( | void | ) | const [inline] |
get the key for this sample
bool SampleValue::operator== | ( | const SampleValue & | sv | ) | const [inline] |
two sample values are equal iff their keys are equal
bool SampleValue::operator!= | ( | const SampleValue & | sv | ) | const [inline] |
bool SampleValue::operator< | ( | const SampleValue & | sv | ) | const [inline] |
void SampleValue::incNumEdges | ( | EmbValue | t | ) |
void SampleValue::decNumEdges | ( | EmbValue | t | ) |
void SampleValue::setLabel | ( | unsigned long | l | ) | [inline] |
unsigned long SampleValue::getLabel | ( | void | ) | const [inline] |
void SampleValue::print | ( | unsigned short | spc = 0 |
) | const |
EmbValue SampleValue::EValue [protected] |
UWORD32 SampleValue::Key [protected] |
unsigned long SampleValue::Label [private] |
UWORD32* SampleValue::NumEdges [private] |
NumEdges[t] contains the number of edges that are added to a vertex if this sample value with corresponding target value t is added to the vertex