SampleValue.h
Go to the documentation of this file.
/*
* steghide 0.5.1 - a steganography program
* Copyright (C) 1999-2003 Stefan Hetzl <shetzl@chello.at>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
#ifndef SH_SAMPLEVALUE_H
#define SH_SAMPLEVALUE_H
#include <functional>
#include "common.h"
#include "wrapper_hash_set.h"
class CvrStgFile ;
class SampleValue {
public:
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
{ return EValue ; } ;
UWORD32 getKey (void) const
{ return Key ; } ;
bool operator== (const SampleValue& sv) const { return (getKey() == sv.getKey()) ; } ;
bool operator!= (const SampleValue& sv) const { return (getKey() != sv.getKey()) ; } ;
bool operator< (const SampleValue& sv) const { return (getKey() < sv.getKey()) ; } ;
UWORD32 getNumEdges (EmbValue t) const { return NumEdges[t] ; } ;
void setNumEdges (EmbValue t, UWORD32 ne) { NumEdges[t] = ne ; } ;
void incNumEdges (EmbValue t) ;
void decNumEdges (EmbValue t) ;
void setLabel (unsigned long l) { Label = l ; } ;
unsigned long getLabel (void) const { return Label ; } ;
void print (unsigned short spc = 0) const ;
protected:
EmbValue EValue ;
UWORD32 Key ;
private:
unsigned long Label ;
UWORD32* NumEdges ;
} ;
struct SampleValuesEqual : public std::binary_function<SampleValue*, SampleValue*, bool> {
bool operator() (const SampleValue* s1, const SampleValue *s2) const
{
return (*s1 == *s2) ;
}
} ;
struct SampleValuesLess : public std::binary_function<SampleValue*, SampleValue*, bool> {
bool operator() (const SampleValue* s1, const SampleValue *s2) const
{
return (*s1 < *s2) ;
}
} ;
struct SampleValueHash : public std::unary_function<SampleValue*,size_t> {
size_t operator() (const SampleValue* s) const
{
sgi::hash<UWORD32> h ;
return h(s->getKey()) ;
}
} ;
#endif // ndef SH_CVRSTGSAMPLE_H
CvrStgFile
a cover-/stego-file
Definition CvrStgFile.h:46
SampleValue
the value of a sample in a CvrStgFile
Definition SampleValue.h:61
SampleValue::EValue
EmbValue EValue
the bit that is embedded in this sample value - must be set in constructor of derived class
Definition SampleValue.h:134
SampleValue::Key
UWORD32 Key
the key of this sample value - must be different for two different sample values - must be set in con...
Definition SampleValue.h:137
SampleValue::Label
unsigned long Label
Definition SampleValue.h:140
SampleValue::operator==
bool operator==(const SampleValue &sv) const
Definition SampleValue.h:117
SampleValue::decNumEdges
void decNumEdges(EmbValue t)
Definition SampleValue.cc:41
SampleValue::setNumEdges
void setNumEdges(EmbValue t, UWORD32 ne)
Definition SampleValue.h:123
SampleValue::getKey
UWORD32 getKey(void) const
Definition SampleValue.h:111
SampleValue::isNeighbour
virtual bool isNeighbour(const SampleValue *s) const
Definition SampleValue.cc:47
SampleValue::operator!=
bool operator!=(const SampleValue &sv) const
Definition SampleValue.h:118
SampleValue::SampleValue
SampleValue(void)
Definition SampleValue.cc:25
SampleValue::incNumEdges
void incNumEdges(EmbValue t)
Definition SampleValue.cc:36
SampleValue::~SampleValue
virtual ~SampleValue(void)
Definition SampleValue.cc:31
SampleValue::operator<
bool operator<(const SampleValue &sv) const
Definition SampleValue.h:120
SampleValue::print
void print(unsigned short spc=0) const
Definition SampleValue.cc:55
SampleValue::setLabel
void setLabel(unsigned long l)
Definition SampleValue.h:127
SampleValue::calcDistance
virtual UWORD32 calcDistance(const SampleValue *s) const =0
SampleValue::getNumEdges
UWORD32 getNumEdges(EmbValue t) const
Definition SampleValue.h:122
SampleValue::NumEdges
UWORD32 * NumEdges
Definition SampleValue.h:146
SampleValue::getLabel
unsigned long getLabel(void) const
Definition SampleValue.h:128
SampleValue::getNearestTargetSampleValue
virtual SampleValue * getNearestTargetSampleValue(EmbValue t) const =0
SampleValue::getName
virtual std::string getName(void) const =0
SampleValue::getEmbeddedValue
EmbValue getEmbeddedValue(void) const
Definition SampleValue.h:104
common.h
UWORD32
unsigned long UWORD32
Definition common.h:45
EmbValue
BYTE EmbValue
Definition common.h:66
SampleValueHash
Definition SampleValue.h:163
SampleValueHash::operator()
size_t operator()(const SampleValue *s) const
Definition SampleValue.h:164
SampleValuesEqual
Definition SampleValue.h:149
SampleValuesEqual::operator()
bool operator()(const SampleValue *s1, const SampleValue *s2) const
Definition SampleValue.h:150
SampleValuesLess
Definition SampleValue.h:156
SampleValuesLess::operator()
bool operator()(const SampleValue *s1, const SampleValue *s2) const
Definition SampleValue.h:157
wrapper_hash_set.h