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

#include <cImageBase.h>

Inheritance diagram for GrayLib::cImageBase:
GrayLib::cSurfaceBase Gray::cRefBase Gray::cMemBlock IUnknown GrayCodec::cImageJP2 GrayCodec::cImageJPG GrayCodec::cImagePNG GrayLib::cImageBMP GrayLib::cImageDDS GrayLib::cImageTGA GrayLib::cImageGIF

Public Member Functions

 cImageBase () noexcept
 
virtual ~cImageBase ()
 
virtual bool isValidImage () const noexcept
 
virtual HRESULT ReadStream (cStreamInput &strIn)=0
 
virtual HRESULT WriteStream (cStreamOutput *pFile) const
 
virtual HRESULT LoadFile (const FILECHAR_t *pszFileName)
 
virtual HRESULT SaveFile (const FILECHAR_t *pszFileName) const
 
- Public Member Functions inherited from GrayLib::cSurfaceBase
 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 cSurfaceInfoget_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_tGetPixPtr16 (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)
 
- Public Member Functions inherited from Gray::cRefBase
 cRefBase (int iRefCount=0) noexcept
 
virtual ~cRefBase ()
 
int get_RefCount () const noexcept
 
HASHCODE_t get_HashCode () const noexcept
 
 STDMETHOD_ (HASHCODE_t, get_HashCodeX)() const noexcept
 
virtual void onFinalRelease ()
 
bool isValidObj () const noexcept
 
 STDMETHOD_ (ULONG, AddRef)(void) override
 
 STDMETHOD_ (ULONG, Release)(void) override
 
STDMETHOD() QueryInterface (const IID &riid, void __RPC_FAR *__RPC_FAR *ppvObject) override
 
void IncRefCount ()
 
void DecRefCount ()
 
bool isStaticConstruct () const noexcept
 
void StaticConstruct ()
 
void StaticDestruct ()
 
bool isDestructing () noexcept
 
void SetDestructing ()
 

Additional Inherited Members

- Static Public Member Functions inherited from GrayLib::cSurfaceBase
static bool GetPixColor1P (const void *pvLine, PIXELS_t x) noexcept
 
static void SetPixColor1P (void *pvLine, PIXELS_t x, bool b) noexcept
 
- Protected Member Functions inherited from GrayLib::cSurfaceBase
cSurfaceBaseoperator= (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
 
- 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)
 
- Protected Attributes inherited from GrayLib::cSurfaceBase
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
 

Detailed Description

Base class for all the image file format loaders/savers. Store an image (or animation) in memory. Can be cached or disposed . The image may optionally have multiple layers (frames) and alpha channel info. Any pixel format or compression.

Constructor & Destructor Documentation

◆ cImageBase()

GrayLib::cImageBase::cImageBase ( )
inlinenoexcept

◆ ~cImageBase()

virtual GrayLib::cImageBase::~cImageBase ( )
inlinevirtual

Member Function Documentation

◆ isValidImage()

virtual bool GrayLib::cImageBase::isValidImage ( ) const
inlinevirtualnoexcept

Is the image data set valid? in general. Should succeed being saved.

Reimplemented in GrayLib::cImageBMP.

◆ LoadFile()

HRESULT GrayLib::cImageBase::LoadFile ( const FILECHAR_t pszFileName)
virtual

Load a file by its name. Can be overridden by cImageGDIP

◆ ReadStream()

virtual HRESULT GrayLib::cImageBase::ReadStream ( cStreamInput strIn)
pure virtual

◆ SaveFile()

HRESULT GrayLib::cImageBase::SaveFile ( const FILECHAR_t pszFileName) const
virtual
  • pszFileName = save the image to this file.
    Returns
    S_OK = the file was written correctly.

◆ WriteStream()

virtual HRESULT GrayLib::cImageBase::WriteStream ( cStreamOutput pFile) const
inlinevirtual

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