From 6b692020160ae9a925af9ae0b73f31229a107863 Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Sat, 9 Sep 2023 20:20:22 +0900 Subject: [PATCH] [ATL] CImage: Simplify GetBits/GetPixelAddress (#5671) CORE-19008 --- sdk/lib/atl/atlimage.h | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/sdk/lib/atl/atlimage.h b/sdk/lib/atl/atlimage.h index 84bfe64fc76..874ef0f60e8 100644 --- a/sdk/lib/atl/atlimage.h +++ b/sdk/lib/atl/atlimage.h @@ -285,13 +285,7 @@ public: const void *GetBits() const noexcept { - ATLASSERT(IsDIBSection()); - const BYTE *pb = (const BYTE *)m_bm.bmBits; - if (m_eOrientation == DIBOR_BOTTOMUP) - { - pb += m_bm.bmWidthBytes * (m_bm.bmHeight - 1); - } - return pb; + return const_cast(this)->GetBits(); } int GetBPP() const noexcept @@ -363,11 +357,7 @@ public: const void* GetPixelAddress(int x, int y) const noexcept { - ATLASSERT(IsDIBSection()); - const BYTE *pb = (const BYTE *)GetBits(); - pb += GetPitch() * y; - pb += (GetBPP() * x) / 8; - return pb; + return const_cast(this)->GetPixelAddress(x, y); } COLORREF GetTransparentColor() const noexcept