00001 #ifndef GD_H
00002 #define GD_H 1
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include <stdio.h>
00016 #include "../../../core/includes/machine.h"
00017
00018
00019
00020 #define gdMaxColors 256
00021
00022
00023
00024
00025
00026
00027 typedef struct gdImageStruct {
00028 unsigned char ** pixels;
00029 int sx;
00030 int sy;
00031 int colorsTotal;
00032 int red[gdMaxColors];
00033 int green[gdMaxColors];
00034 int blue[gdMaxColors];
00035 int open[gdMaxColors];
00036 int transparent;
00037 int *polyInts;
00038 int polyAllocated;
00039 struct gdImageStruct *brush;
00040 struct gdImageStruct *tile;
00041 int brushColorMap[gdMaxColors];
00042 int tileColorMap[gdMaxColors];
00043 int styleLength;
00044 int stylePos;
00045 int *style;
00046 int interlace;
00047 int alu;
00048 int clipping;
00049 int cliprect[4];
00050 int background;
00051 } gdImage;
00052
00053 typedef gdImage * gdImagePtr;
00054
00055 typedef struct {
00056
00057 int nchars;
00058
00059 int offset;
00060
00061 int w;
00062 int h;
00063 int fixed;
00064
00065
00066
00067 char *data;
00068 } gdFont;
00069
00070
00071 typedef gdFont *gdFontPtr;
00072
00073
00074
00075
00076 #define gdDashSize 4
00077
00078
00079
00080 #define gdStyled (-2)
00081 #define gdBrushed (-3)
00082 #define gdStyledBrushed (-4)
00083 #define gdTiled (-5)
00084
00085
00086
00087 #define gdTransparent (-6)
00088
00089
00090 void gdSetClipping __PARAMS((gdImagePtr im , int xmin, int ymin, int xmax, int ymax));
00091 void gdUnsetClipping __PARAMS((gdImagePtr im));
00092 void gdSetAlu __PARAMS((gdImagePtr im, int alu));
00093
00094
00095 void gdResetDash();
00096
00097
00098 gdImagePtr gdImageCreate __PARAMS((int sx, int sy));
00099 gdImagePtr gdImageCreateFromGif __PARAMS((FILE *fd));
00100 gdImagePtr gdImageCreateFromGd __PARAMS((FILE *in));
00101 gdImagePtr gdImageCreateFromXbm __PARAMS((FILE *fd));
00102 void gdImageDestroy __PARAMS((gdImagePtr im));
00103 void gdImageSetPixel __PARAMS((gdImagePtr im, int x, int y, int color));
00104 int gdImageGetPixel __PARAMS((gdImagePtr im, int x, int y));
00105 void gdImageLine __PARAMS((gdImagePtr im, int x1, int y1, int x2, int y2, int color));
00106
00107
00108
00109
00110
00111 void gdImageRectangle __PARAMS((gdImagePtr im, int x1, int y1, int x2, int y2, int color));
00112 void gdImageThickRectangle __PARAMS((gdImagePtr im, int x1, int y1, int x2, int y2, int color, int thick));
00113
00114
00115 void gdImageFilledRectangle __PARAMS((gdImagePtr im, int x1, int y1, int x2, int y2, int color));
00116 int gdImageBoundsSafe __PARAMS((gdImagePtr im, int x, int y));
00117 int gdImageChar __PARAMS((gdImagePtr im, gdFontPtr f, int x, int y, int c, int color));
00118 void gdImageCharUp __PARAMS((gdImagePtr im, gdFontPtr f, int x, int y, int c, int color));
00119 void gdImageString __PARAMS((gdImagePtr im, gdFontPtr f, int x, int y, unsigned char *s, int color));
00120 void gdImageStringUp __PARAMS((gdImagePtr im, gdFontPtr f, int x, int y, unsigned char *s, int color));
00121 void gdImageString16 __PARAMS((gdImagePtr im, gdFontPtr f, int x, int y, unsigned short *s, int color));
00122 void gdImageStringUp16 __PARAMS((gdImagePtr im, gdFontPtr f, int x, int y, unsigned short *s, int color));
00123
00124
00125
00126 typedef struct {
00127 int x, y;
00128 } gdPoint, *gdPointPtr;
00129
00130 void gdImagePolygon __PARAMS((gdImagePtr im, gdPointPtr p, int n, int c));
00131 void gdImageFilledPolygon __PARAMS((gdImagePtr im, gdPointPtr p, int n, int c));
00132
00133 int gdImageColorAllocate __PARAMS((gdImagePtr im, int r, int g, int b));
00134 int gdImageColorClosest __PARAMS((gdImagePtr im, int r, int g, int b));
00135 int gdImageColorExact __PARAMS((gdImagePtr im, int r, int g, int b));
00136 void gdImageColorDeallocate __PARAMS((gdImagePtr im, int color));
00137 void gdImageColorTransparent __PARAMS((gdImagePtr im, int color));
00138 void gdImageGif __PARAMS((gdImagePtr im, FILE *out));
00139 void gdImagePPM __PARAMS((gdImagePtr im, FILE *out));
00140 void gdImageGd __PARAMS((gdImagePtr im, FILE *out));
00141 void gdImageArc __PARAMS((gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color));
00142 void gdImageFillToBorder __PARAMS((gdImagePtr im, int x, int y, int border, int color));
00143 void gdImageFill __PARAMS((gdImagePtr im, int x, int y, int color));
00144 void gdImageCopy __PARAMS((gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h));
00145
00146 void gdImageCopyResized __PARAMS((gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH));
00147 void gdImageSetBrush __PARAMS((gdImagePtr im, gdImagePtr brush));
00148 void gdImageSetTile __PARAMS((gdImagePtr im, gdImagePtr tile));
00149 void gdImageSetStyle __PARAMS((gdImagePtr im, int *style, int noOfPixels));
00150
00151 void gdImageInterlace __PARAMS((gdImagePtr im, int interlaceArg));
00152 void gdImageChangeColor __PARAMS((gdImagePtr im, int old, int new));
00153 void gdSetBackground __PARAMS((gdImagePtr im, int background));
00154 int gdCharWidth __PARAMS((gdFontPtr f, int c));
00155 void gdImageThickLine __PARAMS((gdImagePtr im, int x1, int y1, int x2, int y2, int color, int thick));
00156 void gdImagePolyLine __PARAMS((gdImagePtr im, int *X, int *Y, int n, int color, int thick, int close));
00157
00158
00159
00160 #define gdImageSX(im) ((im)->sx)
00161 #define gdImageSY(im) ((im)->sy)
00162 #define gdImageColorsTotal(im) ((im)->colorsTotal)
00163 #define gdImageRed(im, c) ((im)->red[(c)])
00164 #define gdImageGreen(im, c) ((im)->green[(c)])
00165 #define gdImageBlue(im, c) ((im)->blue[(c)])
00166 #define gdImageGetTransparent(im) ((im)->transparent)
00167 #define gdImageGetInterlaced(im) ((im)->interlace)
00168 #endif