Lines Matching refs:x

75 #  define floorf(x) ((float)(floor(x)))  argument
88 #define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x))) argument
94 #define gd_itofx(x) (long)((unsigned long)(x) << 8) argument
97 #define gd_ftofx(x) (long)((x) * 256) argument
100 #define gd_dtofx(x) (long)((x) * 256) argument
103 #define gd_fxtoi(x) ((x) >> 8) argument
106 # define gd_fxtof(x) ((float)(x) / 256) argument
109 #define gd_fxtod(x) ((double)(x) / 256) argument
112 #define gd_mulfx(x,y) (((x) * (y)) >> 8) argument
115 #define gd_divfx(x,y) ((long)((unsigned long)(x) << 8) / (y)) argument
183 static double KernelBessel_J1(const double x) in KernelBessel_J1() argument
219 p = p*x*x+Pone[i]; in KernelBessel_J1()
220 q = q*x*x+Qone[i]; in KernelBessel_J1()
225 static double KernelBessel_P1(const double x) in KernelBessel_P1() argument
255 p = p*(8.0/x)*(8.0/x)+Pone[i]; in KernelBessel_P1()
256 q = q*(8.0/x)*(8.0/x)+Qone[i]; in KernelBessel_P1()
261 static double KernelBessel_Q1(const double x) in KernelBessel_Q1() argument
291 p = p*(8.0/x)*(8.0/x)+Pone[i]; in KernelBessel_Q1()
292 q = q*(8.0/x)*(8.0/x)+Qone[i]; in KernelBessel_Q1()
297 static double KernelBessel_Order1(double x) in KernelBessel_Order1() argument
301 if (x == 0.0) in KernelBessel_Order1()
303 p = x; in KernelBessel_Order1()
304 if (x < 0.0) in KernelBessel_Order1()
305 x=(-x); in KernelBessel_Order1()
306 if (x < 8.0) in KernelBessel_Order1()
307 return (p*KernelBessel_J1(x)); in KernelBessel_Order1()
308 …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()
309 (-1.0f/sqrt(2.0f)*(sin(x)+cos(x)))); in KernelBessel_Order1()
315 static double filter_bessel(const double x) in filter_bessel() argument
317 if (x == 0.0f) in filter_bessel()
319 return (KernelBessel_Order1((double)M_PI*x)/(2.0f*x)); in filter_bessel()
323 static double filter_blackman(const double x) in filter_blackman() argument
325 return (0.42f+0.5f*(double)cos(M_PI*x)+0.08f*(double)cos(2.0f*M_PI*x)); in filter_blackman()
373 const double x = x1 < 0.0 ? -x1 : x1; in filter_cubic_spline() local
375 if (x < 1.0 ) { in filter_cubic_spline()
376 const double x2 = x*x; in filter_cubic_spline()
378 return (0.5 * x2 * x - x2 + 2.0 / 3.0); in filter_cubic_spline()
380 if (x < 2.0) { in filter_cubic_spline()
381 return (pow(2.0 - x, 3.0)/6.0); in filter_cubic_spline()
391 const double x = x1 < 0.0 ? -x1 : x1; in filter_cubic_convolution() local
393 const double x2_x = x2 * x; in filter_cubic_convolution()
395 if (x <= 1.0) return ((4.0 / 3.0)* x2_x - (7.0 / 3.0) * x2 + 1.0); in filter_cubic_convolution()
396 if (x <= 2.0) return (- (7.0 / 12.0) * x2_x + 3 * x2 - (59.0 / 12.0) * x + 2.5); in filter_cubic_convolution()
397 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()
402 static double filter_box(double x) { in filter_box() argument
403 if (x < - DEFAULT_FILTER_BOX) in filter_box()
405 if (x < DEFAULT_FILTER_BOX) in filter_box()
410 static double filter_catmullrom(const double x) in filter_catmullrom() argument
412 if (x < -2.0) in filter_catmullrom()
414 if (x < -1.0) in filter_catmullrom()
415 return(0.5f*(4.0f+x*(8.0f+x*(5.0f+x)))); in filter_catmullrom()
416 if (x < 0.0) in filter_catmullrom()
417 return(0.5f*(2.0f+x*x*(-5.0f-3.0f*x))); in filter_catmullrom()
418 if (x < 1.0) in filter_catmullrom()
419 return(0.5f*(2.0f+x*x*(-5.0f+3.0f*x))); in filter_catmullrom()
420 if (x < 2.0) in filter_catmullrom()
421 return(0.5f*(4.0f+x*(-8.0f+x*(5.0f-x)))); in filter_catmullrom()
439 const double x = x1 < 0.0 ? -x1 : x1; in filter_lanczos8() local
442 if ( x == 0.0) return 1; in filter_lanczos8()
444 if ( x < R) { in filter_lanczos8()
445 return R * sin(x*M_PI) * sin(x * M_PI/ R) / (x * M_PI * x * M_PI); in filter_lanczos8()
456 const double x = x1 < 0.0 ? -x1 : x1; in filter_lanczos3() local
459 if ( x == 0.0) return 1; in filter_lanczos3()
461 if ( x < R) in filter_lanczos3()
463 return R * sin(x*M_PI) * sin(x * M_PI / R) / (x * M_PI * x * M_PI); in filter_lanczos3()
473 const double x = x1 < 0.0 ? -x1 : x1; in filter_hermite() local
475 if (x < 1.0) return ((2.0 * x - 3) * x * x + 1.0 ); in filter_hermite()
483 const double x = x1 < 0.0 ? -x1 : x1; in filter_triangle() local
484 if (x < 1.0) return (1.0 - x); in filter_triangle()
491 const double x = x1 < 0.0 ? -x1 : x1; in filter_bell() local
493 if (x < 0.5) return (0.75 - x*x); in filter_bell()
494 if (x < 1.5) return (0.5 * pow(x - 1.5, 2.0)); in filter_bell()
499 static double filter_mitchell(const double x) in filter_mitchell() argument
511 if (x < -2.0) in filter_mitchell()
513 if (x < -1.0) in filter_mitchell()
514 return(KM_Q0-x*(KM_Q1-x*(KM_Q2-x*KM_Q3))); in filter_mitchell()
515 if (x < 0.0f) in filter_mitchell()
516 return(KM_P0+x*x*(KM_P2-x*KM_P3)); in filter_mitchell()
517 if (x < 1.0f) in filter_mitchell()
518 return(KM_P0+x*x*(KM_P2+x*KM_P3)); in filter_mitchell()
519 if (x < 2.0f) in filter_mitchell()
520 return(KM_Q0+x*(KM_Q1+x*(KM_Q2+x*KM_Q3))); in filter_mitchell()
528 static double filter_cosine(const double x) in filter_cosine() argument
530 if ((x >= -1.0) && (x <= 1.0)) return ((cos(x * M_PI) + 1.0)/2.0); in filter_cosine()
539 const double x = x1 < 0.0 ? -x1 : x1; in filter_quadratic() local
541 if (x <= 0.5) return (- 2.0 * x * x + 1); in filter_quadratic()
542 if (x <= 1.5) return (x * x - 2.5* x + 1.5); in filter_quadratic()
546 static double filter_bspline(const double x) in filter_bspline() argument
548 if (x>2.0f) { in filter_bspline()
553 const double xm1 = x - 1.0f; in filter_bspline()
554 const double xp1 = x + 1.0f; in filter_bspline()
555 const double xp2 = x + 2.0f; in filter_bspline()
559 if (x <= 0) c = 0.0f; else c = x*x*x; in filter_bspline()
570 const double x = x1 < 0.0 ? -x1 : x1; in filter_quadratic_bspline() local
572 if (x <= 0.5) return (- x * x + 0.75); in filter_quadratic_bspline()
573 if (x <= 1.5) return (0.5 * x * x - 1.5 * x + 1.125); in filter_quadratic_bspline()
578 static double filter_gaussian(const double x) in filter_gaussian() argument
581 return (double)(exp(-2.0f * x * x) * 0.79788456080287f); in filter_gaussian()
584 static double filter_hanning(const double x) in filter_hanning() argument
587 return(0.5 + 0.5 * cos(M_PI * x)); in filter_hanning()
590 static double filter_hamming(const double x) in filter_hamming() argument
595 if (x < -1.0f) in filter_hamming()
597 if (x < 0.0f) in filter_hamming()
598 return 0.92f*(-2.0f*x-3.0f)*x*x+1.0f; in filter_hamming()
599 if (x < 1.0f) in filter_hamming()
600 return 0.92f*(2.0f*x-3.0f)*x*x+1.0f; in filter_hamming()
604 static double filter_power(const double x) in filter_power() argument
607 if (fabs(x)>1) return 0.0f; in filter_power()
608 return (1.0f - (double)fabs(pow(x,a))); in filter_power()
611 static double filter_sinc(const double x) in filter_sinc() argument
614 if (x == 0.0) return(1.0); in filter_sinc()
615 return (sin(M_PI * (double) x) / (M_PI * (double) x)); in filter_sinc()
619 static double filter_welsh(const double x) in filter_welsh() argument
622 if (x < 1.0) in filter_welsh()
623 return(1 - x*x); in filter_welsh()
661 static inline int getPixelOverflowTC(gdImagePtr im, const int x, const int y, const int bgColor) in getPixelOverflowTC() argument
663 if (gdImageBoundsSafe(im, x, y)) { in getPixelOverflowTC()
664 const int c = im->tpixels[y][x]; in getPixelOverflowTC()
676 static inline int getPixelOverflowPalette(gdImagePtr im, const int x, const int y, const int bgColo… in getPixelOverflowPalette() argument
678 if (gdImageBoundsSafe(im, x, y)) { in getPixelOverflowPalette()
679 const int c = im->pixels[y][x]; in getPixelOverflowPalette()
689 static int getPixelInterpolateWeight(gdImagePtr im, const double x, const double y, const int bgCol… in getPixelInterpolateWeight() argument
692 int sx = (int)(x); in getPixelInterpolateWeight()
694 const double xf = x - (double)sx; in getPixelInterpolateWeight()
710 if (x < 0) sx--; in getPixelInterpolateWeight()
750 int getPixelInterpolated(gdImagePtr im, const double x, const double y, const int bgColor) in getPixelInterpolated() argument
752 const int xi=(int)((x) < 0 ? x - 1: x); in getPixelInterpolated()
766 return getPixelInterpolateWeight(im, x, y, bgColor); in getPixelInterpolated()
778 kernel_x[i] = (double) im->interpolation((double)(xi+i-1-x)); in getPixelInterpolated()
937 unsigned int x; in _gdScaleRow() local
939 for (x = 0; x < dst_width; x++) { in _gdScaleRow()
941 const int left = contrib->ContribRow[x].Left; in _gdScaleRow()
942 const int right = contrib->ContribRow[x].Right; in _gdScaleRow()
948 …r += (unsigned char)(contrib->ContribRow[x].Weights[left_channel] * (double)(gdTrueColorGetRed(p_s… in _gdScaleRow()
949 …g += (unsigned char)(contrib->ContribRow[x].Weights[left_channel] * (double)(gdTrueColorGetGreen(p… in _gdScaleRow()
950 …b += (unsigned char)(contrib->ContribRow[x].Weights[left_channel] * (double)(gdTrueColorGetBlue(p_… in _gdScaleRow()
951 …a += (unsigned char)(contrib->ContribRow[x].Weights[left_channel] * (double)(gdTrueColorGetAlpha(p… in _gdScaleRow()
953 p_dst_row[x] = gdTrueColorAlpha(r, g, b, a); in _gdScaleRow()
1601 src_area.x = 0; in gdRotatedImageSize()
2199 x1 = r->x + r->width - 1; in gdImageClipRectangle()
2201 r->x = CLAMP(r->x, c1x, c2x); in gdImageClipRectangle()
2203 r->width = CLAMP(x1, c1x, c2x) - r->x + 1; in gdImageClipRectangle()
2209 printf("%s (%i, %i) (%i, %i)\n", msg, r->x, r->y, r->width, r->height); in gdDumpRect()
2239 area_full.x = 0; in gdTransformAffineGetImage()
2259 gdAffineTranslate(m, -bbox.x, -bbox.y); in gdTransformAffineGetImage()
2303 register int x, y, src_offset_x, src_offset_y; in gdTransformAffineCopy() local
2321 if (src_region->x > 0 || src_region->y > 0 in gdTransformAffineCopy()
2329 gdImageSetClip(src, src_region->x, src_region->y, in gdTransformAffineCopy()
2330 src_region->x + src_region->width - 1, in gdTransformAffineCopy()
2345 end_x = bbox.width + abs(bbox.x); in gdTransformAffineCopy()
2354 src_offset_x = src_region->x; in gdTransformAffineCopy()
2360 for (x = 0; x <= end_x; x++) { in gdTransformAffineCopy()
2361 pt.x = x + 0.5; in gdTransformAffineCopy()
2363 …gdImageSetPixel(dst, dst_x + x, dst_y + y, getPixelInterpolated(src, src_offset_x + src_pt.x, src_… in gdTransformAffineCopy()
2374 for (x = 0; x <= end_x; x++) { in gdTransformAffineCopy()
2375 pt.x = x + 0.5 + bbox.x; in gdTransformAffineCopy()
2378 if ((dst_x + x) < 0 || (dst_x + x) > (gdImageSX(dst) - 1)) { in gdTransformAffineCopy()
2381 *(dst_p++) = getPixelInterpolated(src, src_offset_x + src_pt.x, src_offset_y + src_pt.y, -1); in gdTransformAffineCopy()
2414 extent[0].x=0.0; in gdTransformAffineBoundingBox()
2416 extent[1].x=(double) src->width; in gdTransformAffineBoundingBox()
2418 extent[2].x=(double) src->width; in gdTransformAffineBoundingBox()
2420 extent[3].x=0.0; in gdTransformAffineBoundingBox()
2433 if (min.x > extent[i].x) in gdTransformAffineBoundingBox()
2434 min.x=extent[i].x; in gdTransformAffineBoundingBox()
2437 if (max.x < extent[i].x) in gdTransformAffineBoundingBox()
2438 max.x=extent[i].x; in gdTransformAffineBoundingBox()
2442 bbox->x = (int) min.x; in gdTransformAffineBoundingBox()
2444 bbox->width = (int) floor(max.x - min.x) - 1; in gdTransformAffineBoundingBox()