fun allocPixelsFlags(imageInfo: ImageInfo, zeroPixels: Boolean): Boolean

Sets ImageInfo to info following the rules in setImageInfo() and allocates pixel memory. Memory is zeroed.

Returns false and calls reset() if ImageInfo could not be set, or memory could not be allocated, or memory could not optionally be zeroed.

On most platforms, allocating pixel memory may succeed even though there is not sufficient memory to hold pixels; allocation does not take place until the pixels are written to. The actual behavior depends on the platform implementation of calloc().


true if pixels allocation is successful



contains width, height, ColorAlphaType, ColorType, ColorSpace


whether pixels should be zeroed