--- parser3/src/classes/gd/Attic/gif.h 2001/04/11 17:47:03 1.3 +++ parser3/src/classes/gd/Attic/gif.h 2001/09/17 16:14:04 1.10.4.2 @@ -1,4 +1,12 @@ /** @file + Parser: image manipulations decls. + + Author: Alexander Petrosyan (http://design.ru/paf) + + $Id: gif.h,v 1.10.4.2 2001/09/17 16:14:04 parser Exp $ + + + based on: gd.h: declarations file for the gifdraw module. Written by Tom Boutell, 5/94. @@ -13,18 +21,14 @@ #ifndef GIF_H #define GIF_H 1 +#include "pa_config_includes.h" + #include "pa_pool.h" #include "pa_string.h" -#include -#include #define gdMaxColors 0x100 #define HSIZE 5003 /* 80% occupancy */ -/* For backwards compatibility only. Use gdImageSetStyle() for MUCH more flexible line drawing. Also see gdImageSetBrush(). */ -#define gdDashSize 4 - - /** Image type. See functions below; you will not need to change the elements directly. Use the provided macros to @@ -33,26 +37,28 @@ */ class gdImage : public Pooled { -public: /* Functions to manipulate images. */ - +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 DashedLine(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 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); + //@} - /* Point type for use in polygon drawing. */ - + /// Point type for use in polygon drawing. struct Point { int x, y; }; - void Polygon(Point *p, int n, int c); + void Polygon(Point *p, int n, int c, bool closed=true); void FilledPolygon(Point *p, int n, int c); void FilledPolygonReplaceColor(Point *p, int n, int a, int b); @@ -73,11 +79,14 @@ public: /* Functions to manipulate image void Fill(int x, int y, int color); void Copy(gdImage& dst, int dstX, int dstY, int srcX, int srcY, int w, int h); void CopyResized(gdImage& dst, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH); - void SetStyle(int width); + void SetLineWidth(int width); + void SetLineStyle(const char *aLineStyle); void SetInterlace(int interlaceArg); /* On or off(1 or 0) */ -public: /* information about image. READ ONLY */ +public: + //@{ + /// @name information about image. READ ONLY int SX() { return sx; } int SY() { return sy; } int ColorsTotal() { return colorsTotal; } @@ -86,6 +95,7 @@ public: /* information about image. READ int Blue(int c) { return blue[c]; } int GetTransparent() { return transparent; } int GetInterlaced() { return interlace; } + //@} private: @@ -100,7 +110,7 @@ private: int transparent; int *polyInts; int polyAllocated; - int styleWidth; + int lineWidth; const char *lineStyle; int interlace; private: // read gif @@ -117,6 +127,7 @@ private: // read gif }; +/// used by gdImage::Gif to produce buffer with bytes in GIF format class gdGifEncoder : public Pooled { public: @@ -130,16 +141,14 @@ public: private: - /* - * a code_int must be able to hold 2**GIFBITS values of type int, and also -1 - */ + /// a code_int must be able to hold 2**GIFBITS values of type int, and also -1 typedef int code_int; - #ifdef SIGNED_COMPARE_SLOW +#ifdef SIGNED_COMPARE_SLOW typedef unsigned long int count_int; typedef unsigned short int count_short; - #else /*SIGNED_COMPARE_SLOW*/ +#else typedef long int count_int; - #endif /*SIGNED_COMPARE_SLOW*/ +#endif private: @@ -219,6 +228,4 @@ inline /*paf int*/void gdImage::DoSetPix if(BoundsSafe(x, y)) pixels[x][y] = color; } - - #endif