observe Function
@JvmOverloads external fun observe(buffer: ByteArray, width: Int, height: Int, format: Int, rotation: Int = 0, viewfinder: Rect? = null): FrameObserver.Observation
Analyses one camera frame and returns what it found.
Call once per preview frame, from the camera’s analysis thread.
Return
what the observer made of the frame
Parameters
- buffer — the frame pixels, in the layout
formatdescribes - width — the frame width in pixels
- height — the frame height in pixels
- format — the pixel format of
buffer - rotation — how the frame is rotated relative to the display
- viewfinder — the region of the frame the user can actually see
Throws
- NullPointerException — if
bufferis null - IllegalArgumentException — if
bufferis too small for the geometry given, ifformatis unsupported, or if the dimensions are non-positive or, for the YUV formats, odd - ScanningSdkException — if this observer has been closed, or if the engine fails to process the frame