Shape_frame::Shape_frame ( unsigned char *pixels, int w, int h, int xoff, int yoff, bool setrle ) : xleft(xoff), yabove(yoff), xright(w - xoff - 1), ybelow(h - yoff - 1), rle(setrle) { if (!rle) { assert(w == 8 && h == 8); datalen = 64; data = new unsigned char[64]; memcpy(data, pixels, 64); } else data = encode_rle(pixels, w, h, xleft, yabove, datalen); }
Shape_frame() : data(0), datalen(0) {  }
Shape_frame::Shape_frame	(	unsigned char *pixels, 		// (A copy is made.)	int w, int h,			// Dimensions.	int xoff, int yoff,		// Xleft, yabove.	bool setrle			// Run-length-encode.	) : xleft(xoff), yabove(yoff), xright(w - xoff - 1),	    ybelow(h - yoff - 1), rle(setrle)	{	if (!rle)		{		assert(w == 8 && h == 8);		datalen = 64;		data = new unsigned char[64];		memcpy(data, pixels, 64);		}	else		data = encode_rle(pixels, w, h, xleft, yabove, datalen);	}