samplevalue(3)
NAME
SampleValue - the value of a sample in a CvrStgFile
SYNOPSIS
#include <SampleValue.h> Inherited by AudioSampleValue< Type, ValueType >, BmpSampleValue, DummySampleValue, JpegSampleValue, and WavPCMSampleValue. 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
Detailed Description
This is the abstract base class for all AuSampleValue, BmpSampleValue,
etc. classes
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.
Constructor & Destructor Documentation
SampleValue::SampleValue (void) SampleValue::~SampleValue (void) [virtual]
Member Function Documentation
- 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 - Parameters:
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.
- 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 - Parameters:
s a sample value of the same type as this
- Returns:
the distance
- 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 ?
- Returns:
true iff this and s are neighbours
- This is implemented as (calcDistance() <= Radius) but may be overridden by derived classes.
- Reimplemented in DummySampleValue.
- EmbValue SampleValue::getEmbeddedValue (void) const [inline]
- get the value that is embedded in this sample value (must be >=0 and
<EmbValueModulus) - Returns:
the embedded value
- UWORD32 SampleValue::getKey (void) const [inline]
- get the key for this sample
- Returns:
a key which must be different for two different samples values.
- 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] UWORD32 SampleValue::getNumEdges (EmbValue t) const [inline] void SampleValue::setNumEdges (EmbValue t, UWORD32 ne) [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
Member Data Documentation
- 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
Author
- Generated automatically by Doxygen for steghide from the source code.