/** * Just enough PNG to cut a rectangle out of a simulator screenshot. * * The simulator encodes with stb_image_write — 8-bit, non-interlaced, no * palette — so this handles that shape (RGB and RGBA in, RGB out) and refuses * anything else loudly rather than returning a scrambled image. A real image * library would be a dependency for one 320x240 crop. */ /** Decoded pixels, three bytes per pixel, row-major. */ export interface RgbImage { width: number; height: number; data: Buffer; } /** Decode an 8-bit non-interlaced RGB/RGBA PNG into packed RGB bytes. */ export declare function decodePng(png: Buffer): RgbImage; /** Encode packed RGB bytes as an 8-bit RGB PNG (filter type 0 on every row). */ export declare function encodePng(img: RgbImage): Buffer; /** Cut `w`x`h` at (`x`,`y`) out of a PNG and re-encode it. */ export declare function cropPng(png: Buffer, x: number, y: number, w: number, h: number): Buffer;