steghide 0.5.1
Selector.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_SELECTOR_H
22#define SH_SELECTOR_H
23
24#include <string>
25#include <vector>
26#include "wrapper_hash_map.h"
27
28#include "common.h"
29
31
36class Selector {
37 public:
43 Selector (UWORD32 m, std::string pp) ;
44
49 Selector (UWORD32 m) ;
50
57 Selector (const std::vector<UWORD32>& retvals) ;
58
59 ~Selector (void) ;
60
66
67 UWORD32 getRange (void) const
68 { return Maximum ; } ;
69
70 private:
71 std::vector<UWORD32> X ;
72 std::vector<UWORD32> Y ;
73 sgi::hash_map<UWORD32,UWORD32> Xreversed ;
79
83 void calculate (UWORD32 m) ;
84
92 bool idxX (UWORD32 v, UWORD32 m, UWORD32* p) const ;
93
97 void setX (UWORD32 i, UWORD32 v) ;
98} ;
99
100#endif // ndef SH_SELECTOR_H
this class serves as a source of reproducible (pseudo-)random numbers
Definition PseudoRandomSource.h:33
UWORD32 getRange(void) const
Definition Selector.h:67
UWORD32 Maximum
operator[] will return a value in {0,...,Maximum-1}
Definition Selector.h:75
void calculate(UWORD32 m)
Definition Selector.cc:75
void setX(UWORD32 i, UWORD32 v)
Definition Selector.cc:130
PseudoRandomSource * PRandom
Definition Selector.h:78
UWORD32 operator[](UWORD32 i)
Definition Selector.cc:68
std::vector< UWORD32 > Y
Definition Selector.h:72
~Selector(void)
Definition Selector.cc:61
std::vector< UWORD32 > X
Definition Selector.h:71
UWORD32 NumInArray
the number of calculated positions in the arrays
Definition Selector.h:77
bool idxX(UWORD32 v, UWORD32 m, UWORD32 *p) const
Definition Selector.cc:119
sgi::hash_map< UWORD32, UWORD32 > Xreversed
Definition Selector.h:73
Selector(UWORD32 m, std::string pp)
Definition Selector.cc:26
unsigned long UWORD32
Definition common.h:45