Struct RasterWrapBorder

Wrap border policy.

struct RasterWrapBorder;

For one axis with extent N > 0, an arbitrary integer coordinate c maps to:

euclideanModulo(c, N)

Negative coordinates therefore wrap from the opposite edge rather than using implementation-language remainder semantics.

The policy is undefined for zero extent and an operation must reject such a request before attempting wrap mapping.

Example

Example selecting compile-time border policies.

import raster;

static assert(
    RasterValidBorder.kind
    == RasterBorderKind.valid
);

static assert(
    RasterClampBorder.kind
    == RasterBorderKind.clamp
);

static assert(
    RasterMirrorBorder.kind
    == RasterBorderKind.mirror
);

static assert(
    RasterWrapBorder.kind
    == RasterBorderKind.wrap
);

RasterConstantBorder!ubyte constant =
    RasterConstantBorder!ubyte(17);

assert(constant.value == 17);

static assert(
    typeof(constant).kind
    == RasterBorderKind.constant
);