ReactOS 0.4.15-dev-7994-gb388cb6
ATL::CImage::CInitGDIPlus Class Reference
Collaboration diagram for ATL::CImage::CInitGDIPlus:

Public Member Functions

 CInitGDIPlus () noexcept
 
 ~CInitGDIPlus () noexcept
 
bool Init () noexcept
 
void ReleaseGDIPlus () noexcept
 
void IncreaseCImageCount () noexcept
 
void DecreaseCImageCount () noexcept
 

Public Attributes

FUN_Startup Startup
 
FUN_Shutdown Shutdown
 
FUN_CreateBitmapFromFile CreateBitmapFromFile
 
FUN_CreateBitmapFromHBITMAP CreateBitmapFromHBITMAP
 
FUN_CreateBitmapFromStream CreateBitmapFromStream
 
FUN_CreateHBITMAPFromBitmap CreateHBITMAPFromBitmap
 
FUN_DisposeImage DisposeImage
 
FUN_GetImageDecoder GetImageDecoders
 
FUN_GetImageDecoderSize GetImageDecodersSize
 
FUN_GetImageEncoder GetImageEncoders
 
FUN_GetImageEncoderSize GetImageEncodersSize
 
FUN_SaveImageToFile SaveImageToFile
 
FUN_SaveImageToStream SaveImageToStream
 

Private Types

using FUN_Startup = decltype(&Gdiplus::GdiplusStartup)
 
using FUN_Shutdown = decltype(&Gdiplus::GdiplusShutdown)
 
using FUN_CreateBitmapFromFile = decltype(&Gdiplus::DllExports::GdipCreateBitmapFromFile)
 
using FUN_CreateBitmapFromHBITMAP = decltype(&Gdiplus::DllExports::GdipCreateBitmapFromHBITMAP)
 
using FUN_CreateBitmapFromStream = decltype(&Gdiplus::DllExports::GdipCreateBitmapFromStream)
 
using FUN_CreateHBITMAPFromBitmap = decltype(&Gdiplus::DllExports::GdipCreateHBITMAPFromBitmap)
 
using FUN_DisposeImage = decltype(&Gdiplus::DllExports::GdipDisposeImage)
 
using FUN_GetImageDecoder = decltype(&Gdiplus::DllExports::GdipGetImageDecoders)
 
using FUN_GetImageDecoderSize = decltype(&Gdiplus::DllExports::GdipGetImageDecodersSize)
 
using FUN_GetImageEncoder = decltype(&Gdiplus::DllExports::GdipGetImageEncoders)
 
using FUN_GetImageEncoderSize = decltype(&Gdiplus::DllExports::GdipGetImageEncodersSize)
 
using FUN_SaveImageToFile = decltype(&Gdiplus::DllExports::GdipSaveImageToFile)
 
using FUN_SaveImageToStream = decltype(&Gdiplus::DllExports::GdipSaveImageToStream)
 

Private Member Functions

void _clear_funs () noexcept
 
template<typename T_FUN >
T_FUN _get_fun (T_FUN &fun, LPCSTR name) noexcept
 

Private Attributes

HINSTANCE m_hInst
 
ULONG_PTR m_dwToken
 
CRITICAL_SECTION m_sect
 
LONG m_nCImageObjects
 
DWORD m_dwLastError
 

Detailed Description

Definition at line 847 of file atlimage.h.

Member Typedef Documentation

◆ FUN_CreateBitmapFromFile

using ATL::CImage::CInitGDIPlus::FUN_CreateBitmapFromFile = decltype(&Gdiplus::DllExports::GdipCreateBitmapFromFile)
private

Definition at line 853 of file atlimage.h.

◆ FUN_CreateBitmapFromHBITMAP

using ATL::CImage::CInitGDIPlus::FUN_CreateBitmapFromHBITMAP = decltype(&Gdiplus::DllExports::GdipCreateBitmapFromHBITMAP)
private

Definition at line 854 of file atlimage.h.

◆ FUN_CreateBitmapFromStream

using ATL::CImage::CInitGDIPlus::FUN_CreateBitmapFromStream = decltype(&Gdiplus::DllExports::GdipCreateBitmapFromStream)
private

Definition at line 855 of file atlimage.h.

◆ FUN_CreateHBITMAPFromBitmap

