sclass SimpleScanlineImage { // core value: first row occupied int y1; // core value: x coordinates per row // x_left is inclusive, x_right is exclusive // x_left at y1, x_right at y1, // x_left at y1+1, x_right at y1+1, ,,, int[] data; // bounds can be calculated quickly from core values Rect bounds; // color is optional Color color = Color.red; }