Package com.perfectcorp.perfectlib
Class CameraKitParameterBuilder
- java.lang.Object
-
- com.perfectcorp.perfectlib.CameraKitParameterBuilder
-
@Keep @KeepPublicClassMembers public final class CameraKitParameterBuilder extends java.lang.Object
Builder object for configuring CameraKit overwrite parameters.Use
CameraKitParameter.getParameterBuilder()to start from the current applied CameraKit level, then set only the values that should differ from that level's preset.
-
-
Field Summary
Fields Modifier and Type Field Description static floatFACE_PITCH_MAXstatic floatFACE_PITCH_MINstatic floatFACE_SIZE_RATIO_MAXstatic floatFACE_SIZE_RATIO_MINstatic floatFACE_YAW_MAXstatic floatFACE_YAW_MINstatic floatLIGHTING_LOWER_MAXstatic floatLIGHTING_LOWER_MINstatic floatLIGHTING_UPPER_MAXstatic floatLIGHTING_UPPER_MIN
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CameraKitParameterbuild()static CameraKitParameterBuilderbuilder(CameraKitLevel level)Creates a parameter builder configured with the given preset level.static CameraKitParameterBuilderfromParameter(CameraKitParameter parameter)Creates a parameter builder initialized from an applied parameter snapshot.floatgetFacePitchLower()Returns the lower bound of head pose pitch.floatgetFacePitchUpper()Returns the upper bound of head pose pitch.floatgetFaceSizeRatio()Returns the lower bound of the face ratio.floatgetFaceYaw()Returns the absolute upper bound of head pose yaw.CameraKitLevelgetLevel()Returns the preset level associated with this builder.floatgetLightingLower()Returns the lower bound of the lighting condition.floatgetLightingUpper()Returns the upper bound of the lighting condition.voidsetFacePitchLower(float facePitchLower)Sets the lower bound of head pose pitch.voidsetFacePitchUpper(float facePitchUpper)Sets the upper bound of head pose pitch.voidsetFaceSizeRatio(float faceSizeRatio)Sets the lower bound of the face ratio.voidsetFaceYaw(float faceYaw)Sets the absolute upper bound of head pose yaw.voidsetLightingLower(float lightingLower)Sets the lower bound of the lighting condition.voidsetLightingUpper(float lightingUpper)Sets the upper bound of the lighting condition.
-
-
-
Field Detail
-
FACE_SIZE_RATIO_MIN
public static final float FACE_SIZE_RATIO_MIN
- See Also:
- Constant Field Values
-
FACE_SIZE_RATIO_MAX
public static final float FACE_SIZE_RATIO_MAX
- See Also:
- Constant Field Values
-
FACE_YAW_MIN
public static final float FACE_YAW_MIN
- See Also:
- Constant Field Values
-
FACE_YAW_MAX
public static final float FACE_YAW_MAX
- See Also:
- Constant Field Values
-
FACE_PITCH_MIN
public static final float FACE_PITCH_MIN
- See Also:
- Constant Field Values
-
FACE_PITCH_MAX
public static final float FACE_PITCH_MAX
- See Also:
- Constant Field Values
-
LIGHTING_UPPER_MIN
public static final float LIGHTING_UPPER_MIN
- See Also:
- Constant Field Values
-
LIGHTING_UPPER_MAX
public static final float LIGHTING_UPPER_MAX
- See Also:
- Constant Field Values
-
LIGHTING_LOWER_MIN
public static final float LIGHTING_LOWER_MIN
- See Also:
- Constant Field Values
-
LIGHTING_LOWER_MAX
public static final float LIGHTING_LOWER_MAX
- See Also:
- Constant Field Values
-
-
Method Detail
-
builder
@NonNull public static CameraKitParameterBuilder builder(@NonNull CameraKitLevel level)
Creates a parameter builder configured with the given preset level.- Returns:
- a builder initialized with the preset values for the selected level
-
fromParameter
@NonNull public static CameraKitParameterBuilder fromParameter(@NonNull CameraKitParameter parameter)
Creates a parameter builder initialized from an applied parameter snapshot. Unset values will fall back to the preset defaults for that parameter's current level.- Returns:
- a builder initialized from the provided parameter values
-
getLevel
@NonNull public CameraKitLevel getLevel()
Returns the preset level associated with this builder.- Returns:
- the preset level used as the base for these values
-
getFaceSizeRatio
public float getFaceSizeRatio()
Returns the lower bound of the face ratio. Face width should be betweenfaceSizeRatiox frame width and1.0 xframe width. Checks vertical ratio in landscape mode and horizontal ratio in portrait mode. Valid range:0.55 ~ 1.0. Presets: STRICT0.75, MODERATE0.65, RELAXED0.55.- Returns:
- the configured lower bound of the face ratio
-
setFaceSizeRatio
public void setFaceSizeRatio(float faceSizeRatio)
Sets the lower bound of the face ratio. Face width should be betweenfaceSizeRatiox frame width and1.0 xframe width. Checks vertical ratio in landscape mode and horizontal ratio in portrait mode. Valid range:0.55 ~ 1.0. Presets: STRICT0.75, MODERATE0.65, RELAXED0.55.
-
getFaceYaw
public float getFaceYaw()
Returns the absolute upper bound of head pose yaw. This value controls how far the head can look left or right. Valid range:0.0 ~ 15.0. Presets: STRICT5.0, MODERATE10.0, RELAXED15.0.- Returns:
- the configured upper bound of head pose yaw
-
setFaceYaw
public void setFaceYaw(float faceYaw)
Sets the absolute upper bound of head pose yaw. This value controls how far the head can look left or right. Valid range:0.0 ~ 15.0. Presets: STRICT5.0, MODERATE10.0, RELAXED15.0.
-
getFacePitchUpper
public float getFacePitchUpper()
Returns the upper bound of head pose pitch. This value controls the allowed upward head pose. Valid range:-20.0 ~ 10.0. Presets: STRICT0.0, MODERATE5.0, RELAXED10.0.- Returns:
- the configured upper bound of head pose pitch
-
setFacePitchUpper
public void setFacePitchUpper(float facePitchUpper)
Sets the upper bound of head pose pitch. This value controls the allowed upward head pose. Valid range:-20.0 ~ 10.0. Presets: STRICT0.0, MODERATE5.0, RELAXED10.0.
-
getFacePitchLower
public float getFacePitchLower()
Returns the lower bound of head pose pitch. This value controls the allowed downward head pose. Valid range:-20.0 ~ 10.0. Presets: STRICT-10.0, MODERATE-15.0, RELAXED-20.0.- Returns:
- the configured lower bound of head pose pitch
-
setFacePitchLower
public void setFacePitchLower(float facePitchLower)
Sets the lower bound of head pose pitch. This value controls the allowed downward head pose. Valid range:-20.0 ~ 10.0. Presets: STRICT-10.0, MODERATE-15.0, RELAXED-20.0.
-
getLightingUpper
public float getLightingUpper()
Returns the upper bound of the lighting condition. Valid range:0.8 ~ 1.0. Presets: STRICT0.9, MODERATE0.85, RELAXED0.8.- Returns:
- the configured upper bound of the lighting condition
-
setLightingUpper
public void setLightingUpper(float lightingUpper)
Sets the upper bound of the lighting condition. Valid range:0.8 ~ 1.0. Presets: STRICT0.9, MODERATE0.85, RELAXED0.8.
-
getLightingLower
public float getLightingLower()
Returns the lower bound of the lighting condition. Valid range:0.55 ~ 1.0. Presets: STRICT0.8, MODERATE0.7, RELAXED0.55.- Returns:
- the configured lower bound of the lighting condition
-
setLightingLower
public void setLightingLower(float lightingLower)
Sets the lower bound of the lighting condition. Valid range:0.55 ~ 1.0. Presets: STRICT0.8, MODERATE0.7, RELAXED0.55.
-
build
@NonNull public CameraKitParameter build()
-
-