![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cSurfaceBase.h>
Public Member Functions | |
| cSurfaceBase () noexcept | |
| cSurfaceBase (void *pPixelData, const cSurfaceInfo &rInfo) | |
| cSurfaceBase (void *pPixelData, PIXELS_t cx, PIXELS_t cy, size_t uPitchBytes, SURF_FORM_TYPE ePixelFormat) | |
| virtual | ~cSurfaceBase () |
| HRESULT | SaveRaw (cStreamOutput &file) |
| HRESULT | SaveRaw (const FILECHAR_t *pszFilename) |
| virtual void | SetEmpty () |
| bool | isValidCheck () const noexcept |
| const cSurfaceInfo & | get_Info () const noexcept |
| void | put_Info (const cSurfaceInfo &rInfo) |
| size_t | get_PitchBytes () const noexcept |
| PIXELS_t | get_Width () const noexcept |
| PIXELS_t | get_Height () const noexcept |
| bool | isTopDown () const noexcept |
| SURF_FORM_TYPE | get_PixelFormat () const noexcept |
| bool | isValidPixelData () const noexcept |
| basic attributes. More... | |
| void * | get_PixelData () const noexcept |
| BYTE * | get_PixelBytes () const noexcept |
| void | put_PixelData (void *pPixelData) noexcept |
| void * | GetLinePtrRaw (PIXELS_t y) const noexcept |
| BYTE * | GetLinePtrByte (PIXELS_t y) const noexcept |
| void * | GetLinePtr (PIXELS_t y) const noexcept |
| void * | GetNextLine (const void *pLinePtr) const noexcept |
| bool | IsValidPixPtr (const void *p) const noexcept |
| BYTE * | GetPixPtr (const void *pvLine, PIXELS_t x, size_t sizePixel) const noexcept |
| BYTE * | GetPixPtr (PIXELS_t x, PIXELS_t y, size_t sizePixel) const noexcept |
| COLOR16_t * | GetPixPtr16 (PIXELS_t x, PIXELS_t y) const noexcept |
| BYTE * | GetPixPtr (PIXELS_t x, PIXELS_t y) const noexcept |
| bool | Lock () |
| void | Unlock () |
| bool | GetPixColor1 (const void *pvLine, PIXELS_t x) const |
| void | SetPixColor1 (void *pvLine, PIXELS_t x, bool b) |
| BYTE | GetPixColor8 (const void *pvLine, PIXELS_t x) const noexcept |
| void | SetPixColor8 (void *pvLine, PIXELS_t x, BYTE bColor) noexcept |
| COLOR16_t | GetPixColor16 (const void *pvLine, PIXELS_t x) const noexcept |
| void | SetPixColor16 (void *pvLine, PIXELS_t x, COLOR16_t wColor) noexcept |
| COLOR16_t | GetPixColor16G (const void *pvLine, PIXELS_t x) const |
| COLOR16_t | GetPixColor16G (PIXELS_t x, PIXELS_t y) const |
| void | SetPixColor16G (void *pvLine, PIXELS_t x, COLOR16_t wVal) |
| void | SetPixColor16G (PIXELS_t x, PIXELS_t y, COLOR16_t wVal) |
| COLORREF | GetPixColor24g (const void *pvLine, PIXELS_t x) const noexcept |
| D3DCOLOR | GetPixColor24d (const void *pvLine, PIXELS_t x) const noexcept |
| void | SetPixColor24g (void *pvLine, PIXELS_t x, COLORREF dwColor) noexcept |
| void | SetPixColor24d (void *pvLine, PIXELS_t x, D3DCOLOR dwColor) noexcept |
| COLORREF | GetPixColor32 (const void *pvLine, PIXELS_t x) const noexcept |
| void | SetPixColor32 (void *pvLine, PIXELS_t x, COLORREF dwColor) noexcept |
| COLORREF | GetPixColorRef (const void *pvLine, PIXELS_t x) const |
| COLORREF | GetPixColorRef (PIXELS_t x, PIXELS_t y) const |
| void | SetPixColorRef (void *pvLine, PIXELS_t x, COLORREF c) |
| void | SetPixColorRef (PIXELS_t x, PIXELS_t y, COLORREF c) |
| void | ScrollPixels (PIXELS_t cx, PIXELS_t cy) |
| void | FillColor (COLORREF colorBack) |
| void | SwapTopBottom () |
| void | SetErase () |
| virtual HRESULT | SetPixelData (const cSurfaceBase &rSurfSrc) |
| virtual HRESULT | SetCopySurface (const cSurfaceBase &rSurfSrc) |
| void | SetCopyFrom (const cSurfaceBase &TexSrc, PIXELS_t itxs=0, PIXELS_t itys=0, bool bTextureXReverse=false, bool bTextureYReverse=false, bool bColorReverse=false) |
| void | CopyTo (cSurfaceBase &TexDst, PIXELS_t itxs=0, PIXELS_t itys=0, bool bTextureXReverse=false, bool bTextureYReverse=false) const |
| HRESULT | InitTestPattern () |
| UNITTEST_FRIEND (cSurfaceBase) | |
Static Public Member Functions | |
| static bool | GetPixColor1P (const void *pvLine, PIXELS_t x) noexcept |
| static void | SetPixColor1P (void *pvLine, PIXELS_t x, bool b) noexcept |
Protected Member Functions | |
| cSurfaceBase & | operator= (const cSurfaceBase &rSurf) |
| bool | InitSurfaceInfo (const cSurfaceInfo &rInfo) |
| bool | InitSurfaceAlign (PIXELS_t cx, PIXELS_t cy, size_t nAlignBytes, SURF_FORM_TYPE ePixelFormat) |
| bool | InitSurfacePitch (PIXELS_t cx, PIXELS_t cy, size_t uPitchBytes, SURF_FORM_TYPE ePixelFormat) |
Protected Member Functions inherited from Gray::cMemBlock | |
| cMemBlock () noexcept | |
| cMemBlock (const void *pData, size_t nSize) noexcept | |
| cMemBlock (const cMemBlock &block) noexcept | |
| cMemBlock (const cMemBlock *pBlock) noexcept | |
| size_t | get_DataSize () const noexcept |
| void * | get_Data () const noexcept |
| BYTE * | get_DataBytes () const noexcept |
| char * | get_DataA () const noexcept |
| operator const BYTE * () const noexcept | |
| bool | isValidPtr () const noexcept |
| bool | IsValidIndex (size_t i) const noexcept |
| bool | IsValidIndex2 (size_t i) const noexcept |
| bool | IsValidPtr (const void *p) const noexcept |
| bool | IsValidPtr2 (const void *p) const noexcept |
| bool | IsZeros () const noexcept |
| bool | IsEqualData (const void *pData, size_t nSize) const noexcept |
| bool | IsEqualData (const cMemBlock *pData) const noexcept |
| bool | IsEqualData (const cMemBlock &data) const noexcept |
| BYTE * | GetOffset (size_t nOffset) const |
| const void * | get_DataEnd () const noexcept |
| void | put_DataPtr (void *pStart) noexcept |
| void | put_Size (size_t nSize) noexcept |
| void | SetBlock (void *pData, size_t nSize) noexcept |
| void | SetEmptyBlock () noexcept |
| void | InitZeros () noexcept |
| StrLen_t | ConvertToString (char *pszDst, StrLen_t iDstSizeMax) const |
Protected Attributes | |
| cSurfaceInfo | m_Info |
| the image size, pitch and pixel format for m_pPixelData below. More... | |
Protected Attributes inherited from Gray::cMemBlock | |
| size_t | m_nSize |
| size_t of m_pData in bytes. May be determined at runtime. More... | |
| void * | m_pData |
Friends | |
| class | cSurfaceDC |
| class | cSurfaceDC2 |
Additional Inherited Members | |
Static Protected Member Functions inherited from Gray::cMemBlock | |
| static COMPARE_t __stdcall | Compare (const void *pData1, size_t iLen1, const void *pData2, size_t iLen2) |
A simple surface/DIB. (unknown owner allocation of m_pPixelData in system memory)
|
noexcept |
| GrayLib::cSurfaceBase::cSurfaceBase | ( | void * | pPixelData, |
| const cSurfaceInfo & | rInfo | ||
| ) |
| GrayLib::cSurfaceBase::cSurfaceBase | ( | void * | pPixelData, |
| PIXELS_t | cx, | ||
| PIXELS_t | cy, | ||
| size_t | uPitchBytes, | ||
| SURF_FORM_TYPE | ePixelFormat | ||
| ) |
|
virtual |
NOT destruct pixel data here.
| void GrayLib::cSurfaceBase::CopyTo | ( | cSurfaceBase & | TexDst, |
| PIXELS_t | itxs = 0, |
||
| PIXELS_t | itys = 0, |
||
| bool | bTextureXReverse = false, |
||
| bool | bTextureYReverse = false |
||
| ) | const |
Copy this whole bitmap into a small part of some other bitmap TexDst. ASSUME same format! else use cSurfaceConv??
| void GrayLib::cSurfaceBase::FillColor | ( | COLORREF | colorBack | ) |
Fill the whole DIB with a color.
|
inlinenoexcept |
height in pixels not bytes.
|
inlinenoexcept |
|
inlinenoexcept |
row width in bytes not pixels. (AKA Pitch, Stride or BytesPerRow)
|
inlinenoexcept |
|
inlinenoexcept |
pointer to the pixel data. We assume nothing about pixel format. ASSERT(m_pPixelData); // allow this for mouse hits.
|
inlinenoexcept |
|
inlinenoexcept |
width in pixels not bytes.
|
inlinenoexcept |
get a pointer to the start of a line of pixels. assumes nothing about pixel format. adjust Y if this is a bottom up image. get_HeightRaw
|
inlinenoexcept |
Ignore line order. -y.
|
inlinenoexcept |
Ignore line order. -y.
|
inlinenoexcept |
|
inline |
1 BPP
|
inlinenoexcept |
get 16 BPP color from surface assumed to be the same format. Stored in SURF_FORM_RGB565 format.
get a 16 bit Grey-scale pixel.
|
inlinestaticnoexcept |
1 BPP
|
inlinenoexcept |
24 BPP = DX/D3D format. [0]=b Stored in Blue,Green,Red order.
|
inlinenoexcept |
24 BPP = GDI format. [0]=red
|
inlinenoexcept |
get pixel in 32 BPP = cColorRef or D3DCOLOR
|
inlinenoexcept |
8 BPP
get a 32 bit GDI color pixel. convert the pixel to 32 bits if needed. ABGR=COLORREF
|
inlinenoexcept |
get a pixel pointer given the byte aligned size of a pixel.
Get x,y pixel data location for unknown (mostly) pixel format. this should work for 1 bit pp.
|
inlinenoexcept |
Assume 16 bit per pixel SURF_FORM_RGB565 colors
|
protected |
Bitmaps require 4 (or X) byte align Other images require diff align.
|
protected |
|
protected |
| HRESULT GrayLib::cSurfaceBase::InitTestPattern | ( | ) |
Fill the pixels with the test pattern. Assume pixel format is 888 or 8888 type.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
basic attributes.
|
inlinenoexcept |
|
inline |
do nothing. Emulate DirectX locking stuff.
|
inlineprotected |
|
inline |
|
inlinenoexcept |
pointer to the pixel data. We assume nothing about pixel format. or allocation. allow pPixelData == nullptr for mouse hits throw.
| HRESULT GrayLib::cSurfaceBase::SaveRaw | ( | const FILECHAR_t * | pszFilename | ) |
| HRESULT GrayLib::cSurfaceBase::SaveRaw | ( | cStreamOutput & | file | ) |
Scroll the bitmap pixel data in dx and dy. ASSUME 8 bit aligned pixels.
| void GrayLib::cSurfaceBase::SetCopyFrom | ( | const cSurfaceBase & | TexSrc, |
| PIXELS_t | itxs = 0, |
||
| PIXELS_t | itys = 0, |
||
| bool | bTextureXReverse = false, |
||
| bool | bTextureYReverse = false, |
||
| bool | bColorReverse = false |
||
| ) |
fill this bitmap from a part of some larger bitmap TexSrc.
|
inlinevirtual |
Change image format and set pixels from rSrc.
Reimplemented in GrayLib::cImageTGA, GrayLib::cImageBMP, GrayLib::cSurface, and GrayCodec::cImageJP2.
|
virtual |
Init the surface to invalid values. Some derived class should override this to free any previous m_pPixelData properly. SetEmpty
Reimplemented in GrayLib::cImageTGA, GrayLib::cImageGIF, GrayLib::cImageDDS, GrayLib::cImageBMP, GrayCodec::cImagePNG, GrayCodec::cImageJPG, GrayCodec::cImageJP2, and GrayLib::cSurface.
|
inline |
|
inline |
1 BPP
|
inlinenoexcept |
16 BPP Stored in SURF_FORM_RGB565 format.
set a 16 bit Greyscale pixel.
|
inlinestaticnoexcept |
1 BPP
|
inlinenoexcept |
24 BPP = DX/D3D format Stored in Blue,Green,Red order.
|
inlinenoexcept |
24 BPP = GDI format Stored in Red,Green,Blue order.
|
inlinenoexcept |
set pixel in 32 BPP = cColorRef, GDI byte order storage.
|
inlinenoexcept |
8 BPP
set a cColorRef 32 bit color to a surface of any pixel format. cVal = ABGR
|
virtual |
copy pixels to this from rSurfSrc. Resample the pSrc to the pDst if needed/possible.
| void GrayLib::cSurfaceBase::SwapTopBottom | ( | ) |
related to BMP isTopDown()
| GrayLib::cSurfaceBase::UNITTEST_FRIEND | ( | cSurfaceBase | ) |
|
inline |
do nothing. Emulate DirectX locking stuff.
|
friend |
|
friend |
|
protected |
the image size, pitch and pixel format for m_pPixelData below.