|
DCMTK Version 3.7.1
OFFIS DICOM Toolkit
|
This is a I2DImgSource implementation that can parse BMP files and convert them into DICOM images. More...
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 further information about this pixel data. | |
| virtual OFCondition | getLossyComprInfo (OFBool &srcEncodingLossy, OFString &srcLossyComprMethod) const |
| After reading of pixel data, this function can be used for getting information about lossy compression parameters. | |
| virtual | ~I2DBmpSource () |
| Destructor, frees some memory. | |
| Public Member Functions inherited from I2DImgSource | |
| I2DImgSource () | |
| Constructor. | |
| void | setImageFile (const OFString &filename) |
| Sets the input image file to read. | |
| OFString | getImageFile () |
| Returns the input image file that currently associated with plugin. | |
| virtual | ~I2DImgSource () |
| Virtual Destructor. | |
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, OFBool &isMonochrome, Uint32 *&palette) |
| Read the color palette from the file. | |
| OFCondition | readBitmapData (const Uint16 width, const Uint16 height, const Uint16 bpp, const OFBool isTopDown, const OFBool isMonochrome, 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, OFBool isMonochrome, char *pixData) const |
| Parse a single 24bpp or 32bpp row of BMP data. | |
| OFCondition | parse16BppRow (const Uint8 *row, const Uint16 width, OFBool isMonochrome, 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, const OFBool isMonochrome, 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. | |
| Protected Attributes inherited from I2DImgSource | |
| OFString | m_imageFile |
| The input file. | |
This is a I2DImgSource implementation that can parse BMP files and convert them into DICOM images.
|
inlinevirtual |
After reading of pixel data, this function can be used for getting information about lossy compression parameters.
| srcEncodingLossy | - [out] Always returns OFFalse (i.e. lossless) |
| srcLossyComprMethod | - [out] Unused parameter |
Implements I2DImgSource.
References EC_Normal, and getLossyComprInfo().
Referenced by getLossyComprInfo().
|
virtual |
Returns format of input image.
For this class "BMP" is returned.
Implements I2DImgSource.
|
protected |
Opens the BMP file specified by the given filename.
| filename | - [in] The file to be opened |
|
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. |
| isMonochrome | - [in] true if a monochrome color palette was detected in the BMP data. |
| pixData | - [out] The buffer to write the data to (in "RGB" format). |
|
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. |
| isMonochrome | - [in] true if a monochrome color palette was detected in the BMP data. |
| pixData | - [out] The buffer to write the data to (in "RGB" format). |
|
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. |
| isMonochrome | - [in] If true, this is a monochrome palette color image |
| pixData | - [out] The buffer to write the data to (in "RGB" format). |
|
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 |
| isMonochrome | - [in] If true, this is a monochrome palette color image |
| colors | - [in] Number of color palette entries |
| palette | - [in] Color palette |
| pixData | - [out] Image data |
| length | - [out] Length of data |
|
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. |
|
protected |
Read the color palette from the file.
| colors | - [in] number of colors to read |
| isMonochrome | - [out] true if the palette is monochrome |
| palette | - [out] the read color palette is stored here |
|
protected |
Read 4 bytes from the byte stream.
| result | - [out] The result |
|
protected |
Reads and checks the BMP file header.
| offset | - [out] Offset to the BMP data from beginning of file |
|
protected |
Read 4 bytes from the byte stream and interpret it as a signed integer.
| result | - [out] The result |
|
virtual |
Extracts the raw BMP pixel data stream from a BMP file and returns some further 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 |
| length | - [out] Length of pixel data |
| ts | - [out] The transfer syntax imposed by the imported pixel pixel data |
Implements I2DImgSource.
|
protected |
Read 2 bytes from the byte stream.
| result | - [out] The result |