public class AndroidFrameConverter extends FrameConverter<Bitmap>
Frame
and Bitmap
.
Since Bitmap
does not expose its internal buffer, we cannot share
allocated memory with Frame
.
This class is not optimized for speed. For best performance, convert first your data to and from RGBA with optimized functions from FFmpeg or OpenCV. Further, pixel formats other than grayscale, BGR, and RGBA are not well supported. Their conversions might fail in undefined ways.
frame
Constructor and Description |
---|
AndroidFrameConverter() |
Modifier and Type | Method and Description |
---|---|
Frame |
convert(Bitmap bitmap) |
Frame |
convert(byte[] data,
int width,
int height)
Convert YUV 4:2:0 SP (NV21) data to BGR, as received, for example,
via
Camera.PreviewCallback#onPreviewFrame(byte[],Camera) . |
Bitmap |
convert(Frame frame) |
close
public Frame convert(byte[] data, int width, int height)
Camera.PreviewCallback#onPreviewFrame(byte[],Camera)
.public Frame convert(Bitmap bitmap)
convert
in class FrameConverter<Bitmap>
public Bitmap convert(Frame frame)
convert
in class FrameConverter<Bitmap>
Copyright © 2022. All rights reserved.