srecord noeq G22Tiling
(Img img) {
new L tiles;
// number of pixels covered by all tiles
int pixelsCovered;
// for each pixel: tile index+1 (or 0 for empty)
int[] tileMatrix;
// index = dual log of tile size, value = tile index
//new L tilesBySize;
sclass Tile {
int index;
int color; // tile color as defined by the tiler
Rect position;
*(int *index, int *color) {}
// Lists of neighbors in all 4 directions (index like NESWDirection)
// (If only a corner is touching, it's not a neighbor.)
Cl[] neighbors = new Cl[4];
}
int w() { ret img.w(); }
int h() { ret img.h(); }
void initTileMatrix {
tileMatrix = new int[w()*h()];
}
int numTiles() { ret l(tiles); }
}