Companion

object Companion

Functions

Link copied to clipboard
fun fromBgra(width: Int, height: Int, bgra: ByteArray, rowStride: Int = width * 4): RgbImage

From B,G,R,A bytes (e.g. iOS kCVPixelFormatType_32BGRA camera frames).

Link copied to clipboard
fun fromNv21(width: Int, height: Int, nv21: ByteArray): RgbImage

From an Android NV21 buffer (full Y plane followed by interleaved V,U).

Link copied to clipboard
fun fromRgba(width: Int, height: Int, rgba: ByteArray, rowStride: Int = width * 4): RgbImage

From tightly- or loosely-packed R,G,B,A bytes (e.g. Android Bitmap.Config.ARGB_8888 copied to a buffer).

Link copied to clipboard
fun fromYuv420(width: Int, height: Int, yPlane: ByteArray, yRowStride: Int, uPlane: ByteArray, vPlane: ByteArray, uvRowStride: Int, uvPixelStride: Int, uOffset: Int = 0, vOffset: Int = 0): RgbImage

From separate YUV 4:2:0 planes, e.g. Android ImageProxy YUV_420_888 (planes[0..2]) or an iOS bi-planar NV12 buffer (pass the interleaved UV plane as both uPlane and vPlane with vOffset = 1).