← back to roto on ba3a.dev

NearestScale

Integer nearest-neighbour enlargement of a Raster: every output pixel is one the input holds.

Properties

Link copied to clipboard
const val MAX_FACTOR: Int = 16

The largest factor scale takes.

Link copied to clipboard
const val MAX_SIDE: Int = 4096

The longest side, in pixels, a scaled raster may have.

Link copied to clipboard
const val MIN_FACTOR: Int = 1

The smallest factor scale takes.

Functions

Link copied to clipboard
fun scale(raster: Raster, factor: Int): Raster

A new raster in which each pixel of raster is a factor by factor block; raster is not changed. A factor outside MIN_FACTOR..MAX_FACTOR, or a result over MAX_SIDE on either side, fails with an IllegalArgumentException.