php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
gd.c File Reference
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include "gd.h"
#include "gdhelpers.h"
#include "gd_errors.h"
#include "php.h"

Go to the source code of this file.

Data Structures

struct  RGBType
 
struct  HWBType
 
struct  seg
 

Macros

#define ASC(ch)
 
#define floor_cast(exp)
 
#define RETURN_HWB(h, w, b)
 
#define RETURN_RGB(r, g, b)
 
#define HWB_UNDEFINED   -1
 
#define SETUP_RGB(s, r, g, b)
 
#define MIN(a, b)
 
#define MIN3(a, b, c)
 
#define MAX(a, b)
 
#define MAX3(a, b, c)
 
#define BLEND_COLOR(a, nc, c, cc)
 
#define FILL_MAX   ((int)(im->sy*im->sx)/4)
 
#define FILL_PUSH(Y, XL, XR, DY)
 
#define FILL_POP(Y, XL, XR, DY)
 

Functions

void gd_stderr_error (int priority, const char *format, va_list args)
 
void gd_error (const char *format,...)
 
void gd_error_ex (int priority, const char *format,...)
 
void gdSetErrorMethod (gdErrorMethod error_method)
 
void gdClearErrorMethod (void)
 
int gdImageGetTrueColorPixel (gdImagePtr im, int x, int y)
 
gdImagePtr gdImageCreate (int sx, int sy)
 
gdImagePtr gdImageCreateTrueColor (int sx, int sy)
 
void gdImageDestroy (gdImagePtr im)
 
int gdImageColorClosest (gdImagePtr im, int r, int g, int b)
 
int gdImageColorClosestAlpha (gdImagePtr im, int r, int g, int b, int a)
 
int gdImageColorClosestHWB (gdImagePtr im, int r, int g, int b)
 
int gdImageColorExact (gdImagePtr im, int r, int g, int b)
 
int gdImageColorExactAlpha (gdImagePtr im, int r, int g, int b, int a)
 
int gdImageColorAllocate (gdImagePtr im, int r, int g, int b)
 
int gdImageColorAllocateAlpha (gdImagePtr im, int r, int g, int b, int a)
 
int gdImageColorResolve (gdImagePtr im, int r, int g, int b)
 
int gdImageColorResolveAlpha (gdImagePtr im, int r, int g, int b, int a)
 
void gdImageColorDeallocate (gdImagePtr im, int color)
 
void gdImageColorTransparent (gdImagePtr im, int color)
 
void gdImagePaletteCopy (gdImagePtr to, gdImagePtr from)
 
void gdImageSetPixel (gdImagePtr im, int x, int y, int color)
 
int gdImageGetPixel (gdImagePtr im, int x, int y)
 
void gdImageAABlend (gdImagePtr im)
 
gdImagePtr gdImageClone (gdImagePtr src)
 
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 col)
 
void gdImageDashedLine (gdImagePtr im, int x1, int y1, int x2, int y2, int color)
 
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)
 
void gdImageStringUp (gdImagePtr im, gdFontPtr f, int x, int y, unsigned char *s, int color)
 
void gdImageString16 (gdImagePtr im, gdFontPtr f, int x, int y, unsigned short *s, int color)
 
void gdImageStringUp16 (gdImagePtr im, gdFontPtr f, int x, int y, unsigned short *s, int color)
 
long lsqrt (long n)
 
void gdImageArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color)
 
void gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color, int style)
 
void gdImageEllipse (gdImagePtr im, int mx, int my, int w, int h, int c)
 
void gdImageFilledEllipse (gdImagePtr im, int mx, int my, int w, int h, int c)
 
void gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color)
 
void gdImageFill (gdImagePtr im, int x, int y, int nc)
 
void gdImageRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color)
 
void gdImageFilledRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, 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)
 
void gdImageCopyResized (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH)
 
void gdImageCopyResampled (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH)
 
void gdImagePolygon (gdImagePtr im, gdPointPtr p, int n, int c)
 
void gdImageOpenPolygon (gdImagePtr im, gdPointPtr p, int n, int c)
 
int gdCompareInt (const void *a, const void *b)
 
