Struct RasterLease
Lifetime capability for a retained raster representation.
struct RasterLease(T);
Copying a RasterLease retains the same backing representation.
A RasterView obtained from view() borrows from this lease and therefore
must not outlive it.
Methods
| Name | Description |
|---|---|
tryWritableView
(success)
|
Attempts to return a non-owning writable semantic view borrowing from this lease. |
view
()
|
Returns a non-owning read-only RasterView borrowing from this lease. |
Example
Example inspecting the default retained-lifetime capability.
import raster;
RasterLease!ubyte lease;
bool success;
scope auto writable = lease .tryWritableView(success);
assert(!success);
assert(writable .empty);