|
Enrollment 28.2.0
|
Face crop configuration. More...
#include <FaceCropConfiguration.h>
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. | |
Face crop configuration.
|
default |
Default configuration is.
References FaceCropConfiguration(), and TOKEN.
Referenced by FaceCropConfiguration().
|
inlinenodiscard |
Get the Crop Background object.
|
inlinenodiscard |
Get the Crop method.
|
inlinenodiscard |
Get the Crop scale.
|
inline |
Set the Crop Background color Background with transparency is only allowed when method is FaceCrop::FULL_NOT_ALIGNED.
| background | cropped background color |
| EnrollmentInvalidArgumentException | when background is transparent and aligned crop is true and method is FaceCrop::FULL. |
| EnrollmentInvalidArgumentException | when background is transparent and method is FaceCrop::TOKEN. |
| EnrollmentInvalidArgumentException | when background is transparent and method is FaceCrop::TOKEN_NOT_FRONTAL. |
References FULL_NOT_ALIGNED.
|
inline |
Set the Crop method.
| method | Crop method |
| EnrollmentInvalidArgumentException | when Crop::TOKEN_NOT_FRONTAL method needs to be set with other crop scale as 1.0. |
| EnrollmentInvalidArgumentException | when unknown crop method is going to be set. |
| EnrollmentInvalidArgumentException | when scale is already set and method is FaceCrop::TOKEN_NOT_FRONTAL. |
| EnrollmentInvalidArgumentException | when transparent background is already set and method is not FaceCrop::FULL_NOT_ALIGNED. |
References FULL_NOT_ALIGNED, IsFaceCropMethodValid(), and TOKEN_NOT_FRONTAL.
|
inline |
Set the Crop scale.
It shrink or enlarge rounding box according to scale.
| scale | Scale 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. |
| EnrollmentInvalidArgumentException | when scale is not in range or when crop method is Crop::TOKEN_NOT_FRONTAL |
References TOKEN_NOT_FRONTAL.
|
inlinefinalvirtual |
Function serializes configuration via provided Writer.
| writer | used to serialize Config. |
Implements Serializable.