|
|
|
@ -147,6 +147,31 @@ typedef struct gdImageStruct { |
|
|
|
PNG at the moment; other future formats may also |
|
|
|
have that capability. JPEG doesn't. */ |
|
|
|
int saveAlphaFlag; |
|
|
|
|
|
|
|
|
|
|
|
/* 2.0.12: anti-aliased globals */ |
|
|
|
int AA; |
|
|
|
int AA_color; |
|
|
|
int AA_dont_blend; |
|
|
|
unsigned char **AA_opacity; |
|
|
|
int AA_polygon; |
|
|
|
/* Stored and pre-computed variables for determining the perpendicular |
|
|
|
* distance from a point to the anti-aliased line being drawn: |
|
|
|
*/ |
|
|
|
int AAL_x1; |
|
|
|
int AAL_y1; |
|
|
|
int AAL_x2; |
|
|
|
int AAL_y2; |
|
|
|
int AAL_Bx_Ax; |
|
|
|
int AAL_By_Ay; |
|
|
|
int AAL_LAB_2; |
|
|
|
float AAL_LAB; |
|
|
|
|
|
|
|
/* 2.0.12: simple clipping rectangle. These values must be checked for safety when set; please use gdImageSetClip */ |
|
|
|
int cx1; |
|
|
|
int cy1; |
|
|
|
int cx2; |
|
|
|
int cy2; |
|
|
|
} gdImage; |
|
|
|
|
|
|
|
typedef gdImage * gdImagePtr; |
|
|
|
@ -184,6 +209,8 @@ typedef gdFont *gdFontPtr; |
|
|
|
This is used in line styles only. */ |
|
|
|
#define gdTransparent (-6) |
|
|
|
|
|
|
|
#define gdAntiAliased (-7) |
|
|
|
|
|
|
|
/* Functions to manipulate images. */ |
|
|
|
|
|
|
|
/* Creates a palette-based image (up to 256 colors). */ |
|
|
|
@ -245,6 +272,8 @@ void gdImageSetPixel(gdImagePtr im, int x, int y, int color); |
|
|
|
|
|
|
|
int gdImageGetPixel(gdImagePtr im, int x, int y); |
|
|
|
|
|
|
|
void gdImageAABlend(gdImagePtr im); |
|
|
|
|
|
|
|
void gdImageLine(gdImagePtr im, int x1, int y1, int x2, int y2, int color); |
|
|
|
void gdImageAALine(gdImagePtr im, int x1, int y1, int x2, int y2, int color); |
|
|
|
|
|
|
|
@ -256,6 +285,8 @@ void gdImageDashedLine(gdImagePtr im, int x1, int y1, int x2, int y2, int color) |
|
|
|
void gdImageRectangle(gdImagePtr im, int x1, int y1, int x2, int y2, int color); |
|
|
|
/* Solid bar. Upper left corner first, lower right corner second. */ |
|
|
|
void gdImageFilledRectangle(gdImagePtr im, int x1, int y1, int x2, int y2, int color); |
|
|
|
void gdImageSetClip(gdImagePtr im, int x1, int y1, int x2, int y2); |
|
|
|
void gdImageGetClip(gdImagePtr im, int *x1P, int *y1P, int *x2P, int *y2P); |
|
|
|
void gdImageChar(gdImagePtr im, gdFontPtr f, int x, int y, int c, int color); |
|
|
|
void gdImageCharUp(gdImagePtr im, gdFontPtr f, int x, int y, int c, int color); |
|
|
|
void gdImageString(gdImagePtr im, gdFontPtr f, int x, int y, unsigned char *s, int color); |
|
|
|
@ -275,10 +306,22 @@ char *gdImageStringFT(gdImage *im, int *brect, int fg, char *fontlist, |
|
|
|
double ptsize, double angle, int x, int y, char *string); |
|
|
|
|
|
|
|
typedef struct { |
|
|
|
int flags; /* for future expansion logical OR of gdFTEX_ values */ |
|
|
|
double linespacing; /* fine tune line spacing for '\n' */ |
|
|
|
} gdFTStringExtra, *gdFTStringExtraPtr; |
|
|
|
double linespacing; /* fine tune line spacing for '\n' */ |
|
|
|
int flags; /* Logical OR of gdFTEX_ values */ |
|
|
|
int charmap; /* TBB: 2.0.12: may be gdFTEX_Unicode, |
|
|
|
gdFTEX_Shift_JIS, or gdFTEX_Big5; |
|
|
|
when not specified, maps are searched |
|
|
|
for in the above order. */ |
|
|
|
} |
|
|
|
gdFTStringExtra, *gdFTStringExtraPtr; |
|
|
|
|
|
|
|
#define gdFTEX_LINESPACE 1 |
|
|
|
#define gdFTEX_CHARMAP 2 |
|
|
|
|
|
|
|
/* These are NOT flags; set one in 'charmap' if you set the gdFTEX_CHARMAP bit in 'flags'. */ |
|
|
|
#define gdFTEX_Unicode 0 |
|
|
|
#define gdFTEX_Shift_JIS 1 |
|
|
|
#define gdFTEX_Big5 2 |
|
|
|
|
|
|
|
/* FreeType 2 text output with fine tuning */ |
|
|
|
char * |
|
|
|
@ -373,6 +416,13 @@ void gdImageColorTransparent(gdImagePtr im, int color); |
|
|
|
void gdImagePaletteCopy(gdImagePtr dst, gdImagePtr src); |
|
|
|
void gdImagePng(gdImagePtr im, FILE *out); |
|
|
|
void gdImagePngCtx(gdImagePtr im, gdIOCtx *out); |
|
|
|
/* 2.0.12: Compression level: 0-9 or -1, where 0 is NO COMPRESSION at all, |
|
|
|
* 1 is FASTEST but produces larger files, 9 provides the best |
|
|
|
* compression (smallest files) but takes a long time to compress, and |
|
|
|
* -1 selects the default compiled into the zlib library. |
|
|
|
*/ |
|
|
|
void gdImagePngEx(gdImagePtr im, FILE * out, int level); |
|
|
|
void gdImagePngCtxEx(gdImagePtr im, gdIOCtx * out, int level); |
|
|
|
|
|
|
|
void gdImageWBMP(gdImagePtr image, int fg, FILE *out); |
|
|
|
void gdImageWBMPCtx(gdImagePtr image, int fg, gdIOCtx *out); |
|
|
|
@ -416,6 +466,7 @@ void* gdImagePngPtr(gdImagePtr im, int *size); |
|
|
|
|
|
|
|
/* Best to free this memory with gdFree(), not free() */ |
|
|
|
void* gdImageGdPtr(gdImagePtr im, int *size); |
|
|
|
void *gdImagePngPtrEx(gdImagePtr im, int *size, int level); |
|
|
|
|
|
|
|
/* Best to free this memory with gdFree(), not free() */ |
|
|
|
void* gdImageGd2Ptr(gdImagePtr im, int cs, int fmt, int *size); |
|
|
|
@ -474,6 +525,8 @@ gdImagePtr gdImageRotate (gdImagePtr src, double dAngle, int clrBack); |
|
|
|
|
|
|
|
void gdImageSetBrush(gdImagePtr im, gdImagePtr brush); |
|
|
|
void gdImageSetTile(gdImagePtr im, gdImagePtr tile); |
|
|
|
void gdImageSetAntiAliased(gdImagePtr im, int c); |
|
|
|
void gdImageSetAntiAliasedDontBlend(gdImagePtr im, int c, int dont_blend); |
|
|
|
void gdImageSetStyle(gdImagePtr im, int *style, int noOfPixels); |
|
|
|
/* Line thickness (defaults to 1). Affects lines, ellipses, |
|
|
|
rectangles, polygons and so forth. */ |
|
|
|
|