Document all BGD_DECLARE'd functions
We add only minimal documentation comments for now, but at least that lets Natural Docs add the function prototypes to the documentation.master
parent
5a8139faae
commit
b0333689ef
241
src/gd.c
241
src/gd.c
|
@ -120,11 +120,17 @@ void gd_error_ex(int priority, const char *format, ...)
|
|||
va_end(args);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdSetErrorMethod
|
||||
*/
|
||||
BGD_DECLARE(void) gdSetErrorMethod(gdErrorMethod error_method)
|
||||
{
|
||||
gd_error_method = error_method;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdClearErrorMethod
|
||||
*/
|
||||
BGD_DECLARE(void) gdClearErrorMethod(void)
|
||||
{
|
||||
gd_error_method = gd_stderr_error;
|
||||
|
@ -132,6 +138,10 @@ BGD_DECLARE(void) gdClearErrorMethod(void)
|
|||
|
||||
static void gdImageBrushApply (gdImagePtr im, int x, int y);
|
||||
static void gdImageTileApply (gdImagePtr im, int x, int y);
|
||||
|
||||
/*
|
||||
Function: gdImageGetTrueColorPixel
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageGetTrueColorPixel (gdImagePtr im, int x, int y);
|
||||
|
||||
|
||||
|
@ -385,11 +395,17 @@ BGD_DECLARE(void) gdImageDestroy (gdImagePtr im)
|
|||
gdFree (im);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageColorClosest
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageColorClosest (gdImagePtr im, int r, int g, int b)
|
||||
{
|
||||
return gdImageColorClosestAlpha (im, r, g, b, gdAlphaOpaque);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageColorClosestAlpha
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageColorClosestAlpha (gdImagePtr im, int r, int g, int b, int a)
|
||||
{
|
||||
int i;
|
||||
|
@ -557,6 +573,9 @@ HWB_to_RGB (HWBType HWB, RGBType * RGB)
|
|||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
Function: gdImageColorClosestHWB
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageColorClosestHWB (gdImagePtr im, int r, int g, int b)
|
||||
{
|
||||
int i;
|
||||
|
@ -582,11 +601,17 @@ BGD_DECLARE(int) gdImageColorClosestHWB (gdImagePtr im, int r, int g, int b)
|
|||
return ct;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageColorExact
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageColorExact (gdImagePtr im, int r, int g, int b)
|
||||
{
|
||||
return gdImageColorExactAlpha (im, r, g, b, gdAlphaOpaque);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageColorExactAlpha
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageColorExactAlpha (gdImagePtr im, int r, int g, int b, int a)
|
||||
{
|
||||
int i;
|
||||
|
@ -605,11 +630,17 @@ BGD_DECLARE(int) gdImageColorExactAlpha (gdImagePtr im, int r, int g, int b, int
|
|||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageColorAllocate
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageColorAllocate (gdImagePtr im, int r, int g, int b)
|
||||
{
|
||||
return gdImageColorAllocateAlpha (im, r, g, b, gdAlphaOpaque);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageColorAllocateAlpha
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageColorAllocateAlpha (gdImagePtr im, int r, int g, int b, int a)
|
||||
{
|
||||
int i;
|
||||
|
@ -639,21 +670,24 @@ BGD_DECLARE(int) gdImageColorAllocateAlpha (gdImagePtr im, int r, int g, int b,
|
|||
}
|
||||
|
||||
/*
|
||||
* gdImageColorResolve is an alternative for the code fragment:
|
||||
*
|
||||
* if ((color=gdImageColorExact(im,R,G,B)) < 0)
|
||||
* if ((color=gdImageColorAllocate(im,R,G,B)) < 0)
|
||||
* color=gdImageColorClosest(im,R,G,B);
|
||||
*
|
||||
* in a single function. Its advantage is that it is guaranteed to
|
||||
* return a color index in one search over the color table.
|
||||
*/
|
||||
Function: gdImageColorResolve
|
||||
|
||||
gdImageColorResolve is an alternative for the code fragment
|
||||
| if ((color=gdImageColorExact(im,R,G,B)) < 0)
|
||||
| if ((color=gdImageColorAllocate(im,R,G,B)) < 0)
|
||||
| color=gdImageColorClosest(im,R,G,B);
|
||||
in a single function. Its advantage is that it is guaranteed to
|
||||
return a color index in one search over the color table.
|
||||
*/
|
||||
|
||||
BGD_DECLARE(int) gdImageColorResolve (gdImagePtr im, int r, int g, int b)
|
||||
{
|
||||
return gdImageColorResolveAlpha (im, r, g, b, gdAlphaOpaque);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageColorResolveAlpha
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageColorResolveAlpha (gdImagePtr im, int r, int g, int b, int a)
|
||||
{
|
||||
int c;
|
||||
|
@ -705,6 +739,9 @@ BGD_DECLARE(int) gdImageColorResolveAlpha (gdImagePtr im, int r, int g, int b, i
|
|||
return op; /* Return newly allocated color */
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageColorDeallocate
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageColorDeallocate (gdImagePtr im, int color)
|
||||
{
|
||||
if (im->trueColor || (color >= gdMaxColors) || (color < 0)) {
|
||||
|
@ -714,6 +751,9 @@ BGD_DECLARE(void) gdImageColorDeallocate (gdImagePtr im, int color)
|
|||
im->open[color] = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageColorTransparent
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageColorTransparent (gdImagePtr im, int color)
|
||||
{
|
||||
if (color < 0) {
|
||||
|
@ -734,6 +774,9 @@ BGD_DECLARE(void) gdImageColorTransparent (gdImagePtr im, int color)
|
|||
im->transparent = color;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImagePaletteCopy
|
||||
*/
|
||||
BGD_DECLARE(void) gdImagePaletteCopy (gdImagePtr to, gdImagePtr from)
|
||||
{
|
||||
int i;
|
||||
|
@ -786,6 +829,9 @@ BGD_DECLARE(void) gdImagePaletteCopy (gdImagePtr to, gdImagePtr from)
|
|||
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageColorReplace
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageColorReplace (gdImagePtr im, int src, int dst)
|
||||
{
|
||||
register int x, y;
|
||||
|
@ -817,6 +863,9 @@ BGD_DECLARE(int) gdImageColorReplace (gdImagePtr im, int src, int dst)
|
|||
return n;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageColorReplaceThreshold
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageColorReplaceThreshold (gdImagePtr im, int src, int dst, float threshold)
|
||||
{
|
||||
register int x, y;
|
||||
|
@ -855,6 +904,9 @@ static int colorCmp (const void *x, const void *y)
|
|||
return (a > b) - (a < b);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageColorReplaceArray
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageColorReplaceArray (gdImagePtr im, int len, int *src, int *dst)
|
||||
{
|
||||
register int x, y;
|
||||
|
@ -904,6 +956,9 @@ BGD_DECLARE(int) gdImageColorReplaceArray (gdImagePtr im, int len, int *src, int
|
|||
return n;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageColorReplaceCallback
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageColorReplaceCallback (gdImagePtr im, gdCallbackImageColor callback)
|
||||
{
|
||||
int c, d, n = 0;
|
||||
|
@ -1029,6 +1084,9 @@ clip_1d (int *x0, int *y0, int *x1, int *y1, int mindim, int maxdim)
|
|||
|
||||
/* end of line clipping code */
|
||||
|
||||
/*
|
||||
Function: gdImageSetPixel
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageSetPixel (gdImagePtr im, int x, int y, int color)
|
||||
{
|
||||
int p;
|
||||
|
@ -1220,6 +1278,9 @@ gdImageTileApply (gdImagePtr im, int x, int y)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageGetPixel
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageGetPixel (gdImagePtr im, int x, int y)
|
||||
{
|
||||
if (gdImageBoundsSafeMacro (im, x, y)) {
|
||||
|
@ -1233,6 +1294,9 @@ BGD_DECLARE(int) gdImageGetPixel (gdImagePtr im, int x, int y)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageGetTrueColorPixel
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageGetTrueColorPixel (gdImagePtr im, int x, int y)
|
||||
{
|
||||
int p = gdImageGetPixel (im, x, y);
|
||||
|
@ -1245,9 +1309,13 @@ BGD_DECLARE(int) gdImageGetTrueColorPixel (gdImagePtr im, int x, int y)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageAABlend
|
||||
|
||||
NO-OP, kept for library compatibility.
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageAABlend (gdImagePtr im)
|
||||
{
|
||||
/* NO-OP, kept for library compatibility. */
|
||||
(void)im;
|
||||
}
|
||||
|
||||
|
@ -1294,7 +1362,11 @@ static void gdImageVLine(gdImagePtr im, int x, int y1, int y2, int col)
|
|||
return;
|
||||
}
|
||||
|
||||
/* Bresenham as presented in Foley & Van Dam */
|
||||
/*
|
||||
Function: gdImageLine
|
||||
|
||||
Bresenham as presented in Foley & Van Dam.
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageLine (gdImagePtr im, int x1, int y1, int x2, int y2, int color)
|
||||
{
|
||||
int dx, dy, incr1, incr2, d, x, y, xend, yend, xdirflag, ydirflag;
|
||||
|
@ -1462,6 +1534,9 @@ BGD_DECLARE(void) gdImageLine (gdImagePtr im, int x1, int y1, int x2, int y2, in
|
|||
static void dashedSet (gdImagePtr im, int x, int y, int color,
|
||||
int *onP, int *dashStepP, int wid, int vert);
|
||||
|
||||
/*
|
||||
Function: gdImageDashedLine
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageDashedLine (gdImagePtr im, int x1, int y1, int x2, int y2, int color)
|
||||
{
|
||||
int dx, dy, incr1, incr2, d, x, y, xend, yend, xdirflag, ydirflag;
|
||||
|
@ -1603,11 +1678,17 @@ dashedSet (gdImagePtr im, int x, int y, int color,
|
|||
*onP = on;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageBoundsSafe
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageBoundsSafe (gdImagePtr im, int x, int y)
|
||||
{
|
||||
return gdImageBoundsSafeMacro (im, x, y);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageChar
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageChar (gdImagePtr im, gdFontPtr f, int x, int y, int c, int color)
|
||||
{
|
||||
int cx, cy;
|
||||
|
@ -1634,6 +1715,9 @@ BGD_DECLARE(void) gdImageChar (gdImagePtr im, gdFontPtr f, int x, int y, int c,
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageCharUp
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageCharUp (gdImagePtr im, gdFontPtr f, int x, int y, int c, int color)
|
||||
{
|
||||
int cx, cy;
|
||||
|
@ -1660,6 +1744,9 @@ BGD_DECLARE(void) gdImageCharUp (gdImagePtr im, gdFontPtr f, int x, int y, int c
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageString
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageString (gdImagePtr im, gdFontPtr f,
|
||||
int x, int y, unsigned char *s, int color)
|
||||
{
|
||||
|
@ -1672,6 +1759,9 @@ BGD_DECLARE(void) gdImageString (gdImagePtr im, gdFontPtr f,
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageStringUp
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageStringUp (gdImagePtr im, gdFontPtr f,
|
||||
int x, int y, unsigned char *s, int color)
|
||||
{
|
||||
|
@ -1686,6 +1776,9 @@ BGD_DECLARE(void) gdImageStringUp (gdImagePtr im, gdFontPtr f,
|
|||
|
||||
static int strlen16 (unsigned short *s);
|
||||
|
||||
/*
|
||||
Function: gdImageString16
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageString16 (gdImagePtr im, gdFontPtr f,
|
||||
int x, int y, unsigned short *s, int color)
|
||||
{
|
||||
|
@ -1698,6 +1791,9 @@ BGD_DECLARE(void) gdImageString16 (gdImagePtr im, gdFontPtr f,
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageStringUp16
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageStringUp16 (gdImagePtr im, gdFontPtr f,
|
||||
int x, int y, unsigned short *s, int color)
|
||||
{
|
||||
|
@ -1738,12 +1834,18 @@ lsqrt (long n)
|
|||
cx and cy are the center in pixels; w and h are the horizontal
|
||||
and vertical diameter in pixels. */
|
||||
|
||||
/*
|
||||
Function: gdImageArc
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e,
|
||||
int color)
|
||||
{
|
||||
gdImageFilledArc (im, cx, cy, w, h, s, e, color, gdNoFill);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageFilledArc
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e,
|
||||
int color, int style)
|
||||
{
|
||||
|
@ -1844,6 +1946,9 @@ BGD_DECLARE(void) gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h,
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageEllipse
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageEllipse(gdImagePtr im, int mx, int my, int w, int h, int c)
|
||||
{
|
||||
int x=0,mx1=0,mx2=0,my1=0,my2=0;
|
||||
|
@ -1888,6 +1993,9 @@ BGD_DECLARE(void) gdImageEllipse(gdImagePtr im, int mx, int my, int w, int h, in
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
Function: gdImageFilledEllipse
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageFilledEllipse (gdImagePtr im, int mx, int my, int w, int h, int c)
|
||||
{
|
||||
int x=0,mx1=0,mx2=0,my1=0,my2=0;
|
||||
|
@ -1941,6 +2049,9 @@ BGD_DECLARE(void) gdImageFilledEllipse (gdImagePtr im, int mx, int my, int w, in
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageFillToBorder
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color)
|
||||
{
|
||||
int lastBorder;
|
||||
|
@ -2086,6 +2197,10 @@ struct seg {
|
|||
{sp--; Y = sp->y+(DY = sp->dy); XL = sp->xl; XR = sp->xr;}
|
||||
|
||||
static void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc);
|
||||
|
||||
/*
|
||||
Function: gdImageFill
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageFill(gdImagePtr im, int x, int y, int nc)
|
||||
{
|
||||
int l, x1, x2, dy;
|
||||
|
@ -2279,6 +2394,9 @@ skip:
|
|||
gdFree(stack);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageRectangle
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color)
|
||||
{
|
||||
int thick = im->thick;
|
||||
|
@ -2450,12 +2568,18 @@ static void _gdImageFilledVRectangle (gdImagePtr im, int x1, int y1, int x2, int
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageFilledRectangle
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageFilledRectangle (gdImagePtr im, int x1, int y1, int x2, int y2,
|
||||
int color)
|
||||
{
|
||||
_gdImageFilledVRectangle(im, x1, y1, x2, y2, color);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageClone
|
||||
*/
|
||||
BGD_DECLARE(gdImagePtr) gdImageClone (gdImagePtr src) {
|
||||
gdImagePtr dst;
|
||||
register int i, x;
|
||||
|
@ -2551,6 +2675,9 @@ BGD_DECLARE(gdImagePtr) gdImageClone (gdImagePtr src) {
|
|||
return dst;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageCopy
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageCopy (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX,
|
||||
int srcY, int w, int h)
|
||||
{
|
||||
|
@ -2638,8 +2765,12 @@ BGD_DECLARE(void) gdImageCopy (gdImagePtr dst, gdImagePtr src, int dstX, int dst
|
|||
}
|
||||
}
|
||||
|
||||
/* This function is a substitute for real alpha channel operations,
|
||||
so it doesn't pay attention to the alpha channel. */
|
||||
/*
|
||||
Function: gdImageCopyMerge
|
||||
|
||||
This function is a substitute for real alpha channel operations,
|
||||
so it doesn't pay attention to the alpha channel.
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageCopyMerge (gdImagePtr dst, gdImagePtr src, int dstX, int dstY,
|
||||
int srcX, int srcY, int w, int h, int pct)
|
||||
{
|
||||
|
@ -2682,8 +2813,12 @@ BGD_DECLARE(void) gdImageCopyMerge (gdImagePtr dst, gdImagePtr src, int dstX, in
|
|||
}
|
||||
}
|
||||
|
||||
/* This function is a substitute for real alpha channel operations,
|
||||
so it doesn't pay attention to the alpha channel. */
|
||||
/*
|
||||
Function: gdImageCopyMergeGray
|
||||
|
||||
This function is a substitute for real alpha channel operations,
|
||||
so it doesn't pay attention to the alpha channel.
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageCopyMergeGray (gdImagePtr dst, gdImagePtr src, int dstX, int dstY,
|
||||
int srcX, int srcY, int w, int h, int pct)
|
||||
{
|
||||
|
@ -2742,6 +2877,9 @@ BGD_DECLARE(void) gdImageCopyMergeGray (gdImagePtr dst, gdImagePtr src, int dstX
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageCopyResized
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageCopyResized (gdImagePtr dst, gdImagePtr src, int dstX, int dstY,
|
||||
int srcX, int srcY, int dstW, int dstH, int srcW,
|
||||
int srcH)
|
||||
|
@ -2878,6 +3016,9 @@ BGD_DECLARE(void) gdImageCopyResized (gdImagePtr dst, gdImagePtr src, int dstX,
|
|||
coordinates allow accurate rotation of
|
||||
objects of odd-numbered width or height. */
|
||||
|
||||
/*
|
||||
Function: gdImageCopyRotated
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageCopyRotated (gdImagePtr dst,
|
||||
gdImagePtr src,
|
||||
double dstX, double dstY,
|
||||
|
@ -2961,6 +3102,9 @@ BGD_DECLARE(void) gdImageCopyRotated (gdImagePtr dst,
|
|||
#define floor2(exp) ((long) exp)
|
||||
/*#define floor2(exp) floor(exp)*/
|
||||
|
||||
/*
|
||||
Function: gdImageCopyResampled
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageCopyResampled (gdImagePtr dst,
|
||||
gdImagePtr src,
|
||||
int dstX, int dstY,
|
||||
|
@ -3063,6 +3207,9 @@ BGD_DECLARE(void) gdImageCopyResampled (gdImagePtr dst,
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImagePolygon
|
||||
*/
|
||||
BGD_DECLARE(void) gdImagePolygon (gdImagePtr im, gdPointPtr p, int n, int c)
|
||||
{
|
||||
if (n <= 0) {
|
||||
|
@ -3074,6 +3221,9 @@ BGD_DECLARE(void) gdImagePolygon (gdImagePtr im, gdPointPtr p, int n, int c)
|
|||
gdImageOpenPolygon (im, p, n, c);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageOpenPolygon
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageOpenPolygon (gdImagePtr im, gdPointPtr p, int n, int c)
|
||||
{
|
||||
int i;
|
||||
|
@ -3101,6 +3251,9 @@ BGD_DECLARE(void) gdImageOpenPolygon (gdImagePtr im, gdPointPtr p, int n, int c)
|
|||
/* That could help to adjust intersections to produce a nice */
|
||||
/* interior_extrema. */
|
||||
|
||||
/*
|
||||
Function: gdImageFilledPolygon
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageFilledPolygon (gdImagePtr im, gdPointPtr p, int n, int c)
|
||||
{
|
||||
int i;
|
||||
|
@ -3244,6 +3397,9 @@ BGD_DECLARE(void) gdImageFilledPolygon (gdImagePtr im, gdPointPtr p, int n, int
|
|||
|
||||
static void gdImageSetAAPixelColor(gdImagePtr im, int x, int y, int color, int t);
|
||||
|
||||
/*
|
||||
Function: gdImageSetStyle
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageSetStyle (gdImagePtr im, int *style, int noOfPixels)
|
||||
{
|
||||
if (im->style) {
|
||||
|
@ -3261,11 +3417,17 @@ BGD_DECLARE(void) gdImageSetStyle (gdImagePtr im, int *style, int noOfPixels)
|
|||
im->stylePos = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageSetThickness
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageSetThickness (gdImagePtr im, int thickness)
|
||||
{
|
||||
im->thick = thickness;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageSetBrush
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageSetBrush (gdImagePtr im, gdImagePtr brush)
|
||||
{
|
||||
int i;
|
||||
|
@ -3283,6 +3445,9 @@ BGD_DECLARE(void) gdImageSetBrush (gdImagePtr im, gdImagePtr brush)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageSetTile
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageSetTile (gdImagePtr im, gdImagePtr tile)
|
||||
{
|
||||
int i;
|
||||
|
@ -3300,6 +3465,9 @@ BGD_DECLARE(void) gdImageSetTile (gdImagePtr im, gdImagePtr tile)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageSetAntiAliased
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageSetAntiAliased (gdImagePtr im, int c)
|
||||
{
|
||||
im->AA = 1;
|
||||
|
@ -3307,6 +3475,9 @@ BGD_DECLARE(void) gdImageSetAntiAliased (gdImagePtr im, int c)
|
|||
im->AA_dont_blend = -1;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageSetAntiAliasedDontBlend
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageSetAntiAliasedDontBlend (gdImagePtr im, int c, int dont_blend)
|
||||
{
|
||||
im->AA = 1;
|
||||
|
@ -3314,11 +3485,17 @@ BGD_DECLARE(void) gdImageSetAntiAliasedDontBlend (gdImagePtr im, int c, int dont
|
|||
im->AA_dont_blend = dont_blend;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageInterlace
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageInterlace (gdImagePtr im, int interlaceArg)
|
||||
{
|
||||
im->interlace = interlaceArg;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageCompare
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageCompare (gdImagePtr im1, gdImagePtr im2)
|
||||
{
|
||||
int x, y;
|
||||
|
@ -3401,6 +3578,9 @@ BGD_DECLARE(int) gdImageCompare (gdImagePtr im1, gdImagePtr im2)
|
|||
of gdAlphaBlend(), which merges alpha in the
|
||||
destination color much better. */
|
||||
|
||||
/*
|
||||
Function: gdAlphaBlend
|
||||
*/
|
||||
BGD_DECLARE(int) gdAlphaBlend (int dst, int src)
|
||||
{
|
||||
int src_alpha = gdTrueColorGetAlpha(src);
|
||||
|
@ -3447,6 +3627,10 @@ BGD_DECLARE(int) gdAlphaBlend (int dst, int src)
|
|||
}
|
||||
|
||||
static int gdAlphaOverlayColor (int src, int dst, int max );
|
||||
|
||||
/*
|
||||
Function: gdLayerOverlay
|
||||
*/
|
||||
BGD_DECLARE(int) gdLayerOverlay (int dst, int src)
|
||||
{
|
||||
int a1, a2;
|
||||
|
@ -3472,7 +3656,11 @@ static int gdAlphaOverlayColor (int src, int dst, int max )
|
|||
}
|
||||
}
|
||||
|
||||
/* Apply 'multiply' effect */
|
||||
/*
|
||||
Function: gdLayerMultiply
|
||||
|
||||
Apply 'multiply' effect.
|
||||
*/
|
||||
BGD_DECLARE(int) gdLayerMultiply (int dst, int src)
|
||||
{
|
||||
int a1, a2, r1, r2, g1, g2, b1, b2;
|
||||
|
@ -3495,16 +3683,25 @@ BGD_DECLARE(int) gdLayerMultiply (int dst, int src)
|
|||
);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageAlphaBlending
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageAlphaBlending (gdImagePtr im, int alphaBlendingArg)
|
||||
{
|
||||
im->alphaBlendingFlag = alphaBlendingArg;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageSaveAlpha
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageSaveAlpha (gdImagePtr im, int saveAlphaArg)
|
||||
{
|
||||
im->saveAlphaFlag = saveAlphaArg;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageSetClip
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageSetClip (gdImagePtr im, int x1, int y1, int x2, int y2)
|
||||
{
|
||||
if (x1 < 0) {
|
||||
|
@ -3537,6 +3734,9 @@ BGD_DECLARE(void) gdImageSetClip (gdImagePtr im, int x1, int y1, int x2, int y2)
|
|||
im->cy2 = y2;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageGetClip
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageGetClip (gdImagePtr im, int *x1P, int *y1P, int *x2P, int *y2P)
|
||||
{
|
||||
*x1P = im->cx1;
|
||||
|
@ -3545,6 +3745,9 @@ BGD_DECLARE(void) gdImageGetClip (gdImagePtr im, int *x1P, int *y1P, int *x2P, i
|
|||
*y2P = im->cy2;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageSetResolution
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageSetResolution(gdImagePtr im, const unsigned int res_x, const unsigned int res_y)
|
||||
{
|
||||
if (res_x > 0) im->res_x = res_x;
|
||||
|
@ -3702,7 +3905,11 @@ static void gdImageAALine (gdImagePtr im, int x1, int y1, int x2, int y2, int co
|
|||
}
|
||||
|
||||
|
||||
/* convert a palette image to true color */
|
||||
/*
|
||||
Function: gdImagePaletteToTrueColor
|
||||
|
||||
Convert a palette image to true color.
|
||||
*/
|
||||
BGD_DECLARE(int) gdImagePaletteToTrueColor(gdImagePtr src)
|
||||
{
|
||||
unsigned int y;
|
||||
|
|
18
src/gd_bmp.c
18
src/gd_bmp.c
|
@ -60,6 +60,9 @@ static int gdBMPPutInt(gdIOCtx *out, int w)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageBmpPtr
|
||||
*/
|
||||
BGD_DECLARE(void *) gdImageBmpPtr(gdImagePtr im, int *size, int compression)
|
||||
{
|
||||
void *rv;
|
||||
|
@ -71,6 +74,9 @@ BGD_DECLARE(void *) gdImageBmpPtr(gdImagePtr im, int *size, int compression)
|
|||
return rv;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageBmp
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageBmp(gdImagePtr im, FILE *outFile, int compression)
|
||||
{
|
||||
gdIOCtx *out = gdNewFileCtx(outFile);
|
||||
|
@ -79,6 +85,9 @@ BGD_DECLARE(void) gdImageBmp(gdImagePtr im, FILE *outFile, int compression)
|
|||
out->gd_free(out);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageBmpCtx
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageBmpCtx(gdImagePtr im, gdIOCtxPtr out, int compression)
|
||||
{
|
||||
int bitmap_size = 0, info_size, total_size, padding;
|
||||
|
@ -397,6 +406,9 @@ static int build_rle_packet(unsigned char *row, int packet_type, int length, uns
|
|||
return compressed_size;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageCreateFromBmp
|
||||
*/
|
||||
BGD_DECLARE(gdImagePtr) gdImageCreateFromBmp(FILE * inFile)
|
||||
{
|
||||
gdImagePtr im = 0;
|
||||
|
@ -407,6 +419,9 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFromBmp(FILE * inFile)
|
|||
return im;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageCreateFromBmpPtr
|
||||
*/
|
||||
BGD_DECLARE(gdImagePtr) gdImageCreateFromBmpPtr(int size, void *data)
|
||||
{
|
||||
gdImagePtr im;
|
||||
|
@ -417,6 +432,9 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFromBmpPtr(int size, void *data)
|
|||
return im;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageCreateFromBmpCtx
|
||||
*/
|
||||
BGD_DECLARE(gdImagePtr) gdImageCreateFromBmpCtx(gdIOCtxPtr infile)
|
||||
{
|
||||
bmp_hdr_t *hdr;
|
||||
|
|
|
@ -767,6 +767,9 @@ BGD_EXPORT_DATA_PROT gdColorMap GD_COLOR_MAP_X11 = {
|
|||
(gdColorMapEntry *)GD_COLOR_MAP_X11_ENTRIES
|
||||
};
|
||||
|
||||
/*
|
||||
Function: gdColorMapLookup
|
||||
*/
|
||||
BGD_DECLARE(int)
|
||||
gdColorMapLookup(const gdColorMap color_map, const char *color_name, int *r, int *g, int *b)
|
||||
{
|
||||
|
|
|
@ -5,8 +5,10 @@
|
|||
#include "gd.h"
|
||||
#include "gdhelpers.h"
|
||||
|
||||
/* bring the palette colors in im2 to be closer to im1
|
||||
*
|
||||
/*
|
||||
Function: gdImageColorMatch
|
||||
|
||||
Bring the palette colors in im2 to be closer to im1.
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageColorMatch (gdImagePtr im1, gdImagePtr im2)
|
||||
{
|
||||
|
|
|
@ -18,6 +18,9 @@
|
|||
|
||||
static int gdGuessBackgroundColorFromCorners(gdImagePtr im, int *color);
|
||||
|
||||
/*
|
||||
Function: gdImageCrop
|
||||
*/
|
||||
BGD_DECLARE(gdImagePtr) gdImageCrop(gdImagePtr src, const gdRect *crop)
|
||||
{
|
||||
gdImagePtr dst;
|
||||
|
@ -29,6 +32,9 @@ BGD_DECLARE(gdImagePtr) gdImageCrop(gdImagePtr src, const gdRect *crop)
|
|||
return dst;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageCropAuto
|
||||
*/
|
||||
BGD_DECLARE(gdImagePtr) gdImageCropAuto(gdImagePtr im, const unsigned int mode)
|
||||
{
|
||||
const int width = gdImageSX(im);
|
||||
|
@ -117,6 +123,9 @@ BGD_DECLARE(gdImagePtr) gdImageCropAuto(gdImagePtr im, const unsigned int mode)
|
|||
return gdImageCrop(im, &crop);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageCropThreshold
|
||||
*/
|
||||
BGD_DECLARE(gdImagePtr) gdImageCropThreshold(gdImagePtr im, const unsigned int color, const float threshold)
|
||||
{
|
||||
const int width = gdImageSX(im);
|
||||
|
|
|
@ -34,6 +34,9 @@ typedef int (BGD_STDCALL *FuncPtr)(gdImagePtr, int, int);
|
|||
# define GD_SCATTER_SEED() (unsigned int)(time(0) * getpid())
|
||||
#endif
|
||||
|
||||
/*
|
||||
Function: gdImageScatter
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageScatter(gdImagePtr im, int sub, int plus)
|
||||
{
|
||||
gdScatter s;
|
||||
|
@ -45,6 +48,9 @@ BGD_DECLARE(int) gdImageScatter(gdImagePtr im, int sub, int plus)
|
|||
return gdImageScatterEx(im, &s);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageScatterColor
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageScatterColor(gdImagePtr im, int sub, int plus, int colors[], unsigned int num_colors)
|
||||
{
|
||||
gdScatter s;
|
||||
|
@ -57,6 +63,9 @@ BGD_DECLARE(int) gdImageScatterColor(gdImagePtr im, int sub, int plus, int color
|
|||
return gdImageScatterEx(im, &s);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageScatterEx
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageScatterEx(gdImagePtr im, gdScatterPtr scatter)
|
||||
{
|
||||
register int x, y;
|
||||
|
@ -116,6 +125,9 @@ BGD_DECLARE(int) gdImageScatterEx(gdImagePtr im, gdScatterPtr scatter)
|
|||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImagePixelate
|
||||
*/
|
||||
BGD_DECLARE(int) gdImagePixelate(gdImagePtr im, int block_size, const unsigned int mode)
|
||||
{
|
||||
int x, y;
|
||||
|
@ -172,7 +184,11 @@ BGD_DECLARE(int) gdImagePixelate(gdImagePtr im, int block_size, const unsigned i
|
|||
return 1;
|
||||
}
|
||||
|
||||
/* invert src image */
|
||||
/*
|
||||
Function: gdImageNegate
|
||||
|
||||
Invert src image.
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageNegate(gdImagePtr src)
|
||||
{
|
||||
int x, y;
|
||||
|
@ -204,7 +220,11 @@ BGD_DECLARE(int) gdImageNegate(gdImagePtr src)
|
|||
return 1;
|
||||
}
|
||||
|
||||
/* Convert the image src to a grayscale image */
|
||||
/*
|
||||
Function: gdImageGrayScale
|
||||
|
||||
Convert the image src to a grayscale image.
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageGrayScale(gdImagePtr src)
|
||||
{
|
||||
int x, y;
|
||||
|
@ -237,7 +257,11 @@ BGD_DECLARE(int) gdImageGrayScale(gdImagePtr src)
|
|||
return 1;
|
||||
}
|
||||
|
||||
/* Set the brightness level <level> for the image src */
|
||||
/*
|
||||
Function: gdImageBrightness
|
||||
|
||||
Set the brightness level <level> for the image src.
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageBrightness(gdImagePtr src, int brightness)
|
||||
{
|
||||
int x, y;
|
||||
|
@ -283,6 +307,9 @@ BGD_DECLARE(int) gdImageBrightness(gdImagePtr src, int brightness)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
Function: gdImageContrast
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageContrast(gdImagePtr src, double contrast)
|
||||
{
|
||||
int x, y;
|
||||
|
@ -343,6 +370,9 @@ BGD_DECLARE(int) gdImageContrast(gdImagePtr src, double contrast)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
Function: gdImageColor
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageColor(gdImagePtr src, const int red, const int green, const int blue, const int alpha)
|
||||
{
|
||||
int x, y;
|
||||
|
@ -385,6 +415,9 @@ BGD_DECLARE(int) gdImageColor(gdImagePtr src, const int red, const int green, co
|
|||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageConvolution
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageConvolution(gdImagePtr src, float filter[3][3], float filter_div, float offset)
|
||||
{
|
||||
int x, y, i, j, new_a;
|
||||
|
@ -445,6 +478,9 @@ BGD_DECLARE(int) gdImageConvolution(gdImagePtr src, float filter[3][3], float fi
|
|||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageSelectiveBlur
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageSelectiveBlur( gdImagePtr src)
|
||||
{
|
||||
int x, y, i, j;
|
||||
|
@ -563,6 +599,9 @@ BGD_DECLARE(int) gdImageSelectiveBlur( gdImagePtr src)
|
|||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageEdgeDetectQuick
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageEdgeDetectQuick(gdImagePtr src)
|
||||
{
|
||||
float filter[3][3] = {{-1.0,0.0,-1.0},
|
||||
|
@ -603,6 +642,9 @@ BGD_DECLARE(int) gdImageGaussianBlur(gdImagePtr im)
|
|||
return gdImageConvolution(im, filter, 16, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageEmboss
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageEmboss(gdImagePtr im)
|
||||
{
|
||||
/*
|
||||
|
@ -617,6 +659,9 @@ BGD_DECLARE(int) gdImageEmboss(gdImagePtr im)
|
|||
return gdImageConvolution(im, filter, 1, 127);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageMeanRemoval
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageMeanRemoval(gdImagePtr im)
|
||||
{
|
||||
float filter[3][3] = {{-1.0,-1.0,-1.0},
|
||||
|
@ -626,6 +671,9 @@ BGD_DECLARE(int) gdImageMeanRemoval(gdImagePtr im)
|
|||
return gdImageConvolution(im, filter, 1, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageSmooth
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageSmooth(gdImagePtr im, float weight)
|
||||
{
|
||||
float filter[3][3] = {{1.0,1.0,1.0},
|
||||
|
|
|
@ -326,6 +326,9 @@ _gdImageGd (gdImagePtr im, gdIOCtx * out)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageGd
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageGd (gdImagePtr im, FILE * outFile)
|
||||
{
|
||||
gdIOCtx *out = gdNewFileCtx (outFile);
|
||||
|
@ -334,6 +337,9 @@ BGD_DECLARE(void) gdImageGd (gdImagePtr im, FILE * outFile)
|
|||
out->gd_free (out);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageGdPtr
|
||||
*/
|
||||
BGD_DECLARE(void *) gdImageGdPtr (gdImagePtr im, int *size)
|
||||
{
|
||||
void *rv;
|
||||
|
|
|
@ -1043,6 +1043,9 @@ fail:
|
|||
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageGd2
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageGd2 (gdImagePtr im, FILE * outFile, int cs, int fmt)
|
||||
{
|
||||
gdIOCtx *out = gdNewFileCtx (outFile);
|
||||
|
@ -1051,6 +1054,9 @@ BGD_DECLARE(void) gdImageGd2 (gdImagePtr im, FILE * outFile, int cs, int fmt)
|
|||
out->gd_free (out);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageGd2Ptr
|
||||
*/
|
||||
BGD_DECLARE(void *) gdImageGd2Ptr (gdImagePtr im, int cs, int fmt, int *size)
|
||||
{
|
||||
void *rv;
|
||||
|
|
|
@ -1607,6 +1607,9 @@ gdImageScaleBicubicFixed(gdImagePtr src, const unsigned int width,
|
|||
return dst;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageScale
|
||||
*/
|
||||
BGD_DECLARE(gdImagePtr) gdImageScale(const gdImagePtr src, const unsigned int new_width, const unsigned int new_height)
|
||||
{
|
||||
gdImagePtr im_scaled = NULL;
|
||||
|
@ -1793,6 +1796,9 @@ gdImageRotateGeneric(gdImagePtr src, const float degrees, const int bgColor)
|
|||
return dst;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageRotateInterpolated
|
||||
*/
|
||||
BGD_DECLARE(gdImagePtr) gdImageRotateInterpolated(const gdImagePtr src, const float angle, int bgcolor)
|
||||
{
|
||||
/* round to two decimals and keep the 100x multiplication to use it in the common square angles
|
||||
|
@ -2111,6 +2117,9 @@ BGD_DECLARE(int) gdTransformAffineBoundingBox(gdRectPtr src, const double affine
|
|||
return GD_TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageSetInterpolationMethod
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageSetInterpolationMethod(gdImagePtr im, gdInterpolationMethod id)
|
||||
{
|
||||
if (im == NULL || (uintmax_t)id > GD_METHOD_COUNT) {
|
||||
|
@ -2193,9 +2202,13 @@ BGD_DECLARE(int) gdImageSetInterpolationMethod(gdImagePtr im, gdInterpolationMet
|
|||
}
|
||||
|
||||
|
||||
/* Return the interpolation mode set in 'im'. This is here so that
|
||||
* the value can be read via a language or VM with an FFI but no
|
||||
* (portable) way to extract the value from the struct. */
|
||||
/*
|
||||
Function: gdImageGetInterpolationMethod
|
||||
|
||||
Return the interpolation mode set in 'im'. This is here so that
|
||||
the value can be read via a language or VM with an FFI but no
|
||||
(portable) way to extract the value from the struct.
|
||||
*/
|
||||
BGD_DECLARE(gdInterpolationMethod) gdImageGetInterpolationMethod(gdImagePtr im)
|
||||
{
|
||||
return im->interpolation_id;
|
||||
|
|
|
@ -64,13 +64,20 @@ static int dynamicGetchar(gdIOCtxPtr ctx);
|
|||
static int dynamicSeek(struct gdIOCtx *, const int);
|
||||
static long dynamicTell(struct gdIOCtx *);
|
||||
|
||||
/* return data as a dynamic pointer */
|
||||
/*
|
||||
Function: gdNewDynamicCtx
|
||||
|
||||
Return data as a dynamic pointer.
|
||||
*/
|
||||
BGD_DECLARE(gdIOCtx *) gdNewDynamicCtx(int initialSize, void *data)
|
||||
{
|
||||
/* 2.0.23: Phil Moore: 'return' keyword was missing! */
|
||||
return gdNewDynamicCtxEx(initialSize, data, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdNewDynamicCtxEx
|
||||
*/
|
||||
BGD_DECLARE(gdIOCtx *) gdNewDynamicCtxEx(int initialSize, void *data, int freeOKFlag)
|
||||
{
|
||||
dpIOCtx *ctx;
|
||||
|
@ -103,6 +110,9 @@ BGD_DECLARE(gdIOCtx *) gdNewDynamicCtxEx(int initialSize, void *data, int freeOK
|
|||
return (gdIOCtx *)ctx;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdDPExtractData
|
||||
*/
|
||||
BGD_DECLARE(void *) gdDPExtractData (struct gdIOCtx *ctx, int *size)
|
||||
{
|
||||
dynamicPtr *dp;
|
||||
|
|
|
@ -48,7 +48,11 @@ static int fileSeek(struct gdIOCtx *, const int);
|
|||
static long fileTell(struct gdIOCtx *);
|
||||
static void gdFreeFileCtx(gdIOCtx *ctx);
|
||||
|
||||
/* return data as a dynamic pointer */
|
||||
/*
|
||||
Function: gdNewFileCtx
|
||||
|
||||
Return data as a dynamic pointer.
|
||||
*/
|
||||
BGD_DECLARE(gdIOCtx *) gdNewFileCtx(FILE *f)
|
||||
{
|
||||
fileIOCtx *ctx;
|
||||
|
|
|
@ -47,7 +47,11 @@ static int sinkPutbuf(gdIOCtx *ctx, const void *buf, int size);
|
|||
static void sinkPutchar(gdIOCtx *ctx, int a);
|
||||
static void gdFreeSsCtx(gdIOCtx *ctx);
|
||||
|
||||
/* return data as a dynamic pointer */
|
||||
/*
|
||||
Function: gdNewSSCtx
|
||||
|
||||
Return data as a dynamic pointer.
|
||||
*/
|
||||
BGD_DECLARE(gdIOCtx *) gdNewSSCtx(gdSourcePtr src, gdSinkPtr snk)
|
||||
{
|
||||
ssIOCtxPtr ctx;
|
||||
|
|
|
@ -506,6 +506,9 @@ int verbose;
|
|||
if (verbose) gd_error_ex(GD_NOTICE, "finished 1D learning: final alpha=%f !\n",((float)alpha)/initalpha);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageNeuQuant
|
||||
*/
|
||||
BGD_DECLARE(gdImagePtr) gdImageNeuQuant(gdImagePtr im, const int max_color, int sample_factor)
|
||||
{
|
||||
const int newcolors = max_color;
|
||||
|
|
|
@ -18,6 +18,9 @@
|
|||
#define GD_SS_DBG(s)
|
||||
|
||||
#ifdef HAVE_LIBPNG
|
||||
/*
|
||||
Function: gdImagePngToSink
|
||||
*/
|
||||
BGD_DECLARE(void) gdImagePngToSink (gdImagePtr im, gdSinkPtr outSink)
|
||||
{
|
||||
gdIOCtx *out = gdNewSSCtx (NULL, outSink);
|
||||
|
|
26
src/gd_tga.c
26
src/gd_tga.c
|
@ -12,10 +12,14 @@
|
|||
#include "gd_errors.h"
|
||||
#include "gdhelpers.h"
|
||||
|
||||
/*! \brief Creates a gdImage from a TGA file
|
||||
* Creates a gdImage from a TGA binary file via a gdIOCtx.
|
||||
* \param infile Pointer to TGA binary file
|
||||
* \return gdImagePtr
|
||||
/*
|
||||
Function: gdImageCreateFromTga
|
||||
|
||||
Creates a gdImage from a TGA file
|
||||
|
||||
Parameters:
|
||||
|
||||
infile - Pointer to TGA binary file
|
||||
*/
|
||||
BGD_DECLARE(gdImagePtr) gdImageCreateFromTga(FILE *fp)
|
||||
{
|
||||
|
@ -27,6 +31,9 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFromTga(FILE *fp)
|
|||
return image;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageCreateFromTgaPtr
|
||||
*/
|
||||
BGD_DECLARE(gdImagePtr) gdImageCreateFromTgaPtr(int size, void *data)
|
||||
{
|
||||
gdImagePtr im;
|
||||
|
@ -38,10 +45,13 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFromTgaPtr(int size, void *data)
|
|||
}
|
||||
|
||||
|
||||
/*! \brief Creates a gdImage from a gdIOCtx
|
||||
* Creates a gdImage from a gdIOCtx referencing a TGA binary file.
|
||||
* \param ctx Pointer to a gdIOCtx structure
|
||||
* \return gdImagePtr
|
||||
/*
|
||||
Function: gdImageCreateFromTgaCtx
|
||||
|
||||
Creates a gdImage from a gdIOCtx referencing a TGA binary file.
|
||||
|
||||
Parameters:
|
||||
ctx - Pointer to a gdIOCtx structure
|
||||
*/
|
||||
BGD_DECLARE(gdImagePtr) gdImageCreateFromTgaCtx(gdIOCtx* ctx)
|
||||
{
|
||||
|
|
|
@ -408,13 +408,15 @@ void tiffWriter(gdImagePtr image, gdIOCtx *out, int bitDepth)
|
|||
}
|
||||
|
||||
/*
|
||||
gdImageTiffCtx
|
||||
--------------
|
||||
Write the gd image as a tiff file
|
||||
Parameters are:
|
||||
image: gd image structure;
|
||||
out: the stream where to write
|
||||
*/
|
||||
Function: gdImageTiffCtx
|
||||
|
||||
Write the gd image as a tiff file.
|
||||
|
||||
Parameters:
|
||||
|
||||
image - gd image structure;
|
||||
out - the stream where to write
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageTiffCtx(gdImagePtr image, gdIOCtx *out)
|
||||
{
|
||||
int clipx1P, clipy1P, clipx2P, clipy2P;
|
||||
|
@ -782,10 +784,11 @@ static int createFromTiffRgba(TIFF * tif, gdImagePtr im)
|
|||
return GD_SUCCESS;
|
||||
}
|
||||
|
||||
/* gdImageCreateFromTiffCtx
|
||||
** ------------------------
|
||||
** Create a gdImage from a TIFF file input from an gdIOCtx
|
||||
*/
|
||||
/*
|
||||
Function: gdImageCreateFromTiffCtx
|
||||
|
||||
Create a gdImage from a TIFF file input from an gdIOCtx.
|
||||
*/
|
||||
BGD_DECLARE(gdImagePtr) gdImageCreateFromTiffCtx(gdIOCtx *infile)
|
||||
{
|
||||
TIFF *tif;
|
||||
|
@ -991,9 +994,9 @@ error:
|
|||
return im;
|
||||
}
|
||||
|
||||
/* gdImageCreateFromTIFF
|
||||
** ---------------------
|
||||
*/
|
||||
/*
|
||||
Function: gdImageCreateFromTIFF
|
||||
*/
|
||||
BGD_DECLARE(gdImagePtr) gdImageCreateFromTiff(FILE *inFile)
|
||||
{
|
||||
gdImagePtr im;
|
||||
|
@ -1004,6 +1007,9 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFromTiff(FILE *inFile)
|
|||
return im;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageCreateFromTiffPtr
|
||||
*/
|
||||
BGD_DECLARE(gdImagePtr) gdImageCreateFromTiffPtr(int size, void *data)
|
||||
{
|
||||
gdImagePtr im;
|
||||
|
@ -1014,9 +1020,9 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFromTiffPtr(int size, void *data)
|
|||
return im;
|
||||
}
|
||||
|
||||
/* gdImageTIFF
|
||||
** -----------
|
||||
*/
|
||||
/*
|
||||
Function: gdImageTiff
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageTiff(gdImagePtr im, FILE *outFile)
|
||||
{
|
||||
gdIOCtx *out = gdNewFileCtx(outFile);
|
||||
|
@ -1025,9 +1031,9 @@ BGD_DECLARE(void) gdImageTiff(gdImagePtr im, FILE *outFile)
|
|||
out->gd_free(out);
|
||||
}
|
||||
|
||||
/* gdImageTIFFPtr
|
||||
** --------------
|
||||
*/
|
||||
/*
|
||||
Function: gdImageTiffPtr
|
||||
*/
|
||||
BGD_DECLARE(void *) gdImageTiffPtr(gdImagePtr im, int *size)
|
||||
{
|
||||
void *rv;
|
||||
|
|
|
@ -1366,12 +1366,14 @@ zeroHistogram (hist3d histogram)
|
|||
|
||||
|
||||
/*
|
||||
Selects quantization method used for subsequent gdImageTrueColorToPalette calls.
|
||||
See gdPaletteQuantizationMethod enum (e.g. GD_QUANT_NEUQUANT, GD_QUANT_LIQ).
|
||||
Speed is from 1 (highest quality) to 10 (fastest).
|
||||
Speed 0 selects method-specific default (recommended).
|
||||
Function: gdImageTrueColorToPaletteSetMethod
|
||||
|
||||
Returns FALSE if the given method is invalid or not available.
|
||||
Selects quantization method used for subsequent gdImageTrueColorToPalette calls.
|
||||
See gdPaletteQuantizationMethod enum (e.g. GD_QUANT_NEUQUANT, GD_QUANT_LIQ).
|
||||
Speed is from 1 (highest quality) to 10 (fastest).
|
||||
Speed 0 selects method-specific default (recommended).
|
||||
|
||||
Returns FALSE if the given method is invalid or not available.
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageTrueColorToPaletteSetMethod (gdImagePtr im, int method, int speed)
|
||||
{
|
||||
|
@ -1393,11 +1395,13 @@ BGD_DECLARE(int) gdImageTrueColorToPaletteSetMethod (gdImagePtr im, int method,
|
|||
}
|
||||
|
||||
/*
|
||||
Chooses quality range that subsequent call to gdImageTrueColorToPalette will aim for.
|
||||
Min and max quality is in range 1-100 (1 = ugly, 100 = perfect). Max must be higher than min.
|
||||
If palette cannot represent image with at least min_quality, then image will remain true-color.
|
||||
If palette can represent image with quality better than max_quality, then lower number of colors will be used.
|
||||
This function has effect only when GD_QUANT_LIQ method has been selected.
|
||||
Function: gdImageTrueColorToPaletteSetQuality
|
||||
|
||||
Chooses quality range that subsequent call to gdImageTrueColorToPalette will aim for.
|
||||
Min and max quality is in range 1-100 (1 = ugly, 100 = perfect). Max must be higher than min.
|
||||
If palette cannot represent image with at least min_quality, then image will remain true-color.
|
||||
If palette can represent image with quality better than max_quality, then lower number of colors will be used.
|
||||
This function has effect only when GD_QUANT_LIQ method has been selected.
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageTrueColorToPaletteSetQuality (gdImagePtr im, int min_quality, int max_quality)
|
||||
{
|
||||
|
@ -1410,6 +1414,9 @@ BGD_DECLARE(void) gdImageTrueColorToPaletteSetQuality (gdImagePtr im, int min_qu
|
|||
|
||||
static int gdImageTrueColorToPaletteBody (gdImagePtr oim, int dither, int colorsWanted, gdImagePtr *cimP);
|
||||
|
||||
/*
|
||||
Function: gdImageCreatePaletteFromTrueColor
|
||||
*/
|
||||
BGD_DECLARE(gdImagePtr) gdImageCreatePaletteFromTrueColor (gdImagePtr im, int dither, int colorsWanted)
|
||||
{
|
||||
gdImagePtr nim;
|
||||
|
@ -1419,6 +1426,9 @@ BGD_DECLARE(gdImagePtr) gdImageCreatePaletteFromTrueColor (gdImagePtr im, int di
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageTrueColorToPalette
|
||||
*/
|
||||
BGD_DECLARE(int) gdImageTrueColorToPalette (gdImagePtr im, int dither, int colorsWanted)
|
||||
{
|
||||
return gdImageTrueColorToPaletteBody(im, dither, colorsWanted, 0);
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
|
||||
#include "gd.h"
|
||||
|
||||
/*
|
||||
Function: gdImageFlipVertical
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageFlipVertical(gdImagePtr im)
|
||||
{
|
||||
register int x, y;
|
||||
|
@ -32,6 +35,9 @@ BGD_DECLARE(void) gdImageFlipVertical(gdImagePtr im)
|
|||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageFlipHorizontal
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageFlipHorizontal(gdImagePtr im)
|
||||
{
|
||||
|
||||
|
@ -68,6 +74,9 @@ BGD_DECLARE(void) gdImageFlipHorizontal(gdImagePtr im)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageFlipBoth
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageFlipBoth(gdImagePtr im)
|
||||
{
|
||||
gdImageFlipVertical(im);
|
||||
|
|
|
@ -9,25 +9,40 @@
|
|||
* so that changes in the shared library will automatically be
|
||||
* reflected in executables using it without recompiling them. */
|
||||
|
||||
/*
|
||||
Function: gdMajorVersion
|
||||
*/
|
||||
BGD_DECLARE(int) gdMajorVersion()
|
||||
{
|
||||
return GD_MAJOR_VERSION;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdMinorVersion
|
||||
*/
|
||||
BGD_DECLARE(int) gdMinorVersion()
|
||||
{
|
||||
return GD_MINOR_VERSION;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdReleaseVersion
|
||||
*/
|
||||
BGD_DECLARE(int) gdReleaseVersion()
|
||||
{
|
||||
return GD_RELEASE_VERSION;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdExtraVersion
|
||||
*/
|
||||
BGD_DECLARE(const char *) gdExtraVersion() {
|
||||
return GD_EXTRA_VERSION;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdVersionString
|
||||
*/
|
||||
BGD_DECLARE(const char *) gdVersionString() {
|
||||
return GD_VERSION_STRING;
|
||||
}
|
||||
|
|
|
@ -82,15 +82,17 @@ int gd_getin(void *in)
|
|||
return (gdGetC((gdIOCtx *)in));
|
||||
}
|
||||
|
||||
/* gdImageWBMPCtx
|
||||
* --------------
|
||||
* Write the image as a wbmp file
|
||||
* Parameters are:
|
||||
* image: gd image structure;
|
||||
* fg: the index of the foreground color. any other value will be
|
||||
* considered as background and will not be written
|
||||
* out: the stream where to write
|
||||
*/
|
||||
/*
|
||||
Function: gdImageWBMPCtx
|
||||
|
||||
Write the image as a wbmp file
|
||||
|
||||
Parameters:
|
||||
image - gd image structure
|
||||
fg - the index of the foreground color. any other value will be
|
||||
considered as background and will not be written
|
||||
out - the stream where to write
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageWBMPCtx(gdImagePtr image, int fg, gdIOCtx *out)
|
||||
{
|
||||
int x, y, pos;
|
||||
|
@ -242,8 +244,9 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFromWBMPPtr(int size, void *data)
|
|||
return im;
|
||||
}
|
||||
|
||||
/* gdImageWBMP
|
||||
*/
|
||||
/*
|
||||
Function: gdImageWBMP
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageWBMP(gdImagePtr im, int fg, FILE *outFile)
|
||||
{
|
||||
gdIOCtx *out = gdNewFileCtx(outFile);
|
||||
|
@ -252,8 +255,9 @@ BGD_DECLARE(void) gdImageWBMP(gdImagePtr im, int fg, FILE *outFile)
|
|||
out->gd_free(out);
|
||||
}
|
||||
|
||||
/* gdImageWBMPPtr
|
||||
*/
|
||||
/*
|
||||
Function: gdImageWBMPPtr
|
||||
*/
|
||||
BGD_DECLARE(void *) gdImageWBMPPtr(gdImagePtr im, int *size, int fg)
|
||||
{
|
||||
void *rv;
|
||||
|
|
|
@ -160,6 +160,9 @@ freeargb:
|
|||
gdFree(argb);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageWebpEx
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageWebpEx (gdImagePtr im, FILE * outFile, int quantization)
|
||||
{
|
||||
gdIOCtx *out = gdNewFileCtx(outFile);
|
||||
|
@ -170,6 +173,9 @@ BGD_DECLARE(void) gdImageWebpEx (gdImagePtr im, FILE * outFile, int quantization
|
|||
out->gd_free(out);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageWebp
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageWebp (gdImagePtr im, FILE * outFile)
|
||||
{
|
||||
gdIOCtx *out = gdNewFileCtx(outFile);
|
||||
|
@ -180,6 +186,9 @@ BGD_DECLARE(void) gdImageWebp (gdImagePtr im, FILE * outFile)
|
|||
out->gd_free(out);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageWebpPtr
|
||||
*/
|
||||
BGD_DECLARE(void *) gdImageWebpPtr (gdImagePtr im, int *size)
|
||||
{
|
||||
void *rv;
|
||||
|
@ -194,6 +203,9 @@ BGD_DECLARE(void *) gdImageWebpPtr (gdImagePtr im, int *size)
|
|||
return rv;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdImageWebpPtrEx
|
||||
*/
|
||||
BGD_DECLARE(void *) gdImageWebpPtrEx (gdImagePtr im, int *size, int quantization)
|
||||
{
|
||||
void *rv;
|
||||
|
|
|
@ -195,6 +195,9 @@ static void gdCtxPrintf(gdIOCtx * out, const char *format, ...)
|
|||
#define gdCtxPuts(out, s) out->putBuf(out, s, strlen(s))
|
||||
|
||||
/* {{{ gdImageXbmCtx */
|
||||
/*
|
||||
Function: gdImageXbmCtx
|
||||
*/
|
||||
BGD_DECLARE(void) gdImageXbmCtx(gdImagePtr image, char* file_name, int fg, gdIOCtx * out)
|
||||
{
|
||||
int x, y, c, b, sx, sy, p;
|
||||
|
|
|
@ -4382,6 +4382,9 @@ gdFont gdFontGiantRep = {
|
|||
|
||||
BGD_EXPORT_DATA_PROT gdFontPtr gdFontGiant = &gdFontGiantRep;
|
||||
|
||||
/*
|
||||
Function: gdFontGetGiant
|
||||
*/
|
||||
BGD_DECLARE(gdFontPtr) gdFontGetGiant (void)
|
||||
{
|
||||
return gdFontGiant;
|
||||
|
|
|
@ -4639,6 +4639,9 @@ gdFont gdFontLargeRep = {
|
|||
|
||||
BGD_EXPORT_DATA_PROT gdFontPtr gdFontLarge = &gdFontLargeRep;
|
||||
|
||||
/*
|
||||
Function: gdFontGetLarge
|
||||
*/
|
||||
BGD_DECLARE(gdFontPtr)
|
||||
gdFontGetLarge (void)
|
||||
{
|
||||
|
|
|
@ -3869,6 +3869,9 @@ gdFont gdFontMediumBoldRep = {
|
|||
|
||||
BGD_EXPORT_DATA_PROT gdFontPtr gdFontMediumBold = &gdFontMediumBoldRep;
|
||||
|
||||
/*
|
||||
Function: gdFontGetMediumBold
|
||||
*/
|
||||
BGD_DECLARE(gdFontPtr)
|
||||
gdFontGetMediumBold (void)
|
||||
{
|
||||
|
|
|
@ -3867,6 +3867,9 @@ gdFont gdFontSmallRep = {
|
|||
|
||||
BGD_EXPORT_DATA_PROT gdFontPtr gdFontSmall = &gdFontSmallRep;
|
||||
|
||||
/*
|
||||
Function: gdFontGetSmall
|
||||
*/
|
||||
BGD_DECLARE(gdFontPtr)
|
||||
gdFontGetSmall (void)
|
||||
{
|
||||
|
|
|
@ -2590,6 +2590,9 @@ gdFont gdFontTinyRep = {
|
|||
|
||||
BGD_EXPORT_DATA_PROT gdFontPtr gdFontTiny = &gdFontTinyRep;
|
||||
|
||||
/*
|
||||
Function: gdFontGetTiny
|
||||
*/
|
||||
BGD_DECLARE(gdFontPtr)
|
||||
gdFontGetTiny (void)
|
||||
{
|
||||
|
|
21
src/gdft.c
21
src/gdft.c
|
@ -92,6 +92,9 @@ static char *font_path(char **fontpath, char *name_list);
|
|||
#define TRUE !FALSE
|
||||
#endif
|
||||
|
||||
/*
|
||||
Function: gdImageStringTTF
|
||||
*/
|
||||
BGD_DECLARE(char *) gdImageStringTTF (gdImage * im, int *brect, int fg, char *fontlist,
|
||||
double ptsize, double angle, int x, int y, char *string)
|
||||
{
|
||||
|
@ -866,11 +869,17 @@ gdft_draw_bitmap (gdCache_head_t * tc_cache, gdImage * im, int fg,
|
|||
return (char *) NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdFreeFontCache
|
||||
*/
|
||||
BGD_DECLARE(void) gdFreeFontCache ()
|
||||
{
|
||||
gdFontCacheShutdown ();
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdFontCacheShutdown
|
||||
*/
|
||||
BGD_DECLARE(void) gdFontCacheShutdown ()
|
||||
{
|
||||
if (fontCache) {
|
||||
|
@ -884,9 +893,11 @@ BGD_DECLARE(void) gdFontCacheShutdown ()
|
|||
}
|
||||
}
|
||||
|
||||
/********************************************************************/
|
||||
/* gdImageStringFT - render a utf8 string onto a gd image */
|
||||
/*
|
||||
Function: gdImageStringFT
|
||||
|
||||
Render a utf8 string onto a gd image.
|
||||
*/
|
||||
BGD_DECLARE(char *) gdImageStringFT (gdImage * im, int *brect, int fg, char *fontlist,
|
||||
double ptsize, double angle, int x, int y, char *string)
|
||||
{
|
||||
|
@ -894,6 +905,9 @@ BGD_DECLARE(char *) gdImageStringFT (gdImage * im, int *brect, int fg, char *fon
|
|||
ptsize, angle, x, y, string, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdFontCacheSetup
|
||||
*/
|
||||
BGD_DECLARE(int) gdFontCacheSetup (void)
|
||||
{
|
||||
if (fontCache) {
|
||||
|
@ -1842,6 +1856,9 @@ static char * font_path(char **fontpath, char *name_list)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdFTUseFontConfig
|
||||
*/
|
||||
BGD_DECLARE(int) gdFTUseFontConfig(int flag)
|
||||
{
|
||||
#ifdef HAVE_LIBFONTCONFIG
|
||||
|
|
28
src/gdfx.c
28
src/gdfx.c
|
@ -25,6 +25,9 @@
|
|||
#define MAXY(x) MAX4(x[1],x[3],x[5],x[7])
|
||||
#define MINY(x) MIN4(x[1],x[3],x[5],x[7])
|
||||
|
||||
/*
|
||||
Function: gdImageStringFTCircle
|
||||
*/
|
||||
BGD_DECLARE(char *)
|
||||
gdImageStringFTCircle (gdImagePtr im,
|
||||
int cx,
|
||||
|
@ -254,6 +257,9 @@ main (int argc, char *argv[])
|
|||
#define SUPERBITS1 1
|
||||
#define SUPERBITS2 2
|
||||
|
||||
/*
|
||||
Function: gdImageSquareToCircle
|
||||
*/
|
||||
BGD_DECLARE(gdImagePtr)
|
||||
gdImageSquareToCircle (gdImagePtr im, int radius)
|
||||
{
|
||||
|
@ -381,16 +387,18 @@ gdImageSubSharpen (int pc, int c, int nc, float inner_coeff, float
|
|||
}
|
||||
|
||||
/*
|
||||
* Sharpen function added on 2003-11-19
|
||||
* by Paul Troughton (paul<dot>troughton<at>ieee<dot>org)
|
||||
* Simple 3x3 convolution kernel
|
||||
* Makes use of seperability
|
||||
* Faster, but less flexible, than full-blown unsharp masking
|
||||
* pct is sharpening percentage, and can be greater than 100
|
||||
* Silently does nothing to non-truecolor images
|
||||
* Silently does nothing for pct<0, as not a useful blurring function
|
||||
* Leaves transparency/alpha-channel untouched
|
||||
*/
|
||||
Function: gdImageSharpen
|
||||
|
||||
Sharpen function added on 2003-11-19
|
||||
by Paul Troughton (paul<dot>troughton<at>ieee<dot>org)
|
||||
Simple 3x3 convolution kernel
|
||||
Makes use of seperability
|
||||
Faster, but less flexible, than full-blown unsharp masking
|
||||
pct is sharpening percentage, and can be greater than 100
|
||||
Silently does nothing to non-truecolor images
|
||||
Silently does nothing for pct<0, as not a useful blurring function
|
||||
Leaves transparency/alpha-channel untouched
|
||||
*/
|
||||
BGD_DECLARE(void)
|
||||
gdImageSharpen (gdImagePtr im, int pct)
|
||||
{
|
||||
|
|
|
@ -90,6 +90,9 @@ gdReallocEx (void *ptr, size_t size)
|
|||
return newPtr;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: gdFree
|
||||
*/
|
||||
BGD_DECLARE(void) gdFree (void *ptr)
|
||||
{
|
||||
free (ptr);
|
||||
|
|
Loading…
Reference in New Issue