Inheritance diagram for I2DBmpSource:
Public Member Functions | |
I2DBmpSource () | |
Constructor, initializes member variables. | |
OFString | inputFormat () const |
Returns format of input image. | |
OFCondition | readPixelData (Uint16 &rows, Uint16 &cols, Uint16 &samplesPerPixel, OFString &photoMetrInt, Uint16 &bitsAlloc, Uint16 &bitsStored, Uint16 &highBit, Uint16 &pixelRepr, Uint16 &planConf, Uint16 &pixAspectH, Uint16 &pixAspectV, char *&pixData, Uint32 &length, E_TransferSyntax &ts) |
Extracts the raw BMP pixel data stream from a BMP file and returns some image information about this pixel data. | |
virtual OFCondition | getLossyComprInfo (OFBool &srcEncodingLossy, OFString &) const |
After reading of pixel data, this function can be used for getting information about lossy compression parameters. | |
virtual | ~I2DBmpSource () |
Destructor, frees some memory. | |
Protected Member Functions | |
OFCondition | openFile (const OFString &filename) |
Opens the BMP file specified by the given filename. | |
void | closeFile () |
Closes BMP file. | |
OFCondition | readFileHeader (Uint32 &offset) |
Reads and checks the BMP file header. | |
OFCondition | readBitmapHeader (Uint16 &width, Uint16 &height, Uint16 &bpp, OFBool &isTopDown, Uint16 &colors) |
Reads and checks the BMP bitmap header. | |
OFCondition | readColorPalette (Uint16 colors, Uint32 *&palette) |
Read the color palette from the file. | |
OFCondition | readBitmapData (const Uint16 width, const Uint16 height, const Uint16 bpp, const OFBool isTopDown, const Uint16 colors, const Uint32 *palette, char *&pixData, Uint32 &length) |
Read the bitmap data. | |
OFCondition | parse24_32BppRow (const Uint8 *row, const Uint16 width, const int bpp, char *pixData) const |
Parse a single 24bpp or 32bpp row of bmp data. | |
OFCondition | parse16BppRow (const Uint8 *row, const Uint16 width, char *pixData) const |
Parse a single 16bpp row of bmp data. | |
OFCondition | parseIndexedColorRow (const Uint8 *row, const Uint16 width, const int bpp, const Uint16 colors, const Uint32 *palette, char *pixData) const |
Parse a single 1, 4 or 8bpp row of bmp data. | |
int | readLong (Sint32 &result) |
Read 4 bytes from the byte stream and interpret it as a signed integer. | |
int | readDWord (Uint32 &result) |
Read 4 bytes from the byte stream. | |
int | readWord (Uint16 &result) |
Read 2 bytes from the byte stream. | |
Protected Attributes | |
OFFile | bmpFile |
The BMP file, if opened. |
Definition at line 39 of file i2dbmps.h.
I2DBmpSource::I2DBmpSource | ( | ) |
Constructor, initializes member variables.
virtual I2DBmpSource::~I2DBmpSource | ( | ) | [virtual] |
Destructor, frees some memory.
OFString I2DBmpSource::inputFormat | ( | ) | const [virtual] |
Returns format of input image.
For this class "BMP" is returned.
Implements I2DImgSource.
OFCondition I2DBmpSource::readPixelData | ( | Uint16 & | rows, | |
Uint16 & | cols, | |||
Uint16 & | samplesPerPixel, | |||
OFString & | photoMetrInt, | |||
Uint16 & | bitsAlloc, | |||
Uint16 & | bitsStored, | |||
Uint16 & | highBit, | |||
Uint16 & | pixelRepr, | |||
Uint16 & | planConf, | |||
Uint16 & | pixAspectH, | |||
Uint16 & | pixAspectV, | |||
char *& | pixData, | |||
Uint32 & | length, | |||
E_TransferSyntax & | ts | |||
) | [virtual] |
Extracts the raw BMP pixel data stream from a BMP file and returns some image information about this pixel data.
Raw means that any header information is removed from the BMP stream. This function allocates memory for the pixel data returned to the user. The caller of this function is responsible for deleting the memory buffer
rows | - [out] Rows of image | |
cols | - [out] Columns of image | |
samplesPerPixel | - [out] Number of components per pixel | |
photoMetrInt | - [out] The DICOM color model used for the compressed data | |
bitsAlloc | - [out] Bits Allocated for one sample | |
bitsStored | - [out] Bits Stored, Number of bits actually stored within Bits Allocated | |
highBit | - [out] High Bit, Highest stored in bit within Bits Allocated | |
pixelRepr | - [out] Pixel Representation (0=unsigned, 1=signed) | |
planConf | - [out] Planar Configuration | |
pixAspectH | - [out] Horizontal value of pixel aspect ratio | |
pixAspectV | - [out] Vertical value of pixel aspect ratio | |
pixData | - [out] Pointer to the pixel data in BMP Interchange Format (but without APPx markers). | |
length | - [out] Length of pixel data | |
ts | - [out] The transfer syntax imposed by the imported pixel pixel data. This is necessary for the BMP importer that needs to report which TS must be used for the imported BMP data (ie. baseline, progressive, ...). |
Implements I2DImgSource.
virtual OFCondition I2DBmpSource::getLossyComprInfo | ( | OFBool & | srcEncodingLossy, | |
OFString & | ||||
) | const [inline, virtual] |
After reading of pixel data, this function can be used for getting information about lossy compression parameters.
srcEncodingLossy | - [out] Denotes, whether the encoding of the pixel data read was lossy (OFtrue) or lossless (OFFalse) | |
srcLossyComprMethod | - [out] Denotes the lossy compression method used in source if there is one (srcEncodingLossy = OFTrue). Should use defined terms of attribute Lossy Compression Method. |
Implements I2DImgSource.
OFCondition I2DBmpSource::openFile | ( | const OFString & | filename | ) | [protected] |
Opens the BMP file specified by the given filename.
filename | - [in] The file to be opened |
void I2DBmpSource::closeFile | ( | ) | [protected] |
Closes BMP file.
OFCondition I2DBmpSource::readFileHeader | ( | Uint32 & | offset | ) | [protected] |
Reads and checks the BMP file header.
offset | - [out] Offset to the BMP data from beginning of file |
OFCondition I2DBmpSource::readBitmapHeader | ( | Uint16 & | width, | |
Uint16 & | height, | |||
Uint16 & | bpp, | |||
OFBool & | isTopDown, | |||
Uint16 & | colors | |||
) | [protected] |
Reads and checks the BMP bitmap header.
After this function, the current read position is just after the header. That is, at the beginning of the color palette.
width | - [out] width of the image in pixel | |
height | - [out] height of the image in pixel | |
isTopDown | - [out] OFTrue if this is a top down bitmap (height was read as negative value).OFFalse otherwise. | |
bpp | - [out] bits per pixel of the image. | |
colors | - [out] number of entries in color table. |
OFCondition I2DBmpSource::readColorPalette | ( | Uint16 | colors, | |
Uint32 *& | palette | |||
) | [protected] |
Read the color palette from the file.
colors | - [in] number of colors to read | |
palette | - [out] the read color palette is stored here |
OFCondition I2DBmpSource::readBitmapData | ( | const Uint16 | width, | |
const Uint16 | height, | |||
const Uint16 | bpp, | |||
const OFBool | isTopDown, | |||
const Uint16 | colors, | |||
const Uint32 * | palette, | |||
char *& | pixData, | |||
Uint32 & | length | |||
) | [protected] |
Read the bitmap data.
This assumes the current read position is at the start of the image data.
width | - [in] width of the image in pixel | |
height | - [in] height of the image in pixel | |
bpp | - [in] Image's bits per pixel. | |
isTopDown | - [in] If true, this is a top down bitmap | |
colors | - [in] Number of color palette entries | |
palette | - [in] Color palette | |
pixData | - [out] Image data | |
length | - [out] Length of data |
OFCondition I2DBmpSource::parse24_32BppRow | ( | const Uint8 * | row, | |
const Uint16 | width, | |||
const int | bpp, | |||
char * | pixData | |||
) | const [protected] |
Parse a single 24bpp or 32bpp row of bmp data.
row | - [in] The row of data to parse. | |
width | - [in] The length in pixel of the row. | |
bpp | - [in] The number of bits per pixel. | |
pixData | - [out] The buffer to write the data to (in "RGB" format). |
OFCondition I2DBmpSource::parse16BppRow | ( | const Uint8 * | row, | |
const Uint16 | width, | |||
char * | pixData | |||
) | const [protected] |
Parse a single 16bpp row of bmp data.
row | - [in] The row of data to parse. | |
width | - [in] The length in pixel of the row. | |
pixData | - [out] The buffer to write the data to (in "RGB" format). |
OFCondition I2DBmpSource::parseIndexedColorRow | ( | const Uint8 * | row, | |
const Uint16 | width, | |||
const int | bpp, | |||
const Uint16 | colors, | |||
const Uint32 * | palette, | |||
char * | pixData | |||
) | const [protected] |
Parse a single 1, 4 or 8bpp row of bmp data.
row | - [in] The row of data to parse. | |
width | - [in] The length in pixel of the row. | |
bpp | - [in] The number of bits per pixel. | |
colors | - [in] The number of entries in the color palette. | |
palette | - [in] The color palette to use. | |
pixData | - [out] The buffer to write the data to (in "RGB" format). |
int I2DBmpSource::readLong | ( | Sint32 & | result | ) | [protected] |
Read 4 bytes from the byte stream and interpret it as a signed integer.
result | - [out] The result |
int I2DBmpSource::readDWord | ( | Uint32 & | result | ) | [protected] |
Read 4 bytes from the byte stream.
result | - [out] The result |
int I2DBmpSource::readWord | ( | Uint16 & | result | ) | [protected] |
Read 2 bytes from the byte stream.
result | - [out] The result |