Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cSurfaceBitmapInfo Class Reference

#include <cSurfaceInfo.h>

Inheritance diagram for GrayLib::cSurfaceBitmapInfo:

Public Member Functions

 cSurfaceBitmapInfo () noexcept
 
 cSurfaceBitmapInfo (const cSurfaceInfo &rInfo)
 
void InitZero () noexcept
 
bool isCompressed () const noexcept
 
bool isValidInfo () const
 
PIXELS_t get_Width () const noexcept
 
PIXELS_t get_Height () const noexcept
 
PIXELS_t get_HeightRaw () const noexcept
 
void SetHeightTopDown () noexcept
 
bool isTopDown () const noexcept
 
BIT_SIZE_t get_BitsPerPixel () const noexcept
 
void SetSurfaceInfo (const cSurfaceInfo &rInfo)
 
void SetCopy (const tagBITMAPINFO &rCopy)
 
size_t get_PitchBytes () const
 
SURF_FORM_TYPE get_PixelFormat () const
 
WORD get_NumColors () const
 
size_t get_ColorSize () const noexcept
 
tagRGBQUAD * get_ColorTablePtr () const noexcept
 
size_t get_SurfaceSize () const noexcept
 
size_t get_ImageSize () const noexcept
 
size_t get_TotalSize () const noexcept
 
BYTE * get_PixelDataPtr () const
 

Detailed Description

Like cSurfaceInfo but allows compressed formats. Just cast tagBITMAPINFO or tagBITMAPINFOHEADER to this.

Note
MUST have NO vtable to cast properly!
this might be a compressed image format. biCompression

Constructor & Destructor Documentation

◆ cSurfaceBitmapInfo() [1/2]

GrayLib::cSurfaceBitmapInfo::cSurfaceBitmapInfo ( )
inlinenoexcept

◆ cSurfaceBitmapInfo() [2/2]

GrayLib::cSurfaceBitmapInfo::cSurfaceBitmapInfo ( const cSurfaceInfo rInfo)
inline

Member Function Documentation

◆ get_BitsPerPixel()

BIT_SIZE_t GrayLib::cSurfaceBitmapInfo::get_BitsPerPixel ( ) const
inlinenoexcept

◆ get_ColorSize()

size_t GrayLib::cSurfaceBitmapInfo::get_ColorSize ( void  ) const
inlinenoexcept

this == pointer to DIB header (BITMAPINFOHEADER NOT BITMAPCOREHEADER)

Returns
number of bytes in the DIB's color table.

◆ get_ColorTablePtr()

tagRGBQUAD* GrayLib::cSurfaceBitmapInfo::get_ColorTablePtr ( ) const
inlinenoexcept

Get the palette table. get_ColorSize(), get_NumColors()

◆ get_Height()

PIXELS_t GrayLib::cSurfaceBitmapInfo::get_Height ( void  ) const
inlinenoexcept

y in pixels. Always positive.

◆ get_HeightRaw()

PIXELS_t GrayLib::cSurfaceBitmapInfo::get_HeightRaw ( ) const
inlinenoexcept

y in pixels. <0 = top down (normal) else bottom up Win GDI weird mode.

Note
Might be negative for windows y flip topdown bullshit in non compressed modes.

◆ get_ImageSize()

size_t GrayLib::cSurfaceBitmapInfo::get_ImageSize ( ) const
noexcept

Size of the image info for the DIB. Can be overridden by biSizeImage if supplied. else same as get_SurfaceSize()

Note
bmi.bmiHeader.biPlanes MUST ALWAYS be 1 in the file !
Returns
Max size of the bitmap image data.

◆ get_NumColors()

WORD GrayLib::cSurfaceBitmapInfo::get_NumColors ( void  ) const

returns a number of colors in the DIB's color table. this == pointer to DIB header (BITMAPINFOHEADER NOT BITMAPCOREHEADER)

Note
If this is a Windows style DIB, the number of colors in the color table can be less than the number of bits per pixel allows for (i.e. this->biClrUsed can be set to some value). If this is the case, return the appropriate value.
Returns
Number of colors.

◆ get_PitchBytes()

size_t GrayLib::cSurfaceBitmapInfo::get_PitchBytes ( ) const

get stride/bytes per row. in most cases it must be 4 or 8 byte aligned ? (AKA Pitch, Stride or BytesPerRow)

Note
Must use the 32 bit scan line boundary.

◆ get_PixelDataPtr()

BYTE * GrayLib::cSurfaceBitmapInfo::get_PixelDataPtr ( ) const

get pointer to pixel data. ASSUME This is cast from a REAL tagBITMAPINFO

◆ get_PixelFormat()

SURF_FORM_TYPE GrayLib::cSurfaceBitmapInfo::get_PixelFormat ( ) const

◆ get_SurfaceSize()

size_t GrayLib::cSurfaceBitmapInfo::get_SurfaceSize ( ) const
noexcept

Recalculate the biSizeImage

◆ get_TotalSize()

size_t GrayLib::cSurfaceBitmapInfo::get_TotalSize ( ) const
noexcept

Get the total size needed.

◆ get_Width()

PIXELS_t GrayLib::cSurfaceBitmapInfo::get_Width ( void  ) const
inlinenoexcept

x in pixels.

◆ InitZero()

void GrayLib::cSurfaceBitmapInfo::InitZero ( )
inlinenoexcept

◆ isCompressed()

bool GrayLib::cSurfaceBitmapInfo::isCompressed ( ) const
inlinenoexcept

biCompression = FOURCC code for compression. except BI_JPEG

◆ isTopDown()

bool GrayLib::cSurfaceBitmapInfo::isTopDown ( ) const
inlinenoexcept

Is normal y=0=top ? http://www.fourcc.org/fccbihgt.php negative biHeight value to indicate that the vertical orientation of the image is top-down (i.e. normal)

◆ isValidInfo()

bool GrayLib::cSurfaceBitmapInfo::isValidInfo ( ) const

◆ SetCopy()

void GrayLib::cSurfaceBitmapInfo::SetCopy ( const tagBITMAPINFO &  rCopy)

◆ SetHeightTopDown()

void GrayLib::cSurfaceBitmapInfo::SetHeightTopDown ( )
inlinenoexcept

VFW compressor needs this to be turned off!

◆ SetSurfaceInfo()

void GrayLib::cSurfaceBitmapInfo::SetSurfaceInfo ( const cSurfaceInfo rInfo)

Set the _WIN32 tagBITMAPINFO version of the cSurfaceInfo. reverse of SetBitmapInfo()

Note
GDI uses y<0 = topdown.

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