steghide 0.5.1
CvrStgFile.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_CVRSTGFILE_H
22#define SH_CVRSTGFILE_H
23
24#include <list>
25#include <string>
26#include <map>
27
28#include "BinaryIO.h"
29#include "CvrStgObject.h"
30class Graph ;
31class Matching ;
33class SampleValue ;
35
46class CvrStgFile : public CvrStgObject {
47 public:
52 static CvrStgFile *readFile (const std::string& fn) ;
53
54 class Property : private std::pair<std::string,std::string> {
55 public:
56 Property (std::string key, std::string value)
57 : std::pair<std::string,std::string> (key, value) {} ;
58
59 std::string getKey (void) const
60 { return first ; } ;
61
62 std::string getValue (void) const
63 { return second ; } ;
64 } ;
65
66 CvrStgFile (void) ;
67 virtual ~CvrStgFile (void) ;
68
69 virtual void read (BinaryIO *io) ;
70 virtual void write (void) ;
71 void transform (const std::string& fn) ;
72
73 virtual std::list<Property> getProperties (void) const = 0 ;
74
86 virtual std::vector<SampleValueAdjacencyList*> calcSVAdjacencyLists (const std::vector<SampleValue*>& svs) const ;
87
95 virtual std::vector<MatchingAlgorithm*> getMatchingAlgorithms (Graph* g, Matching* m) const ;
96
100 const std::string& getName (void) const
101 { return getBinIO()->getName() ; } ;
102
103 bool is_std (void) const
104 { return getBinIO()->is_std() ; } ;
105
110 unsigned long getCapacity (void) const ;
111
115 std::string getHRCapacity (void) const ;
116
120 unsigned short getSamplesPerVertex (void) const
121 { return SamplesPerVertex ; } ;
122
125 UWORD32 getRadius (void) const
126 { return Radius ; } ;
127
131 { return EmbValueModulus ; } ;
132
142 virtual EmbValue getEmbeddedValue (const SamplePos pos) const ;
143
144#ifdef DEBUG
148 virtual std::map<SampleKey,unsigned long>* getFrequencies (void) ;
155 virtual void printFrequencies (const std::map<SampleKey,unsigned long>& freqs) ;
156#endif
157
158 protected:
159 void setSamplesPerVertex (unsigned short spv)
160 { SamplesPerVertex = spv ; } ;
161
164 void setRadius (UWORD32 r) ;
167
169 { BinIO = io ; } ;
170
171 BinaryIO* getBinIO (void) const
172 { return BinIO ; } ;
173
174 private:
176
180 static FILEFORMAT guessff (BinaryIO *io) ;
181
183
184 unsigned short SamplesPerVertex ;
187} ;
188
189#endif /* ndef SH_CVRSTGFILE_H */
provides methods for file i/o as needed by the rest of steghide
Definition BinaryIO.h:33
bool is_std(void) const
Definition BinaryIO.h:65
const std::string & getName(void) const
Definition BinaryIO.h:53
Property(std::string key, std::string value)
Definition CvrStgFile.h:56
std::string getValue(void) const
Definition CvrStgFile.h:62
std::string getKey(void) const
Definition CvrStgFile.h:59
void setBinIO(BinaryIO *io)
Definition CvrStgFile.h:168
BinaryIO * getBinIO(void) const
Definition CvrStgFile.h:171
std::string getHRCapacity(void) const
Definition CvrStgFile.cc:126
virtual std::vector< SampleValueAdjacencyList * > calcSVAdjacencyLists(const std::vector< SampleValue * > &svs) const
Definition CvrStgFile.cc:79
EmbValue EmbValueModulus
Definition CvrStgFile.h:186
BinaryIO * BinIO
Definition CvrStgFile.h:182
unsigned short getSamplesPerVertex(void) const
Definition CvrStgFile.h:120
static CvrStgFile * readFile(const std::string &fn)
Definition CvrStgFile.cc:186
virtual void read(BinaryIO *io)
Definition CvrStgFile.cc:63
void setEmbValueModulus(EmbValue m)
Definition CvrStgFile.h:165
bool is_std(void) const
Definition CvrStgFile.h:103
const std::string & getName(void) const
Definition CvrStgFile.h:100
void setRadius(UWORD32 r)
Definition CvrStgFile.cc:53
virtual std::vector< MatchingAlgorithm * > getMatchingAlgorithms(Graph *g, Matching *m) const
Definition CvrStgFile.cc:103
EmbValue getEmbValueModulus(void) const
Definition CvrStgFile.h:130
void transform(const std::string &fn)
Definition CvrStgFile.cc:72
unsigned long getCapacity(void) const
Definition CvrStgFile.cc:119
void setSamplesPerVertex(unsigned short spv)
Definition CvrStgFile.h:159
static FILEFORMAT guessff(BinaryIO *io)
Definition CvrStgFile.cc:155
CvrStgFile(void)
Definition CvrStgFile.cc:40
virtual EmbValue getEmbeddedValue(const SamplePos pos) const
Definition CvrStgFile.cc:111
virtual ~CvrStgFile(void)
Definition CvrStgFile.cc:46
unsigned short SamplesPerVertex
Definition CvrStgFile.h:184
UWORD32 getRadius(void) const
Definition CvrStgFile.h:125
UWORD32 Radius
Definition CvrStgFile.h:185
FILEFORMAT
Definition CvrStgFile.h:175
@ UNKNOWN
Definition CvrStgFile.h:175
@ AU
Definition CvrStgFile.h:175
@ JPEG
Definition CvrStgFile.h:175
@ BMP
Definition CvrStgFile.h:175
@ WAV
Definition CvrStgFile.h:175
virtual std::list< Property > getProperties(void) const =0
virtual void write(void)
Definition CvrStgFile.cc:68
an object that can hold embedded data
Definition CvrStgObject.h:40
a graph constructed from a cover file and a message to be embedded
Definition Graph.h:51
Definition MatchingAlgorithm.h:27
represent a matching on a graph
Definition Matching.h:41
an adjacency list-like data structur for sample values
Definition SampleValueAdjacencyList.h:33
the value of a sample in a CvrStgFile
Definition SampleValue.h:61
UWORD32 SamplePos
Definition common.h:67
unsigned long UWORD32
Definition common.h:45
BYTE EmbValue
Definition common.h:66