Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cImagePNG.h
Go to the documentation of this file.
1 //
6 
7 #ifndef _INC_cImagePNG_H
8 #define _INC_cImagePNG_H
9 #if _MSC_VER >= 1000
10 #pragma once
11 #endif // _MSC_VER >= 1000
12 
13 #include "GrayCodec.h"
14 
15 #ifdef USE_PNG
16 
21 
22 // lib png.lib
23 namespace GrayCodec
24 {
26 
28  : public cImageBase
29  , public cSurfaceFrames
30  {
37  typedef cImageBase SUPER_t;
38 
39  private:
40  cHeapBlock m_Pixels;
41 
42  public:
43  cImagePNG() noexcept;
44  virtual ~cImagePNG();
45 
46  virtual HRESULT SetFrameCurrent(int iFrameNum) override;
47  virtual void SetEmpty() override;
48  virtual HRESULT ReadStream(cStreamInput& stmIn) override;
49  virtual HRESULT WriteStream(cStreamOutput* pFile) const override;
50 
52  };
53 
55  : public IImageCreator
56  , public cSingleton<cImagePNGType>
57  {
61  public:
63  : cSingleton<cImagePNGType>(this, typeid(cImagePNGType))
64  {
65  }
66  virtual bool IsFileExt(const FILECHAR_t* pszFileExt) const
67  {
68  return cFilePath::IsFileNameExt(pszFileExt, _FN(".png"));
69  }
70  virtual cImageBasePtr CreateObject() const override
71  {
72  return new cImagePNG;
73  }
74  };
75 };
76 #endif // _INC_cImagePNG_H
77 #endif
#define _FN(x)
like _T(x) macro for static text file names.
Definition: FileName.h:23
#define GRAYCODEC_LINK
Definition: GrayCodec.h:15
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
#define UNITTEST_FRIEND(n)
Define this in the class body to be unit tested. Allow the unit test to access private/protected stuf...
Definition: cUnitTestDecl.h:17
Definition: cImagePNG.h:57
cImagePNGType()
Definition: cImagePNG.h:62
virtual cImageBasePtr CreateObject() const override
Definition: cImagePNG.h:70
virtual bool IsFileExt(const FILECHAR_t *pszFileExt) const
Definition: cImagePNG.h:66
Definition: cImagePNG.h:30
Definition: cImageBase.h:21
Definition: cSurfaceBase.h:366
static bool __stdcall IsFileNameExt(const FILECHAR_t *pszFileName, const FILECHAR_t *pszExt) noexcept
Definition: cFilePath.cpp:1006
Definition: cHeap.h:156
Definition: cRefPtr.h:225
Definition: cSingleton.h:127
Definition: cStream.h:306
Definition: cStream.h:126
Definition: cImageBase.h:66
lib jp2 opaque internal structure.
Definition: GrayCodec.cpp:26
UNITTEST2_PREDEF(cAudioAAC)
char FILECHAR_t
a UTF8 char in a file name. like TCHAR
Definition: FileName.h:22