sampledImage

open fun sampledImage(image: DrawImage, source: FloatRect, localDestination: FloatRect, tint: ArgbColor = ArgbColor(-1), alphaCutoff: Float = 0.1f)(source)

Adds an image sampled at the final physical pixel centers without rounding its geometry to logical pixels.

The immutable image is retained by reference and the rectangles use half-open edges. Nearest sampling maps each covered physical pixel center through the original destination into source. Clipping does not change that mapping. Every normalized source channel, including alpha, is multiplied by the corresponding tint channel. A sample whose multiplied alpha is less than alphaCutoff is discarded before blending. Tint multiplication is not rounded to eight-bit channels before blending. Access uses the owning paint callback's thread and lifetime, just like blitImage. The default implementation rejects this capability so existing paint scopes remain source and binary compatible.

Parameters

image

the immutable source image.

source

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

localDestination

the nonempty destination in this node's local coordinates.

tint

the multiplicative straight ARGB color, defaulting to opaque white.

alphaCutoff

the finite inclusive minimum alpha in the range from zero to one.

Throws

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

when the scope is no longer valid.

when the scope has not implemented sampled images.


open fun sampledImage(image: DrawImage, source: FloatRect, localDestination: FloatRect, orientation: SampledImageOrientation, tint: ArgbColor = ArgbColor(-1), alphaCutoff: Float = 0.1f)(source)

Adds a sampled image with explicit source-axis directions while keeping both rectangles normalized.

Sampling, tint, clipping, ownership, thread, and callback-lifetime rules are the same as for ordinary sampledImage. Reversed axes exchange the source endpoints before interpolation, preserving nearest-neighbor ties without copying or reversing pixels. The default implementation delegates SampledImageOrientation.Normal to the existing overload and rejects other orientations.

Parameters

image

the immutable source image retained by reference.

source

the nonempty source rectangle contained in the image.

localDestination

the nonempty normalized destination in this node's local coordinates.

orientation

source-axis directions, independent of rectangle validation.

tint

the multiplicative straight ARGB color, defaulting to opaque white.

alphaCutoff

the finite inclusive minimum alpha in the range from zero to one.

Throws

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

when the scope is no longer valid.

when the scope has not implemented the requested sampling orientation.