--- parser3/src/lib/gd/gif.C 2004/02/11 15:33:15 1.2 +++ parser3/src/lib/gd/gif.C 2012/03/16 09:24:11 1.7 @@ -1,7 +1,7 @@ /** @file Parser: image manipulations impl1. - Copyright (c) 2001-2004 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) based on: gd @@ -14,12 +14,10 @@ can incorporate them into new versions. */ -static const char * const IDENT_GIF_C="$Date: 2004/02/11 15:33:15 $"; - #include "gif.h" - #include "mtables.h" -//#include "pa_common.h" + +volatile const char * IDENT_GIF_C="$Id: gif.C,v 1.7 2012/03/16 09:24:11 moko Exp $" IDENT_GIF_H; //static void BrushApply(int x, int y); //static void TileApply(int x, int y); @@ -112,6 +110,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 +157,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 +520,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 +532,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 */