Enrollment 28.2.0
Loading...
Searching...
No Matches
FaceCropConfiguration Class Reference

Face crop configuration. More...

#include <FaceCropConfiguration.h>

Collaboration diagram for FaceCropConfiguration:

Public Member Functions

void SetCropBackground (const RGBA &background)
 Set the Crop Background color Background with transparency is only allowed when method is FaceCrop::FULL_NOT_ALIGNED.
RGBA GetCropBackground () const
 Get the Crop Background object.
void SetCropMethod (FaceCrop method)
 Set the Crop method.
FaceCrop GetCropMethod () const
 Get the Crop method.
void SetCropScale (float scale)
 Set the Crop scale.
float GetCropScale () const
 Get the Crop scale.
void WriteTo (Writer &writer) const final
 Function serializes configuration via provided Writer.
 FaceCropConfiguration ()=default
 Default configuration is.

Detailed Description

Face crop configuration.

Constructor & Destructor Documentation

◆ FaceCropConfiguration()

FaceCropConfiguration ( )
default

Default configuration is.

  • cropped background - Colors::White
  • crop method - FaceCrop::TOKEN
  • cropScale - 1.0 (no scale)

References FaceCropConfiguration(), and TOKEN.

Referenced by FaceCropConfiguration().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ GetCropBackground()

RGBA GetCropBackground ( ) const
inlinenodiscard

Get the Crop Background object.

Returns
RGBA cropped background color

◆ GetCropMethod()

FaceCrop GetCropMethod ( ) const
inlinenodiscard

Get the Crop method.

Returns
Crop

◆ GetCropScale()

float GetCropScale ( ) const
inlinenodiscard

Get the Crop scale.

Returns
crop scale

◆ SetCropBackground()

void SetCropBackground ( const RGBA & background)
inline

Set the Crop Background color Background with transparency is only allowed when method is FaceCrop::FULL_NOT_ALIGNED.

Parameters
backgroundcropped background color
Exceptions
EnrollmentInvalidArgumentExceptionwhen background is transparent and aligned crop is true and method is FaceCrop::FULL.
EnrollmentInvalidArgumentExceptionwhen background is transparent and method is FaceCrop::TOKEN.
EnrollmentInvalidArgumentExceptionwhen background is transparent and method is FaceCrop::TOKEN_NOT_FRONTAL.

References FULL_NOT_ALIGNED.

◆ SetCropMethod()

void SetCropMethod ( FaceCrop method)
inline

Set the Crop method.

Parameters
methodCrop method
Exceptions
EnrollmentInvalidArgumentExceptionwhen Crop::TOKEN_NOT_FRONTAL method needs to be set with other crop scale as 1.0.
EnrollmentInvalidArgumentExceptionwhen unknown crop method is going to be set.
EnrollmentInvalidArgumentExceptionwhen scale is already set and method is FaceCrop::TOKEN_NOT_FRONTAL.
EnrollmentInvalidArgumentExceptionwhen transparent background is already set and method is not FaceCrop::FULL_NOT_ALIGNED.

References FULL_NOT_ALIGNED, IsFaceCropMethodValid(), and TOKEN_NOT_FRONTAL.

Here is the call graph for this function:

◆ SetCropScale()

void SetCropScale ( float scale)
inline

Set the Crop scale.

It shrink or enlarge rounding box according to scale.

Parameters
scaleScale is in range <0.3,2>. When scale is 0.3 then rounding box is shrunk to 30% of original size. When scale is 2 then rounding box is enlarged to double size.
Exceptions
EnrollmentInvalidArgumentExceptionwhen scale is not in range or when crop method is Crop::TOKEN_NOT_FRONTAL

References TOKEN_NOT_FRONTAL.

◆ WriteTo()

void WriteTo ( Writer & writer) const
inlinefinalvirtual

Function serializes configuration via provided Writer.

Parameters
writerused to serialize Config.

Implements Serializable.


The documentation for this class was generated from the following file: