summaryrefslogtreecommitdiffstats
path: root/ue2/imgsynth2/cpixelformat_bgr24.cpp
diff options
context:
space:
mode:
authormanuel <manuel@nc8430.lan>2009-05-02 17:28:21 +0200
committermanuel <manuel@nc8430.lan>2009-05-02 17:28:21 +0200
commit5c4506a8c5ee1a82268146007619b09e980a7a57 (patch)
treec21bb83bdf7c87b7c9f9693cd4fcd43212ae4be2 /ue2/imgsynth2/cpixelformat_bgr24.cpp
parentbcadfa267f976fe9f29afa50a635cbe3ea174e38 (diff)
downloadooprog-5c4506a8c5ee1a82268146007619b09e980a7a57.tar.gz
ooprog-5c4506a8c5ee1a82268146007619b09e980a7a57.tar.bz2
ooprog-5c4506a8c5ee1a82268146007619b09e980a7a57.zip
add some assert() to make tutor happy
Diffstat (limited to 'ue2/imgsynth2/cpixelformat_bgr24.cpp')
-rw-r--r--ue2/imgsynth2/cpixelformat_bgr24.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/ue2/imgsynth2/cpixelformat_bgr24.cpp b/ue2/imgsynth2/cpixelformat_bgr24.cpp
index bc95ab9..2332142 100644
--- a/ue2/imgsynth2/cpixelformat_bgr24.cpp
+++ b/ue2/imgsynth2/cpixelformat_bgr24.cpp
@@ -6,6 +6,7 @@
6 */ 6 */
7 7
8#include <boost/numeric/conversion/cast.hpp> 8#include <boost/numeric/conversion/cast.hpp>
9#include <assert.h>
9#include "cpixelformat_bgr24.h" 10#include "cpixelformat_bgr24.h"
10#include "cbitmap.h" 11#include "cbitmap.h"
11 12
@@ -15,6 +16,7 @@ void CPixelFormat_BGR24::getPixel(RGBPIXEL& pixel, uint32_t x, uint32_t y)
15{ 16{
16 if (m_bitmap->getPixelData() == NULL) 17 if (m_bitmap->getPixelData() == NULL)
17 throw PixelFormatError("No pixelbuffer allocated."); 18 throw PixelFormatError("No pixelbuffer allocated.");
19 assert(m_bitmap->getPixelDataSize() > 0);
18 20
19 /* if the y-coordinates are mirrored */ 21 /* if the y-coordinates are mirrored */
20 if (m_bitmap->isMirrored()) 22 if (m_bitmap->isMirrored())
@@ -37,6 +39,7 @@ void CPixelFormat_BGR24::setPixel(const RGBPIXEL& pixel, uint32_t x, uint32_t y)
37{ 39{
38 if (m_bitmap->getPixelData() == NULL) 40 if (m_bitmap->getPixelData() == NULL)
39 throw PixelFormatError("No pixelbuffer allocated."); 41 throw PixelFormatError("No pixelbuffer allocated.");
42 assert(m_bitmap->getPixelDataSize() > 0);
40 43
41 /* if the y-coordinates are mirrored */ 44 /* if the y-coordinates are mirrored */
42 if (m_bitmap->isMirrored()) 45 if (m_bitmap->isMirrored())