makeRasterDirect

fun makeRasterDirect(pixmap: Pixmap, surfaceProps: SurfaceProps?): Surface


fun makeRasterDirect(imageInfo: ImageInfo, pixelsPtr: NativePointer, rowBytes: Int): Surface

Allocates raster Surface. Canvas returned by Surface draws directly into pixels.

Surface is returned if all parameters are valid. Valid parameters include:

  • info dimensions are greater than zero;

  • info contains ColorType and AlphaType supported by raster surface;

  • pixelsPtr is not 0;

  • rowBytes is large enough to contain info width pixels of ColorType.

Pixel buffer size should be info height times computed rowBytes.

Pixels are not initialized.

To access pixels after drawing, peekPixels() or readPixels().

Return

created Surface

Parameters

imageInfo

width, height, ColorType, AlphaType, ColorSpace, of raster surface; width and height must be greater than zero

pixelsPtr

pointer to destination pixels buffer

rowBytes

memory address of destination native pixels buffer


fun makeRasterDirect(imageInfo: ImageInfo, pixelsPtr: NativePointer, rowBytes: Int, surfaceProps: SurfaceProps?): Surface

Allocates raster Surface. Canvas returned by Surface draws directly into pixels.

Surface is returned if all parameters are valid. Valid parameters include:

  • info dimensions are greater than zero;

  • info contains ColorType and AlphaType supported by raster surface;

  • pixelsPtr is not 0;

  • rowBytes is large enough to contain info width pixels of ColorType.

Pixel buffer size should be info height times computed rowBytes.

Pixels are not initialized.

To access pixels after drawing, peekPixels() or readPixels().

Return

created Surface

Parameters

imageInfo

width, height, ColorType, AlphaType, ColorSpace, of raster surface; width and height must be greater than zero

pixelsPtr

pointer to destination pixels buffer

rowBytes

memory address of destination native pixels buffer

surfaceProps

LCD striping orientation and setting for device independent fonts; may be null