Posted by cuntface Wed 21st Mar 2007 19:12 - Syntax is C++ - 59 views
Download | New Post | Modify | Hide line numbers
  1. for(x=0;xget_image_width();x++)    {
  2.         for(y=0;yget_image_height();y++) {
  3.            
  4.             rp = r;
  5.             r = data->get_pixel(x,y,RED);
  6.  
  7.             if(rp == r && rn < 255) { //if we find another pixel the same colour, increment the counter
  8.                 rn++;
  9.             }
  10.  
  11.  
  12.             else { //reset the counter and write the previous series
  13.            
  14.                 compressed[byte_ptr] = (char)rn & 0xff;
  15.                 byte_ptr++;
  16.                 compressed[byte_ptr] = (char)rp & 0xff;
  17.                 byte_ptr++;
  18.  
  19.  
  20.                 rt += rn;
  21.                 rn = 1;
  22.             }
  23.         }
  24.     }

PermaLink to this entry https://pastebin.co.uk/12126
Posted by cuntface Wed 21st Mar 2007 19:12 - Syntax is C++ - 59 views
Download | New Post | Modify | Hide line numbers

 

Comments: 0