void gdImageFilledPolygon (gdImagePtr im, gdPointPtr p, int n, int c)
 
void gdImageSetStyle (gdImagePtr im, int *style, int noOfPixels)
 
void gdImageSetThickness (gdImagePtr im, int thickness)
 
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 gdImageInterlace (gdImagePtr im, int interlaceArg)
 
int gdImageCompare (gdImagePtr im1, gdImagePtr im2)
 
int gdAlphaBlend (int dst, int src)
 
void gdImageAlphaBlending (gdImagePtr im, int alphaBlendingArg)
 
void gdImageSaveAlpha (gdImagePtr im, int saveAlphaArg)
 
int gdLayerOverlay (int dst, int src)
 
int gdLayerMultiply (int dst, int src)
 
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 gdImageSetResolution (gdImagePtr im, const unsigned int res_x, const unsigned int res_y)
 
int gdImagePaletteToTrueColor (gdImagePtr src)
 

Variables

int gdCosT []
 
int gdSinT []
 

Macro Definition Documentation

◆ ASC

#define ASC ( ch)
Value:
zend_long ch
Definition ffi.c:4580

Definition at line 18 of file gd.c.

◆ BLEND_COLOR

#define BLEND_COLOR ( a,
nc,
c,
cc )
Value:
nc = (cc) + (((((c) - (cc)) * (a)) + ((((c) - (cc)) * (a)) >> 8) + 0x80) >> 8);
$obj a
Definition test.php:84

Definition at line 1268 of file gd.c.

◆ FILL_MAX

#define FILL_MAX   ((int)(im->sy*im->sx)/4)

Definition at line 1960 of file gd.c.

◆ FILL_POP

#define FILL_POP ( Y,
XL,
XR,
DY )
Value:
{sp--; Y = sp->y+(DY = sp->dy); XL = sp->xl; XR = sp->xr;}

Definition at line 1965 of file gd.c.

◆ FILL_PUSH

#define FILL_PUSH ( Y,
XL,
XR,
DY )
Value:
if (sp<stack+FILL_MAX && Y+(DY)>=0 && Y+(DY)<wy2) \
{sp->y = Y; sp->xl = XL; sp->xr = XR; sp->dy = DY; sp++;}
#define FILL_MAX
Definition gd.c:1960

Definition at line 1961 of file gd.c.

◆ floor_cast

#define floor_cast ( exp)
Value:
((long) exp)
exp(float $num)

Definition at line 60 of file gd.c.

◆ HWB_UNDEFINED

#define HWB_UNDEFINED   -1

Definition at line 314 of file gd.c.

◆ MAX

#define MAX ( a,
b )
Value:
((a)<(b)?(b):(a))

Definition at line 322 of file gd.c.

◆ MAX3

#define MAX3 ( a,
b,
c )
Value:
((a)<(b)?(MAX(b,c)):(MAX(a,c)))
#define MAX(a, b)

Definition at line 324 of file gd.c.

◆ MIN

#define MIN ( a,
b )
Value:
((a)<(b)?(a):(b))

Definition at line 318 of file gd.c.

◆ MIN3

#define MIN3 ( a,
b,
c )
Value:
((a)<(b)?(MIN(a,c)):(MIN(b,c)))
#define MIN(a, b)

Definition at line 320 of file gd.c.

◆ RETURN_HWB

#define RETURN_HWB ( h,
w,
b )
Value:
{HWB->H = h; HWB->W = w; HWB->B = b; return HWB;}

Definition at line 312 of file gd.c.

◆ RETURN_RGB

#define RETURN_RGB ( r,
g,
b )
Value:
{RGB->R = r; RGB->G = g; RGB->B = b; return RGB;}

Definition at line 313 of file gd.c.

◆ SETUP_RGB

#define SETUP_RGB ( s,
r,
g,
b )
Value:
{s.R = r/255.0f; s.G = g/255.0f; s.B = b/255.0f;}
char s[4]
Definition cdf.c:77

Definition at line 315 of file gd.c.

Function Documentation

◆ gd_error()

void gd_error ( const char * format,
... )

Definition at line 103 of file gd.c.

◆ gd_error_ex()

