readImage
fn
ubyte * readImage(ubyte * buf, int x, int y, int w, int h, bool alpha = false) nothrow @nogcReads pixels from the current window into a buffer.
If buf is null, a new buffer will be allocated.
Parameters
buf | Buffer to store pixels (or null to allocate) |
x | X coordinate |
y | Y coordinate |
w | Width in pixels |
h | Height in pixels |
alpha | Include alpha channel (true for RGBA, false for RGB) |
Returns
Pointer to pixel data, or null on failure