createOwnedDrawImage

Transfers exclusively owned runtime pixels into an immutable image without copying their backing array.

The caller must relinquish every mutable alias after a successful call and must never modify argb afterward. This privileged bridge is for fresh private runtime buffers; application arrays use createDrawImage instead. Validation completes before ownership transfers. The result retains the ordinary immutable image equality and copy contract.

Return

an immutable, thread-safe image owning the transferred buffer.

Parameters

size

the non-negative extent whose checked area must fit in Int.

argb

an exclusively owned row-major straight-ARGB buffer matching the checked image area.

Throws

when the checked image area overflows Int.

when the buffer length does not equal the checked image area.