using ATL::CImage::CInitGDIPlus::FUN_CreateHBITMAPFromBitmap = decltype(&Gdiplus::DllExports::GdipCreateHBITMAPFromBitmap)
private

Definition at line 856 of file atlimage.h.

◆ FUN_DisposeImage

using ATL::CImage::CInitGDIPlus::FUN_DisposeImage = decltype(&Gdiplus::DllExports::GdipDisposeImage)
private

Definition at line 857 of file atlimage.h.

◆ FUN_GetImageDecoder

using ATL::CImage::CInitGDIPlus::FUN_GetImageDecoder = decltype(&Gdiplus::DllExports::GdipGetImageDecoders)
private

Definition at line 858 of file atlimage.h.

◆ FUN_GetImageDecoderSize

using ATL::CImage::CInitGDIPlus::FUN_GetImageDecoderSize = decltype(&Gdiplus::DllExports::GdipGetImageDecodersSize)
private

Definition at line 859 of file atlimage.h.

◆ FUN_GetImageEncoder

using ATL::CImage::CInitGDIPlus::FUN_GetImageEncoder = decltype(&Gdiplus::DllExports::GdipGetImageEncoders)
private

Definition at line 860 of file atlimage.h.

◆ FUN_GetImageEncoderSize

using ATL::CImage::CInitGDIPlus::FUN_GetImageEncoderSize = decltype(&Gdiplus::DllExports::GdipGetImageEncodersSize)
private

Definition at line 861 of file atlimage.h.

◆ FUN_SaveImageToFile

using ATL::CImage::CInitGDIPlus::FUN_SaveImageToFile = decltype(&Gdiplus::DllExports::GdipSaveImageToFile)
private

Definition at line 862 of file atlimage.h.

◆ FUN_SaveImageToStream

using ATL::CImage::CInitGDIPlus::FUN_SaveImageToStream = decltype(&Gdiplus::DllExports::GdipSaveImageToStream)
private

Definition at line 863 of file atlimage.h.

◆ FUN_Shutdown

using ATL::CImage::CInitGDIPlus::FUN_Shutdown = decltype(&Gdiplus::GdiplusShutdown)
private

Definition at line 852 of file atlimage.h.

◆ FUN_Startup

using ATL::CImage::CInitGDIPlus::FUN_Startup = decltype(&Gdiplus::GdiplusStartup)
private

Definition at line 851 of file atlimage.h.

Constructor & Destructor Documentation

◆ CInitGDIPlus()

ATL::CImage::CInitGDIPlus::CInitGDIPlus ( )
inlinenoexcept

Definition at line 913 of file atlimage.h.

914 : m_hInst(NULL)
915 , m_dwToken(0)
918 {
919 _clear_funs();
921 }
void _clear_funs() noexcept
Definition: atlimage.h:872
CRITICAL_SECTION m_sect
Definition: atlimage.h:868
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751

◆ ~CInitGDIPlus()

ATL::CImage::CInitGDIPlus::~CInitGDIPlus ( )
inlinenoexcept

Definition at line 923 of file atlimage.h.

924 {
927 }
void ReleaseGDIPlus() noexcept
Definition: atlimage.h:966
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)

Member Function Documentation

◆ _clear_funs()

void ATL::CImage::CInitGDIPlus::_clear_funs ( )
inlineprivatenoexcept

Definition at line 872 of file atlimage.h.

873 {
874 Startup = NULL;
875 Shutdown = NULL;
887 }
FUN_SaveImageToStream SaveImageToStream
Definition: atlimage.h:911
FUN_DisposeImage DisposeImage
Definition: atlimage.h:905
FUN_CreateBitmapFromFile CreateBitmapFromFile
Definition: atlimage.h:901
FUN_CreateHBITMAPFromBitmap CreateHBITMAPFromBitmap
Definition: atlimage.h:904
FUN_CreateBitmapFromHBITMAP CreateBitmapFromHBITMAP
Definition: atlimage.h:902
FUN_GetImageDecoder GetImageDecoders
Definition: atlimage.h:906
FUN_CreateBitmapFromStream CreateBitmapFromStream
Definition: atlimage.h:903
FUN_GetImageDecoderSize GetImageDecodersSize
Definition: atlimage.h:907
FUN_GetImageEncoderSize GetImageEncodersSize
Definition: atlimage.h:909
FUN_Shutdown Shutdown
Definition: atlimage.h:900
FUN_SaveImageToFile SaveImageToFile
Definition: atlimage.h:910
FUN_GetImageEncoder GetImageEncoders
Definition: atlimage.h:908

