From bcadfa267f976fe9f29afa50a635cbe3ea174e38 Mon Sep 17 00:00:00 2001 From: manuel Date: Sat, 2 May 2009 16:44:53 +0200 Subject: - colortable now uses uint32_t as identifier - rewrote xpm colortable parsing to convert their identifiers to our own and vica vi - implemented indexed8::setpixel/getpixel - moved rowsize to member variable in cbitmap - added second test for xpm/indexed8 --- ue2/imgsynth2/cpixelformat_bgr555.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'ue2/imgsynth2/cpixelformat_bgr555.cpp') diff --git a/ue2/imgsynth2/cpixelformat_bgr555.cpp b/ue2/imgsynth2/cpixelformat_bgr555.cpp index 2f98cc7..657c148 100644 --- a/ue2/imgsynth2/cpixelformat_bgr555.cpp +++ b/ue2/imgsynth2/cpixelformat_bgr555.cpp @@ -17,15 +17,10 @@ void CPixelFormat_BGR555::getPixel(RGBPIXEL& pixel, uint32_t x, uint32_t y) if (m_bitmap->getPixelData() == NULL) throw PixelFormatError("No pixelbuffer allocated."); - /* calc rowsize - boundary is 32 */ - uint32_t rowsize = 4 * static_cast( - ((getBitCount() * m_bitmap->getWidth()) + 31) / 32 - ); - /* if the y-coordinates are mirrored */ if (m_bitmap->isMirrored()) y = m_bitmap->getHeight() - y - 1; - uint32_t offset = y * rowsize + x * (4 * getBitCount() / 32); + uint32_t offset = y * m_bitmap->getRowSize() + x * (4 * getBitCount() / 32); /* boundary check */ if (offset + getBitCount()/8 > m_bitmap->getPixelDataSize()) @@ -45,15 +40,10 @@ void CPixelFormat_BGR555::setPixel(const RGBPIXEL& pixel, uint32_t x, uint32_t y if (m_bitmap->getPixelData() == NULL) throw PixelFormatError("No pixelbuffer allocated."); - /* calc rowsize - boundary is 32 */ - uint32_t rowsize = 4 * static_cast( - ((getBitCount() * m_bitmap->getWidth()) + 31) / 32 - ); - /* if the y-coordinates are mirrored */ if (m_bitmap->isMirrored()) y = m_bitmap->getHeight() - y - 1; - uint32_t offset = y * rowsize + x * (4 * getBitCount() / 32); + uint32_t offset = y * m_bitmap->getRowSize() + x * (4 * getBitCount() / 32); /* boundary check */ if (offset + getBitCount()/8 > m_bitmap->getPixelDataSize()) -- cgit v1.2.3