BmpFile.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_BMPFILE_H
#define SH_BMPFILE_H
#include <vector>
#include "CvrStgFile.h"
class BinaryIO ;
class ColorPalette ;
class BmpFile : public CvrStgFile {
public:
BmpFile (void) ;
BmpFile (BinaryIO *io) ;
~BmpFile (void) ;
void read (BinaryIO *io) ;
void write (void) ;
std::list<CvrStgFile::Property> getProperties (void) const ;
std::vector<MatchingAlgorithm*> getMatchingAlgorithms (Graph* g, Matching* m) const ;
unsigned long getNumSamples (void) const ;
void replaceSample (const SamplePos pos, const SampleValue* s) ;
SampleValue* getSampleValue (SamplePos pos) const ;
std::vector<SampleValueAdjacencyList*> calcSVAdjacencyLists (const std::vector<SampleValue*>& svs) const ;
unsigned short getBitCount (void) const ;
unsigned long getWidth (void) const ;
unsigned long getHeight (void) const ;
ColorPalette *getPalette (void) const ;
protected:
typedef struct struct_BITMAPFILEHEADER {
unsigned short bfType ;
unsigned long bfSize ;
unsigned short bfReserved1 ;
unsigned short bfReserved2 ;
unsigned long bfOffBits ;
} BITMAPFILEHEADER ;
/* windows bmp file format */
typedef struct struct_BITMAPINFOHEADER {
unsigned long biSize ;
signed long biWidth ;
signed long biHeight ;
unsigned short biPlanes ;
unsigned short biBitCount ;
unsigned long biCompression ;
unsigned long biSizeImage ;
signed long biXPelsPerMeter ;
signed long biYPelsPerMeter ;
unsigned long biClrUsed ;
unsigned long biClrImportant ;
} BITMAPINFOHEADER ;
/* os/2 bmp file format */
typedef struct struct_BITMAPCOREHEADER {
unsigned long bcSize;
unsigned short bcWidth;
unsigned short bcHeight;
unsigned short bcPlanes;
unsigned short bcBitCount;
} BITMAPCOREHEADER ;
private:
static const unsigned int IdBm = 19778 ;
static const unsigned short SizeBMFILEHEADER = 14 ;
static const unsigned short SizeBMINFOHEADER = 40 ;
static const unsigned short SizeBMCOREHEADER = 12 ;
static const unsigned int COMPRESSION_BI_RGB = 0 ;
static const unsigned short SamplesPerVertex_SmallPalette = 2 ;
static const unsigned short SamplesPerVertex_LargePalette = 3 ;
static const unsigned short SamplesPerVertex_RGB = 2 ;
static const UWORD32 Radius_Palette = 400 ;
static const UWORD32 Radius_RGB = 100 ;
static const EmbValue EmbValueModulus_SmallPalette = 2 ;
static const EmbValue EmbValueModulus_LargePalette = 4 ;
static const EmbValue EmbValueModulus_RGB = 4 ; // if changed here - also change BmpRGBSampleValue::calcEValue
enum SUBFORMAT { WIN, OS2 } ;
SUBFORMAT subformat ;
BITMAPFILEHEADER bmfh ;
BITMAPINFOHEADER bmih ;
BITMAPCOREHEADER bmch ;
ColorPalette* Palette ;
std::vector<std::vector <unsigned char> > bitmap ;
std::vector<BYTE> BitmapData ;
std::vector<BYTE> atend ;
void readheaders () ;
void bmpwin_readheaders () ;
void bmpos2_readheaders () ;
void writeheaders () ;
void bmpwin_writeheaders () ;
void bmpos2_writeheaders () ;
void readdata () ;
void writedata () ;
void calcIndex (SamplePos pos, unsigned long* index, unsigned short* firstbit) const ;
unsigned long calcLinelength () ;
SUBFORMAT getSubformat (void) const ;
} ;
#endif /* ndef SH_BMPFILE_H */
BmpFile::bmfh
BITMAPFILEHEADER bmfh
Definition: BmpFile.h:109
BmpFile::SizeBMINFOHEADER
static const unsigned short SizeBMINFOHEADER
Definition: BmpFile.h:90
BmpFile::struct_BITMAPCOREHEADER::bcSize
unsigned long bcSize
Definition: BmpFile.h:80
BmpFile::getBitCount
unsigned short getBitCount(void) const
Definition: BmpFile.cc:348
BmpFile::calcSVAdjacencyLists
std::vector< SampleValueAdjacencyList * > calcSVAdjacencyLists(const std::vector< SampleValue *> &svs) const
Definition: BmpFile.cc:172
BmpFile::bmpos2_writeheaders
void bmpos2_writeheaders()
Definition: BmpFile.cc:703
BmpFile::SamplesPerVertex_SmallPalette
static const unsigned short SamplesPerVertex_SmallPalette
Definition: BmpFile.h:94
BmpFile::OS2
Definition: BmpFile.h:106
BmpFile::Radius_RGB
static const UWORD32 Radius_RGB
the default radius for RGB images (100 = 10^2)
Definition: BmpFile.h:100
BmpFile::getMatchingAlgorithms
std::vector< MatchingAlgorithm * > getMatchingAlgorithms(Graph *g, Matching *m) const
Definition: BmpFile.cc:92
BmpFile::getProperties
std::list< CvrStgFile::Property > getProperties(void) const
Definition: BmpFile.cc:72
BmpFile::struct_BITMAPINFOHEADER::biClrImportant
unsigned long biClrImportant
Definition: BmpFile.h:75
BmpFile::SizeBMFILEHEADER
static const unsigned short SizeBMFILEHEADER
Definition: BmpFile.h:89
Graph
a graph constructed from a cover file and a message to be embedded
Definition: Graph.h:51
CvrStgFile
a cover-/stego-file
Definition: CvrStgFile.h:46
BmpFile::Radius_Palette
static const UWORD32 Radius_Palette
the default radius for palette images (400 = 20^2)
Definition: BmpFile.h:98
BmpFile::bitmap
std::vector< std::vector< unsigned char > > bitmap
Definition: BmpFile.h:120
BmpFile::atend
std::vector< BYTE > atend
contains bytes that are appended at the end of the bitmap data (some image editors apparently do this...
Definition: BmpFile.h:128
BmpFile::getPalette
ColorPalette * getPalette(void) const
Definition: BmpFile.cc:395
BmpFile::EmbValueModulus_RGB
static const EmbValue EmbValueModulus_RGB
Definition: BmpFile.h:104
BmpFile::IdBm
static const unsigned int IdBm
Definition: BmpFile.h:88
SamplePos
UWORD32 SamplePos
Definition: common.h:67
BmpFile::BITMAPCOREHEADER
struct BmpFile::struct_BITMAPCOREHEADER BITMAPCOREHEADER
BmpFile::struct_BITMAPFILEHEADER::bfType
unsigned short bfType
Definition: BmpFile.h:56
BmpFile::struct_BITMAPFILEHEADER::bfOffBits
unsigned long bfOffBits
Definition: BmpFile.h:60
BmpFile::struct_BITMAPFILEHEADER::bfSize
unsigned long bfSize
Definition: BmpFile.h:57
BmpFile::struct_BITMAPINFOHEADER::biHeight
signed long biHeight
Definition: BmpFile.h:67
BmpFile::bmpwin_readheaders
void bmpwin_readheaders()
Definition: BmpFile.cc:457
SampleValue
the value of a sample in a CvrStgFile
Definition: SampleValue.h:61
BmpFile::SamplesPerVertex_LargePalette
static const unsigned short SamplesPerVertex_LargePalette
Definition: BmpFile.h:95
BmpFile::EmbValueModulus_SmallPalette
static const EmbValue EmbValueModulus_SmallPalette
Definition: BmpFile.h:102
BmpFile::struct_BITMAPCOREHEADER::bcPlanes
unsigned short bcPlanes
Definition: BmpFile.h:83
BmpFile::SUBFORMAT
SUBFORMAT
Definition: BmpFile.h:106
ColorPalette
a color palette
Definition: ColorPalette.h:36
BmpFile::readdata
void readdata()
Definition: BmpFile.cc:754
BmpFile::struct_BITMAPINFOHEADER::biPlanes
unsigned short biPlanes
Definition: BmpFile.h:68
BmpFile::struct_BITMAPINFOHEADER::biSizeImage
unsigned long biSizeImage
Definition: BmpFile.h:71
BmpFile::writeheaders
void writeheaders()
Definition: BmpFile.cc:643
BmpFile::bmpwin_writeheaders
void bmpwin_writeheaders()
Definition: BmpFile.cc:679
BmpFile::struct_BITMAPINFOHEADER::biClrUsed
unsigned long biClrUsed
Definition: BmpFile.h:74
BmpFile::Palette
ColorPalette * Palette
Definition: BmpFile.h:112
BmpFile::COMPRESSION_BI_RGB
static const unsigned int COMPRESSION_BI_RGB
Definition: BmpFile.h:92
BmpFile::writedata
void writedata()
Definition: BmpFile.cc:808
BmpFile::struct_BITMAPCOREHEADER::bcWidth
unsigned short bcWidth
Definition: BmpFile.h:81
BmpFile
Definition: BmpFile.h:31
UWORD32
unsigned long UWORD32
Definition: common.h:45
BmpFile::calcLinelength
unsigned long calcLinelength()
Definition: BmpFile.cc:721
BmpFile::getSampleValue
SampleValue * getSampleValue(SamplePos pos) const
Definition: BmpFile.cc:148
Matching
represent a matching on a graph
Definition: Matching.h:41
BmpFile::BITMAPFILEHEADER
struct BmpFile::struct_BITMAPFILEHEADER BITMAPFILEHEADER
BinaryIO
provides methods for file i/o as needed by the rest of steghide
Definition: BinaryIO.h:33
BmpFile::EmbValueModulus_LargePalette
static const EmbValue EmbValueModulus_LargePalette
Definition: BmpFile.h:103
BmpFile::struct_BITMAPCOREHEADER::bcBitCount
unsigned short bcBitCount
Definition: BmpFile.h:84
BmpFile::read
void read(BinaryIO *io)
Definition: BmpFile.cc:55
BmpFile::struct_BITMAPFILEHEADER
Definition: BmpFile.h:55
BmpFile::replaceSample
void replaceSample(const SamplePos pos, const SampleValue *s)
Definition: BmpFile.cc:119
BmpFile::struct_BITMAPINFOHEADER::biCompression
unsigned long biCompression
Definition: BmpFile.h:70
BmpFile::struct_BITMAPFILEHEADER::bfReserved2
unsigned short bfReserved2
Definition: BmpFile.h:59
CvrStgFile.h
BmpFile::struct_BITMAPFILEHEADER::bfReserved1
unsigned short bfReserved1
Definition: BmpFile.h:58
BmpFile::bmih
BITMAPINFOHEADER bmih
Definition: BmpFile.h:110
BmpFile::BmpFile
BmpFile(void)
BmpFile::getWidth
unsigned long getWidth(void) const
Definition: BmpFile.cc:364
BmpFile::struct_BITMAPINFOHEADER::biWidth
signed long biWidth
Definition: BmpFile.h:66
BmpFile::struct_BITMAPINFOHEADER
Definition: BmpFile.h:64
BmpFile::struct_BITMAPCOREHEADER
Definition: BmpFile.h:79
BmpFile::SamplesPerVertex_RGB
static const unsigned short SamplesPerVertex_RGB
Definition: BmpFile.h:96
BmpFile::bmch
BITMAPCOREHEADER bmch
Definition: BmpFile.h:111
BmpFile::getHeight
unsigned long getHeight(void) const
Definition: BmpFile.cc:379
BmpFile::BITMAPINFOHEADER
struct BmpFile::struct_BITMAPINFOHEADER BITMAPINFOHEADER
BmpFile::calcIndex
void calcIndex(SamplePos pos, unsigned long *index, unsigned short *firstbit) const
Definition: BmpFile.cc:305
BmpFile::WIN
Definition: BmpFile.h:106
BmpFile::struct_BITMAPINFOHEADER::biSize
unsigned long biSize
Definition: BmpFile.h:65
BmpFile::write
void write(void)
Definition: BmpFile.cc:64
EmbValue
BYTE EmbValue
Definition: common.h:66
BmpFile::readheaders
void readheaders()
Definition: BmpFile.cc:403
BmpFile::BitmapData
std::vector< BYTE > BitmapData
Definition: BmpFile.h:125
BmpFile::getSubformat
SUBFORMAT getSubformat(void) const
Definition: BmpFile.cc:50
BmpFile::bmpos2_readheaders
void bmpos2_readheaders()
Definition: BmpFile.cc:560
BmpFile::struct_BITMAPINFOHEADER::biBitCount
unsigned short biBitCount
Definition: BmpFile.h:69
BmpFile::struct_BITMAPINFOHEADER::biYPelsPerMeter
signed long biYPelsPerMeter
Definition: BmpFile.h:73
BmpFile::getNumSamples
unsigned long getNumSamples(void) const
Definition: BmpFile.cc:104
BmpFile::struct_BITMAPCOREHEADER::bcHeight
unsigned short bcHeight
Definition: BmpFile.h:82
BmpFile::subformat
SUBFORMAT subformat
Definition: BmpFile.h:108
BmpFile::SizeBMCOREHEADER
static const unsigned short SizeBMCOREHEADER
Definition: BmpFile.h:91
BmpFile::~BmpFile
~BmpFile(void)
Definition: BmpFile.cc:45
BmpFile::struct_BITMAPINFOHEADER::biXPelsPerMeter
signed long biXPelsPerMeter
Definition: BmpFile.h:72