All pastes #405441 Raw Edit

Stuff

public cpp v1 · immutable
·published 2007-03-21 19:17 UTC
rendered paste body
for(x=0;x<data->get_image_width();x++)	{		for(y=0;y<data->get_image_height();y++) {						rp = r;			r = data->get_pixel(x,y,RED);			if(rp == r && rn < 255) { //if we find another pixel the same colour, increment the counter				rn++;			}			else { //reset the counter and write the previous series							compressed[byte_ptr] = (char)rn & 0xff;				byte_ptr++;				compressed[byte_ptr] = (char)rp & 0xff;				byte_ptr++;				rt += rn;				rn = 1;			}		}	}