SampledImage

data class SampledImage(val image: DrawImage, val source: FloatRect, val destination: FloatRect, val tint: ArgbColor = ArgbColor(-1), val alphaCutoff: Float = 0.1f, val orientation: SampledImageOrientation) : DrawCommand(source)

Samples an immutable image through fractional geometry at the backend's final physical pixel density.

The image is retained by reference without copying pixels and all values are safe to share between threads. Backends map covered physical pixel centers through the unclipped destination and use nearest source sampling. Source channels are multiplied by normalized tint channels without intermediate eight-bit rounding. Samples with multiplied alpha below DrawCommand.SampledImage.alphaCutoff are discarded before blending in command order.

Throws

when a rectangle is empty, the source is outside DrawCommand.SampledImage.image, or the cutoff is invalid.

Constructors

Link copied to clipboard
constructor(image: DrawImage, source: FloatRect, destination: FloatRect, tint: ArgbColor = ArgbColor(-1), alphaCutoff: Float = 0.1f, orientation: SampledImageOrientation)
constructor(image: DrawImage, source: FloatRect, destination: FloatRect, tint: ArgbColor = ArgbColor(-1), alphaCutoff: Float = 0.1f)

Creates ordinary sampling with increasing source coordinates on both axes. Inputs, immutable ownership, and validation follow the primary constructor.

Properties

Link copied to clipboard

the finite inclusive minimum normalized alpha from zero to one.

Link copied to clipboard

the nonempty destination rectangle in accumulated tree coordinates.

Link copied to clipboard

the immutable source image.

Link copied to clipboard

source-axis directions applied before nearest sampling, without changing normalized bounds.

Link copied to clipboard

the nonempty source rectangle contained in the image, in source pixel coordinates.

Link copied to clipboard

the multiplicative straight ARGB color, defaulting to opaque white.