"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/gd_interpolation.c" between
libgd-2.3.0.tar.gz and libgd-2.3.1.tar.gz

About: LibGD is a library for the dynamic creation of images by programmers (PNG, JPEG, GIF, WebP, XPM, BMP support).

gd_interpolation.c  (libgd-2.3.0):gd_interpolation.c  (libgd-2.3.1)
skipping to change at line 1982 skipping to change at line 1982
* im - Image to draw the transformed image * im - Image to draw the transformed image
* tcolor - TrueColor * tcolor - TrueColor
* *
* Return: * Return:
* index of colors * index of colors
*/ */
static int getPixelRgbInterpolated(gdImagePtr im, const int tcolor) static int getPixelRgbInterpolated(gdImagePtr im, const int tcolor)
{ {
unsigned char r, g, b, a; unsigned char r, g, b, a;
int ct; int ct;
int i;
b = (unsigned char)tcolor; b = (unsigned char)tcolor;
g = (unsigned char)tcolor >> 8; g = (unsigned char)tcolor >> 8;
r = (unsigned char)tcolor >> 16; r = (unsigned char)tcolor >> 16;
a = (unsigned char)tcolor >> 24; a = (unsigned char)tcolor >> 24;
b = CLAMP(b, 0, 255); b = CLAMP(b, 0, 255);
g = CLAMP(g, 0, 255); g = CLAMP(g, 0, 255);
r = CLAMP(r, 0, 255); r = CLAMP(r, 0, 255);
a = CLAMP(a, 0, 127); a = CLAMP(a, 0, 127);
for (int i = 0; i < im->colorsTotal; i++) { for (i = 0; i < im->colorsTotal; i++) {
if (im->red[i] == r && im->green[i] == g && im->blue[i] == b && im->a if (im->red[i] == r && im->green[i] == g && im->blue[i] == b && i
lpha[i] == a) { m->alpha[i] == a) {
return i; return i;
} }
} }
ct = im->colorsTotal; ct = im->colorsTotal;
if (ct == gdMaxColors) { if (ct == gdMaxColors) {
return -1; return -1;
} }
im->colorsTotal++; im->colorsTotal++;
 End of changes. 2 change blocks. 
3 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)