--- parser3/src/classes/gd/Attic/gifio.C 2001/09/21 14:46:09 1.12 +++ parser3/src/classes/gd/Attic/gifio.C 2003/03/18 15:14:15 1.21.2.2.2.1 @@ -1,7 +1,18 @@ /** @file Parser: image manipulations impl2. - Author: Alexander Petrosyan (http://design.ru/paf) + Copyright (c) 2001-2003 ArtLebedev Group (http://www.artlebedev.com) + Author: Alexandr Petrosian (http://paf.design.ru) + + based on: gd + + Written by Tom Boutell, 5/94. + Copyright 1994, Cold Spring Harbor Labs. + Permission granted to use this code in any fashion provided + that this notice is retained and any alterations are + labeled as such. It is requested, but not required, that + you share extensions to this module with us so that we + can incorporate them into new versions. based on: ** @@ -23,17 +34,18 @@ ** CompuServe Incorporated. GIF(sm) is a Service Mark property of ** CompuServe Incorporated. */ -static const char *RCSId="$Id: gifio.C,v 1.12 2001/09/21 14:46:09 parser Exp $"; + +static const char* IDENT_GIFIO_C="$Date: 2003/03/18 15:14:15 $"; #include "gif.h" static int colorstobpp(int colors); -void gdImage::Gif(String& out) +void gdImage::GifString& out) { int BitsPerPixel = colorstobpp(colorsTotal); /* Clear any old values in statics strewn through the GIF code */ - gdGifEncoder encoder(pool(), *this, out); + gdGifEncoder encoder(pool, *this, out); /* All set, let's do it. */ encoder.encode( sx, sy, interlace, 0, transparent, BitsPerPixel, @@ -73,8 +85,12 @@ colorstobpp(int colors) * *****************************************************************************/ +#ifndef TRUE #define TRUE 1 +#endif +#ifndef FALSE #define FALSE 0 +#endif /* * Bump the 'curx' and 'cury' to point to the next pixel @@ -312,7 +328,7 @@ gdGifEncoder::encode(int GWidth, int GHe */ void gdGifEncoder::Putbyte(int c) { - char *p=(char *)malloc(1); + char *p=new char[1]; *p=c; fp.APPEND_AS_IS(p, 1, 0, 0); } @@ -322,14 +338,14 @@ gdGifEncoder::Putbyte(int c) { void gdGifEncoder::Putword(int w) { - char *p=(char *)malloc(2); + char *p=new char[2]; p[0]=w & 0xff; p[1]=(w / 256) & 0xff; fp.APPEND_AS_IS(p, 2, 0, 0); } void gdGifEncoder::Write(void *buf, size_t size) { - char *p=(char *)malloc(size); + char *p=new char[size]; memcpy(p, buf, size); fp.APPEND_AS_IS(p, size, 0, 0); } @@ -665,7 +681,7 @@ void } } -gdGifEncoder::gdGifEncoder(Pool& pool, gdImage& aim, String& afp) : Pooled(pool), +gdGifEncoder::gdGifEncoder(gdImage& aim, String& afp): pool(), im(aim), fp(afp) { /* Some of these are properly initialized later. What I'm doing @@ -711,8 +727,12 @@ gdGifEncoder::gdGifEncoder(Pool& pool, g #define MAXCOLORMAPSIZE 256 +#ifndef TRUE #define TRUE 1 +#endif +#ifndef FALSE #define FALSE 0 +#endif #define CM_RED 0 #define CM_GREEN 1