steghide
0.5.1
Main Page
Classes
Files
File List
File Members
src
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
29
class
CvrStgFile
;
30
61
class
SampleValue
{
62
public
:
63
SampleValue
(
void
) ;
64
65
virtual
~SampleValue
(
void
) ;
66
77
virtual
SampleValue
*
getNearestTargetSampleValue
(
EmbValue
t)
const
= 0 ;
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
104
EmbValue
getEmbeddedValue
(
void
)
const
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
:
134
EmbValue
EValue
;
135
137
UWORD32
Key
;
138
139
private
:
140
unsigned
long
Label
;
141
146
UWORD32
*
NumEdges
;
147
} ;
148
149
struct
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
156
struct
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
163
struct
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
Generated on Mon Jan 14 2013 04:45:06 for steghide by
1.8.3