Function WritableRasterView.trySample
Attempts to read one logical sample.
bool trySample(
size_t band,
size_t x,
size_t y,
out T value
) const nothrow @nogc @safe;
Read semantics intentionally reuse RasterView's already-established checked semantic accessor rather than duplicating read-side address arithmetic.
Coordinates are relative to this view.
On failure value is reset to T.init.
The method is scope with respect to its implicit this borrow.
Reading may create temporary aliases internally, but none may escape
the call.
Example
Example reading safely from an empty writable view.
import raster;
WritableRasterView!ubyte view;
ubyte value = 99;
assert(!view .trySample(0, 0, 0, value));
assert(value == ubyte .init);