Minor change to avoid a compiler warning in gcc

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403982
This commit is contained in:
Davis King 2010-12-15 00:51:53 +00:00
parent c560f60479
commit d89dbfa333
1 changed files with 6 additions and 2 deletions

View File

@ -639,14 +639,18 @@ namespace dlib
// dest += (src - dest)*(alpha/255); // dest += (src - dest)*(alpha/255);
int temp = avg; int temp = avg;
// copy dest into dest_copy using assign_pixel to avoid potential
// warnings about implicit float to int warnings.
int dest_copy;
assign_pixel(dest_copy, dest);
temp -= dest; temp -= dest_copy;
temp *= src.alpha; temp *= src.alpha;
temp /= 255; temp /= 255;
assign_pixel(dest, temp+dest); assign_pixel(dest, temp+dest_copy);
} }
} }