Lines Matching refs:x

76 #  define floorf(x) ((float)(floor(x)))  argument
93 #define gd_itofx(x) (long)((unsigned long)(x) << 8) argument
96 #define gd_ftofx(x) (long)((x) * 256) argument
99 #define gd_dtofx(x) (long)((x) * 256) argument
102 #define gd_fxtoi(x) ((x) >> 8) argument
105 # define gd_fxtof(x) ((float)(x) / 256) argument
108 #define gd_fxtod(x) ((double)(x) / 256) argument
111 #define gd_mulfx(x,y) (((x) * (y)) >> 8) argument
114 #define gd_divfx(x,y) ((long)((unsigned long)(x) << 8) / (y)) argument
182 static double KernelBessel_J1(const double x) in KernelBessel_J1() argument
218 p = p*x*x+Pone[i]; in KernelBessel_J1()
219 q = q*x*x+Qone[i]; in KernelBessel_J1()
224 static double KernelBessel_P1(const double x) in KernelBessel_P1() argument
254 p = p*(8.0/x)*(8.0/x)+Pone[i]; in KernelBessel_P1()
255 q = q*(8.0/x)*(8.0/x)+Qone[i]; in KernelBessel_P1()
260 static double KernelBessel_Q1(const double x) in KernelBessel_Q1() argument
290 p = p*(8.0/x)*(8.0/x)+Pone[i]; in KernelBessel_Q1()
291 q = q*(8.0/x)*(8.0/x)+Qone[i]; in KernelBessel_Q1()
296 static double KernelBessel_Order1(double x) in KernelBessel_Order1() argument
300 if (x == 0.0) in KernelBessel_Order1()
302 p = x; in KernelBessel_Order1()
303 if (x < 0.0) in KernelBessel_Order1()
304 x=(-x); in KernelBessel_Order1()
305 if (x < 8.0) in KernelBessel_Order1()
306 return (p*KernelBessel_J1(x)); in KernelBessel_Order1()
307 …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()
308 (-1.0f/sqrt(2.0f)*(sin(x)+cos(x)))); in KernelBessel_Order1()
314 static double filter_bessel(const double x) in filter_bessel() argument
316 if (x == 0.0f) in filter_bessel()
318 return (KernelBessel_Order1((double)M_PI*x)/(2.0f*x)); in filter_bessel()
322 static double filter_blackman(const double x) in filter_blackman() argument
324 return (0.42f+0.5f*(double)cos(M_PI*x)+0.08f*(double)cos(2.0f*M_PI*x)); in filter_blackman()
372 const double x = x1 < 0.0 ? -x1 : x1; in filter_cubic_spline() local
374 if (x < 1.0 ) { in filter_cubic_spline()
375 const double x2 = x*x; in filter_cubic_spline()
377 return (0.5 * x2 * x - x2 + 2.0 / 3.0); in filter_cubic_spline()
379 if (x < 2.0) { in filter_cubic_spline()
380 return (pow(2.0 - x, 3.0)/6.0); in filter_cubic_spline()
390 const double x = x1 < 0.0 ? -x1 : x1; in filter_cubic_convolution() local
392 const double x2_x = x2 * x; in filter_cubic_convolution()
394 if (x <= 1.0) return ((4.0 / 3.0)* x2_x - (7.0 / 3.0) * x2 + 1.0); in filter_cubic_convolution()
395 if (x <= 2.0) return (- (7.0 / 12.0) * x2_x + 3 * x2 - (59.0 / 12.0) * x + 2.5); in filter_cubic_convolution()
396 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()
401 static double filter_box(double x) { in filter_box() argument
402 if (x < - DEFAULT_FILTER_BOX) in filter_box()
404 if (x < DEFAULT_FILTER_BOX) in filter_box()
409 static double filter_catmullrom(const double x) in filter_catmullrom() argument
411 if (x < -2.0) in filter_catmullrom()
413 if (x < -1.0) in filter_catmullrom()
414 return(0.5f*(4.0f+x*(8.0f+x*(5.0f+x)))); in filter_catmullrom()
415 if (x < 0.0) in filter_catmullrom()
416 return(0.5f*(2.0f+x*x*(-5.0f-3.0f*x))); in filter_catmullrom()
417 if (x < 1.0) in filter_catmullrom()
418 return(0.5f*(2.0f+x*x*(-5.0f+3.0f*x))); in filter_catmullrom()
419 if (x < 2.0) in filter_catmullrom()
420 return(0.5f*(4.0f+x*(-8.0f+x*(5.0f-x)))); in filter_catmullrom()
438 const double x = x1 < 0.0 ? -x1 : x1; in filter_lanczos8() local
441 if ( x == 0.0) return 1; in filter_lanczos8()
443 if ( x < R) { in filter_lanczos8()
444 return R * sin(x*M_PI) * sin(x * M_PI/ R) / (x * M_PI * x * M_PI); in filter_lanczos8()
455 const double x = x1 < 0.0 ? -x1 : x1; in filter_lanczos3() local
458 if ( x == 0.0) return 1; in filter_lanczos3()
460 if ( x < R) in filter_lanczos3()
462 return R * sin(x*M_PI) * sin(x * M_PI / R) / (x * M_PI * x * M_PI); in filter_lanczos3()
472 const double x = x1 < 0.0 ? -x1 : x1; in filter_hermite() local
474 if (x < 1.0) return ((2.0 * x - 3) * x * x + 1.0 ); in filter_hermite()
482 const double x = x1 < 0.0 ? -x1 : x1; in filter_triangle() local
483 if (x < 1.0) return (1.0 - x); in filter_triangle()
490 const double x = x1 < 0.0 ? -x1 : x1; in filter_bell() local
492 if (x < 0.5) return (0.75 - x*x); in filter_bell()
493 if (x < 1.5) return (0.5 * pow(x - 1.5, 2.0)); in filter_bell()
498 static double filter_mitchell(const double x) in filter_mitchell() argument
510 if (x < -2.0) in filter_mitchell()
512 if (x < -1.0) in filter_mitchell()
513 return(KM_Q0-x*(KM_Q1-x*(KM_Q2-x*KM_Q3))); in filter_mitchell()
514 if (x < 0.0f) in filter_mitchell()
515 return(KM_P0+x*x*(KM_P2-x*KM_P3)); in filter_mitchell()
516 if (x < 1.0f) in filter_mitchell()
517 return(KM_P0+x*x*(KM_P2+x*KM_P3)); in filter_mitchell()
518 if (x < 2.0f) in filter_mitchell()
519 return(KM_Q0+x*(KM_Q1+x*(KM_Q2+x*KM_Q3))); in filter_mitchell()
527 static double filter_cosine(const double x) in filter_cosine() argument
529 if ((x >= -1.0) && (x <= 1.0)) return ((cos(x * M_PI) + 1.0)/2.0); in filter_cosine()
538 const double x = x1 < 0.0 ? -x1 : x1; in filter_quadratic() local
540 if (x <= 0.5) return (- 2.0 * x * x + 1); in filter_quadratic()
541 if (x <= 1.5) return (x * x - 2.5* x + 1.5); in filter_quadratic()
545 static double filter_bspline(const double x) in filter_bspline() argument
547 if (x>2.0f) { in filter_bspline()
552 const double xm1 = x - 1.0f; in filter_bspline()
553 const double xp1 = x + 1.0f; in filter_bspline()
554 const double xp2 = x + 2.0f; in filter_bspline()
558 if (x <= 0) c = 0.0f; else c = x*x*x; in filter_bspline()
569 const double x = x1 < 0.0 ? -x1 : x1; in filter_quadratic_bspline() local
571 if (x <= 0.5) return (- x * x + 0.75); in filter_quadratic_bspline()
572 if (x <= 1.5) return (0.5 * x * x - 1.5 * x + 1.125); in filter_quadratic_bspline()
577 static double filter_gaussian(const double x) in filter_gaussian() argument
580 return (double)(exp(-2.0f * x * x) * 0.79788456080287f); in filter_gaussian()
583 static double filter_hanning(const double x) in filter_hanning() argument
586 return(0.5 + 0.5 * cos(M_PI * x)); in filter_hanning()
589 static double filter_hamming(const double x) in filter_hamming() argument
594 if (x < -1.0f) in filter_hamming()
596 if (x < 0.0f) in filter_hamming()
597 return 0.92f*(-2.0f*x-3.0f)*x*x+1.0f; in filter_hamming()
598 if (x < 1.0f) in filter_hamming()
599 return 0.92f*(2.0f*x-3.0f)*x*x+1.0f; in filter_hamming()
603 static double filter_power(const double x) in filter_power() argument
606 if (fabs(x)>1) return 0.0f; in filter_power()
607 return (1.0f - (double)fabs(pow(x,a))); in filter_power()
610 static double filter_sinc(const double x) in filter_sinc() argument
613 if (x == 0.0) return(1.0); in filter_sinc()
614 return (sin(M_PI * (double) x) / (M_PI * (double) x)); in filter_sinc()
618 static double filter_welsh(const double x) in filter_welsh() argument
621 if (x < 1.0) in filter_welsh()
622 return(1 - x*x); in filter_welsh()
660 static inline int getPixelOverflowTC(gdImagePtr im, const int x, const int y, const int bgColor) in getPixelOverflowTC() argument
662 if (gdImageBoundsSafe(im, x, y)) { in getPixelOverflowTC()
663 const int c = im->tpixels[y][x]; in getPixelOverflowTC()
675 static inline int getPixelOverflowPalette(gdImagePtr im, const int x, const int y, const int bgColo… in getPixelOverflowPalette() argument
677 if (gdImageBoundsSafe(im, x, y)) { in getPixelOverflowPalette()
678 const int c = im->pixels[y][x]; in getPixelOverflowPalette()
688 static int getPixelInterpolateWeight(gdImagePtr im, const double x, const double y, const int bgCol… in getPixelInterpolateWeight() argument
691 int sx = (int)(x); in getPixelInterpolateWeight()
693 const double xf = x - (double)sx; in getPixelInterpolateWeight()
709 if (x < 0) sx--; in getPixelInterpolateWeight()
749 int getPixelInterpolated(gdImagePtr im, const double x, const double y, const int bgColor) in getPixelInterpolated() argument
751 const int xi=(int)((x) < 0 ? x - 1: x); in getPixelInterpolated()
765 return getPixelInterpolateWeight(im, x, y, bgColor); in getPixelInterpolated()
777 kernel_x[i] = (double) im->interpolation((double)(xi+i-1-x)); in getPixelInterpolated()
936 unsigned int x; in _gdScaleRow() local
938 for (x = 0; x < dst_width; x++) { in _gdScaleRow()
940 const int left = contrib->ContribRow[x].Left; in _gdScaleRow()
941 const int right = contrib->ContribRow[x].Right; in _gdScaleRow()
947 …r += (unsigned char)(contrib->ContribRow[x].Weights[left_channel] * (double)(gdTrueColorGetRed(p_s… in _gdScaleRow()
948 …g += (unsigned char)(contrib->ContribRow[x].Weights[left_channel] * (double)(gdTrueColorGetGreen(p… in _gdScaleRow()
949 …b += (unsigned char)(contrib->ContribRow[x].Weights[left_channel] * (double)(gdTrueColorGetBlue(p_… in _gdScaleRow()
950 …a += (unsigned char)(contrib->ContribRow[x].Weights[left_channel] * (double)(gdTrueColorGetAlpha(p… in _gdScaleRow()
952 p_dst_row[x] = gdTrueColorAlpha(r, g, b, a); in _gdScaleRow()
1600 src_area.x = 0; in gdRotatedImageSize()
2198 x1 = r->x + r->width - 1; in gdImageClipRectangle()
2200 r->x = CLAMP(r->x, c1x, c2x); in gdImageClipRectangle()
2202 r->width = CLAMP(x1, c1x, c2x) - r->x + 1; in gdImageClipRectangle()
2208 printf("%s (%i, %i) (%i, %i)\n", msg, r->x, r->y, r->width, r->height); in gdDumpRect()
2238 area_full.x = 0; in gdTransformAffineGetImage()
2258 gdAffineTranslate(m, -bbox.x, -bbox.y); in gdTransformAffineGetImage()
2302 register int x, y, src_offset_x, src_offset_y; in gdTransformAffineCopy() local
2319 if (src_region->x > 0 || src_region->y > 0 in gdTransformAffineCopy()
2327 gdImageSetClip(src, src_region->x, src_region->y, in gdTransformAffineCopy()
2328 src_region->x + src_region->width - 1, in gdTransformAffineCopy()
2343 end_x = bbox.width + abs(bbox.x); in gdTransformAffineCopy()
2352 src_offset_x = src_region->x; in gdTransformAffineCopy()
2358 for (x = 0; x <= end_x; x++) { in gdTransformAffineCopy()
2359 pt.x = x + 0.5; in gdTransformAffineCopy()
2361 …gdImageSetPixel(dst, dst_x + x, dst_y + y, getPixelInterpolated(src, src_offset_x + src_pt.x, src_… in gdTransformAffineCopy()
2379 for (x = 0; x <= end_x; x++) { in gdTransformAffineCopy()
2380 pt.x = x + 0.5 + bbox.x; in gdTransformAffineCopy()
2383 if ((dst_x + x) < 0 || (dst_x + x) > (gdImageSX(dst) - 1)) { in gdTransformAffineCopy()
2387 *(tdst_p++) = getPixelInterpolated(src, src_offset_x + src_pt.x, src_offset_y + src_pt.y, -1); in gdTransformAffineCopy()
2389 *(dst_p++) = getPixelInterpolated(src, src_offset_x + src_pt.x, src_offset_y + src_pt.y, -1); in gdTransformAffineCopy()
2423 extent[0].x=0.0; in gdTransformAffineBoundingBox()
2425 extent[1].x=(double) src->width; in gdTransformAffineBoundingBox()
2427 extent[2].x=(double) src->width; in gdTransformAffineBoundingBox()
2429 extent[3].x=0.0; in gdTransformAffineBoundingBox()
2442 if (min.x > extent[i].x) in gdTransformAffineBoundingBox()
2443 min.x=extent[i].x; in gdTransformAffineBoundingBox()
2446 if (max.x < extent[i].x) in gdTransformAffineBoundingBox()
2447 max.x=extent[i].x; in gdTransformAffineBoundingBox()
2451 bbox->x = (int) min.x; in gdTransformAffineBoundingBox()
2453 bbox->width = (int) floor(max.x - min.x) - 1; in gdTransformAffineBoundingBox()