Lines Matching refs:src

13 #define GET_PIXEL_FUNCTION(src)(src->trueColor?gdImageGetTrueColorPixel:gdImageGetPixel)  argument
16 int gdImageNegate(gdImagePtr src) in gdImageNegate() argument
24 if (src==NULL) { in gdImageNegate()
28 f = GET_PIXEL_FUNCTION(src); in gdImageNegate()
30 for (y=0; y<src->sy; ++y) { in gdImageNegate()
31 for (x=0; x<src->sx; ++x) { in gdImageNegate()
32 pxl = f (src, x, y); in gdImageNegate()
33 r = gdImageRed(src, pxl); in gdImageNegate()
34 g = gdImageGreen(src, pxl); in gdImageNegate()
35 b = gdImageBlue(src, pxl); in gdImageNegate()
36 a = gdImageAlpha(src, pxl); in gdImageNegate()
38 new_pxl = gdImageColorAllocateAlpha(src, 255-r, 255-g, 255-b, a); in gdImageNegate()
40 new_pxl = gdImageColorClosestAlpha(src, 255-r, 255-g, 255-b, a); in gdImageNegate()
42 gdImageSetPixel (src, x, y, new_pxl); in gdImageNegate()
49 int gdImageGrayScale(gdImagePtr src) in gdImageGrayScale() argument
56 f = GET_PIXEL_FUNCTION(src); in gdImageGrayScale()
58 if (src==NULL) { in gdImageGrayScale()
62 for (y=0; y<src->sy; ++y) { in gdImageGrayScale()
63 for (x=0; x<src->sx; ++x) { in gdImageGrayScale()
64 pxl = f (src, x, y); in gdImageGrayScale()
65 r = gdImageRed(src, pxl); in gdImageGrayScale()
66 g = gdImageGreen(src, pxl); in gdImageGrayScale()
67 b = gdImageBlue(src, pxl); in gdImageGrayScale()
68 a = gdImageAlpha(src, pxl); in gdImageGrayScale()
71 new_pxl = gdImageColorAllocateAlpha(src, r, g, b, a); in gdImageGrayScale()
73 new_pxl = gdImageColorClosestAlpha(src, r, g, b, a); in gdImageGrayScale()
75 gdImageSetPixel (src, x, y, new_pxl); in gdImageGrayScale()
82 int gdImageBrightness(gdImagePtr src, int brightness) in gdImageBrightness() argument
89 f = GET_PIXEL_FUNCTION(src); in gdImageBrightness()
91 if (src==NULL || (brightness < -255 || brightness>255)) { in gdImageBrightness()
99 for (y=0; y<src->sy; ++y) { in gdImageBrightness()
100 for (x=0; x<src->sx; ++x) { in gdImageBrightness()
101 pxl = f (src, x, y); in gdImageBrightness()
103 r = gdImageRed(src, pxl); in gdImageBrightness()
104 g = gdImageGreen(src, pxl); in gdImageBrightness()
105 b = gdImageBlue(src, pxl); in gdImageBrightness()
106 a = gdImageAlpha(src, pxl); in gdImageBrightness()
116 new_pxl = gdImageColorAllocateAlpha(src, (int)r, (int)g, (int)b, a); in gdImageBrightness()
118 new_pxl = gdImageColorClosestAlpha(src, (int)r, (int)g, (int)b, a); in gdImageBrightness()
120 gdImageSetPixel (src, x, y, new_pxl); in gdImageBrightness()
127 int gdImageContrast(gdImagePtr src, double contrast) in gdImageContrast() argument
136 f = GET_PIXEL_FUNCTION(src); in gdImageContrast()
138 if (src==NULL) { in gdImageContrast()
145 for (y=0; y<src->sy; ++y) { in gdImageContrast()
146 for (x=0; x<src->sx; ++x) { in gdImageContrast()
147 pxl = f(src, x, y); in gdImageContrast()
149 r = gdImageRed(src, pxl); in gdImageContrast()
150 g = gdImageGreen(src, pxl); in gdImageContrast()
151 b = gdImageBlue(src, pxl); in gdImageContrast()
152 a = gdImageAlpha(src, pxl); in gdImageContrast()
176 new_pxl = gdImageColorAllocateAlpha(src, (int)rf, (int)gf, (int)bf, a); in gdImageContrast()
178 new_pxl = gdImageColorClosestAlpha(src, (int)rf, (int)gf, (int)bf, a); in gdImageContrast()
180 gdImageSetPixel (src, x, y, new_pxl); in gdImageContrast()
187 int gdImageColor(gdImagePtr src, const int red, const int green, const int blue, const int alpha) in gdImageColor() argument
194 if (src == NULL) { in gdImageColor()
198 f = GET_PIXEL_FUNCTION(src); in gdImageColor()
200 for (y=0; y<src->sy; ++y) { in gdImageColor()
201 for (x=0; x<src->sx; ++x) { in gdImageColor()
204 pxl = f(src, x, y); in gdImageColor()
205 r = gdImageRed(src, pxl); in gdImageColor()
206 g = gdImageGreen(src, pxl); in gdImageColor()
207 b = gdImageBlue(src, pxl); in gdImageColor()
208 a = gdImageAlpha(src, pxl); in gdImageColor()
220 new_pxl = gdImageColorAllocateAlpha(src, r, g, b, a); in gdImageColor()
222 new_pxl = gdImageColorClosestAlpha(src, r, g, b, a); in gdImageColor()
224 gdImageSetPixel (src, x, y, new_pxl); in gdImageColor()
230 int gdImageConvolution(gdImagePtr src, float filter[3][3], float filter_div, float offset) in gdImageConvolution() argument
239 if (src==NULL) { in gdImageConvolution()
244 srcback = gdImageCreateTrueColor (src->sx, src->sy); in gdImageConvolution()
253 gdImageCopy(srcback, src,0,0,0,0,src->sx,src->sy); in gdImageConvolution()
255 f = GET_PIXEL_FUNCTION(src); in gdImageConvolution()
257 for ( y=0; y<src->sy; y++) { in gdImageConvolution()
258 for(x=0; x<src->sx; x++) { in gdImageConvolution()
263 int yv = MIN(MAX(y - 1 + j, 0), src->sy - 1); in gdImageConvolution()
265 pxl = f(srcback, MIN(MAX(x - 1 + i, 0), src->sx - 1), yv); in gdImageConvolution()
280 new_pxl = gdImageColorAllocateAlpha(src, (int)new_r, (int)new_g, (int)new_b, new_a); in gdImageConvolution()
282 new_pxl = gdImageColorClosestAlpha(src, (int)new_r, (int)new_g, (int)new_b, new_a); in gdImageConvolution()
284 gdImageSetPixel (src, x, y, new_pxl); in gdImageConvolution()
291 int gdImageSelectiveBlur( gdImagePtr src) in gdImageSelectiveBlur() argument
305 if (src==NULL) { in gdImageSelectiveBlur()
310 srcback = gdImageCreateTrueColor (src->sx, src->sy); in gdImageSelectiveBlur()
314 gdImageCopy(srcback, src,0,0,0,0,src->sx,src->sy); in gdImageSelectiveBlur()
316 f = GET_PIXEL_FUNCTION(src); in gdImageSelectiveBlur()
318 for(y = 0; y<src->sy; y++) { in gdImageSelectiveBlur()
319 for (x=0; x<src->sx; x++) { in gdImageSelectiveBlur()
321 cpxl = f(src, x, y); in gdImageSelectiveBlur()
328 pxl = f(src, x-(3>>1)+i, y-(3>>1)+j); in gdImageSelectiveBlur()
389 pxl = f(src, x-(3>>1)+i, y-(3>>1)+j); in gdImageSelectiveBlur()
399 new_pxl = gdImageColorAllocateAlpha(src, (int)new_r, (int)new_g, (int)new_b, new_a); in gdImageSelectiveBlur()
401 new_pxl = gdImageColorClosestAlpha(src, (int)new_r, (int)new_g, (int)new_b, new_a); in gdImageSelectiveBlur()
403 gdImageSetPixel (src, x, y, new_pxl); in gdImageSelectiveBlur()
410 int gdImageEdgeDetectQuick(gdImagePtr src) in gdImageEdgeDetectQuick() argument
416 return gdImageConvolution(src, filter, 1, 127); in gdImageEdgeDetectQuick()