Referenced by CInitGDIPlus(), and ReleaseGDIPlus().

◆ _get_fun()

template<typename T_FUN >
T_FUN ATL::CImage::CInitGDIPlus::_get_fun ( T_FUN &  fun,
LPCSTR  name 
)
inlineprivatenoexcept

Definition at line 890 of file atlimage.h.

891 {
892 if (!fun)
893 fun = reinterpret_cast<T_FUN>(::GetProcAddress(m_hInst, name));
894 return fun;
895 }
#define GetProcAddress(x, y)
Definition: compat.h:753
Definition: name.c:39

Referenced by Init().

◆ DecreaseCImageCount()

void ATL::CImage::CInitGDIPlus::DecreaseCImageCount ( )
inlinenoexcept

Definition at line 992 of file atlimage.h.

993 {
995 if (--m_nCImageObjects == 0)
996 {
998 }
1000 }
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)

Referenced by ATL::CImage::~CImage().

◆ IncreaseCImageCount()

void ATL::CImage::CInitGDIPlus::IncreaseCImageCount ( )
inlinenoexcept

Definition at line 985 of file atlimage.h.

Referenced by ATL::CImage::CImage().

◆ Init()

bool ATL::CImage::CInitGDIPlus::Init ( )
inlinenoexcept

Definition at line 929 of file atlimage.h.

930 {
932
933 if (m_dwToken == 0)
934 {
935 if (!m_hInst)
936 m_hInst = ::LoadLibrary(TEXT("gdiplus.dll"));
937
938 if (m_hInst &&
939 _get_fun(Startup, "GdiplusStartup") &&
940 _get_fun(Shutdown, "GdiplusShutdown") &&
941 _get_fun(CreateBitmapFromFile, "GdipCreateBitmapFromFile") &&
942 _get_fun(CreateBitmapFromHBITMAP, "GdipCreateBitmapFromHBITMAP") &&
943 _get_fun(CreateBitmapFromStream, "GdipCreateBitmapFromStream") &&
944 _get_fun(CreateHBITMAPFromBitmap, "GdipCreateHBITMAPFromBitmap") &&
945 _get_fun(DisposeImage, "GdipDisposeImage") &&
946 _get_fun(GetImageDecoders, "GdipGetImageDecoders") &&
947 _get_fun(GetImageDecodersSize, "GdipGetImageDecodersSize") &&
948 _get_fun(GetImageEncoders, "GdipGetImageEncoders") &&
949 _get_fun(GetImageEncodersSize, "GdipGetImageEncodersSize") &&
950 _get_fun(SaveImageToFile, "GdipSaveImageToFile") &&
951 _get_fun(SaveImageToStream, "GdipSaveImageToStream"))
952 {
953 using namespace Gdiplus;
956 Startup(&m_dwToken, &input, &output);
957 }
958 }
959
960 bool ret = (m_dwToken != 0);
962
963 return ret;
964 }
T_FUN _get_fun(T_FUN &fun, LPCSTR name) noexcept
Definition: atlimage.h:890
GLenum GLenum GLenum input
Definition: glext.h:9031
#define TEXT(s)
Definition: k32.h:26
int ret
#define LoadLibrary
Definition: winbase.h:3862

Referenced by ATL::CImage::InitGDIPlus().

◆ ReleaseGDIPlus()

void ATL::CImage::CInitGDIPlus::ReleaseGDIPlus ( )
inlinenoexcept

Definition at line 966 of file atlimage.h.

967 {
969 if (m_dwToken)
970 {
971 if (Shutdown)
973
974 m_dwToken = 0;
975 }
976 if (m_hInst)
977 {
979 m_hInst = NULL;
980 }
981 _clear_funs();
983 }
#define FreeLibrary(x)
Definition: compat.h:748

Referenced by DecreaseCImageCount(), ATL::CImage::ReleaseGDIPlus(), and ~CInitGDIPlus().

Member Data Documentation

◆ CreateBitmapFromFile

