steghide 0.5.1
SampleValue.h
Go to the documentation of this file.
1/*
2 * steghide 0.5.1 - a steganography program
3 * Copyright (C) 1999-2003 Stefan Hetzl <shetzl@chello.at>
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 *
19 */
20
21#ifndef SH_SAMPLEVALUE_H
22#define SH_SAMPLEVALUE_H
23
24#include <functional>
25
26#include "common.h"
27#include "wrapper_hash_set.h"
28
29class CvrStgFile ;
30
62 public:
63 SampleValue (void) ;
64
65 virtual ~SampleValue (void) ;
66
78
84 virtual UWORD32 calcDistance (const SampleValue *s) const = 0 ;
85
89 virtual std::string getName (void) const = 0 ;
90
98 virtual bool isNeighbour (const SampleValue* s) const ;
99
105 { return EValue ; } ;
106
111 UWORD32 getKey (void) const
112 { return Key ; } ;
113
117 bool operator== (const SampleValue& sv) const { return (getKey() == sv.getKey()) ; } ;
118 bool operator!= (const SampleValue& sv) const { return (getKey() != sv.getKey()) ; } ;
119
120 bool operator< (const SampleValue& sv) const { return (getKey() < sv.getKey()) ; } ;
121
122 UWORD32 getNumEdges (EmbValue t) const { return NumEdges[t] ; } ;
123 void setNumEdges (EmbValue t, UWORD32 ne) { NumEdges[t] = ne ; } ;
124 void incNumEdges (EmbValue t) ;
125 void decNumEdges (EmbValue t) ;
126
127 void setLabel (unsigned long l) { Label = l ; } ;
128 unsigned long getLabel (void) const { return Label ; } ;
129
130 void print (unsigned short spc = 0) const ;
131
132 protected:
135
138
139 private:
140 unsigned long Label ;
141
147} ;
148
149struct SampleValuesEqual : public std::binary_function<SampleValue*, SampleValue*, bool> {
150 bool operator() (const SampleValue* s1, const SampleValue *s2) const
151 {
152 return (*s1 == *s2) ;
153 }
154} ;
155
156struct SampleValuesLess : public std::binary_function<SampleValue*, SampleValue*, bool> {
157 bool operator() (const SampleValue* s1, const SampleValue *s2) const
158 {
159 return (*s1 < *s2) ;
160 }
161} ;
162
163struct SampleValueHash : public std::unary_function<SampleValue*,size_t> {
164 size_t operator() (const SampleValue* s) const
165 {
166 sgi::hash<UWORD32> h ;
167 return h(s->getKey()) ;
168 }
169} ;
170
171#endif // ndef SH_CVRSTGSAMPLE_H
a cover-/stego-file
Definition CvrStgFile.h:46
the value of a sample in a CvrStgFile
Definition SampleValue.h:61
EmbValue EValue
the bit that is embedded in this sample value - must be set in constructor of derived class
Definition SampleValue.h:134
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
unsigned long Label
Definition SampleValue.h:140
bool operator==(const SampleValue &sv) const
Definition SampleValue.h:117
void decNumEdges(EmbValue t)
Definition SampleValue.cc:41
void setNumEdges(EmbValue t, UWORD32 ne)
Definition SampleValue.h:123
UWORD32 getKey(void) const
Definition SampleValue.h:111
virtual bool isNeighbour(const SampleValue *s) const
Definition SampleValue.cc:47
bool operator!=(const SampleValue &sv) const
Definition SampleValue.h:118
SampleValue(void)
Definition SampleValue.cc:25
void incNumEdges(EmbValue t)
Definition SampleValue.cc:36
virtual ~SampleValue(void)
Definition SampleValue.cc:31
bool operator<(const SampleValue &sv) const
Definition SampleValue.h:120
void print(unsigned short spc=0) const
Definition SampleValue.cc:55
void setLabel(unsigned long l)
Definition SampleValue.h:127
virtual UWORD32 calcDistance(const SampleValue *s) const =0
UWORD32 getNumEdges(EmbValue t) const
Definition SampleValue.h:122
UWORD32 * NumEdges
Definition SampleValue.h:146
unsigned long getLabel(void) const
Definition SampleValue.h:128
virtual SampleValue * getNearestTargetSampleValue(EmbValue t) const =0
virtual std::string getName(void) const =0
EmbValue getEmbeddedValue(void) const
Definition SampleValue.h:104
unsigned long UWORD32
Definition common.h:45
BYTE EmbValue
Definition common.h:66
Definition SampleValue.h:163
size_t operator()(const SampleValue *s) const
Definition SampleValue.h:164
Definition SampleValue.h:149
bool operator()(const SampleValue *s1, const SampleValue *s2) const
Definition SampleValue.h:150
Definition SampleValue.h:156
bool operator()(const SampleValue *s1, const SampleValue *s2) const
Definition SampleValue.h:157