Selector.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_SELECTOR_H
#define SH_SELECTOR_H
#include <string>
#include <vector>
#include "wrapper_hash_map.h"
#include "common.h"
class PseudoRandomSource ;
class Selector {
public:
Selector (UWORD32 m, std::string pp) ;
Selector (UWORD32 m) ;
Selector (const std::vector<UWORD32>& retvals) ;
~Selector (void) ;
UWORD32 operator[] (UWORD32 i) ;
UWORD32 getRange (void) const
{ return Maximum ; } ;
private:
std::vector<UWORD32> X ;
std::vector<UWORD32> Y ;
sgi::hash_map<UWORD32,UWORD32> Xreversed ;
UWORD32 Maximum ;
UWORD32 NumInArray ;
PseudoRandomSource* PRandom ;
void calculate (UWORD32 m) ;
bool idxX (UWORD32 v, UWORD32 m, UWORD32* p) const ;
void setX (UWORD32 i, UWORD32 v) ;
} ;
#endif // ndef SH_SELECTOR_H
PseudoRandomSource
this class serves as a source of reproducible (pseudo-)random numbers
Definition PseudoRandomSource.h:33
Selector::getRange
UWORD32 getRange(void) const
Definition Selector.h:67
Selector::Maximum
UWORD32 Maximum
operator[] will return a value in {0,...,Maximum-1}
Definition Selector.h:75
Selector::calculate
void calculate(UWORD32 m)
Definition Selector.cc:75
Selector::setX
void setX(UWORD32 i, UWORD32 v)
Definition Selector.cc:130
Selector::PRandom
PseudoRandomSource * PRandom
Definition Selector.h:78
Selector::operator[]
UWORD32 operator[](UWORD32 i)
Definition Selector.cc:68
Selector::Y
std::vector< UWORD32 > Y
Definition Selector.h:72
Selector::~Selector
~Selector(void)
Definition Selector.cc:61
Selector::X
std::vector< UWORD32 > X
Definition Selector.h:71
Selector::NumInArray
UWORD32 NumInArray
the number of calculated positions in the arrays
Definition Selector.h:77
Selector::idxX
bool idxX(UWORD32 v, UWORD32 m, UWORD32 *p) const
Definition Selector.cc:119
Selector::Xreversed
sgi::hash_map< UWORD32, UWORD32 > Xreversed
Definition Selector.h:73
Selector::Selector
Selector(UWORD32 m, std::string pp)
Definition Selector.cc:26
common.h
UWORD32
unsigned long UWORD32
Definition common.h:45
wrapper_hash_map.h