Package com.perfectcorp.perfectlib
Class CameraKit
- java.lang.Object
-
- com.perfectcorp.perfectlib.CameraKit
-
@Keep @KeepPublicClassMembers public final class CameraKit extends java.lang.Object
The class performs skin health analysis.Initialize an instance for
CameraKitwithcreate.Use
sendCameraBufferto input camera frames.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCameraKit.BadLightingReportstatic classCameraKit.CameraKitCheckResultstatic interfaceCameraKit.CameraKitQualityCheckCallbackCallback interface used to receive camera-kit quality results.static interfaceCameraKit.CreateCallbackCallback interface used to notify the completion of the operation.static classCameraKit.FaceCheckParameters
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidcreate(CameraKit.CreateCallback createCallback)Create an instance ofCameraKit.static voidcreateFromAssets(java.lang.String assetsModelFolder, CameraKit.CreateCallback createCallback)static voidcreateFromFiles(java.lang.String modelFolderPath, CameraKit.CreateCallback createCallback)CameraKitParametergetCurrentParameter()Returns the currently applied CameraKit parameters.CameraKitParameterBuildergetParameterBuilder()Returns a builder seeded from the currently applied CameraKit parameters.voidonCameraOpened(boolean isFront, int cameraOrientation, int previewWidth, int previewHeight)Call this method to provide camera settings after camera is opened and beforeCamera#startPreview.voidonCreated()Call this method in the onCreate() of the Activity/Fragment.voidonDestroyed()Call this method in the onDestroyed() of the Activity/Fragment.voidonPaused()Call this method in the onPaused() of the Activity/Fragment.voidonResumed()Call this method in the onResumed() of the Activity/Fragment.voidonStarted()Call this method in the onStarted() of the Activity/Fragment.voidonStopped()Call this method in the onStopped() of the Activity/Fragment.voidsendCameraBuffer(CameraFrame cameraFrame)Call this method to send camera frames toCameraKit.voidsetCameraKitLevel(CameraKitLevel level)Applies the preset thresholds for the selected CameraKit level.voidsetCameraKitOverwrite(CameraKitParameter parameter)Applies overwrite thresholds on top of the current preset level.voidsetCameraKitQualityCheckCallback(CameraKit.CameraKitQualityCheckCallback callback)Set a callback to receive camera-kit quality results.
-
-
-
Method Detail
-
create
@MainThread public static void create(@NonNull CameraKit.CreateCallback createCallback)
Create an instance ofCameraKit.- Parameters:
createCallback- a callback called when operation completes
-
createFromAssets
@MainThread public static void createFromAssets(@NonNull java.lang.String assetsModelFolder, @NonNull CameraKit.CreateCallback createCallback)
-
createFromFiles
@MainThread public static void createFromFiles(@NonNull java.lang.String modelFolderPath, @NonNull CameraKit.CreateCallback createCallback)
-
onCreated
@Lifecycle @MainThread public void onCreated()
Call this method in the onCreate() of the Activity/Fragment.
-
onStarted
@Lifecycle @MainThread public void onStarted()
Call this method in the onStarted() of the Activity/Fragment.
-
onResumed
@Lifecycle @MainThread public void onResumed()
Call this method in the onResumed() of the Activity/Fragment.
-
onPaused
@Lifecycle @MainThread public void onPaused()
Call this method in the onPaused() of the Activity/Fragment.
-
onStopped
@Lifecycle @MainThread public void onStopped()
Call this method in the onStopped() of the Activity/Fragment.
-
onDestroyed
@Lifecycle @MainThread public void onDestroyed()
Call this method in the onDestroyed() of the Activity/Fragment.
-
onCameraOpened
@WorkerThread public void onCameraOpened(boolean isFront, int cameraOrientation, int previewWidth, int previewHeight)
Call this method to provide camera settings after camera is opened and beforeCamera#startPreview.Note: Call this method from camera thread.
- Parameters:
isFront-trueif current opened camera is front;falseotherwise.cameraOrientation- camera orientation from CameraInfo. It should be 0, 90, 180, or 270.previewWidth- camera preview widthpreviewHeight- camera preview height
-
sendCameraBuffer
@WorkerThread public void sendCameraBuffer(@NonNull CameraFrame cameraFrame)
Call this method to send camera frames toCameraKit.Note: Call this method from camera thread.
- See Also:
CameraFrame
-
setCameraKitLevel
@MainThread public void setCameraKitLevel(@NonNull CameraKitLevel level)
Applies the preset thresholds for the selected CameraKit level.- Parameters:
level- the preset level to apply.
-
setCameraKitOverwrite
@MainThread public void setCameraKitOverwrite(@NonNull CameraKitParameter parameter)
Applies overwrite thresholds on top of the current preset level.- Parameters:
parameter- the overwrite parameter to apply.
-
getCurrentParameter
@MainThread @NonNull public CameraKitParameter getCurrentParameter()
Returns the currently applied CameraKit parameters.
-
getParameterBuilder
@MainThread @NonNull public CameraKitParameterBuilder getParameterBuilder()
Returns a builder seeded from the currently applied CameraKit parameters.
-
setCameraKitQualityCheckCallback
@MainThread public void setCameraKitQualityCheckCallback(@Nullable CameraKit.CameraKitQualityCheckCallback callback)
Set a callback to receive camera-kit quality results.- Parameters:
callback- a callback object to notify the completion of the operation.
-
-