Lines Matching refs:x

76 #define CLAMP(x, low, high)  (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))  argument
82 #define gd_itofx(x) ((x) << 8) argument
85 #define gd_ftofx(x) (long)((x) * 256) argument
88 #define gd_dtofx(x) (long)((x) * 256) argument
91 #define gd_fxtoi(x) ((x) >> 8) argument
94 # define gd_fxtof(x) ((float)(x) / 256) argument
97 #define gd_fxtod(x) ((double)(x) / 256) argument
100 #define gd_mulfx(x,y) (((x) * (y)) >> 8) argument
103 #define gd_divfx(x,y) (((x) << 8) / (y)) argument
171 static double KernelBessel_J1(const double x) in KernelBessel_J1() argument
207 p = p*x*x+Pone[i]; in KernelBessel_J1()
208 q = q*x*x+Qone[i]; in KernelBessel_J1()
213 static double KernelBessel_P1(const double x) in KernelBessel_P1() argument
243 p = p*(8.0/x)*(8.0/x)+Pone[i]; in KernelBessel_P1()
244 q = q*(8.0/x)*(8.0/x)+Qone[i]; in KernelBessel_P1()
249 static double KernelBessel_Q1(const double x) in KernelBessel_Q1() argument
279 p = p*(8.0/x)*(8.0/x)+Pone[i]; in KernelBessel_Q1()
280 q = q*(8.0/x)*(8.0/x)+Qone[i]; in KernelBessel_Q1()
285 static double KernelBessel_Order1(double x) in KernelBessel_Order1() argument
289 if (x == 0.0) in KernelBessel_Order1()
291 p = x; in KernelBessel_Order1()
292 if (x < 0.0) in KernelBessel_Order1()
293 x=(-x); in KernelBessel_Order1()
294 if (x < 8.0) in KernelBessel_Order1()
295 return (p*KernelBessel_J1(x)); in KernelBessel_Order1()
296 …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()
297 (-1.0f/sqrt(2.0f)*(sin(x)+cos(x)))); in KernelBessel_Order1()
303 static double filter_bessel(const double x) in filter_bessel() argument
305 if (x == 0.0f) in filter_bessel()
307 return (KernelBessel_Order1((double)M_PI*x)/(2.0f*x)); in filter_bessel()
311 static double filter_blackman(const double x) in filter_blackman() argument
313 return (0.42f+0.5f*(double)cos(M_PI*x)+0.08f*(double)cos(2.0f*M_PI*x)); in filter_blackman()
360 const double x = x1 < 0.0 ? -x1 : x1; in filter_cubic_spline() local
362 if (x < 1.0 ) { in filter_cubic_spline()
363 const double x2 = x*x; in filter_cubic_spline()
365 return (0.5 * x2 * x - x2 + 2.0 / 3.0); in filter_cubic_spline()
367 if (x < 2.0) { in filter_cubic_spline()
368 return (pow(2.0 - x, 3.0)/6.0); in filter_cubic_spline()
376 const double x = x1 < 0.0 ? -x1 : x1; in filter_cubic_convolution() local
378 const double x2_x = x2 * x; in filter_cubic_convolution()
380 if (x <= 1.0) return ((4.0 / 3.0)* x2_x - (7.0 / 3.0) * x2 + 1.0); in filter_cubic_convolution()
381 if (x <= 2.0) return (- (7.0 / 12.0) * x2_x + 3 * x2 - (59.0 / 12.0) * x + 2.5); in filter_cubic_convolution()
382 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()
386 static double filter_box(double x) { in filter_box() argument
387 if (x < - DEFAULT_FILTER_BOX) in filter_box()
389 if (x < DEFAULT_FILTER_BOX) in filter_box()
394 static double filter_catmullrom(const double x) in filter_catmullrom() argument
396 if (x < -2.0) in filter_catmullrom()
398 if (x < -1.0) in filter_catmullrom()
399 return(0.5f*(4.0f+x*(8.0f+x*(5.0f+x)))); in filter_catmullrom()
400 if (x < 0.0) in filter_catmullrom()
401 return(0.5f*(2.0f+x*x*(-5.0f-3.0f*x))); in filter_catmullrom()
402 if (x < 1.0) in filter_catmullrom()
403 return(0.5f*(2.0f+x*x*(-5.0f+3.0f*x))); in filter_catmullrom()
404 if (x < 2.0) in filter_catmullrom()
405 return(0.5f*(4.0f+x*(-8.0f+x*(5.0f-x)))); in filter_catmullrom()
421 const double x = x1 < 0.0 ? -x1 : x1; in filter_lanczos8() local
424 if ( x == 0.0) return 1; in filter_lanczos8()
426 if ( x < R) { in filter_lanczos8()
427 return R * sin(x*M_PI) * sin(x * M_PI/ R) / (x * M_PI * x * M_PI); in filter_lanczos8()
437 const double x = x1 < 0.0 ? -x1 : x1; in filter_lanczos3() local
440 if ( x == 0.0) return 1; in filter_lanczos3()
442 if ( x < R) in filter_lanczos3()
444 return R * sin(x*M_PI) * sin(x * M_PI / R) / (x * M_PI * x * M_PI); in filter_lanczos3()
453 const double x = x1 < 0.0 ? -x1 : x1; in filter_hermite() local
455 if (x < 1.0) return ((2.0 * x - 3) * x * x + 1.0 ); in filter_hermite()
463 const double x = x1 < 0.0 ? -x1 : x1; in filter_triangle() local
464 if (x < 1.0) return (1.0 - x); in filter_triangle()
471 const double x = x1 < 0.0 ? -x1 : x1; in filter_bell() local
473 if (x < 0.5) return (0.75 - x*x); in filter_bell()
474 if (x < 1.5) return (0.5 * pow(x - 1.5, 2.0)); in filter_bell()
479 static double filter_mitchell(const double x) in filter_mitchell() argument
491 if (x < -2.0) in filter_mitchell()
493 if (x < -1.0) in filter_mitchell()
494 return(KM_Q0-x*(KM_Q1-x*(KM_Q2-x*KM_Q3))); in filter_mitchell()
495 if (x < 0.0f) in filter_mitchell()
496 return(KM_P0+x*x*(KM_P2-x*KM_P3)); in filter_mitchell()
497 if (x < 1.0f) in filter_mitchell()
498 return(KM_P0+x*x*(KM_P2+x*KM_P3)); in filter_mitchell()
499 if (x < 2.0f) in filter_mitchell()
500 return(KM_Q0+x*(KM_Q1+x*(KM_Q2+x*KM_Q3))); in filter_mitchell()
507 static double filter_cosine(const double x) in filter_cosine() argument
509 if ((x >= -1.0) && (x <= 1.0)) return ((cos(x * M_PI) + 1.0)/2.0); in filter_cosine()
517 const double x = x1 < 0.0 ? -x1 : x1; in filter_quadratic() local
519 if (x <= 0.5) return (- 2.0 * x * x + 1); in filter_quadratic()
520 if (x <= 1.5) return (x * x - 2.5* x + 1.5); in filter_quadratic()
524 static double filter_bspline(const double x) in filter_bspline() argument
526 if (x>2.0f) { in filter_bspline()
531 const double xm1 = x - 1.0f; in filter_bspline()
532 const double xp1 = x + 1.0f; in filter_bspline()
533 const double xp2 = x + 2.0f; in filter_bspline()
537 if (x <= 0) c = 0.0f; else c = x*x*x; in filter_bspline()
547 const double x = x1 < 0.0 ? -x1 : x1; in filter_quadratic_bspline() local
549 if (x <= 0.5) return (- x * x + 0.75); in filter_quadratic_bspline()
550 if (x <= 1.5) return (0.5 * x * x - 1.5 * x + 1.125); in filter_quadratic_bspline()
554 static double filter_gaussian(const double x) in filter_gaussian() argument
557 return (double)(exp(-2.0f * x * x) * 0.79788456080287f); in filter_gaussian()
560 static double filter_hanning(const double x) in filter_hanning() argument
563 return(0.5 + 0.5 * cos(M_PI * x)); in filter_hanning()
566 static double filter_hamming(const double x) in filter_hamming() argument
571 if (x < -1.0f) in filter_hamming()
573 if (x < 0.0f) in filter_hamming()
574 return 0.92f*(-2.0f*x-3.0f)*x*x+1.0f; in filter_hamming()
575 if (x < 1.0f) in filter_hamming()
576 return 0.92f*(2.0f*x-3.0f)*x*x+1.0f; in filter_hamming()
580 static double filter_power(const double x) in filter_power() argument
583 if (fabs(x)>1) return 0.0f; in filter_power()
584 return (1.0f - (double)fabs(pow(x,a))); in filter_power()
587 static double filter_sinc(const double x) in filter_sinc() argument
590 if (x == 0.0) return(1.0); in filter_sinc()
591 return (sin(M_PI * (double) x) / (M_PI * (double) x)); in filter_sinc()
594 static double filter_welsh(const double x) in filter_welsh() argument
597 if (x < 1.0) in filter_welsh()
598 return(1 - x*x); in filter_welsh()
636 static inline int _setEdgePixel(const gdImagePtr src, unsigned int x, unsigned int y, gdFixed cover… in _setEdgePixel() argument
639 register int c = src->tpixels[y][x]; in _setEdgePixel()
644 static inline int getPixelOverflowTC(gdImagePtr im, const int x, const int y, const int bgColor) in getPixelOverflowTC() argument
646 if (gdImageBoundsSafe(im, x, y)) { in getPixelOverflowTC()
647 const int c = im->tpixels[y][x]; in getPixelOverflowTC()
666 if (x >= im->cx1 && x <= im->cx1) { in getPixelOverflowTC()
667 border = im->tpixels[im->cy2][x]; in getPixelOverflowTC()
675 if (x < im->cx1) { in getPixelOverflowTC()
680 if (x > im->cx2) { in getPixelOverflowTC()
695 static inline int getPixelOverflowPalette(gdImagePtr im, const int x, const int y, const int bgColo… in getPixelOverflowPalette() argument
697 if (gdImageBoundsSafe(im, x, y)) { in getPixelOverflowPalette()
698 const int c = im->pixels[y][x]; in getPixelOverflowPalette()
716 if (x >= im->cx1 && x <= im->cx1) { in getPixelOverflowPalette()
717 border = gdImageGetPixel(im, x, im->cy2); in getPixelOverflowPalette()
725 if (x < im->cx1) { in getPixelOverflowPalette()
730 if (x > im->cx2) { in getPixelOverflowPalette()
743 static int getPixelInterpolateWeight(gdImagePtr im, const double x, const double y, const int bgCol… in getPixelInterpolateWeight() argument
746 int sx = (int)(x); in getPixelInterpolateWeight()
748 const double xf = x - (double)sx; in getPixelInterpolateWeight()
764 if (x < 0) sx--; in getPixelInterpolateWeight()
804 int getPixelInterpolated(gdImagePtr im, const double x, const double y, const int bgColor) in getPixelInterpolated() argument
806 const int xi=(int)((x) < 0 ? x - 1: x); in getPixelInterpolated()
824 return getPixelInterpolateWeight(im, x, y, bgColor); in getPixelInterpolated()
836 kernel_x[i] = (double) im->interpolation((double)(xi+i-1-x)); in getPixelInterpolated()
995 unsigned int x; in _gdScaleRow() local
997 for (x = 0; x < dst_width - 1; x++) { in _gdScaleRow()
999 const int left = contrib->ContribRow[x].Left; in _gdScaleRow()
1000 const int right = contrib->ContribRow[x].Right; in _gdScaleRow()
1006 …r += (unsigned char)(contrib->ContribRow[x].Weights[left_channel] * (double)(gdTrueColorGetRed(p_s… in _gdScaleRow()
1007 …g += (unsigned char)(contrib->ContribRow[x].Weights[left_channel] * (double)(gdTrueColorGetGreen(p… in _gdScaleRow()
1008 …b += (unsigned char)(contrib->ContribRow[x].Weights[left_channel] * (double)(gdTrueColorGetBlue(p_… in _gdScaleRow()
1009 …a += (unsigned char)(contrib->ContribRow[x].Weights[left_channel] * (double)(gdTrueColorGetAlpha(p… in _gdScaleRow()
1011 p_dst_row[x] = gdTrueColorAlpha(r, g, b, a); in _gdScaleRow()
1184 static inline int getPixelOverflowColorTC(gdImagePtr im, const int x, const int y, const int color) in getPixelOverflowColorTC() argument
1186 if (gdImageBoundsSafe(im, x, y)) { in getPixelOverflowColorTC()
1187 const int c = im->tpixels[y][x]; in getPixelOverflowColorTC()
1205 if (x >= im->cx1 && x <= im->cx1) { in getPixelOverflowColorTC()
1206 border = im->tpixels[im->cy2][x]; in getPixelOverflowColorTC()
1214 if (x < im->cx1) { in getPixelOverflowColorTC()
1219 if (x > im->cx2) { in getPixelOverflowColorTC()
2251 x1 = r->x + r->width - 1; in gdImageClipRectangle()
2253 r->x = CLAMP(r->x, c1x, c2x); in gdImageClipRectangle()
2255 r->width = CLAMP(x1, c1x, c2x) - r->x + 1; in gdImageClipRectangle()
2261 printf("%s (%i, %i) (%i, %i)\n", msg, r->x, r->y, r->width, r->height); in gdDumpRect()
2291 area_full.x = 0; in gdTransformAffineGetImage()
2311 gdAffineTranslate(m, -bbox.x, -bbox.y); in gdTransformAffineGetImage()
2355 register int x, y, src_offset_x, src_offset_y; in gdTransformAffineCopy() local
2375 if (src_region->x > 0 || src_region->y > 0 in gdTransformAffineCopy()
2383 gdImageSetClip(src, src_region->x, src_region->y, in gdTransformAffineCopy()
2384 src_region->x + src_region->width - 1, in gdTransformAffineCopy()
2399 end_x = bbox.width + (int) fabs(bbox.x); in gdTransformAffineCopy()
2405 src_offset_x = src_region->x; in gdTransformAffineCopy()
2411 for (x = 0; x <= end_x; x++) { in gdTransformAffineCopy()
2412 pt.x = x + 0.5; in gdTransformAffineCopy()
2414 …gdImageSetPixel(dst, dst_x + x, dst_y + y, getPixelInterpolated(src, src_offset_x + src_pt.x, src_… in gdTransformAffineCopy()
2425 for (x = 0; x <= end_x; x++) { in gdTransformAffineCopy()
2426 pt.x = x + 0.5 + bbox.x; in gdTransformAffineCopy()
2429 if ((dst_x + x) < 0 || (dst_x + x) > (gdImageSX(dst) - 1)) { in gdTransformAffineCopy()
2432 *(dst_p++) = getPixelInterpolated(src, src_offset_x + src_pt.x, src_offset_y + src_pt.y, -1); in gdTransformAffineCopy()
2465 extent[0].x=0.0; in gdTransformAffineBoundingBox()
2467 extent[1].x=(double) src->width; in gdTransformAffineBoundingBox()
2469 extent[2].x=(double) src->width; in gdTransformAffineBoundingBox()
2471 extent[3].x=0.0; in gdTransformAffineBoundingBox()
2484 if (min.x > extent[i].x) in gdTransformAffineBoundingBox()
2485 min.x=extent[i].x; in gdTransformAffineBoundingBox()
2488 if (max.x < extent[i].x) in gdTransformAffineBoundingBox()
2489 max.x=extent[i].x; in gdTransformAffineBoundingBox()
2493 bbox->x = (int) min.x; in gdTransformAffineBoundingBox()
2495 bbox->width = (int) floor(max.x - min.x) - 1; in gdTransformAffineBoundingBox()