retdec
Private Attributes | List of all members
retdec::fileformat::BitmapImage Class Reference

#include <bitmap_image.h>

Collaboration diagram for retdec::fileformat::BitmapImage:
Collaboration graph
[legend]

Public Member Functions

Getters
std::size_t getWidth () const
 
std::size_t getHeight () const
 
std::size_t getSize () const
 
const std::vector< std::vector< struct BitmapPixel > > & getImage () const
 
Other methods
bool parseDibFormat (const ResourceIcon &icon)
 
bool parseDibHeader (const ResourceIcon &icon, struct BitmapInformationHeader &res) const
 
bool parseDib1Data (const ResourceIcon &icon, const struct BitmapInformationHeader &hdr)
 
bool parseDib4Data (const ResourceIcon &icon, const struct BitmapInformationHeader &hdr)
 
bool parseDib8Data (const ResourceIcon &icon, const struct BitmapInformationHeader &hdr)
 
bool parseDib24Data (const ResourceIcon &icon, const struct BitmapInformationHeader &hdr)
 
bool parseDib32Data (const ResourceIcon &icon, const struct BitmapInformationHeader &hdr)
 
bool parseDibPalette (const ResourceIcon &icon, std::vector< struct BitmapPixel > &palette, std::uint32_t nColors)
 
void invertAxisY ()
 
void setAlphaFull ()
 
bool reduce8x8 ()
 
bool averageRowPixels (std::size_t row, std::size_t offset, std::size_t nPixels, struct BitmapPixel &res)
 
bool averageColumnPixels (std::size_t column, std::size_t offset, std::size_t nPixels, struct BitmapPixel &res)
 
void greyScale ()
 

Private Attributes

std::vector< std::vector< struct BitmapPixel > > image
 bitmap image map row x column More...
 

Detailed Description

One bitmap image

Member Function Documentation

◆ averageColumnPixels()

bool retdec::fileformat::BitmapImage::averageColumnPixels ( std::size_t  column,
std::size_t  offset,
std::size_t  nPixels,
struct BitmapPixel res 
)

Average pixels in a column

Parameters
columnA column to average pixels from (indexed from 0)
offsetRow offset (indexed from 0)
nPixelsNumber of pixels
resPixel to store the result to
Returns
true on success, otherwise false

◆ averageRowPixels()

bool retdec::fileformat::BitmapImage::averageRowPixels ( std::size_t  row,
std::size_t  offset,
std::size_t  nPixels,
struct BitmapPixel res 
)

Average pixels in a row

Parameters
rowA row to average pixels from (indexed from 0)
offsetColumn offset (indexed from 0)
nPixelsNumber of pixels
resPixel to store the result to
Returns
true on success, otherwise false

◆ getHeight()

std::size_t retdec::fileformat::BitmapImage::getHeight ( ) const

Get image height

Returns
Image height

◆ getImage()

const std::vector< std::vector< struct BitmapPixel > > & retdec::fileformat::BitmapImage::getImage ( ) const

Get image

Returns
Image

◆ getSize()

std::size_t retdec::fileformat::BitmapImage::getSize ( ) const

◆ getWidth()

std::size_t retdec::fileformat::BitmapImage::getWidth ( ) const

Get image width

Returns
Image with

◆ greyScale()

void retdec::fileformat::BitmapImage::greyScale ( )

Converts image to greyscale

◆ invertAxisY()

void retdec::fileformat::BitmapImage::invertAxisY ( )

Invert Y axis

◆ parseDib1Data()

bool retdec::fileformat::BitmapImage::parseDib1Data ( const ResourceIcon icon,
const struct BitmapInformationHeader hdr 
)

Parse a 1 bpp DIB data

Parameters
iconIcon to parse the data from
hdrDIB header structure
Returns
true on success, otherwise false

◆ parseDib24Data()

bool retdec::fileformat::BitmapImage::parseDib24Data ( const ResourceIcon icon,
const struct BitmapInformationHeader hdr 
)

Parse a 24 bpp DIB data

Parameters
iconIcon to parse the data from
hdrDIB header structure
Returns
true on success, otherwise false

◆ parseDib32Data()

bool retdec::fileformat::BitmapImage::parseDib32Data ( const ResourceIcon icon,
const struct BitmapInformationHeader hdr 
)

Parse a 32 bpp DIB data

Parameters
iconIcon to parse the data from
hdrDIB header structure
Returns
true on success, otherwise false

◆ parseDib4Data()

bool retdec::fileformat::BitmapImage::parseDib4Data ( const ResourceIcon icon,
const struct BitmapInformationHeader hdr 
)

Parse a 4 bpp DIB data

Parameters
iconIcon to parse the data from
hdrDIB header structure
Returns
true on success, otherwise false

◆ parseDib8Data()

bool retdec::fileformat::BitmapImage::parseDib8Data ( const ResourceIcon icon,
const struct BitmapInformationHeader hdr 
)

Parse a 8 bpp DIB data

Parameters
iconIcon to parse the data from
hdrDIB header structure
Returns
true on success, otherwise false

◆ parseDibFormat()

bool retdec::fileformat::BitmapImage::parseDibFormat ( const ResourceIcon icon)

Parse image in DIB format and converts it to unified BMP

Parameters
iconIcon to parse
Returns
true on success, otherwise false

◆ parseDibHeader()

bool retdec::fileformat::BitmapImage::parseDibHeader ( const ResourceIcon icon,
struct BitmapInformationHeader res 
) const

Parse a DIB header

Parameters
iconIcon to parse the header from
resDIB header structure to store the result to
Returns
true on success, otherwise false

◆ parseDibPalette()

bool retdec::fileformat::BitmapImage::parseDibPalette ( const ResourceIcon icon,
std::vector< struct BitmapPixel > &  palette,
std::uint32_t  nColors 
)

Parse a DIB palette

Parameters
iconIcon to parse the palette from
palettePalette structure to store the result to
nColorsThe expected number of colors in palette
Returns
true on success, otherwise false

◆ reduce8x8()

bool retdec::fileformat::BitmapImage::reduce8x8 ( )

Reduces an image to 8x8

Returns
true on success, otherwise false

◆ setAlphaFull()

void retdec::fileformat::BitmapImage::setAlphaFull ( )

Set image alpha channel to 0xFF

Member Data Documentation

◆ image

std::vector<std::vector<struct BitmapPixel> > retdec::fileformat::BitmapImage::image
private

bitmap image map row x column


The documentation for this class was generated from the following files: