Class PreviewFrameStore


  • public class PreviewFrameStore
    extends java.lang.Object
    • Constructor Detail

      • PreviewFrameStore

        public PreviewFrameStore​(int wantedNbOfFrames)
    • Method Detail

      • reset

        public void reset​(int wantedNbOfFrames)
      • clearExistingFrames

        public void clearExistingFrames()
      • prepareForPreviewSampling

        public void prepareForPreviewSampling​(long interval)
        Call to enable sampling mode; will clear any data from previous sampling and start collecting frames immediately. Caller is responsible for allocating camera buffers to support the requested number of samples
        Parameters:
        interval - time between samples
      • onSampleFrame

        public boolean onSampleFrame​(com.yoti.mobile.android.commons.image.ImageBuffer frame)
        Call every time a preview frame is generated while sampling. Must call prepareForPreviewSampling(long) first.
        Parameters:
        frame - preview image from camera
      • removeLastValidFrame

        public void removeLastValidFrame()
      • getSampledFrameImages

        @NonNull
        public com.yoti.mobile.android.commons.image.DirectBuffer[] getSampledFrameImages()
        Returns frame data previously captured with with #prepareForPreviewSampling. Should only be called when the buffer is full (#onPreviewFrame returns false) to avoid nulls in the output
        Returns:
        Array of JPEG compressed frames,
      • setValidFrame

        public void setValidFrame​(com.yoti.mobile.android.commons.image.ImageBuffer frame)
        Used when a frame has passed all checks and should be returned from #getLastValidFrame.
        Parameters:
        frame - New valid frame
      • updateLastFrame

        public void updateLastFrame​(com.yoti.mobile.android.commons.image.ImageBuffer frame)
        Should be called every frame to copy the data to local storage. This data will only be used for later calls to setLastFrameAsValid().
      • isLastFrameCaptured

        public boolean isLastFrameCaptured()
      • isFrameBufferFull

        public boolean isFrameBufferFull()