From b9ce1555b2baf9be209775dbd4c8b217db5cd735 Mon Sep 17 00:00:00 2001 From: manuel Date: Fri, 1 May 2009 20:18:51 +0200 Subject: rewrote pixmap::read to do more sanity checks --- ue2/imgsynth2/cbitmap.cpp | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) (limited to 'ue2/imgsynth2/cbitmap.cpp') diff --git a/ue2/imgsynth2/cbitmap.cpp b/ue2/imgsynth2/cbitmap.cpp index ed26600..c2cd99a 100644 --- a/ue2/imgsynth2/cbitmap.cpp +++ b/ue2/imgsynth2/cbitmap.cpp @@ -28,18 +28,9 @@ CBitmap::~CBitmap() m_pixelformat = NULL; /* delete colortable content */ - //TODO - /*map::iterator it2; - for (it2 = m_colortable.begin(); it2 != m_colortable.end(); it2++) - delete (*it2).second;*/ - - map >::iterator it1; - map::iterator it2; - for(it1 = xpmColors.begin(); it1 != xpmColors.end(); it1++) - { - for(it2 = (*it1).second.begin(); it2 != (*it1).second.end(); it2++) - delete[] (*it2).second; - } + map::iterator it2; + for(it2 = m_colortable.begin(); it2 != m_colortable.end(); it2++) + delete (*it2).second; } /*----------------------------------------------------------------------------*/ @@ -153,13 +144,12 @@ void CBitmap::invert(std::list params) { /* invert every entry in the colortable */ map::iterator it; - //TODO - /*for (it = m_colortable.begin(); it != m_colortable.end(); it++) + for (it = m_colortable.begin(); it != m_colortable.end(); it++) { (*it).second->red = max.red - (*it).second->red; (*it).second->green = max.green - (*it).second->green; (*it).second->blue = max.blue - (*it).second->blue; - }*/ + } } else { @@ -223,13 +213,12 @@ void CBitmap::brightness(std::list params) { /* invert every entry in the colortable */ map::iterator it; - //TODO - /*for (it = m_colortable.begin(); it != m_colortable.end(); it++) + for (it = m_colortable.begin(); it != m_colortable.end(); it++) { (*it).second->red = min(max.red, static_cast((*it).second->red * factor)); (*it).second->green = min(max.green, static_cast((*it).second->green * factor)); (*it).second->blue = min(max.blue, static_cast((*it).second->blue * factor)); - }*/ + } } else { -- cgit v1.2.3