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 struct
BmpFile::struct_BITMAPFILEHEADER 
BITMAPFILEHEADER
typedef struct
BmpFile::struct_BITMAPINFOHEADER 
BITMAPINFOHEADER
typedef struct
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

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
 the default radius for palette images (400 = 20^2)
static const UWORD32 Radius_RGB = 100
 the default radius for RGB images (100 = 10^2)
static const EmbValue EmbValueModulus_SmallPalette = 2
static const EmbValue EmbValueModulus_LargePalette = 4
static const EmbValue EmbValueModulus_RGB = 4

Classes

struct  struct_BITMAPCOREHEADER
struct  struct_BITMAPFILEHEADER
struct  struct_BITMAPINFOHEADER


Member Typedef Documentation

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

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

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


Member Enumeration Documentation

enum BmpFile::SUBFORMAT [private]

Enumerator:
WIN 
OS2 


Constructor & Destructor Documentation

BmpFile::BmpFile ( void   ) 

BmpFile::BmpFile ( BinaryIO io  ) 

BmpFile::~BmpFile ( void   ) 


Member Function Documentation

void BmpFile::read ( BinaryIO io  )  [virtual]

Reimplemented from CvrStgFile.

void BmpFile::write ( void   )  [virtual]

Reimplemented from CvrStgFile.

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

Implements CvrStgFile.

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.

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.

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.

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::getWidth ( void   )  const

unsigned long BmpFile::getHeight ( void   )  const

ColorPalette * BmpFile::getPalette ( void   )  const

void BmpFile::readheaders (  )  [private]

void BmpFile::bmpwin_readheaders (  )  [private]

void BmpFile::bmpos2_readheaders (  )  [private]

void BmpFile::writeheaders (  )  [private]

void BmpFile::bmpwin_writeheaders (  )  [private]

void BmpFile::bmpos2_writeheaders (  )  [private]

void BmpFile::readdata (  )  [private]

void BmpFile::writedata (  )  [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]

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


Member Data Documentation

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

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

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

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

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

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

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

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

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

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

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

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

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

SUBFORMAT BmpFile::subformat [private]

BITMAPFILEHEADER BmpFile::bmfh [private]

BITMAPINFOHEADER BmpFile::bmih [private]

BITMAPCOREHEADER BmpFile::bmch [private]

ColorPalette* BmpFile::Palette [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)

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


The documentation for this class was generated from the following files:
Generated on Thu Jan 3 18:39:33 2008 for steghide by  doxygen 1.5.4