Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

BmpFile Class Reference

#include <BmpFile.h>

Inheritance diagram for BmpFile:

CvrStgFile CvrStgObject List of all members.

Public Member Functions

 BmpFile (void)
 BmpFile (BinaryIO *io)
 ~BmpFile (void)
void read (BinaryIO *io)
void write (void)
std::list< CvrStgFile::PropertygetProperties (void) const
std::vector< MatchingAlgorithm * > getMatchingAlgorithms (Graph *g, Matching *m) const
unsigned long getNumSamples (void) const
void replaceSample (const SamplePos pos, const SampleValue *s)
SampleValuegetSampleValue (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
ColorPalettegetPalette (void) const

Protected Types

typedef BmpFile::struct_BITMAPFILEHEADER BITMAPFILEHEADER
typedef BmpFile::struct_BITMAPINFOHEADER BITMAPINFOHEADER
typedef BmpFile::struct_BITMAPCOREHEADER BITMAPCOREHEADER

Private Types

enum  SUBFORMAT { WIN, OS2 }

Private Member Functions

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

Private Attributes

SUBFORMAT subformat
BITMAPFILEHEADER bmfh
BITMAPINFOHEADER bmih
BITMAPCOREHEADER bmch
ColorPalettePalette
std::vector< std::vector<
unsigned char > > 
bitmap
std::vector< BYTEBitmapData
std::vector< BYTEatend
 contains bytes that are appended at the end of the bitmap data (some image editors apparently do this)


Static Private Attributes

const unsigned int IdBm = 19778
const unsigned short SizeBMFILEHEADER = 14
const unsigned short SizeBMINFOHEADER = 40
const unsigned short SizeBMCOREHEADER = 12
const unsigned int COMPRESSION_BI_RGB = 0
const unsigned short SamplesPerVertex_SmallPalette = 2
const unsigned short SamplesPerVertex_LargePalette = 3
const unsigned short SamplesPerVertex_RGB = 2
const UWORD32 Radius_Palette = 400
 the default radius for palette images (400 = 20^2)

const UWORD32 Radius_RGB = 100
 the default radius for RGB images (100 = 10^2)

const EmbValue EmbValueModulus_SmallPalette = 2
const EmbValue EmbValueModulus_LargePalette = 4
const EmbValue EmbValueModulus_RGB = 4

Member Typedef Documentation

typedef struct BmpFile::struct_BITMAPCOREHEADER BmpFile::BITMAPCOREHEADER [protected]
 

typedef struct BmpFile::struct_BITMAPFILEHEADER BmpFile::BITMAPFILEHEADER [protected]
 

typedef struct BmpFile::struct_BITMAPINFOHEADER BmpFile::BITMAPINFOHEADER [protected]
 


Member Enumeration Documentation

enum BmpFile::SUBFORMAT [private]
 

Enumeration values:
WIN 
OS2 


Constructor & Destructor Documentation

BmpFile::BmpFile void   ) 
 

BmpFile::BmpFile BinaryIO io  ) 
 

BmpFile::~BmpFile void   ) 
 


Member Function Documentation

void BmpFile::bmpos2_readheaders  )  [private]
 

void BmpFile::bmpos2_writeheaders  )  [private]
 

void BmpFile::bmpwin_readheaders  )  [private]
 

void BmpFile::bmpwin_writeheaders  )  [private]
 

void BmpFile::calcIndex SamplePos  pos,
unsigned long *  index,
unsigned short *  firstbit
const [private]
 

translate a sample position into a <index,firstbit> pair "pointing" into the BitmapData array

Parameters:
pos a sample position
index a pointer to a variable that will contain the array index used to access the pos-th sample
firstbit the firstbit in BitmapData[index] that belongs to the sample with the given position

unsigned long BmpFile::calcLinelength  )  [private]
 

std::vector< SampleValueAdjacencyList * > BmpFile::calcSVAdjacencyLists const std::vector< SampleValue * > &  svs  )  const [virtual]
 

calculate a vector a SampleValueAdjacencyLists

Parameters:
svs a vector of unique(!) sample values where svs[i]->getLabel() == i holds for all i
Returns:
a vector of SampleValueAdjacencyLists where retval[i] only contains sample values with getEmbValue() == i
Every row in the adjacency lists must be sorted in the following order: The first sample value has the least distance to the source sample value, the last has the largest distance. If two sample values in one row have the same distance to the source sample value, the order does not matter.

May be overridden in derived class to provide a faster version.

