Changeset 465
 Timestamp:
 Jan 18, 2005, 3:34:23 PM (17 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

pwntcha/trunk/src/scode.c
r445 r465 51 51 stats[i] = 0; 52 52 53 for(y = 0; y < 3; y++) 53 for(y = 0; y < 6; y++) 54 { 55 int y2 = (y & 1) ? img>width  1  y / 2 : y / 2; 54 56 for(x = 0; x < img>width; x++) 55 57 { 56 getpixel(tmp1, x, y, &r, &g, &b); 57 stats[r + g + b]++; 58 getpixel(tmp1, x, img>height  1  y, &r, &g, &b); 59 stats[r + g + b]++; 60 } 58 getpixel(tmp1, x, y2, &r, &g, &b); 59 if(stats[r + g + b] == 0) 60 { 61 /* Parse middle line to see if this colour can be removed */ 62 int available = 0, x2, r2, g2, b2; 63 stats[r + g + b] = 1; 64 for(x2 = 0; x2 < img>width; x2++) 65 { 66 getpixel(tmp1, x2, img>width / 2, &r2, &g2, &b2); 67 if(stats[r2 + g2 + b2] == 0) 68 available = 1; 69 } 70 if(!available) 71 stats[r + g + b] = 2; 72 } 73 } 74 } 61 75 62 76 /* Set nonbackground colours to 0 */ … … 65 79 { 66 80 getpixel(tmp1, x, y, &r, &g, &b); 67 if(stats[r + g + b] )81 if(stats[r + g + b] == 1) 68 82 setpixel(tmp1, x, y, 255, 255, 255); 69 83 else
Note: See TracChangeset
for help on using the changeset viewer.