Warning: session_start(): open(/var/lib/php/sessions/sess_5e6cjq4tsbi6v86ilsfhle3org, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
// Abstract base class for tiling an image (G22Tiling)
abstract srecord noeq G22AbstractTiler
(Img image) is Runnable {
int w, h, runner;
gettable int size; // =w*h
new IntBuffer stack; // locations to be looked at as y*w+x
int[] tileMatrix; // for each pixel: tile index+1 (or 0 for empty)
G22Tiling tiling; // the tiling we are making
int regionCounter;
bool verbose;
double regionStep = .1; // for rendering in regionsImage
int x(int pos) { ret pos % w; }
int y(int pos) { ret pos / w; }
int pos(int x, int y) { ret y*w+x; }
Pt pt(int pos) { ret Pt(x(pos), y(pos)); }
bool validPos(int x, int y) { ret x >= 0 && y >= 0 && x < w && y < h; }
abstract int getColor(int pos);
run {
w = image.getWidth(); h = image.getHeight();
size = w*h;
regionMatrix = new int[size];
}