Skip to content

Commit

Permalink
Remove unused _setEdgePixel() and getPixelOverflowColorTC() functions
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Jun 11, 2019
1 parent 5c844c1 commit e5411e1
Showing 1 changed file with 0 additions and 56 deletions.
56 changes: 0 additions & 56 deletions ext/gd/libgd/gd_interpolation.c
Expand Up @@ -658,14 +658,6 @@ static inline int _color_blend (const int dst, const int src)
}
}

static inline int _setEdgePixel(const gdImagePtr src, unsigned int x, unsigned int y, gdFixed coverage, const int bgColor)
{
const gdFixed f_127 = gd_itofx(127);
register int c = src->tpixels[y][x];
c = c | (( (int) (gd_fxtof(gd_mulfx(coverage, f_127)) + 50.5f)) << 24);
return _color_blend(bgColor, c);
}

static inline int getPixelOverflowTC(gdImagePtr im, const int x, const int y, const int bgColor)
{
if (gdImageBoundsSafe(im, x, y)) {
Expand Down Expand Up @@ -1138,54 +1130,6 @@ gdImagePtr gdImageScaleNearestNeighbour(gdImagePtr im, const unsigned int width,
return dst_img;
}

static inline int getPixelOverflowColorTC(gdImagePtr im, const int x, const int y, const int color)
{
if (gdImageBoundsSafe(im, x, y)) {
const int c = im->tpixels[y][x];
if (c == im->transparent) {
return gdTrueColorAlpha(0, 0, 0, 127);
}
return c;
} else {
register int border = 0;
if (y < im->cy1) {
border = im->tpixels[0][im->cx1];
goto processborder;
}

if (y < im->cy1) {
border = im->tpixels[0][im->cx1];
goto processborder;
}

if (y > im->cy2) {
if (x >= im->cx1 && x <= im->cx1) {
border = im->tpixels[im->cy2][x];
goto processborder;
} else {
return gdTrueColorAlpha(0, 0, 0, 127);
}
}

/* y is bound safe at this point */
if (x < im->cx1) {
border = im->tpixels[y][im->cx1];
goto processborder;
}

if (x > im->cx2) {
border = im->tpixels[y][im->cx2];
}

processborder:
if (border == im->transparent) {
return gdTrueColorAlpha(0, 0, 0, 127);
} else{
return gdTrueColorAlpha(gdTrueColorGetRed(border), gdTrueColorGetGreen(border), gdTrueColorGetBlue(border), 127);
}
}
}

static gdImagePtr gdImageScaleBilinearPalette(gdImagePtr im, const unsigned int new_width, const unsigned int new_height)
{
long _width = MAX(1, new_width);
Expand Down

0 comments on commit e5411e1

Please sign in to comment.