void gd_error_ex ( int priority,
const char * format,
... )

Definition at line 111 of file gd.c.

◆ gd_stderr_error()

void gd_stderr_error ( int priority,
const char * format,
va_list args )

Group: Error Handling

Definition at line 69 of file gd.c.

◆ gdAlphaBlend()

int gdAlphaBlend ( int dst,
int src )

Definition at line 2992 of file gd.c.

◆ gdClearErrorMethod()

void gdClearErrorMethod ( void )

Definition at line 131 of file gd.c.

◆ gdCompareInt()

int gdCompareInt ( const void * a,
const void * b )

Definition at line 2850 of file gd.c.

◆ gdImageAABlend()

void gdImageAABlend ( gdImagePtr im)

Definition at line 966 of file gd.c.

◆ gdImageAALine()

void gdImageAALine ( gdImagePtr im,
int x1,
int y1,
int x2,
int y2,
int col )

Definition at line 1292 of file gd.c.

◆ gdImageAlphaBlending()

void gdImageAlphaBlending ( gdImagePtr im,
int alphaBlendingArg )

Definition at line 3037 of file gd.c.

◆ gdImageArc()

void gdImageArc ( gdImagePtr im,
int cx,
int cy,
int w,
int h,
int s,
int e,
int color )

Definition at line 1645 of file gd.c.

◆ gdImageChar()

void gdImageChar ( gdImagePtr im,
gdFontPtr f,
int x,
int y,
int c,
int color )

Definition at line 1517 of file gd.c.

◆ gdImageCharUp()

void gdImageCharUp ( gdImagePtr im,
gdFontPtr f,
int x,
int y,
int c,
int color )

Definition at line 1545 of file gd.c.

◆ gdImageClone()

gdImagePtr gdImageClone ( gdImagePtr src)

Definition at line 973 of file gd.c.

◆ gdImageColorAllocate()

int gdImageColorAllocate ( gdImagePtr im,
int r,
int g,
int b )

Definition at line 489 of file gd.c.

◆ gdImageColorAllocateAlpha()

int gdImageColorAllocateAlpha ( gdImagePtr im,
int r,
int g,
int b,
int a )

Definition at line 494 of file gd.c.

◆ gdImageColorClosest()

int gdImageColorClosest ( gdImagePtr im,
int r,
int g,
int b )

Definition at line 271 of file gd.c.

◆ gdImageColorClosestAlpha()

int gdImageColorClosestAlpha ( gdImagePtr im,
int r,
int g,
int b,
int a )

Definition at line 276 of file gd.c.

◆ gdImageColorClosestHWB()

int gdImageColorClosestHWB ( gdImagePtr im,
int r,
int g,
int b )

Definition at line 442 of file gd.c.

◆ gdImageColorDeallocate()

void gdImageColorDeallocate ( gdImagePtr im,
int color )

Definition at line 597 of file gd.c.

◆ gdImageColorExact()

int gdImageColorExact ( gdImagePtr im,
int r,
int g,
int b )

Definition at line 467 of file gd.c.

◆ gdImageColorExactAlpha()

int gdImageColorExactAlpha ( gdImagePtr im,
int r,
int g,
int b,
int a )

Definition at line 472 of file gd.c.

◆ gdImageColorResolve()

int gdImageColorResolve ( gdImagePtr im,
int r,
int g,
int b )

Definition at line 534 of file gd.c.

◆ gdImageColorResolveAlpha()

int gdImageColorResolveAlpha ( gdImagePtr im,
int r,
int g,
int b,
int a )

Definition at line 539 of file gd.c.

◆ gdImageColorTransparent()

void gdImageColorTransparent ( gdImagePtr im,
int color )

Definition at line 606 of file gd.c.

◆ gdImageCompare()

int gdImageCompare ( gdImagePtr im1,
gdImagePtr im2 )

Definition at line 2920 of file gd.c.

◆ gdImageCopy()

void gdImageCopy ( gdImagePtr dst,
gdImagePtr src,
int dstX,
int dstY,
int srcX,
int srcY,
int w,
int h )

Definition at line 2312 of file gd.c.

