CvrStgFile.h

Go to the documentation of this file.
00001 /*
00002  * steghide 0.5.1 - a steganography program
00003  * Copyright (C) 1999-2003 Stefan Hetzl <shetzl@chello.at>
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00018  *
00019  */
00020 
00021 #ifndef SH_CVRSTGFILE_H
00022 #define SH_CVRSTGFILE_H
00023 
00024 #include <list>
00025 #include <string>
00026 #include <map>
00027 
00028 #include "BinaryIO.h"
00029 #include "CvrStgObject.h"
00030 class Graph ;
00031 class Matching ;
00032 class MatchingAlgorithm ;
00033 class SampleValue ;
00034 class SampleValueAdjacencyList ;
00035 
00046 class CvrStgFile : public CvrStgObject {
00047         public:
00052         static CvrStgFile *readFile (const std::string& fn) ;
00053 
00054         class Property : private std::pair<std::string,std::string> {
00055                 public:
00056                 Property (std::string key, std::string value)
00057                         : std::pair<std::string,std::string> (key, value) {} ;
00058 
00059                 std::string getKey (void) const
00060                         { return first ; } ;
00061 
00062                 std::string getValue (void) const
00063                         { return second ; } ;
00064         } ;
00065 
00066         CvrStgFile (void) ;
00067         virtual ~CvrStgFile (void) ;
00068 
00069         virtual void read (BinaryIO *io) ;
00070         virtual void write (void) ;
00071         void transform (const std::string& fn) ;
00072 
00073         virtual std::list<Property> getProperties (void) const = 0 ;
00074 
00086         virtual std::vector<SampleValueAdjacencyList*> calcSVAdjacencyLists (const std::vector<SampleValue*>& svs) const ;
00087 
00095         virtual std::vector<MatchingAlgorithm*> getMatchingAlgorithms (Graph* g, Matching* m) const ;
00096 
00100         const std::string& getName (void) const
00101                 { return getBinIO()->getName() ; } ;
00102 
00103         bool is_std (void) const
00104                 { return getBinIO()->is_std() ; } ;
00105 
00110         unsigned long getCapacity (void) const ;
00111         
00115         std::string getHRCapacity (void) const ;
00116 
00120         unsigned short getSamplesPerVertex (void) const
00121                 { return SamplesPerVertex ; } ;
00125         UWORD32 getRadius (void) const
00126                 { return Radius ; } ;
00130         EmbValue getEmbValueModulus (void) const
00131                 { return EmbValueModulus ; } ;
00132 
00142         virtual EmbValue getEmbeddedValue (const SamplePos pos) const ;
00143 
00144 #ifdef DEBUG
00145 
00148         virtual std::map<SampleKey,unsigned long>* getFrequencies (void) ;
00155         virtual void printFrequencies (const std::map<SampleKey,unsigned long>& freqs) ;
00156 #endif
00157 
00158         protected:
00159         void setSamplesPerVertex (unsigned short spv)
00160                 { SamplesPerVertex = spv ; } ;
00164         void setRadius (UWORD32 r) ;
00165         void setEmbValueModulus (EmbValue m)
00166                 { EmbValueModulus = m ; } ;
00167         
00168         void setBinIO (BinaryIO* io)
00169                 { BinIO = io ; } ;
00170 
00171         BinaryIO* getBinIO (void) const
00172                 { return BinIO ; } ;
00173 
00174         private:
00175         enum FILEFORMAT { UNKNOWN, BMP, WAV, AU, JPEG } ;
00176 
00180         static FILEFORMAT guessff (BinaryIO *io) ;
00181 
00182         BinaryIO* BinIO ;
00183 
00184         unsigned short SamplesPerVertex ;
00185         UWORD32 Radius ;
00186         EmbValue EmbValueModulus ;
00187 } ;
00188 
00189 #endif /* ndef SH_CVRSTGFILE_H */

Generated on Fri Feb 2 09:21:48 2007 for steghide by  doxygen 1.5.1