Decode one ICO directory entry (largest area by default) into owned RGBA8 pixels. Supports PNG payloads and uncompressed 24/32-bit DIBs with an AND mask. Free with deinit. Unsupported palette/compressed DIBs fail explicitly; entry offsets are checked before access.
Signature
decode_ico :: (
data: [] u8,
entry: s64 = -1
) -> (image: Image, ok: bool, error: string)
Icons :: #import "Ico_File";
bytes := Icons.create_ico_file(1, 1, 4, u8.[0, 0, 255, 255].data);
defer free(bytes);
image, ok := decode_ico(cast([] u8) bytes);
defer deinit(*image);
assert(ok && image.width == 256);