Skip to content
Snippets Groups Projects
Commit 83602e0f authored by dronus's avatar dronus
Browse files

slower fades

parent 4c1a9d97
No related branches found
No related tags found
No related merge requests found
......@@ -60,9 +60,12 @@ int fade(int b, int a, int t)
int gb=(b >> 8) & 0xFF;
int bb=(b >> 16) & 0xFF;
int rc=(ra*t+rb*(255-t))/256;
int gc=(ga*t+gb*(255-t))/256;
int bc=(ba*t+bb*(255-t))/256;
// int rc=(ra*t+rb*(255-t))/256;
// int gc=(ga*t+gb*(255-t))/256;
// int bc=(ba*t+bb*(255-t))/256;
int rc=(ra*t+rb*(255-t))/512;
int gc=(ga*t+gb*(255-t))/512;
int bc=(ba*t+bb*(255-t))/512;
return (bc<<0)+(rc<<8)+(gc<<16);
......@@ -77,7 +80,7 @@ int main() {
fprintf(stderr,"Sender input size: %i \n", (int)read);
// do a fade
for(int t=0; t<256; t+=1)
for(int t=0; t<=256; t+=1)
{
for(int i=0; i<sizeof(image)/4; i++)
image[i]=fade(image_old[i],image_new[i],t);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment