Package com.appliedrec.verid.ui2
Class CameraWrapper
- java.lang.Object
-
- com.appliedrec.verid.ui2.CameraWrapper
-
- All Implemented Interfaces:
androidx.lifecycle.DefaultLifecycleObserver
,androidx.lifecycle.LifecycleObserver
public class CameraWrapper extends java.lang.Object implements androidx.lifecycle.DefaultLifecycleObserver
Interfaces with the device's camera- Since:
- 2.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
CameraWrapper.Listener
Camera wrapper listener
-
Constructor Summary
Constructors Constructor Description CameraWrapper(android.content.Context context, CameraLocation cameraLocation, IImageIterator imageIterator, ISessionVideoRecorder videoRecorder)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(CameraWrapper.Listener listener)
Add a listenerint
getCapturedImageMinimumArea()
IImageIterator
getImageIterator()
Get image iteratorvoid
onDestroy(androidx.lifecycle.LifecycleOwner owner)
void
onStart(androidx.lifecycle.LifecycleOwner owner)
void
onStop(androidx.lifecycle.LifecycleOwner owner)
void
removeListener(CameraWrapper.Listener listener)
Remove a listenervoid
setCapturedImageMinimumArea(int area)
void
setPreviewClass(java.lang.Class<?> previewClass)
Set preview class – will be used to determine the available preview sizesvoid
setPreviewSurface(android.view.Surface surface)
Set a surface on which to render the camera previewvoid
start(int width, int height, int displayRotation)
Open the camera nad start a previewvoid
stop()
Close the camera
-
-
-
Constructor Detail
-
CameraWrapper
public CameraWrapper(@NonNull android.content.Context context, @NonNull CameraLocation cameraLocation, @NonNull IImageIterator imageIterator, @Nullable ISessionVideoRecorder videoRecorder)
Constructor- Parameters:
context
- ContextcameraLocation
- Location of the camera to useimageIterator
- Image iterator – reads images from the camera and provides them to a sessionvideoRecorder
- Video recorder to use to record a video of the session (optional)- Since:
- 2.0.0
-
-
Method Detail
-
setPreviewSurface
public void setPreviewSurface(android.view.Surface surface)
Set a surface on which to render the camera preview- Parameters:
surface
- Surface on which to render the camera preview- Since:
- 2.0.0
-
setPreviewClass
public void setPreviewClass(java.lang.Class<?> previewClass)
Set preview class – will be used to determine the available preview sizes- Parameters:
previewClass
- Preview class- Since:
- 2.0.0
-
addListener
public void addListener(CameraWrapper.Listener listener)
Add a listener- Parameters:
listener
- Listener to add- Since:
- 2.0.0
-
removeListener
public void removeListener(CameraWrapper.Listener listener)
Remove a listener- Parameters:
listener
- Listener to remove- Since:
- 2.0.0
-
start
public void start(int width, int height, int displayRotation)
Open the camera nad start a preview- Parameters:
width
- Width of the view in which the camera preview will be renderedheight
- Height of the view in which the camera preview will be rendereddisplayRotation
- Display rotation of the view in which the camera preview will be rendered- Since:
- 2.0.0
-
stop
public void stop()
Close the camera- Since:
- 2.0.0
-
getImageIterator
public IImageIterator getImageIterator()
Get image iterator- Returns:
- Image iterator used to read images from the camera
- Since:
- 2.0.0
-
setCapturedImageMinimumArea
public void setCapturedImageMinimumArea(int area)
-
getCapturedImageMinimumArea
public int getCapturedImageMinimumArea()
-
onStart
public void onStart(@NonNull androidx.lifecycle.LifecycleOwner owner)
- Specified by:
onStart
in interfaceandroidx.lifecycle.DefaultLifecycleObserver
-
onStop
public void onStop(@NonNull androidx.lifecycle.LifecycleOwner owner)
- Specified by:
onStop
in interfaceandroidx.lifecycle.DefaultLifecycleObserver
-
onDestroy
public void onDestroy(@NonNull androidx.lifecycle.LifecycleOwner owner)
- Specified by:
onDestroy
in interfaceandroidx.lifecycle.DefaultLifecycleObserver
-
-