mirror of
https://github.com/reactos/reactos.git
synced 2025-08-07 01:12:58 +00:00
[ATL] atlimage.h: Rename some members
Based on Doxygen analysis. - s/m_hbmOld/m_hOldBitmap/ - s/m_hbm/m_hBitmap/ - s/m_bHasAlphaCh/m_bHasAlphaChannel/ - s/m_bIsDIBSec/m_bIsDIBSection/ - s/m_rgbTransColor/m_clrTransparentColor/ CORE-19008
This commit is contained in:
parent
c8a990845b
commit
a93352fdaf
1 changed files with 44 additions and 44 deletions
|
@ -45,14 +45,14 @@ public:
|
||||||
|
|
||||||
CImage() throw()
|
CImage() throw()
|
||||||
{
|
{
|
||||||
m_hbm = NULL;
|
m_hBitmap = NULL;
|
||||||
m_hbmOld = NULL;
|
m_hOldBitmap = NULL;
|
||||||
m_hDC = NULL;
|
m_hDC = NULL;
|
||||||
|
|
||||||
m_eOrientation = DIBOR_DEFAULT;
|
m_eOrientation = DIBOR_DEFAULT;
|
||||||
m_bHasAlphaCh = false;
|
m_bHasAlphaChannel = false;
|
||||||
m_bIsDIBSec = false;
|
m_bIsDIBSection = false;
|
||||||
m_rgbTransColor = CLR_INVALID;
|
m_clrTransparentColor = CLR_INVALID;
|
||||||
ZeroMemory(&m_ds, sizeof(m_ds));
|
ZeroMemory(&m_ds, sizeof(m_ds));
|
||||||
|
|
||||||
s_gdiplus.IncreaseCImageCount();
|
s_gdiplus.IncreaseCImageCount();
|
||||||
|
@ -66,7 +66,7 @@ public:
|
||||||
|
|
||||||
operator HBITMAP() throw()
|
operator HBITMAP() throw()
|
||||||
{
|
{
|
||||||
return m_hbm;
|
return m_hBitmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ReleaseGDIPlus()
|
static void ReleaseGDIPlus()
|
||||||
|
@ -82,12 +82,12 @@ public:
|
||||||
HBITMAP Detach() throw()
|
HBITMAP Detach() throw()
|
||||||
{
|
{
|
||||||
m_eOrientation = DIBOR_DEFAULT;
|
m_eOrientation = DIBOR_DEFAULT;
|
||||||
m_bHasAlphaCh = false;
|
m_bHasAlphaChannel = false;
|
||||||
m_rgbTransColor = CLR_INVALID;
|
m_clrTransparentColor = CLR_INVALID;
|
||||||
ZeroMemory(&m_ds, sizeof(m_ds));
|
ZeroMemory(&m_ds, sizeof(m_ds));
|
||||||
|
|
||||||
HBITMAP hBitmap = m_hbm;
|
HBITMAP hBitmap = m_hBitmap;
|
||||||
m_hbm = NULL;
|
m_hBitmap = NULL;
|
||||||
return hBitmap;
|
return hBitmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ public:
|
||||||
return m_hDC;
|
return m_hDC;
|
||||||
|
|
||||||
m_hDC = ::CreateCompatibleDC(NULL);
|
m_hDC = ::CreateCompatibleDC(NULL);
|
||||||
m_hbmOld = ::SelectObject(m_hDC, m_hbm);
|
m_hOldBitmap = (HBITMAP)::SelectObject(m_hDC, m_hBitmap);
|
||||||
return m_hDC;
|
return m_hDC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,10 +108,10 @@ public:
|
||||||
if (m_hDC == NULL)
|
if (m_hDC == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (m_hbmOld)
|
if (m_hOldBitmap)
|
||||||
{
|
{
|
||||||
::SelectObject(m_hDC, m_hbmOld);
|
::SelectObject(m_hDC, m_hOldBitmap);
|
||||||
m_hbmOld = NULL;
|
m_hOldBitmap = NULL;
|
||||||
}
|
}
|
||||||
::DeleteDC(m_hDC);
|
::DeleteDC(m_hDC);
|
||||||
m_hDC = NULL;
|
m_hDC = NULL;
|
||||||
|
@ -204,7 +204,7 @@ public:
|
||||||
|
|
||||||
void Destroy() throw()
|
void Destroy() throw()
|
||||||
{
|
{
|
||||||
if (m_hbm)
|
if (m_hBitmap)
|
||||||
{
|
{
|
||||||
::DeleteObject(Detach());
|
::DeleteObject(Detach());
|
||||||
}
|
}
|
||||||
|
@ -214,18 +214,18 @@ public:
|
||||||
int xSrc, int ySrc, int nSrcWidth, int nSrcHeight) const throw()
|
int xSrc, int ySrc, int nSrcWidth, int nSrcHeight) const throw()
|
||||||
{
|
{
|
||||||
ATLASSERT(IsTransparencySupported());
|
ATLASSERT(IsTransparencySupported());
|
||||||
if (m_bHasAlphaCh)
|
if (m_bHasAlphaChannel)
|
||||||
{
|
{
|
||||||
return AlphaBlend(hDestDC, xDest, yDest, nDestWidth, nDestHeight,
|
return AlphaBlend(hDestDC, xDest, yDest, nDestWidth, nDestHeight,
|
||||||
xSrc, ySrc, nSrcWidth, nSrcHeight);
|
xSrc, ySrc, nSrcWidth, nSrcHeight);
|
||||||
}
|
}
|
||||||
else if (m_rgbTransColor != CLR_INVALID)
|
else if (m_clrTransparentColor != CLR_INVALID)
|
||||||
{
|
{
|
||||||
COLORREF rgb;
|
COLORREF rgb;
|
||||||
if ((m_rgbTransColor & 0xFF000000) == 0x01000000)
|
if ((m_clrTransparentColor & 0xFF000000) == 0x01000000)
|
||||||
rgb = RGBFromPaletteIndex(m_rgbTransColor & 0xFF);
|
rgb = RGBFromPaletteIndex(m_clrTransparentColor & 0xFF);
|
||||||
else
|
else
|
||||||
rgb = m_rgbTransColor;
|
rgb = m_clrTransparentColor;
|
||||||
return TransparentBlt(hDestDC, xDest, yDest, nDestWidth, nDestHeight,
|
return TransparentBlt(hDestDC, xDest, yDest, nDestWidth, nDestHeight,
|
||||||
xSrc, ySrc, nSrcWidth, nSrcHeight, rgb);
|
xSrc, ySrc, nSrcWidth, nSrcHeight, rgb);
|
||||||
}
|
}
|
||||||
|
@ -278,7 +278,7 @@ public:
|
||||||
|
|
||||||
int GetBPP() const throw()
|
int GetBPP() const throw()
|
||||||
{
|
{
|
||||||
ATLASSERT(m_hbm);
|
ATLASSERT(m_hBitmap);
|
||||||
return m_bm.bmBitsPixel;
|
return m_bm.bmBitsPixel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -293,7 +293,7 @@ public:
|
||||||
|
|
||||||
int GetHeight() const throw()
|
int GetHeight() const throw()
|
||||||
{
|
{
|
||||||
ATLASSERT(m_hbm);
|
ATLASSERT(m_hBitmap);
|
||||||
return m_bm.bmHeight;
|
return m_bm.bmHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -345,19 +345,19 @@ public:
|
||||||
|
|
||||||
COLORREF GetTransparentColor() const throw()
|
COLORREF GetTransparentColor() const throw()
|
||||||
{
|
{
|
||||||
return m_rgbTransColor;
|
return m_clrTransparentColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
int GetWidth() const throw()
|
int GetWidth() const throw()
|
||||||
{
|
{
|
||||||
ATLASSERT(m_hbm);
|
ATLASSERT(m_hBitmap);
|
||||||
return m_bm.bmWidth;
|
return m_bm.bmWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsDIBSection() const throw()
|
bool IsDIBSection() const throw()
|
||||||
{
|
{
|
||||||
ATLASSERT(m_hbm);
|
ATLASSERT(m_hBitmap);
|
||||||
return m_bIsDIBSec;
|
return m_bIsDIBSection;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsIndexed() const throw()
|
bool IsIndexed() const throw()
|
||||||
|
@ -368,7 +368,7 @@ public:
|
||||||
|
|
||||||
bool IsNull() const throw()
|
bool IsNull() const throw()
|
||||||
{
|
{
|
||||||
return m_hbm == NULL;
|
return m_hBitmap == NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT Load(LPCTSTR pszFileName) throw()
|
HRESULT Load(LPCTSTR pszFileName) throw()
|
||||||
|
@ -511,7 +511,7 @@ public:
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
using namespace Gdiplus;
|
using namespace Gdiplus;
|
||||||
ATLASSERT(m_hbm);
|
ATLASSERT(m_hBitmap);
|
||||||
|
|
||||||
// Get encoders
|
// Get encoders
|
||||||
UINT cEncoders = 0;
|
UINT cEncoders = 0;
|
||||||
|
@ -523,7 +523,7 @@ public:
|
||||||
|
|
||||||
// create a GpBitmap from HBITMAP
|
// create a GpBitmap from HBITMAP
|
||||||
GpBitmap *pBitmap = NULL;
|
GpBitmap *pBitmap = NULL;
|
||||||
s_gdiplus.CreateBitmapFromHBITMAP(m_hbm, NULL, &pBitmap);
|
s_gdiplus.CreateBitmapFromHBITMAP(m_hBitmap, NULL, &pBitmap);
|
||||||
|
|
||||||
// save to stream
|
// save to stream
|
||||||
Status status;
|
Status status;
|
||||||
|
@ -542,7 +542,7 @@ public:
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
using namespace Gdiplus;
|
using namespace Gdiplus;
|
||||||
ATLASSERT(m_hbm);
|
ATLASSERT(m_hBitmap);
|
||||||
|
|
||||||
// convert the file name string into Unicode
|
// convert the file name string into Unicode
|
||||||
CStringW pszNameW(pszFileName);
|
CStringW pszNameW(pszFileName);
|
||||||
|
@ -566,7 +566,7 @@ public:
|
||||||
|
|
||||||
// create a GpBitmap from HBITMAP
|
// create a GpBitmap from HBITMAP
|
||||||
GpBitmap *pBitmap = NULL;
|
GpBitmap *pBitmap = NULL;
|
||||||
s_gdiplus.CreateBitmapFromHBITMAP(m_hbm, NULL, &pBitmap);
|
s_gdiplus.CreateBitmapFromHBITMAP(m_hBitmap, NULL, &pBitmap);
|
||||||
|
|
||||||
// save to file
|
// save to file
|
||||||
Status status = s_gdiplus.SaveImageToFile(pBitmap, pszNameW, &clsid, NULL);
|
Status status = s_gdiplus.SaveImageToFile(pBitmap, pszNameW, &clsid, NULL);
|
||||||
|
@ -608,9 +608,9 @@ public:
|
||||||
|
|
||||||
COLORREF SetTransparentColor(COLORREF rgbTransparent) throw()
|
COLORREF SetTransparentColor(COLORREF rgbTransparent) throw()
|
||||||
{
|
{
|
||||||
ATLASSERT(m_hbm);
|
ATLASSERT(m_hBitmap);
|
||||||
COLORREF rgbOldColor = m_rgbTransColor;
|
COLORREF rgbOldColor = m_clrTransparentColor;
|
||||||
m_rgbTransColor = rgbTransparent;
|
m_clrTransparentColor = rgbTransparent;
|
||||||
return rgbOldColor;
|
return rgbOldColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1013,13 +1013,13 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
HBITMAP m_hbm;
|
HBITMAP m_hBitmap;
|
||||||
mutable HGDIOBJ m_hbmOld;
|
mutable HBITMAP m_hOldBitmap;
|
||||||
mutable HDC m_hDC;
|
mutable HDC m_hDC;
|
||||||
DIBOrientation m_eOrientation;
|
DIBOrientation m_eOrientation;
|
||||||
bool m_bHasAlphaCh;
|
bool m_bHasAlphaChannel;
|
||||||
bool m_bIsDIBSec;
|
bool m_bIsDIBSection;
|
||||||
COLORREF m_rgbTransColor;
|
COLORREF m_clrTransparentColor;
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
BITMAP m_bm;
|
BITMAP m_bm;
|
||||||
|
@ -1131,16 +1131,16 @@ private:
|
||||||
Destroy();
|
Destroy();
|
||||||
|
|
||||||
const int size = sizeof(DIBSECTION);
|
const int size = sizeof(DIBSECTION);
|
||||||
m_bIsDIBSec = (::GetObject(hBitmap, size, &m_ds) == size);
|
m_bIsDIBSection = (::GetObject(hBitmap, size, &m_ds) == size);
|
||||||
|
|
||||||
bool bOK = (::GetObject(hBitmap, sizeof(BITMAP), &m_bm) != 0);
|
bool bOK = (::GetObject(hBitmap, sizeof(BITMAP), &m_bm) != 0);
|
||||||
|
|
||||||
if (bOK)
|
if (bOK)
|
||||||
{
|
{
|
||||||
m_hbm = hBitmap;
|
m_hBitmap = hBitmap;
|
||||||
m_eOrientation = eOrientation;
|
m_eOrientation = eOrientation;
|
||||||
m_bHasAlphaCh = (m_bm.bmBitsPixel == 32);
|
m_bHasAlphaChannel = (m_bm.bmBitsPixel == 32);
|
||||||
m_rgbTransColor = CLR_INVALID;
|
m_clrTransparentColor = CLR_INVALID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1201,7 +1201,7 @@ private:
|
||||||
|
|
||||||
// attach it
|
// attach it
|
||||||
AttachInternal(hbm, eOrientation, -1);
|
AttachInternal(hbm, eOrientation, -1);
|
||||||
m_bHasAlphaCh = bHasAlphaCh;
|
m_bHasAlphaChannel = bHasAlphaCh;
|
||||||
|
|
||||||
return hbm != NULL;
|
return hbm != NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue