--- parser3/src/classes/gd/Attic/gif.h 2002/02/08 07:27:42 1.19 +++ parser3/src/classes/gd/Attic/gif.h 2003/02/21 08:50:02 1.23.2.5 @@ -1,11 +1,8 @@ /** @file Parser: image manipulations decls. - Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) - Author: Alexander Petrosyan (http://paf.design.ru) - - $Id: gif.h,v 1.19 2002/02/08 07:27:42 paf Exp $ - + Copyright (c) 2001-2003 ArtLebedev Group (http://www.artlebedev.com) + Author: Alexandr Petrosian (http://paf.design.ru) based on: gd.h: declarations file for the gifdraw module. @@ -19,7 +16,9 @@ */ #ifndef GIF_H -#define GIF_H 1 +#define GIF_H + +static const char* IDENT_GIF_H="$Date: 2003/02/21 08:50:02 $"; #include "pa_config_includes.h" @@ -35,19 +34,18 @@ access sx, sy, the color table, and colorsTotal for read-only purposes. */ -class gdImage : public Pooled { +class gdImage: public PA_Object { public: //@{ /// @name Functions to manipulate images - gdImage(Pool& pool) : Pooled(pool) {} void Create(int asx, int asy); bool CreateFromGif(FILE *fd); void SetPixel(int x, int y, int color); int GetPixel(int x, int y); void Line(int x1, int y1, int x2, int y2, int color); - void StyledLine(int x1, int y1, int x2, int y2, int color, const char *lineStyle); + void StyledLine(int x1, int y1, int x2, int y2, int color, CharPtr lineStyle); void Rectangle(int x1, int y1, int x2, int y2, int color); void LineReplaceColor(int x1, int y1, int x2, int y2, int a, int b); void FilledRectangle(int x1, int y1, int x2, int y2, int color); @@ -73,7 +71,7 @@ public: int BoundsSafe(int x, int y); void DoSetPixel(int x, int y, int color); - void Gif(String& out); + void Gif(Pool& pool, String& out); void Arc(int cx, int cy, int w, int h, int s, int e, int color); void Sector(int cx, int cy, int w, int h, int s, int e, int color); void FillToBorder(int x, int y, int border, int color); @@ -81,7 +79,7 @@ public: void Copy(gdImage& dst, int dstX, int dstY, int srcX, int srcY, int w, int h); void CopyResampled(gdImage& dst, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH, int tolerance); void SetLineWidth(int width); - void SetLineStyle(const char *aLineStyle); + void SetLineStyle(CharPtr aLineStyle); void SetInterlace(int interlaceArg); /* On or off(1 or 0) */ public: @@ -111,7 +109,7 @@ private: int transparent; int *polyInts; int polyAllocated; - int lineWidth; const char *lineStyle; + int lineWidth; CharPtr lineStyle; int interlace; private: // read gif @@ -127,12 +125,13 @@ private: // read gif int ZeroDataBlock; }; +DECLARE_OBJECT_PTR(gdImage); /// used by gdImage::Gif to produce buffer with bytes in GIF format -class gdGifEncoder : public Pooled { +class gdGifEncoder: public PA_Object { public: - gdGifEncoder(Pool& pool, gdImage& aim, String& afp); + gdGifEncoder(Pool& apool, gdImage& aim, String& afp); void encode( int GWidth, int GHeight, @@ -141,6 +140,8 @@ public: int *Red, int *Green, int *Blue); private: + + Pool& pool; /// a code_int must be able to hold 2**GIFBITS values of type int, and also -1 typedef int code_int; @@ -228,5 +229,6 @@ inline int gdImage::BoundsSafe(int x, in inline /*paf int*/void gdImage::DoSetPixel(int x, int y, int color){ if(BoundsSafe(x, y)) pixels[x][y] = color; } +DECLARE_OBJECT_PTR(gdGifEncoder); #endif