FUN_CreateBitmapFromFile ATL::CImage::CInitGDIPlus::CreateBitmapFromFile

Definition at line 901 of file atlimage.h.

Referenced by _clear_funs(), Init(), and ATL::CImage::Load().

◆ CreateBitmapFromHBITMAP

FUN_CreateBitmapFromHBITMAP ATL::CImage::CInitGDIPlus::CreateBitmapFromHBITMAP

Definition at line 902 of file atlimage.h.

Referenced by _clear_funs(), Init(), and ATL::CImage::Save().

◆ CreateBitmapFromStream

FUN_CreateBitmapFromStream ATL::CImage::CInitGDIPlus::CreateBitmapFromStream

Definition at line 903 of file atlimage.h.

Referenced by _clear_funs(), Init(), and ATL::CImage::Load().

◆ CreateHBITMAPFromBitmap

FUN_CreateHBITMAPFromBitmap ATL::CImage::CInitGDIPlus::CreateHBITMAPFromBitmap

Definition at line 904 of file atlimage.h.

Referenced by _clear_funs(), Init(), and ATL::CImage::Load().

◆ DisposeImage

FUN_DisposeImage ATL::CImage::CInitGDIPlus::DisposeImage

Definition at line 905 of file atlimage.h.

Referenced by _clear_funs(), Init(), ATL::CImage::Load(), and ATL::CImage::Save().

◆ GetImageDecoders

FUN_GetImageDecoder ATL::CImage::CInitGDIPlus::GetImageDecoders

Definition at line 906 of file atlimage.h.

Referenced by _clear_funs(), ATL::CImage::_getAllDecoders(), and Init().

◆ GetImageDecodersSize

FUN_GetImageDecoderSize ATL::CImage::CInitGDIPlus::GetImageDecodersSize

Definition at line 907 of file atlimage.h.

Referenced by _clear_funs(), ATL::CImage::_getAllDecoders(), and Init().

◆ GetImageEncoders

FUN_GetImageEncoder ATL::CImage::CInitGDIPlus::GetImageEncoders

Definition at line 908 of file atlimage.h.

Referenced by _clear_funs(), ATL::CImage::_getAllEncoders(), and Init().

◆ GetImageEncodersSize

FUN_GetImageEncoderSize ATL::CImage::CInitGDIPlus::GetImageEncodersSize

Definition at line 909 of file atlimage.h.

Referenced by _clear_funs(), ATL::CImage::_getAllEncoders(), and Init().

◆ m_dwLastError

DWORD ATL::CImage::CInitGDIPlus::m_dwLastError
private

Definition at line 870 of file atlimage.h.

◆ m_dwToken

ULONG_PTR ATL::CImage::CInitGDIPlus::m_dwToken
private

Definition at line 867 of file atlimage.h.

Referenced by Init(), and ReleaseGDIPlus().

◆ m_hInst

HINSTANCE ATL::CImage::CInitGDIPlus::m_hInst
private

Definition at line 866 of file atlimage.h.

Referenced by _get_fun(), Init(), and ReleaseGDIPlus().

◆ m_nCImageObjects

LONG ATL::CImage::CInitGDIPlus::m_nCImageObjects
private

Definition at line 869 of file atlimage.h.

Referenced by DecreaseCImageCount(), and IncreaseCImageCount().

◆ m_sect

CRITICAL_SECTION ATL::CImage::CInitGDIPlus::m_sect
private

◆ SaveImageToFile

FUN_SaveImageToFile ATL::CImage::CInitGDIPlus::SaveImageToFile

Definition at line 910 of file atlimage.h.

Referenced by _clear_funs(), Init(), and ATL::CImage::Save().

◆ SaveImageToStream

FUN_SaveImageToStream ATL::CImage::CInitGDIPlus::SaveImageToStream

Definition at line 911 of file atlimage.h.

Referenced by _clear_funs(), Init(), and ATL::CImage::Save().

◆ Shutdown

FUN_Shutdown ATL::CImage::CInitGDIPlus::Shutdown

Definition at line 900 of file atlimage.h.

Referenced by _clear_funs(), Init(), and ReleaseGDIPlus().

◆ Startup

FUN_Startup ATL::CImage::CInitGDIPlus::Startup

Definition at line 899 of file atlimage.h.

Referenced by _clear_funs(), and Init().


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