|
|
| version 1.20, 2002/02/08 08:30:11 | version 1.23.2.5.2.1, 2003/03/18 15:14:15 |
|---|---|
| Line 1 | Line 1 |
| /** @file | /** @file |
| Parser: image manipulations decls. | Parser: image manipulations decls. |
| Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) | Copyright (c) 2001-2003 ArtLebedev Group (http://www.artlebedev.com) |
| Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) | Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) |
| $Id$ | |
| based on: | based on: |
| gd.h: declarations file for the gifdraw module. | gd.h: declarations file for the gifdraw module. |
| Line 19 | Line 16 |
| */ | */ |
| #ifndef GIF_H | #ifndef GIF_H |
| #define GIF_H 1 | #define GIF_H |
| static const char* IDENT_GIF_H="$Date$"; | |
| #include "pa_config_includes.h" | #include "pa_config_includes.h" |
| #include "pa_pool.h" | |
| #include "pa_string.h" | #include "pa_string.h" |
| #define gdMaxColors 0x100 | #define gdMaxColors 0x100 |
| Line 35 | Line 34 |
| access sx, sy, the color table, and colorsTotal for | access sx, sy, the color table, and colorsTotal for |
| read-only purposes. | read-only purposes. |
| */ | */ |
| class gdImage : public Pooled { | class gdImage: public PA_Object { |
| public: | public: |
| //@{ | //@{ |
| /// @name Functions to manipulate images | /// @name Functions to manipulate images |
| gdImage(Pool& pool) : Pooled(pool) {} | |
| void Create(int asx, int asy); | void Create(int asx, int asy); |
| bool CreateFromGif(FILE *fd); | bool CreateFromGif(FILE *fd); |
| void SetPixel(int x, int y, int color); | void SetPixel(int x, int y, int color); |
| int GetPixel(int x, int y); | int GetPixel(int x, int y); |
| void Line(int x1, int y1, int x2, int y2, int color); | 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, const char* lineStyle); |
| void Rectangle(int x1, int y1, int x2, int y2, int color); | 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 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); | void FilledRectangle(int x1, int y1, int x2, int y2, int color); |
| Line 81 public: | Line 79 public: |
| void Copy(gdImage& dst, int dstX, int dstY, int srcX, int srcY, int w, int h); | 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 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 SetLineWidth(int width); |
| void SetLineStyle(const char *aLineStyle); | void SetLineStyle(const char* aLineStyle); |
| void SetInterlace(int interlaceArg); /* On or off(1 or 0) */ | void SetInterlace(int interlaceArg); /* On or off(1 or 0) */ |
| public: | public: |
| Line 111 private: | Line 109 private: |
| int transparent; | int transparent; |
| int *polyInts; | int *polyInts; |
| int polyAllocated; | int polyAllocated; |
| int lineWidth; const char *lineStyle; | int lineWidth; const char* lineStyle; |
| int interlace; | int interlace; |
| private: // read gif | private: // read gif |
| Line 127 private: // read gif | Line 125 private: // read gif |
| int ZeroDataBlock; | int ZeroDataBlock; |
| }; | }; |
| DECLARE_OBJECT_PTR(gdImage); | |
| /// used by gdImage::Gif to produce buffer with bytes in GIF format | /// used by gdImage::Gif to produce buffer with bytes in GIF format |
| class gdGifEncoder : public Pooled { | class gdGifEncoder: public PA_Object { |
| public: | public: |
| gdGifEncoder(Pool& pool, gdImage& aim, String& afp); | gdGifEncoder(gdImage& aim, String& afp); |
| void encode( | void encode( |
| int GWidth, int GHeight, | int GWidth, int GHeight, |
| Line 141 public: | Line 140 public: |
| int *Red, int *Green, int *Blue); | int *Red, int *Green, int *Blue); |
| private: | 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; | typedef int code_int; |
| Line 228 inline int gdImage::BoundsSafe(int x, in | Line 229 inline int gdImage::BoundsSafe(int x, in |
| inline /*paf int*/void gdImage::DoSetPixel(int x, int y, int color){ | inline /*paf int*/void gdImage::DoSetPixel(int x, int y, int color){ |
| if(BoundsSafe(x, y)) pixels[x][y] = color; | if(BoundsSafe(x, y)) pixels[x][y] = color; |
| } | } |
| DECLARE_OBJECT_PTR(gdGifEncoder); | |
| #endif | #endif |