SubPixmap.isValid

Determines whether the area of the subimage lies within the source image and does not overflow its lines.

If the offset and/or size of a subimage are off, two issues can occur:
  • The resulting subimage will look displaced. (As if the lines were shifted.) This indicates that one scanline of the subimage spans over two ore more lines of the source image. (Happens when (subimage.offset.x + subimage.size.width) > source.size.width.)
  • When accessing the pixel data, bounds checks will fail. This suggests that the area of the subimage extends beyond the bottom end (and optionally also beyond the right end) of the source.

Both defects could indicate an invalid subimage. Use this function to verify the SubPixmap.

Do not use invalid SubPixmaps. The library assumes that the SubPixmaps it receives are always valid.

Non-valid SubPixmaps are not meant to be used for creative effects or similar either. Such uses might lead to unexpected quirks or crashes eventually.

struct SubPixmap
@safe pure nothrow @safe pure nothrow @nogc const
bool
isValid
()

Meta