Lines Matching refs:x
78 #define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x))) argument
84 #define gd_itofx(x) ((x) << 8) argument
87 #define gd_ftofx(x) (long)((x) * 256) argument
90 #define gd_dtofx(x) (long)((x) * 256) argument
93 #define gd_fxtoi(x) ((x) >> 8) argument
96 # define gd_fxtof(x) ((float)(x) / 256) argument
99 #define gd_fxtod(x) ((double)(x) / 256) argument
102 #define gd_mulfx(x,y) (((x) * (y)) >> 8) argument
105 #define gd_divfx(x,y) (((x) << 8) / (y)) argument
173 static double KernelBessel_J1(const double x) in KernelBessel_J1() argument
209 p = p*x*x+Pone[i]; in KernelBessel_J1()
210 q = q*x*x+Qone[i]; in KernelBessel_J1()
215 static double KernelBessel_P1(const double x) in KernelBessel_P1() argument
245 p = p*(8.0/x)*(8.0/x)+Pone[i]; in KernelBessel_P1()
246 q = q*(8.0/x)*(8.0/x)+Qone[i]; in KernelBessel_P1()
251 static double KernelBessel_Q1(const double x) in KernelBessel_Q1() argument
281 p = p*(8.0/x)*(8.0/x)+Pone[i]; in KernelBessel_Q1()
282 q = q*(8.0/x)*(8.0/x)+Qone[i]; in KernelBessel_Q1()
287 static double KernelBessel_Order1(double x) in KernelBessel_Order1() argument
291 if (x == 0.0) in KernelBessel_Order1()
293 p = x; in KernelBessel_Order1()
294 if (x < 0.0) in KernelBessel_Order1()
295 x=(-x); in KernelBessel_Order1()
296 if (x < 8.0) in KernelBessel_Order1()
297 return (p*KernelBessel_J1(x)); in KernelBessel_Order1()
298 …q = (double)sqrt(2.0f/(M_PI*x))*(double)(KernelBessel_P1(x)*(1.0f/sqrt(2.0f)*(sin(x)-cos(x)))-8.0f… in KernelBessel_Order1()
299 (-1.0f/sqrt(2.0f)*(sin(x)+cos(x)))); in KernelBessel_Order1()
305 static double filter_bessel(const double x) in filter_bessel() argument
307 if (x == 0.0f) in filter_bessel()
309 return (KernelBessel_Order1((double)M_PI*x)/(2.0f*x)); in filter_bessel()
313 static double filter_blackman(const double x) in filter_blackman() argument
315 return (0.42f+0.5f*(double)cos(M_PI*x)+0.08f*(double)cos(2.0f*M_PI*x)); in filter_blackman()
362 const double x = x1 < 0.0 ? -x1 : x1; in filter_cubic_spline() local
364 if (x < 1.0 ) { in filter_cubic_spline()
365 const double x2 = x*x; in filter_cubic_spline()
367 return (0.5 * x2 * x - x2 + 2.0 / 3.0); in filter_cubic_spline()
369 if (x < 2.0) { in filter_cubic_spline()
370 return (pow(2.0 - x, 3.0)/6.0); in filter_cubic_spline()
378 const double x = x1 < 0.0 ? -x1 : x1; in filter_cubic_convolution() local
380 const double x2_x = x2 * x; in filter_cubic_convolution()
382 if (x <= 1.0) return ((4.0 / 3.0)* x2_x - (7.0 / 3.0) * x2 + 1.0); in filter_cubic_convolution()
383 if (x <= 2.0) return (- (7.0 / 12.0) * x2_x + 3 * x2 - (59.0 / 12.0) * x + 2.5); in filter_cubic_convolution()
384 if (x <= 3.0) return ( (1.0/12.0) * x2_x - (2.0 / 3.0) * x2 + 1.75 * x - 1.5); in filter_cubic_convolution()
388 static double filter_box(double x) { in filter_box() argument
389 if (x < - DEFAULT_FILTER_BOX) in filter_box()
391 if (x < DEFAULT_FILTER_BOX) in filter_box()
396 static double filter_catmullrom(const double x) in filter_catmullrom() argument
398 if (x < -2.0) in filter_catmullrom()
400 if (x < -1.0) in filter_catmullrom()
401 return(0.5f*(4.0f+x*(8.0f+x*(5.0f+x)))); in filter_catmullrom()
402 if (x < 0.0) in filter_catmullrom()
403 return(0.5f*(2.0f+x*x*(-5.0f-3.0f*x))); in filter_catmullrom()
404 if (x < 1.0) in filter_catmullrom()
405 return(0.5f*(2.0f+x*x*(-5.0f+3.0f*x))); in filter_catmullrom()
406 if (x < 2.0) in filter_catmullrom()
407 return(0.5f*(4.0f+x*(-8.0f+x*(5.0f-x)))); in filter_catmullrom()
423 const double x = x1 < 0.0 ? -x1 : x1; in filter_lanczos8() local
426 if ( x == 0.0) return 1; in filter_lanczos8()
428 if ( x < R) { in filter_lanczos8()
429 return R * sin(x*M_PI) * sin(x * M_PI/ R) / (x * M_PI * x * M_PI); in filter_lanczos8()
439 const double x = x1 < 0.0 ? -x1 : x1; in filter_lanczos3() local
442 if ( x == 0.0) return 1; in filter_lanczos3()
444 if ( x < R) in filter_lanczos3()
446 return R * sin(x*M_PI) * sin(x * M_PI / R) / (x * M_PI * x * M_PI); in filter_lanczos3()
455 const double x = x1 < 0.0 ? -x1 : x1; in filter_hermite() local
457 if (x < 1.0) return ((2.0 * x - 3) * x * x + 1.0 ); in filter_hermite()
465 const double x = x1 < 0.0 ? -x1 : x1; in filter_triangle() local
466 if (x < 1.0) return (1.0 - x); in filter_triangle()
473 const double x = x1 < 0.0 ? -x1 : x1; in filter_bell() local
475 if (x < 0.5) return (0.75 - x*x); in filter_bell()
476 if (x < 1.5) return (0.5 * pow(x - 1.5, 2.0)); in filter_bell()
481 static double filter_mitchell(const double x) in filter_mitchell() argument
493 if (x < -2.0) in filter_mitchell()
495 if (x < -1.0) in filter_mitchell()
496 return(KM_Q0-x*(KM_Q1-x*(KM_Q2-x*KM_Q3))); in filter_mitchell()
497 if (x < 0.0f) in filter_mitchell()
498 return(KM_P0+x*x*(KM_P2-x*KM_P3)); in filter_mitchell()
499 if (x < 1.0f) in filter_mitchell()
500 return(KM_P0+x*x*(KM_P2+x*KM_P3)); in filter_mitchell()
501 if (x < 2.0f) in filter_mitchell()
502 return(KM_Q0+x*(KM_Q1+x*(KM_Q2+x*KM_Q3))); in filter_mitchell()
509 static double filter_cosine(const double x) in filter_cosine() argument
511 if ((x >= -1.0) && (x <= 1.0)) return ((cos(x * M_PI) + 1.0)/2.0); in filter_cosine()
519 const double x = x1 < 0.0 ? -x1 : x1; in filter_quadratic() local
521 if (x <= 0.5) return (- 2.0 * x * x + 1); in filter_quadratic()
522 if (x <= 1.5) return (x * x - 2.5* x + 1.5); in filter_quadratic()
526 static double filter_bspline(const double x) in filter_bspline() argument
528 if (x>2.0f) { in filter_bspline()
533 const double xm1 = x - 1.0f; in filter_bspline()
534 const double xp1 = x + 1.0f; in filter_bspline()
535 const double xp2 = x + 2.0f; in filter_bspline()
539 if (x <= 0) c = 0.0f; else c = x*x*x; in filter_bspline()
549 const double x = x1 < 0.0 ? -x1 : x1; in filter_quadratic_bspline() local
551 if (x <= 0.5) return (- x * x + 0.75); in filter_quadratic_bspline()
552 if (x <= 1.5) return (0.5 * x * x - 1.5 * x + 1.125); in filter_quadratic_bspline()
556 static double filter_gaussian(const double x) in filter_gaussian() argument
559 return (double)(exp(-2.0f * x * x) * 0.79788456080287f); in filter_gaussian()
562 static double filter_hanning(const double x) in filter_hanning() argument
565 return(0.5 + 0.5 * cos(M_PI * x)); in filter_hanning()
568 static double filter_hamming(const double x) in filter_hamming() argument
573 if (x < -1.0f) in filter_hamming()
575 if (x < 0.0f) in filter_hamming()
576 return 0.92f*(-2.0f*x-3.0f)*x*x+1.0f; in filter_hamming()
577 if (x < 1.0f) in filter_hamming()
578 return 0.92f*(2.0f*x-3.0f)*x*x+1.0f; in filter_hamming()
582 static double filter_power(const double x) in filter_power() argument
585 if (fabs(x)>1) return 0.0f; in filter_power()
586 return (1.0f - (double)fabs(pow(x,a))); in filter_power()
589 static double filter_sinc(const double x) in filter_sinc() argument
592 if (x == 0.0) return(1.0); in filter_sinc()
593 return (sin(M_PI * (double) x) / (M_PI * (double) x)); in filter_sinc()
596 static double filter_welsh(const double x) in filter_welsh() argument
599 if (x < 1.0) in filter_welsh()
600 return(1 - x*x); in filter_welsh()
638 static inline int _setEdgePixel(const gdImagePtr src, unsigned int x, unsigned int y, gdFixed cover… in _setEdgePixel() argument
641 register int c = src->tpixels[y][x]; in _setEdgePixel()
646 static inline int getPixelOverflowTC(gdImagePtr im, const int x, const int y, const int bgColor) in getPixelOverflowTC() argument
648 if (gdImageBoundsSafe(im, x, y)) { in getPixelOverflowTC()
649 const int c = im->tpixels[y][x]; in getPixelOverflowTC()
668 if (x >= im->cx1 && x <= im->cx1) { in getPixelOverflowTC()
669 border = im->tpixels[im->cy2][x]; in getPixelOverflowTC()
677 if (x < im->cx1) { in getPixelOverflowTC()
682 if (x > im->cx2) { in getPixelOverflowTC()
697 static inline int getPixelOverflowPalette(gdImagePtr im, const int x, const int y, const int bgColo… in getPixelOverflowPalette() argument
699 if (gdImageBoundsSafe(im, x, y)) { in getPixelOverflowPalette()
700 const int c = im->pixels[y][x]; in getPixelOverflowPalette()
718 if (x >= im->cx1 && x <= im->cx1) { in getPixelOverflowPalette()
719 border = gdImageGetPixel(im, x, im->cy2); in getPixelOverflowPalette()
727 if (x < im->cx1) { in getPixelOverflowPalette()
732 if (x > im->cx2) { in getPixelOverflowPalette()
745 static int getPixelInterpolateWeight(gdImagePtr im, const double x, const double y, const int bgCol… in getPixelInterpolateWeight() argument
748 int sx = (int)(x); in getPixelInterpolateWeight()
750 const double xf = x - (double)sx; in getPixelInterpolateWeight()
766 if (x < 0) sx--; in getPixelInterpolateWeight()
806 int getPixelInterpolated(gdImagePtr im, const double x, const double y, const int bgColor) in getPixelInterpolated() argument
808 const int xi=(int)((x) < 0 ? x - 1: x); in getPixelInterpolated()
822 return getPixelInterpolateWeight(im, x, y, bgColor); in getPixelInterpolated()
834 kernel_x[i] = (double) im->interpolation((double)(xi+i-1-x)); in getPixelInterpolated()
994 unsigned int x; in _gdScaleRow() local
996 for (x = 0; x < dst_width - 1; x++) { in _gdScaleRow()
998 const int left = contrib->ContribRow[x].Left; in _gdScaleRow()
999 const int right = contrib->ContribRow[x].Right; in _gdScaleRow()
1005 …r += (unsigned char)(contrib->ContribRow[x].Weights[left_channel] * (double)(gdTrueColorGetRed(p_s… in _gdScaleRow()
1006 …g += (unsigned char)(contrib->ContribRow[x].Weights[left_channel] * (double)(gdTrueColorGetGreen(p… in _gdScaleRow()
1007 …b += (unsigned char)(contrib->ContribRow[x].Weights[left_channel] * (double)(gdTrueColorGetBlue(p_… in _gdScaleRow()
1008 …a += (unsigned char)(contrib->ContribRow[x].Weights[left_channel] * (double)(gdTrueColorGetAlpha(p… in _gdScaleRow()
1010 p_dst_row[x] = gdTrueColorAlpha(r, g, b, a); in _gdScaleRow()
1200 static inline int getPixelOverflowColorTC(gdImagePtr im, const int x, const int y, const int color) in getPixelOverflowColorTC() argument
1202 if (gdImageBoundsSafe(im, x, y)) { in getPixelOverflowColorTC()
1203 const int c = im->tpixels[y][x]; in getPixelOverflowColorTC()
1221 if (x >= im->cx1 && x <= im->cx1) { in getPixelOverflowColorTC()
1222 border = im->tpixels[im->cy2][x]; in getPixelOverflowColorTC()
1230 if (x < im->cx1) { in getPixelOverflowColorTC()
1235 if (x > im->cx2) { in getPixelOverflowColorTC()
2275 x1 = r->x + r->width - 1; in gdImageClipRectangle()
2277 r->x = CLAMP(r->x, c1x, c2x); in gdImageClipRectangle()
2279 r->width = CLAMP(x1, c1x, c2x) - r->x + 1; in gdImageClipRectangle()
2285 printf("%s (%i, %i) (%i, %i)\n", msg, r->x, r->y, r->width, r->height); in gdDumpRect()
2315 area_full.x = 0; in gdTransformAffineGetImage()
2335 gdAffineTranslate(m, -bbox.x, -bbox.y); in gdTransformAffineGetImage()
2379 register int x, y, src_offset_x, src_offset_y; in gdTransformAffineCopy() local
2399 if (src_region->x > 0 || src_region->y > 0 in gdTransformAffineCopy()
2407 gdImageSetClip(src, src_region->x, src_region->y, in gdTransformAffineCopy()
2408 src_region->x + src_region->width - 1, in gdTransformAffineCopy()
2423 end_x = bbox.width + (int) fabs(bbox.x); in gdTransformAffineCopy()
2429 src_offset_x = src_region->x; in gdTransformAffineCopy()
2435 for (x = 0; x <= end_x; x++) { in gdTransformAffineCopy()
2436 pt.x = x + 0.5; in gdTransformAffineCopy()
2438 …gdImageSetPixel(dst, dst_x + x, dst_y + y, getPixelInterpolated(src, src_offset_x + src_pt.x, src_… in gdTransformAffineCopy()
2449 for (x = 0; x <= end_x; x++) { in gdTransformAffineCopy()
2450 pt.x = x + 0.5 + bbox.x; in gdTransformAffineCopy()
2453 if ((dst_x + x) < 0 || (dst_x + x) > (gdImageSX(dst) - 1)) { in gdTransformAffineCopy()
2456 *(dst_p++) = getPixelInterpolated(src, src_offset_x + src_pt.x, src_offset_y + src_pt.y, -1); in gdTransformAffineCopy()
2489 extent[0].x=0.0; in gdTransformAffineBoundingBox()
2491 extent[1].x=(double) src->width; in gdTransformAffineBoundingBox()
2493 extent[2].x=(double) src->width; in gdTransformAffineBoundingBox()
2495 extent[3].x=0.0; in gdTransformAffineBoundingBox()
2508 if (min.x > extent[i].x) in gdTransformAffineBoundingBox()
2509 min.x=extent[i].x; in gdTransformAffineBoundingBox()
2512 if (max.x < extent[i].x) in gdTransformAffineBoundingBox()
2513 max.x=extent[i].x; in gdTransformAffineBoundingBox()
2517 bbox->x = (int) min.x; in gdTransformAffineBoundingBox()
2519 bbox->width = (int) floor(max.x - min.x) - 1; in gdTransformAffineBoundingBox()