--- parser3/src/lib/gd/gif.C 2004/02/11 15:33:15 1.2 +++ parser3/src/lib/gd/gif.C 2005/08/09 08:14:50 1.6 @@ -1,7 +1,7 @@ /** @file Parser: image manipulations impl1. - Copyright (c) 2001-2004 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001-2005 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) based on: gd @@ -14,7 +14,7 @@ can incorporate them into new versions. */ -static const char * const IDENT_GIF_C="$Date: 2004/02/11 15:33:15 $"; +static const char * const IDENT_GIF_C="$Date: 2005/08/09 08:14:50 $"; #include "gif.h" @@ -112,6 +112,11 @@ int gdImage::Color(unsigned int rgb){ unsigned int b=rgb, g=b>>8, r=g>>8; return ColorRGB(r & 0xFF,g & 0xFF,b & 0xFF); } +unsigned int gdImage::DecodeColor(int color) { + if(color<0) + return color; + return (((red[color]<<8) + green[color])<<8)+blue[color]; +} void gdImage::ColorDeallocate(int color) { @@ -154,7 +159,7 @@ void gdImage::SetPixel(int x, int y, int int gdImage::GetPixel(int x, int y) { - return BoundsSafe(x, y) ? pixels[x][y]:0; + return BoundsSafe(x, y) ? pixels[x][y]:-1; } /* Bresenham as presented in Foley & Van Dam */ @@ -517,7 +522,7 @@ void gdImage::Fill(int x, int y, int col if (GetPixel(i, y) != old) { break; } - SetPixel(i, y, color); + DoSetPixel(i, y, color); // PAF, was SetPixel leftLimit = i; } if (leftLimit == (-1)) { @@ -529,7 +534,7 @@ void gdImage::Fill(int x, int y, int col if (GetPixel(i, y) != old) { break; } - SetPixel(i, y, color); + DoSetPixel(i, y, color); // PAF, was SetPixel rightLimit = i; } /* Look at lines above and below and start paints */