◆ gdImageCopyMerge()

void gdImageCopyMerge ( gdImagePtr dst,
gdImagePtr src,
int dstX,
int dstY,
int srcX,
int srcY,
int w,
int h,
int pct )

Definition at line 2393 of file gd.c.

◆ gdImageCopyMergeGray()

void gdImageCopyMergeGray ( gdImagePtr dst,
gdImagePtr src,
int dstX,
int dstY,
int srcX,
int srcY,
int w,
int h,
int pct )

Definition at line 2433 of file gd.c.

◆ gdImageCopyResampled()

void gdImageCopyResampled ( gdImagePtr dst,
gdImagePtr src,
int dstX,
int dstY,
int srcX,
int srcY,
int dstW,
int dstH,
int srcW,
int srcH )

Definition at line 2597 of file gd.c.

◆ gdImageCopyResized()

void gdImageCopyResized ( gdImagePtr dst,
gdImagePtr src,
int dstX,
int dstY,
int srcX,
int srcY,
int dstW,
int dstH,
int srcW,
int srcH )

Definition at line 2487 of file gd.c.

◆ gdImageCreate()

gdImagePtr gdImageCreate ( int sx,
int sy )

Definition at line 141 of file gd.c.

◆ gdImageCreateTrueColor()

gdImagePtr gdImageCreateTrueColor ( int sx,
int sy )

Definition at line 195 of file gd.c.

◆ gdImageDashedLine()

void gdImageDashedLine ( gdImagePtr im,
int x1,
int y1,
int x2,
int y2,
int color )

Definition at line 1376 of file gd.c.

◆ gdImageDestroy()

void gdImageDestroy ( gdImagePtr im)

Definition at line 247 of file gd.c.

◆ gdImageEllipse()

void gdImageEllipse ( gdImagePtr im,
int mx,
int my,
int w,
int h,
int c )

Integer Ellipse functions (gdImageEllipse and gdImageFilledEllipse) Function added by Pierre-Alain Joye 02/08/2003 (paj@p.nosp@m.earf.nosp@m.r.org) See the ellipse function simplification for the equation as well as the midpoint algorithm.

Definition at line 1771 of file gd.c.

◆ gdImageFill()

void gdImageFill ( gdImagePtr im,
int x,
int y,
int nc )

Definition at line 1970 of file gd.c.

◆ gdImageFilledArc()

void gdImageFilledArc ( gdImagePtr im,
int cx,
int cy,
int w,
int h,
int s,
int e,
int color,
int style )

Definition at line 1650 of file gd.c.

◆ gdImageFilledEllipse()

void gdImageFilledEllipse ( gdImagePtr im,
int mx,
int my,
int w,
int h,
int c )

Definition at line 1810 of file gd.c.

◆ gdImageFilledPolygon()

void gdImageFilledPolygon ( gdImagePtr im,
gdPointPtr p,
int n,
int c )

Definition at line 2730 of file gd.c.

◆ gdImageFilledRectangle()

void gdImageFilledRectangle ( gdImagePtr im,
int x1,
int y1,
int x2,
int y2,
int color )

Definition at line 2307 of file gd.c.

◆ gdImageFillToBorder()

void gdImageFillToBorder ( gdImagePtr im,
int x,
int y,
int border,
int color )

Definition at line 1858 of file gd.c.

◆ gdImageGetClip()

void gdImageGetClip ( gdImagePtr im,
int * x1P,
int * y1P,
int * x2P,
int * y2P )

Definition at line 3134 of file gd.c.

◆ gdImageGetPixel()

int gdImageGetPixel ( gdImagePtr im,
int x,
int y )

Definition at line 953 of file gd.c.

◆ gdImageGetTrueColorPixel()

int gdImageGetTrueColorPixel ( gdImagePtr im,
int x,
int y )

Definition at line 798 of file gd.c.

◆ gdImageInterlace()

void gdImageInterlace ( gdImagePtr im,
int interlaceArg )

Definition at line 2915 of file gd.c.

◆ gdImageLine()

void gdImageLine ( gdImagePtr im,
int x1,
int y1,
int x2,
int y2,
int color )

Definition at line 1096 of file gd.c.

