// A = the objects to be cached (each associated with a BWImage) sclass ScaledBWImageCache extends Meta is WidthAndHeight { int w, h; int bitsPerPixel, bitsPerImage; new MultiMap elementsByCacheImage; *(int *w, int *h, int *bitsPerPixel) { bitsPerImage = safeMul(w, h, bitsPerPixel); if (bitsPerImage >= 64) fail("Too many bits per cached image (64 allowed max)", +w, +h, +bitsPerPixel, +bitsPerImage); } public int getWidth() { ret w; } public int getHeight() { ret h; } }