Reimplemented from CvrStgFile.

unsigned short BmpFile::getBitCount void   )  const
 

unsigned long BmpFile::getHeight void   )  const
 

std::vector< MatchingAlgorithm * > BmpFile::getMatchingAlgorithms Graph g,
Matching m
const [virtual]
 

get recommended list of matching algorithms

Parameters:
m an empty matching - will be used in construction of MatchingAlgorithm objects
The MatchingAlgorithm objects returned by this function should be deleted by the caller if they are no longer needed.

Reimplemented from CvrStgFile.

unsigned long BmpFile::getNumSamples void   )  const [virtual]
 

get the number of samples in this CvrStgObject

Implements CvrStgObject.

ColorPalette * BmpFile::getPalette void   )  const
 

std::list< CvrStgFile::Property > BmpFile::getProperties void   )  const [virtual]
 

Implements CvrStgFile.

SampleValue * BmpFile::getSampleValue SamplePos  pos  )  const [virtual]
 

get the sample at position pos

Parameters:
pos the position of a sample (must be in 0...getNumSamples()-1)
Returns:
the sample at the given position
The sample object is created in this function and should be deleted by the caller. The derived class should check the condition(s) given above in its Implementation of this function.

Implements CvrStgObject.

BmpFile::SUBFORMAT BmpFile::getSubformat void   )  const [private]
 

unsigned long BmpFile::getWidth void   )  const
 

void BmpFile::read BinaryIO io  )  [virtual]
 

Reimplemented from CvrStgFile.

void BmpFile::readdata  )  [private]
 

void BmpFile::readheaders  )  [private]
 

void BmpFile::replaceSample const SamplePos  pos,
const SampleValue s
[virtual]
 

replace a sample thus (possibly) altering the value of the bit returned by SampleValue->getBit()

Parameters:
pos the position of the sample (must be in 0...getNumSamples()-1)
s the sample value that should replace the current sample value (must be of correct type for this CvrStgObject)
The derived class should check the condition(s) given above in its Implementation of this function.

Implements CvrStgObject.

void BmpFile::write void   )  [virtual]
 

Reimplemented from CvrStgFile.

void BmpFile::writedata  )  [private]
 

void BmpFile::writeheaders  )  [private]
 


Member Data Documentation

std::vector<BYTE> BmpFile::atend [private]
 

std::vector<std::vector <unsigned char> > BmpFile::bitmap [private]
 

contains the bitmap in the following format bitmap[i] is the pixel data of the i-th row of the bitmap bitmap[i][j] is the j-th byte of the pixel data of the i-th row of the bitmap if bitcount is < 8 then bitmap[i][j] contains the pixels as read in from the file (i.e. in the "wrong" direction) this is taken care of in the calcRCB function

std::vector<BYTE> BmpFile::BitmapData [private]
 

contains the bitmap data in the same order as read from file (but without padding bytes)

BITMAPCOREHEADER BmpFile::bmch [private]
 

BITMAPFILEHEADER BmpFile::bmfh [private]
 

BITMAPINFOHEADER BmpFile::bmih [private]
 

const unsigned int BmpFile::COMPRESSION_BI_RGB = 0 [static, private]
 

const EmbValue BmpFile::EmbValueModulus_LargePalette = 4 [static, private]
 

const EmbValue BmpFile::EmbValueModulus_RGB = 4 [static, private]
 

const EmbValue BmpFile::EmbValueModulus_SmallPalette = 2 [static, private]
 

const unsigned int BmpFile::IdBm = 19778 [static, private]
 

ColorPalette* BmpFile::Palette [private]
 

const UWORD32 BmpFile::Radius_Palette = 400 [static, private]
 

const UWORD32 BmpFile::Radius_RGB = 100 [static, private]
 

const unsigned short BmpFile::SamplesPerVertex_LargePalette = 3 [static, private]
 

const unsigned short BmpFile::SamplesPerVertex_RGB = 2 [static, private]
 

const unsigned short BmpFile::SamplesPerVertex_SmallPalette = 2 [static, private]
 

const unsigned short BmpFile::SizeBMCOREHEADER = 12 [static, private]
 

const unsigned short BmpFile::SizeBMFILEHEADER = 14 [static, private]
 

const unsigned short BmpFile::SizeBMINFOHEADER = 40 [static, private]
 

SUBFORMAT BmpFile::subformat [private]
 


The documentation for this class was generated from the following files:
Generated on Fri Jul 16 19:41:21 2004 for steghide by doxygen 1.3.7