makeRaster

fun makeRaster(imageInfo: ImageInfo, bytes: ByteArray, rowBytes: Int): Image

Creates Image from pixels.

Image is returned if pixels are valid. Valid Pixmap parameters include:

  • dimensions are greater than zero;

  • each dimension fits in 29 bits;

  • ColorType and AlphaType are valid, and ColorType is not ColorType.UNKNOWN;

  • row bytes are large enough to hold one row of pixels;

  • pixel address is not null.

Return

Image

Parameters

imageInfo

ImageInfo

bytes

pixels array

rowBytes

how many bytes in a row

See also


fun makeRaster(imageInfo: ImageInfo, data: Data, rowBytes: Int): Image

Creates Image from pixels.

Image is returned if pixels are valid. Valid Pixmap parameters include:

  • dimensions are greater than zero;

  • each dimension fits in 29 bits;

  • ColorType and AlphaType are valid, and ColorType is not ColorType.UNKNOWN;

  • row bytes are large enough to hold one row of pixels;

  • pixel address is not null.

Return

Image

Parameters

imageInfo

ImageInfo

data

pixels array

rowBytes

how many bytes in a row