--- parser3/src/classes/gd/Attic/gifio.C 2001/12/28 14:06:50 1.16 +++ parser3/src/classes/gd/Attic/gifio.C 2003/03/24 13:43:40 1.21.2.2.2.5 @@ -1,10 +1,8 @@ /** @file Parser: image manipulations impl2. - Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) - Author: Alexander Petrosyan (http://paf.design.ru) - - $Id: gifio.C,v 1.16 2001/12/28 14:06:50 paf Exp $ + Copyright (c) 2001-2003 ArtLebedev Group (http://www.artlebedev.com) + Author: Alexandr Petrosian (http://paf.design.ru) based on: gd @@ -37,6 +35,8 @@ ** CompuServe Incorporated. */ +static const char* IDENT_GIFIO_C="$Date: 2003/03/24 13:43:40 $"; + #include "gif.h" static int colorstobpp(int colors); @@ -45,7 +45,7 @@ void gdImage::Gif(String& out) { int BitsPerPixel = colorstobpp(colorsTotal); /* Clear any old values in statics strewn through the GIF code */ - gdGifEncoder encoder(pool(), *this, out); + gdGifEncoder encoder(*this, out); /* All set, let's do it. */ encoder.encode( sx, sy, interlace, 0, transparent, BitsPerPixel, @@ -328,9 +328,9 @@ gdGifEncoder::encode(int GWidth, int GHe */ void gdGifEncoder::Putbyte(int c) { - char *p=(char *)malloc(1); + char *p=new(PointerFreeGC) char[1]; *p=c; - fp.APPEND_AS_IS(p, 1, 0, 0); + fp.append(p, 1, String::L_AS_IS); } /* * Write out a word to the GIF file @@ -338,16 +338,16 @@ gdGifEncoder::Putbyte(int c) { void gdGifEncoder::Putword(int w) { - char *p=(char *)malloc(2); + char *p=new(PointerFreeGC) char[2]; p[0]=w & 0xff; p[1]=(w / 256) & 0xff; - fp.APPEND_AS_IS(p, 2, 0, 0); + fp.append(p, 2, String::L_AS_IS); } void gdGifEncoder::Write(void *buf, size_t size) { - char *p=(char *)malloc(size); + char *p=new(PointerFreeGC) char[size]; memcpy(p, buf, size); - fp.APPEND_AS_IS(p, size, 0, 0); + fp.append(p, size, String::L_AS_IS); } /*************************************************************************** @@ -681,7 +681,7 @@ void } } -gdGifEncoder::gdGifEncoder(Pool& pool, gdImage& aim, String& afp) : Pooled(pool), +gdGifEncoder::gdGifEncoder(gdImage& aim, String& afp): im(aim), fp(afp) { /* Some of these are properly initialized later. What I'm doing