readPixels

actual fun readPixels(xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor)

Read back SwapChain pixels asynchronously.

The buffer's callback is invoked on the main thread when complete (usually after several endFrame() calls). Formats RGBA/RGBA_INTEGER and types UBYTE/UINT/INT/FLOAT are always supported.

Call between beginFrame() and endFrame(), typically after render(). Impacts performance significantly, especially on some mobile platforms.

Parameters

xoffset

Left offset in pixels.

yoffset

Bottom offset in pixels.

width

Width in pixels.

height

Height in pixels.

buffer

Pixel buffer descriptor for the result.


actual fun readPixels(renderTarget: RenderTarget, xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor)

Read back RenderTarget pixels asynchronously.

Similar to readPixels(SwapChain), but reads from a RenderTarget instead.

Parameters

renderTarget

RenderTarget to read from.

xoffset

Left offset in pixels.

yoffset

Bottom offset in pixels.

width

Width in pixels.

height

Height in pixels.

buffer

Pixel buffer descriptor for the result.

expect fun readPixels(xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor)

Read back SwapChain pixels asynchronously.

The buffer's callback is invoked on the main thread when complete (usually after several endFrame() calls). Formats RGBA/RGBA_INTEGER and types UBYTE/UINT/INT/FLOAT are always supported.

Call between beginFrame() and endFrame(), typically after render(). Impacts performance significantly, especially on some mobile platforms.

Parameters

xoffset

Left offset in pixels.

yoffset

Bottom offset in pixels.

width

Width in pixels.

height

Height in pixels.

buffer

Pixel buffer descriptor for the result.


expect fun readPixels(renderTarget: RenderTarget, xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor)

Read back RenderTarget pixels asynchronously.

Similar to readPixels(SwapChain), but reads from a RenderTarget instead.

Parameters

renderTarget

RenderTarget to read from.

xoffset

Left offset in pixels.

yoffset

Bottom offset in pixels.

width

Width in pixels.

height

Height in pixels.

buffer

Pixel buffer descriptor for the result.

actual fun readPixels(xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor)

Read back SwapChain pixels asynchronously.

The buffer's callback is invoked on the main thread when complete (usually after several endFrame() calls). Formats RGBA/RGBA_INTEGER and types UBYTE/UINT/INT/FLOAT are always supported.

Call between beginFrame() and endFrame(), typically after render(). Impacts performance significantly, especially on some mobile platforms.

Parameters

xoffset

Left offset in pixels.

yoffset

Bottom offset in pixels.

width

Width in pixels.

height

Height in pixels.

buffer

Pixel buffer descriptor for the result.


actual fun readPixels(renderTarget: RenderTarget, xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor)

Read back RenderTarget pixels asynchronously.

Similar to readPixels(SwapChain), but reads from a RenderTarget instead.

Parameters

renderTarget

RenderTarget to read from.

xoffset

Left offset in pixels.

yoffset

Bottom offset in pixels.

width

Width in pixels.

height

Height in pixels.

buffer

Pixel buffer descriptor for the result.

actual fun readPixels(xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor)

Read back SwapChain pixels asynchronously.

The buffer's callback is invoked on the main thread when complete (usually after several endFrame() calls). Formats RGBA/RGBA_INTEGER and types UBYTE/UINT/INT/FLOAT are always supported.

Call between beginFrame() and endFrame(), typically after render(). Impacts performance significantly, especially on some mobile platforms.

Parameters

xoffset

Left offset in pixels.

yoffset

Bottom offset in pixels.

width

Width in pixels.

height

Height in pixels.

buffer

Pixel buffer descriptor for the result.


actual fun readPixels(renderTarget: RenderTarget, xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor)

Read back RenderTarget pixels asynchronously.

Similar to readPixels(SwapChain), but reads from a RenderTarget instead.

Parameters

renderTarget

RenderTarget to read from.

xoffset

Left offset in pixels.

yoffset

Bottom offset in pixels.

width

Width in pixels.

height

Height in pixels.

buffer

Pixel buffer descriptor for the result.

actual fun readPixels(xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor)

Read back SwapChain pixels asynchronously.

The buffer's callback is invoked on the main thread when complete (usually after several endFrame() calls). Formats RGBA/RGBA_INTEGER and types UBYTE/UINT/INT/FLOAT are always supported.

Call between beginFrame() and endFrame(), typically after render(). Impacts performance significantly, especially on some mobile platforms.

Parameters

xoffset

Left offset in pixels.

yoffset

Bottom offset in pixels.

width

Width in pixels.

height

Height in pixels.

buffer

Pixel buffer descriptor for the result.


actual fun readPixels(renderTarget: RenderTarget, xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor)

Read back RenderTarget pixels asynchronously.

Similar to readPixels(SwapChain), but reads from a RenderTarget instead.

Parameters

renderTarget

RenderTarget to read from.

xoffset

Left offset in pixels.

yoffset

Bottom offset in pixels.

width

Width in pixels.

height

Height in pixels.

buffer

Pixel buffer descriptor for the result.