![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cSurfaceInfo.h>
Public Member Functions | |
cSurfaceInfo (PIXELS_t cx=0, PIXELS_t cy=0, size_t uPitchBytes=0, SURF_FORM_TYPE ePixelFormat=SURF_FORM_UNKNOWN) | |
cSurfaceInfo (const cSurfaceBitmapInfo *pBMI) | |
cSurfaceInfo (struct tagBITMAPINFOHEADER *pBMI) | |
cSurfaceInfo (const tagBITMAPINFO *pBMI) | |
PIXELS_t | get_Width () const noexcept |
PIXELS_t | get_Height () const noexcept |
PIXELS_t | get_HeightRaw () const noexcept |
bool | isTopDown () const noexcept |
cWinSize | get_Size () const noexcept |
size_t | get_PitchBytes () const noexcept |
void | put_PitchBytes (size_t uPitchBytes) noexcept |
SURF_FORM_TYPE | get_PixelFormat () const noexcept |
size_t | get_SurfaceSize () const noexcept |
BIT_SIZE_t | get_BitsPerPixel () const noexcept |
size_t | get_BytesPerPixel () const noexcept |
bool | isValidInfo () const noexcept |
bool | isReasonableInfo () const noexcept |
bool | IsEqual (const cSurfaceInfo &rInfo) const noexcept |
void | SetSurfaceInfo (const cSurfaceInfo &rInfo) |
void | InitSurfaceInfo (PIXELS_t cx=0, PIXELS_t cy=0, size_t uPitchBytes=0, SURF_FORM_TYPE ePixelFormat=SURF_FORM_UNKNOWN) noexcept |
void | InitAligned (PIXELS_t cx, PIXELS_t cy, size_t nAlignBytes, SURF_FORM_TYPE ePixelFormat) |
void | SetBitmapInfo (const cSurfaceBitmapInfo *pBMI) |
void | SetBitmapInfo (const struct tagBITMAPINFOHEADER *pBMI) |
void | SetBitmapInfo (const tagBITMAPINFO *pBMI) |
Static Public Member Functions | |
static BIT_SIZE_t GRAYCALL | GetBitsPerPixel (SURF_FORM_TYPE ePixelFormat) noexcept |
static COLOR_ELEM_t GRAYCALL | GetColorElements (SURF_FORM_TYPE ePixelFormat) noexcept |
static SURF_FORM_TYPE GRAYCALL | GetPixelFormat (int iBitsPerPixel, int iColorElements) |
static constexpr size_t | CvtBitsToAlignedBytes (UINT nBitsTotal, size_t nAlignBytes) noexcept |
Static Public Attributes | |
static const PIXELS_t | kMaxX = 8 * 1024 |
static const PIXELS_t | kMaxY = 8 * 1024 |
image/surface/frame format info/description. size+stride+pixel format. SURF_FORM_TYPE is never a compressed format. Similar to D3DSURFACE_DESC or tagBITMAPINFOHEADER (cSurfaceBitmapInfo)
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestaticconstexprnoexcept |
cSurfaceInfo:: nBitsTotal = bits per pixel * total number of pixels in row = total bits in row. e.g. nAlignBytes = sizeof(UINT32) ASSUME nBitsTotal is multiple of 8?
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
height in pixels not bytes. Always positive. remove any top-down indicator.
|
inlinenoexcept |
height in pixels not bytes. <0 = NOT TopDown(). Opposite of GDI.
|
inlinenoexcept |
row width in bytes not pixels. (AKA Pitch, Stride or BytesPerRow)
|
inlinenoexcept |
the pixel format.
|
inlinenoexcept |
|
inlinenoexcept |
size for the full image in bytes.
|
inlinenoexcept |
width in pixels not bytes.
|
staticnoexcept |
Get Size of a pixel. similar to D3DFORM BIT_ENUM_t
|
staticnoexcept |
|
static |
Try to determine pixel format from some other format info.
|
inline |
make sure the pitch is nAlignBytes bytes aligned. e.g. nAlignBytes = sizeof(UINT32)
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Check for reasonable limits. allow null.
|
inlinenoexcept |
Opposite of default GDI. cy positive = y=0=top of image. normal format?
|
inlinenoexcept |
Check against arbitrary max.
|
inlinenoexcept |
Sometimes we don't discover pitch bytes until later. adjust it.
void GrayLib::cSurfaceInfo::SetBitmapInfo | ( | const cSurfaceBitmapInfo * | pBMI | ) |
Set the cSurfaceInfo from a _WIN32 tagBITMAPINFO or tagBITMAPINFOHEADER. reverse of SetSurfaceInfo ignore compressed format info. assume this is the format that will hold the non compress info once decompressed.
|
inline |
|
inline |
|
inline |
|
static |
|
static |