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_WAVFILE_H 00022 #define SH_WAVFILE_H 00023 00024 #include <vector> 00025 00026 #include "CvrStgFile.h" 00027 00028 class BinaryIO ; 00029 class WavChunkHeader ; 00030 class WavChunkUnused ; 00031 class WavFormatChunk ; 00032 00033 class WavFile : public CvrStgFile { 00034 public: 00035 WavFile (void) ; 00036 WavFile (BinaryIO *io) ; 00037 ~WavFile (void) ; 00038 00039 void read (BinaryIO *io) ; 00040 void write (void) ; 00041 00042 std::list<CvrStgFile::Property> getProperties (void) const ; 00043 00044 unsigned long getNumSamples (void) const ; 00045 void replaceSample (const SamplePos pos, const SampleValue* s) ; 00046 SampleValue* getSampleValue (SamplePos pos) const ; 00047 00048 std::vector<SampleValueAdjacencyList*> calcSVAdjacencyLists (const std::vector<SampleValue*>& svs) const ; 00049 std::vector<MatchingAlgorithm*> getMatchingAlgorithms (Graph* g, Matching* m) const ; 00050 00051 unsigned short getBitsPerSample (void) const ; 00052 00053 private: 00054 static const signed short FormatPCM = 1 ; 00055 00056 static const unsigned short SamplesPerVertex = 2 ; 00057 static const UWORD32 Radius_small = 1 ; 00058 static const UWORD32 Radius_large = 20 ; 00059 static const EmbValue EmbValueModulus = 2 ; 00060 00061 WavChunkHeader *riffchhdr ; 00062 char id_wave[4] ; 00063 00064 WavFormatChunk *FormatChunk ; 00065 00066 WavChunkHeader *datachhdr ; 00068 std::vector<unsigned char> data_small ; 00070 std::vector<int> data_large ; // it is assumed that an int can hold 32 bits 00071 00072 std::vector<WavChunkUnused*> UnusedBeforeData ; 00073 std::vector<BYTE> UnusedAfterData ; 00074 00075 void readheaders (void) ; 00076 void readdata (void) ; 00077 void writeheaders (void) ; 00078 void writedata (void) ; 00079 void calcpos (SamplePos n, unsigned long *bytepos, unsigned short *firstbitpos) const ; 00084 unsigned short getFirstBitPosinSample (void) ; 00085 unsigned short getBytesPerSample (void) ; 00086 } ; 00087 00088 #endif // ndef SH_WAVFILE_H