Function Region2D.hasRepresentableExtent

Returns true when the translated end coordinates can be represented without overflowing size_t.

bool hasRepresentableExtent() pure nothrow @nogc @safe const;

This deliberately uses subtraction-based checks instead of unchecked x + width or y + height.

Example

Example checking translated extent overflow.

import raster;

assert(Region2D(10, 20, 30, 40).hasRepresentableExtent);
assert(!Region2D(size_t.max, 0, 1, 1).hasRepresentableExtent);