// SnP = Scale and Posterize // pixelRows = -1 means use original image's height srecord SnPSettings(int pixelRows, int colors) extends MetaWithChangeListeners { SnPSettings() { pixelRows = 128; colors = 8; } // use full image resolution (no downsampling) SnPSettings(BufferedImage image, int colors) { pixelRows = image.getHeight(); this.colors = colors; } SnPSettings cloneMe() { ret shallowClone(this); } // optional - null for simple decolorization settableWithVar Decolorizer decolorizer; int pixelRowsForImage(WidthAndHeight img) { ret pixelRows < 0 ? img.getHeight() : pixelRows; } static SnPSettings allColors(int pixelRows) { ret new SnPSettings(pixelRows, 255); } }