◆ gdImageOpenPolygon()

void gdImageOpenPolygon ( gdImagePtr im,
gdPointPtr p,
int n,
int c )

Definition at line 2701 of file gd.c.

◆ gdImagePaletteCopy()

void gdImagePaletteCopy ( gdImagePtr to,
gdImagePtr from )

Definition at line 624 of file gd.c.

◆ gdImagePaletteToTrueColor()

int gdImagePaletteToTrueColor ( gdImagePtr src)

Definition at line 3149 of file gd.c.

◆ gdImagePolygon()

void gdImagePolygon ( gdImagePtr im,
gdPointPtr p,
int n,
int c )

Definition at line 2690 of file gd.c.

◆ gdImageRectangle()

void gdImageRectangle ( gdImagePtr im,
int x1,
int y1,
int x2,
int y2,
int color )

Definition at line 2142 of file gd.c.

◆ gdImageSaveAlpha()

void gdImageSaveAlpha ( gdImagePtr im,
int saveAlphaArg )

Definition at line 3042 of file gd.c.

◆ gdImageSetAntiAliased()

void gdImageSetAntiAliased ( gdImagePtr im,
int c )

Definition at line 2900 of file gd.c.

◆ gdImageSetAntiAliasedDontBlend()

void gdImageSetAntiAliasedDontBlend ( gdImagePtr im,
int c,
int dont_blend )

Definition at line 2907 of file gd.c.

◆ gdImageSetBrush()

void gdImageSetBrush ( gdImagePtr im,
gdImagePtr brush )

Definition at line 2874 of file gd.c.

◆ gdImageSetClip()

void gdImageSetClip ( gdImagePtr im,
int x1,
int y1,
int x2,
int y2 )

Definition at line 3102 of file gd.c.

◆ gdImageSetPixel()

void gdImageSetPixel ( gdImagePtr im,
int x,
int y,
int color )

Definition at line 733 of file gd.c.

◆ gdImageSetResolution()

void gdImageSetResolution ( gdImagePtr im,
const unsigned int res_x,
const unsigned int res_y )

Definition at line 3142 of file gd.c.

◆ gdImageSetStyle()

void gdImageSetStyle ( gdImagePtr im,
int * style,
int noOfPixels )

Definition at line 2855 of file gd.c.

◆ gdImageSetThickness()

void gdImageSetThickness ( gdImagePtr im,
int thickness )

Definition at line 2869 of file gd.c.

◆ gdImageSetTile()

void gdImageSetTile ( gdImagePtr im,
gdImagePtr tile )

Definition at line 2887 of file gd.c.

◆ gdImageString()

void gdImageString ( gdImagePtr im,
gdFontPtr f,
int x,
int y,
unsigned char * s,
int color )

Definition at line 1573 of file gd.c.

◆ gdImageString16()

void gdImageString16 ( gdImagePtr im,
gdFontPtr f,
int x,
int y,
unsigned short * s,
int color )

Definition at line 1597 of file gd.c.

◆ gdImageStringUp()

void gdImageStringUp ( gdImagePtr im,
gdFontPtr f,
int x,
int y,
unsigned char * s,
int color )

Definition at line 1584 of file gd.c.

◆ gdImageStringUp16()

void gdImageStringUp16 ( gdImagePtr im,
gdFontPtr f,
int x,
int y,
unsigned short * s,
int color )

Definition at line 1608 of file gd.c.

◆ gdLayerMultiply()

int gdLayerMultiply ( int dst,
int src )

Definition at line 3080 of file gd.c.

◆ gdLayerOverlay()

int gdLayerOverlay ( int dst,
int src )

Definition at line 3047 of file gd.c.

◆ gdSetErrorMethod()

void gdSetErrorMethod ( gdErrorMethod error_method)

Definition at line 123 of file gd.c.

◆ lsqrt()

long lsqrt ( long n)

Definition at line 1633 of file gd.c.

Variable Documentation

◆ gdCosT

int gdCosT[]
extern

Definition at line 8 of file gdtables.c.

◆ gdSinT

int gdSinT[]
extern

Definition at line 372 of file gdtables.c.