⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gd.h

📁 php-4.4.7学习linux时下载的源代码
💻 H
📖 第 1 页 / 共 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 *gdImageStringFTEx(gdImage * im, int *brect, int fg, char * fontlist,		double ptsize, double angle, int x, int y, char * string,		gdFTStringExtraPtr strex);/* Point type for use in polygon drawing. */typedef struct {	int x, y;} gdPoint, *gdPointPtr;void gdImagePolygon(gdImagePtr im, gdPointPtr p, int n, int c);void gdImageFilledPolygon(gdImagePtr im, gdPointPtr p, int n, int c);/* These functions still work with truecolor images,	for which they never return error. */int gdImageColorAllocate(gdImagePtr im, int r, int g, int b);/* gd 2.0: palette entries with non-opaque transparency are permitted. */int gdImageColorAllocateAlpha(gdImagePtr im, int r, int g, int b, int a);/* Assumes opaque is the preferred alpha channel value */int gdImageColorClosest(gdImagePtr im, int r, int g, int b);/* Closest match taking all four parameters into account.	A slightly different color with the same transparency	beats the exact same color with radically different	transparency */int gdImageColorClosestAlpha(gdImagePtr im, int r, int g, int b, int a);/* An alternate method */int gdImageColorClosestHWB(gdImagePtr im, int r, int g, int b);/* Returns exact, 100% opaque matches only */int gdImageColorExact(gdImagePtr im, int r, int g, int b);/* Returns an exact match only, including alpha */int gdImageColorExactAlpha(gdImagePtr im, int r, int g, int b, int a);/* Opaque only */int gdImageColorResolve(gdImagePtr im, int r, int g, int b);/* Based on gdImageColorExactAlpha and gdImageColorClosestAlpha */int gdImageColorResolveAlpha(gdImagePtr im, int r, int g, int b, int a);/* A simpler way to obtain an opaque truecolor value for drawing on a	truecolor image. Not for use with palette images! */#define gdTrueColor(r, g, b) (((r) << 16) + \	((g) << 8) + \	(b))/* Returns a truecolor value with an alpha channel component.	gdAlphaMax (127, **NOT 255**) is transparent, 0 is completely	opaque. */#define gdTrueColorAlpha(r, g, b, a) (((a) << 24) + \	((r) << 16) + \	((g) << 8) + \	(b))void gdImageColorDeallocate(gdImagePtr im, int color);/* Converts a truecolor image to a palette-based image,	using a high-quality two-pass quantization routine	which attempts to preserve alpha channel information	as well as R/G/B color information when creating	a palette. If ditherFlag is set, the image will be	dithered to approximate colors better, at the expense	of some obvious "speckling." colorsWanted can be	anything up to 256. If the original source image	includes photographic information or anything that	came out of a JPEG, 256 is strongly recommended.	Better yet, don't use this function -- write real	truecolor PNGs and JPEGs. The disk space gain of        conversion to palette is not great (for small images        it can be negative) and the quality loss is ugly. */gdImagePtr gdImageCreatePaletteFromTrueColor (gdImagePtr im, int ditherFlag, int colorsWanted);void gdImageTrueColorToPalette(gdImagePtr im, int ditherFlag, int colorsWanted);/* An attempt at getting the results of gdImageTrueColorToPalette	to look a bit more like the original (im1 is the original	and im2 is the palette version */int gdImageColorMatch(gdImagePtr im1, gdImagePtr im2);/* Specifies a color index (if a palette image) or an	RGB color (if a truecolor image) which should be	considered 100% transparent. FOR TRUECOLOR IMAGES,	THIS IS IGNORED IF AN ALPHA CHANNEL IS BEING	SAVED. Use gdImageSaveAlpha(im, 0); to	turn off the saving of a full alpha channel in	a truecolor image. Note that gdImageColorTransparent	is usually compatible with older browsers that	do not understand full alpha channels well. TBB */void gdImageColorTransparent(gdImagePtr im, int color);void gdImagePaletteCopy(gdImagePtr dst, gdImagePtr src);void gdImagePng(gdImagePtr im, FILE *out);void gdImagePngCtx(gdImagePtr im, gdIOCtx *out);void gdImageGif(gdImagePtr im, FILE *out);void gdImageGifCtx(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);/* Guaranteed to correctly free memory returned	by the gdImage*Ptr functions */void gdFree(void *m);/* Best to free this memory with gdFree(), not free() */void *gdImageWBMPPtr(gdImagePtr im, int *size, int fg);/* 100 is highest quality (there is always a little loss with JPEG).       0 is lowest. 10 is about the lowest useful setting. */void gdImageJpeg(gdImagePtr im, FILE *out, int quality);void gdImageJpegCtx(gdImagePtr im, gdIOCtx *out, int quality);/* Best to free this memory with gdFree(), not free() */void *gdImageJpegPtr(gdImagePtr im, int *size, int quality);gdImagePtr gdImageCreateFromGif(FILE *fd);gdImagePtr gdImageCreateFromGifCtx(gdIOCtxPtr in);gdImagePtr gdImageCreateFromGifSource(gdSourcePtr in);/* A custom data sink. For backwards compatibility. Use	gdIOCtx instead. *//* The sink function must return -1 on error, otherwise the number        of bytes written, which must be equal to len. *//* context will be passed to your sink function. */typedef struct {        int (*sink) (void *context, const char *buffer, int len);        void *context;} gdSink, *gdSinkPtr;void gdImagePngToSink(gdImagePtr im, gdSinkPtr out);void gdImageGd(gdImagePtr im, FILE *out);void gdImageGd2(gdImagePtr im, FILE *out, int cs, int fmt);/* Best to free this memory with gdFree(), not free() */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);void gdImageEllipse(gdImagePtr im, int cx, int cy, int w, int h, int c);/* Style is a bitwise OR ( | operator ) of these.	gdArc and gdChord are mutually exclusive;	gdChord just connects the starting and ending	angles with a straight line, while gdArc produces	a rounded edge. gdPie is a synonym for gdArc.	gdNoFill indicates that the arc or chord should be	outlined, not filled. gdEdged, used together with	gdNoFill, indicates that the beginning and ending	angles should be connected to the center; this is	a good way to outline (rather than fill) a	'pie slice'. */#define gdArc   0#define gdPie   gdArc#define gdChord 1#define gdNoFill 2#define gdEdged 4void gdImageFilledArc(gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color, int style);void gdImageArc(gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color);void gdImageFilledEllipse(gdImagePtr im, int cx, int cy, int w, int h, int color);void gdImageFillToBorder(gdImagePtr im, int x, int y, int border, int color);void gdImageFill(gdImagePtr im, int x, int y, int color);void gdImageCopy(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h);void gdImageCopyMerge(gdImagePtr dst, gdImagePtr src, int dstX, int dstY,			int srcX, int srcY, int w, int h, int pct);void gdImageCopyMergeGray(gdImagePtr dst, gdImagePtr src, int dstX, int dstY,                        int srcX, int srcY, int w, int h, int pct);/* Stretches or shrinks to fit, as needed. Does NOT attempt	to average the entire set of source pixels that scale down onto the	destination pixel. */void gdImageCopyResized(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH);/* gd 2.0: stretches or shrinks to fit, as needed. When called with a	truecolor destination image, this function averages the	entire set of source pixels that scale down onto the	destination pixel, taking into account what portion of the	destination pixel each source pixel represents. This is a	floating point operation, but this is not a performance issue	on modern hardware, except for some embedded devices. If the	destination is a palette image, gdImageCopyResized is	substituted automatically. */void gdImageCopyResampled(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH);gdImagePtr gdImageRotate90(gdImagePtr src);gdImagePtr gdImageRotate180(gdImagePtr src);gdImagePtr gdImageRotate270(gdImagePtr src);gdImagePtr gdImageRotate45(gdImagePtr src, double dAngle, int clrBack);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. */void gdImageSetThickness(gdImagePtr im, int thickness);/* On or off (1 or 0) for all three of these. */void gdImageInterlace(gdImagePtr im, int interlaceArg);void gdImageAlphaBlending(gdImagePtr im, int alphaBlendingArg);void gdImageAntialias(gdImagePtr im, int antialias);void gdImageSaveAlpha(gdImagePtr im, int saveAlphaArg);/* Macros to access information about images. *//* Returns nonzero if the image is a truecolor image,	zero for a palette image. */#define gdImageTrueColor(im) ((im)->trueColor)#define gdImageSX(im) ((im)->sx)#define gdImageSY(im) ((im)->sy)#define gdImageColorsTotal(im) ((im)->colorsTotal)#define gdImageRed(im, c) ((im)->trueColor ? gdTrueColorGetRed(c) : \	(im)->red[(c)])#define gdImageGreen(im, c) ((im)->trueColor ? gdTrueColorGetGreen(c) : \	(im)->green[(c)])#define gdImageBlue(im, c) ((im)->trueColor ? gdTrueColorGetBlue(c) : \	(im)->blue[(c)])#define gdImageAlpha(im, c) ((im)->trueColor ? gdTrueColorGetAlpha(c) : \	(im)->alpha[(c)])#define gdImageGetTransparent(im) ((im)->transparent)#define gdImageGetInterlaced(im) ((im)->interlace)/* These macros provide direct access to pixels in	palette-based and truecolor images, respectively.	If you use these macros, you must perform your own	bounds checking. Use of the macro for the correct type	of image is also your responsibility. */#define gdImagePalettePixel(im, x, y) (im)->pixels[(y)][(x)]#define gdImageTrueColorPixel(im, x, y) (im)->tpixels[(y)][(x)]/* I/O Support routines. */gdIOCtx* gdNewFileCtx(FILE*);gdIOCtx* gdNewDynamicCtx(int, void*);gdIOCtx *gdNewDynamicCtxEx(int size, void *data, int freeFlag);gdIOCtx* gdNewSSCtx(gdSourcePtr in, gdSinkPtr out);void* gdDPExtractData(struct gdIOCtx* ctx, int *size);#define GD2_CHUNKSIZE           128#define GD2_CHUNKSIZE_MIN	64#define GD2_CHUNKSIZE_MAX       4096#define GD2_VERS                2#define GD2_ID                  "gd2"#define GD2_FMT_RAW             1#define GD2_FMT_COMPRESSED      2/* filters section * * Negate the imag src, white becomes black, * The red, green, and blue intensities of an image are negated. * White becomes black, yellow becomes blue, etc. */int gdImageNegate(gdImagePtr src);/* Convert the image src to a grayscale image */int gdImageGrayScale(gdImagePtr src);/* Set the brightness level <brightness> for the image src */int gdImageBrightness(gdImagePtr src, int brightness);/* Set the contrast level <contrast> for the image <src> */int gdImageContrast(gdImagePtr src, double contrast);/* Simply adds or substracts respectively red, green or blue to a pixel */int gdImageColor(gdImagePtr src, int red, int green, int blue);/* Image convolution by a 3x3 custom matrix */int gdImageConvolution(gdImagePtr src, float ft[3][3], float filter_div, float offset);int gdImageEdgeDetectQuick(gdImagePtr src);int gdImageGaussianBlur(gdImagePtr im);int gdImageSelectiveBlur( gdImagePtr src);int gdImageEmboss(gdImagePtr im);int gdImageMeanRemoval(gdImagePtr im);int gdImageSmooth(gdImagePtr im, float weight);/* Image comparison definitions */int gdImageCompare(gdImagePtr im1, gdImagePtr im2);#define GD_CMP_IMAGE		1	/* Actual image IS different */#define GD_CMP_NUM_COLORS	2	/* Number of Colours in pallette differ */#define GD_CMP_COLOR		4	/* Image colours differ */#define GD_CMP_SIZE_X		8	/* Image width differs */#define GD_CMP_SIZE_Y		16	/* Image heights differ */#define GD_CMP_TRANSPARENT	32	/* Transparent colour */#define GD_CMP_BACKGROUND	64	/* Background colour */#define GD_CMP_INTERLACE	128	/* Interlaced setting */#define GD_CMP_TRUECOLOR	256	/* Truecolor vs palette differs *//* resolution affects ttf font rendering, particularly hinting */#define GD_RESOLUTION           96      /* pixels per inch */#ifdef __cplusplus}#endif/* 2.0.12: this now checks the clipping rectangle */#define gdImageBoundsSafe(im, x, y) (!((((y) < (im)->cy1) || ((y) > (im)->cy2)) || (((x) < (im)->cx1) || ((x) > (im)->cx2))))#endif /* GD_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -