cropped

fun KiteBitmap.cropped(x: Int, y: Int, width: Int, height: Int): KiteBitmap

Copy the width×height region whose top-left corner is (x, y).

Throws

if the rectangle is empty or reaches outside the bitmap: silently clamping a bad crop hides the caller's bug.


fun KiteAnimation.cropped(x: Int, y: Int, width: Int, height: Int): KiteAnimation

cropped applied to every frame, preserving delays and loop count.