Functions & Hooks

imageFromPixels

function imageFromPixels(
   pixels: ArrayBuffer, 
   width: number, 
   height: number, 
   rowBytes?: number): TgfxImage;

Wrap decoded premultiplied RGBA pixels as a handle. rowBytes is the stride in bytes (a multiple of 4), tightly packed when omitted. A native module's own buffer is borrowed - do not write into it while the handle lives; a JS-constructed ArrayBuffer is copied. Per-frame like a camera frame: it cannot be derived from or encoded.

Parameters

pixels

ArrayBuffer

width

number

height

number

rowBytes?

number

Returns

TgfxImage

On this page