3 #ifndef __PERFECTLYCLEARPRO_H__ 4 #define __PERFECTLYCLEARPRO_H__ 11 #define ULONG unsigned long 12 #define UINT unsigned int 19 #define NRRETCODE(x) (x & 0x000000FF) 20 #define CORERETCODE(x) ((x >> 8) & 0x000000FF) 22 #define FBRETCODE(x) ((x >> 16) & 0x000000FF) 24 #define RERETCODE(x) ((x >> 24) & 0x000000FF) 26 #define PFCINTERNAL void* 167 CALC_CARTOON_DETECTOR = 128,
501 #define PFC3DLutGuidLength 32 504 char guid[PFC3DLutGuidLength + 1];
505 unsigned char strength;
603 #define PFCPROFILE PFCIMAGEPROFILE* 606 #define PFCBGPROFILE PFCINTERNAL 994 void PFC_GetVersion(
char* buf,
int *len,
bool bFormatted =
false);
1044 #include "../Header-internal/PerfectlyClearPro-internal.h" 1050 #endif //__PERFECTLYCLEARPRO_H__ int iDeltaG
Delta G correction amount.
BIASMODE eBiasMode
Skin and depth bias control. Recommended value is BIAS_AVERAGE_PREFERENCE, unless you are printing to...
BOOL bContrast
Set to TRUE to also apply Athentech's patented Medical Imaging contrast technology.
int iTeethLevel
Teeth whitening level. Range 0 to 100.
float centerY
Y of center.
BOOL bEnabled
Set to true to enable the entire Core correction.
PFCPIXELFORMAT
defines the format of the image data
1.0 everywhere (background)
SKINTONINGTYPE eSkinToningType
See enum definition of SKINTONINGTYPE.
DCFMODE
Enumeration defining DCF analysis mode.
PFCFB_STATUS
Enumeration defining status of Face Beautification pre-calculation.
SKINMODE eSmoothMode
Use SKINMODE_FACE to apply correction ONLY on skin regions included in faces. Use SKINMODE_BODY to ap...
Adjust skin to user defined foundation color.
BOOL bUseAutomaticStrengthSelection
Set to TRUE (recommended default) to enable Automatic Strength Selection. Perfectly Clear will determ...
int PFC_FAEFaceCount(PFCIMAGEPROFILE *pImageProfile)
Return number of faces detected during Face Aware Exposure analysis.
void PFC_TrackSave(const char *clientAPIKey)
Report image save event from WASM SDK.
int iEnlargeLevel
Eye enlargement level. Range 0 to 100.
int iColorVibrancy
Color Vibrancy amount.
Reject images classified as clipart, used by default.
int childLevel
We don't implement this.
bool bPreprocessEV
Enable EV correction (Image Ambulance)
4 Error reading image data
Skip pre-calculations on Abnormal Tint Correction during Core pre-calculations.
int iEnhanceLevel
Eye enhancement level. Range 0 to 100.
4 Process aborted because of insufficient memory
void PFC_ReleaseProtectionPath()
Releases resources from PFC_SetProtectionPath function call.
-6 Invalid License or validation failed
PFCCORE_STATUS
Enumeration defining status of Core pre-calculation.
int iFinishTemp
Temp correction amount.
LIPSHARPENTYPE eLipSharpenType
See definition of LIPSHARPENTYPE.
AGGRESSIVENESS
Enumeration defining Auto Exposure calculation modes.
PFCINTERNAL pPfcParam
Internal use only.
2 Source image (pImage) is missing
void PFC_SetParam(PFCPARAM ¶m, PFCPRESETID id=PRESET_IAUTO_21)
Initialize a PFCPARAM structure.
PFC3DLutInfo lutInputSky
LUT data to apply.
PFCFBPARAM fb
Face Beautification corrections.
Engine created successfully.
PFCCORE_MASK_TYPE
Enumeration describing mapping of PFCMask and PFC_MASK_TYPE with 'PFC' -> 'PFCCORE'.
BOOL bEyeCirc
Set to TRUE to enable eye circle removal.
float transparency
overall transparency applied to the whole mask (strength 100 means transparency 0.0, 0 -> 1.0)
This type of correction provides a more uniform appearance to the complexion. It combines the natural...
TINTCORRECTION
Enumeration defining different abnormal tint analysis mode.
PFCNRPARAM nr
Noise reduction corrections.
int iContrast
Intensity of contrast or depth. Range 0 to 100.
8 No correction occur during process
float fBiasScale
Scalar value of how much BIAS correction should be applied. Range 0.0 to 1.0.
BOOL bEnabled
Set to TRUE to enable noise removal.
int iNeutralDensity
Neutral density filter amout.
int widthImage
image width
PFCPOINT ptEyeR
Specifies the x,y coordinates of the right eye, in fixed-point arithmetics (10 bit precision)...
Structure encapsulating the CORE processing parameters.
void PFC_ReleaseProfile(PFCPROFILE pProfile)
Release PFCPROFILE instance.
PFCREPARAM re
Red Eye Removal.
BOOL bAbnormalTintRemoval
Set to true to enable Abnormal Tint Removal. Recommended default is FALSE.
int stride
Byte width of each scanline.
int PFC_ReadPresetsFromStream(PFCPARAM ¶m, const char *s)
Load image processing settings from a char buffer.
-5 Pixel format not supported
PFC3DLutInfo lutOutput
LUT data to apply.
float width
radial/rounded: w of bounding rect, linear: ignored
PFCPOINT ptEyeL
Specifies the x,y coordinates of the left eye, in fixed-point arithmetics (10 bit precision)...
int left
x in point coordinate of this rect.
void PFC_GetRecommendedParam(PFCIMAGEPROFILE *profile, PFCCOREPARAM *dst, PFCCOREPARAM *src)
Get recommended values of auto params using result of precalc.
SKINMODE
Enumeration defining modes in Perfect Smooth analysis.
bool PFC_AbnormalTintDetected(PFCIMAGEPROFILE *pImageProfile, TINTCORRECTION eTintMethod)
Query if abnormal tint is detected.
Struct defining a rectangle.
BOOL bLipSharpen
Set to TRUE to enable lip sharpening.
int iEyeCirc
Eye circle removal level. Range 0 to 100.
2 Warning: face not detected
float height
radial/rounded: h of bounding rect, linear: dist from centerY where grad becomes 1.0
For average usage, corresponds to "Normal" in PfC Products.
BOOL bVibrancy
Set to true (recommended default) to enable Color Vibrancy in the library.
#define PFCPROFILE
Define.
This is a more aggressive and effective correction where the appearance of the entire skin (including...
int height
Pixel height of image.
PFCRECT rcMouth
Specifies the bounding rectangle of the mouth.
BOOL bDCF
Set to TRUE to enable Digital Color Fidelity. Recommended value is FALSE.
If set, the library is unable to locate SFB functions from the loaded library.
PFCRECT face
Bounding rectangle of detected face.
iAuto 2019 with Red Eye correciton enabled
int iSmoothLevel
Face smoothing level. Range 0 to 100.
PFCV3PARAM v3
V3 Corrections.
int iHighlightPreservation
Amount of Highlight Preservation to apply. Range 0 to 100.
Highest sensitivity level of tint detection.
Apply correction ONLY on skin regions included in faces.
PFCINTERNAL pEngine
Pointer to binary definition of the processing engine.
Beautify Plus provides stronger beautification corrections. This is in the 'Perfectly Clear Essential...
PFCPROFILE PFC_Calc(PFCIMAGE *pImage, PFCIMAGE *pImageds, PFCENGINE *pEngine, unsigned int feature=CALC_ALL, int iISO=-1, char *pCameraModel=NULL, PFCPROFILE pImageProfile=NULL, PFC_PROGRESS progfn=NULL, int iRejectOption=PFC_REJECT_CLIPART)
Perform initial analysis on images.
Struct defining an PFC engine instance.
int iDetailOffset
Offset to recommended level of preservation of details. Range -30 to 30.
Moderate level of tint detection.
bool PFC_IsNoiseDetected(PFCIMAGEPROFILE *pImageProfile, int iNoisePreset)
Query if noise is detected.
PFCPOINT leftEye
Point of left eye in detected face.
2 Source image (pImage) is missing
BOOL bEnabled
Set to TRUE to enable red eye removal.
Moderate level of exposure correction.
int iFinishWhites
Whites correction amount.
PFC3DLutInfo lutInputCorrective
LUT data to apply.
Struct PFCPARAM the master structure of all processing parameters.
DCFMODE eDCFMode
Select different class of DCF.
Whitens (bleaches) face. Recommended mainly for darker skin.
int blinkLevelR
Right eye Blink level.
PFC3DLutInfo lutInputFoliageGreen
LUT data to apply.
int angle
Roll angle of the face, from -179 to 180 degrees. 0 degrees means the face it oriented "normally"...
7 Image skipped due AI Clipart detection
Fine tuned for Asian skin tone.
int blinkLevel
Indicates the presence of a blink.
int iFinishShadows
Shadows correction amount.
int PFC_AutoCorrectPreset(PFCIMAGE *pImage, PFCIMAGE *pImageds, PFCPRESETID id=PRESET_IAUTO_21, int iISO=-1, char *pCameraModel=NULL, BOOL bFastFAE=FALSE, PFC_PROGRESS progfn=NULL)
Single function to perform Perfectly Clear corrections.
5 Unable to locate function in the SFBEngine library
float fInfrared
Scale value to control intensity of infrared correction. Range 0.0 to 1.0.
BOOL bBlemish
Set to TRUE to enable blemish removal.
BOOL bHighlightPreservation
Set to true to enable Highlight Preservation.
Use Fast mode of Face Aware Exposure pre-calculations.
Calculates for all of the above.
float centerX
X of center.
PFCENGINESTATUS
ENUM for engine initialization status.
Structure encapsulating Face Beautification parameters.
Struct describing V3 parameters.
int width
Pixel width of image.
Apply correction on most skin regions regardless they are linked with a face or not.
int iFinishContrast
Contrast correction amount.
PFCCORE_STATUS CORE_Status
Status code for CORE pre-calc analysis.
void PFC_DestroyEngine(PFCENGINE *p)
Destroy PFCENGINE instance and release associated resources.
Struct defining an image to be used in PFC library.
Average usage with brighter tone, corresponds to "Bright" in PfC Products.
Optimized to bring out more details in the shadows, more details in the highlights, and more pleasing skin tones.
int PFC_FBFaceCount(PFCPROFILE pImageProfile)
Return number of faces detected.
int iFinishVibrancy
Vibrancy correction amount.
AGGRESSIVENESS eAggressiveness
The desired level of lighting for Automatic Strength Selection to target at the Exposure Correction...
-2 Pointer pEngine is NULL
7 The face analysis did not complete successfully
SKINSMOOTHTYPE eSmoothType
See enum definition of SKINSMOOTHTYPE.
More aggressive in exposure correction.
CONTRASTMODE eContrastMode
Select contrast mode.
PFCINTERNAL pSFBParam
Internal use only.
PFCAPPLYSTATUS PFC_TransposeExif(PFCIMAGE *pImageSrc, int iEXIFOrientation)
Transpose image upright from/to EXIF Orientation.
PFCAPPLYSTATUS PFC_Apply(PFCIMAGE *pImage, PFCENGINE *pEngine, PFCPROFILE pImageProfile, PFCPARAM ¶m, PFC_PROGRESS progfn=NULL, int iOpacity=100, void *pBGProfile=NULL)
Correct image with parameters.
void PFC_GetVersion(char *buf, int *len, bool bFormatted=false)
Get info string with version and features.
BOOL bUseFAE
Set to TRUE (recommended) to enable Face Aware Exposure selection. Recommended exposure will be calcu...
int top
y in point corrdinate of this rect.
PFC3DLutInfo lutInputFoliageBrown
LUT data to apply.
-7 Wrong domain for WASM certificate
int blinkLevelL
Left eye Blink level.
PFCCOREPARAM core
Core corrections to apply.
int PFC_WasmSetCertificate(PFCENGINE *pEngine, const char *clientAPIKey, const char *certificate)
Pass certificate to authorize WASM SDK usage Certificate (2048 string) should match clientAPIKey and ...
int x
x coordinate of this point.
6 Image skipped, too small ( < 32 pixels )
PFCAPPLYSTATUS PFC_Resize(PFCIMAGE *pImageSrc, PFCIMAGE *pImageDst)
Resizes the input image to the dimensions specificed in by the output image. The output image must be...
BOOL(* PFC_PROGRESS)(int iPercent)
PFCNR_STATUS
Enumeration defining status of Noise Removal pre-calculation.
Structure defining face attributes detected by the Face Detection library.
PFCENGINE * PFC_CreateEngine()
Create PFCENGINE instance.
Stronger sharpening. Details are more pronounced.
int iDeFlash
Deflash level. Range 0 to 100.
Priority on minimum false positive detection.
float fTintScale
Scalar value of how much tint correction should be applied. Range 0.0 to 1.0.
Struct defining an image profile as calculated from PFC_Calc() function.
PFCRECT rcEyeR
Specifies the bounding rectangle of the right eye.
PFCRECT rect
Specifies the bounding rectangle of a face.
5 Image skipped due to legacy clipart detection method
PFCFEATURE
ENUM controlling types of calculations at the pre-calculation stage.
-8 Wrong APIKEY for WASM certificate
int height
height of this rect.
Structure encapsulating Red Eye Correction parameters.
int iBlackEnhancement
Set luminance threshold for Noise Management. Range 0 to 25.
BOOL bDynamicRange
Set to TRUE to enable dynamic range correction.
Intelligent Auto - this has been superceded by iAuto 2019 and is here for backwards compatability...
int width
width of this rect.
BOOL bBlush
Set to TRUE to add blush.
PFCAPPLYSTATUS PFC_ApplyLocal(PFCIMAGE *pImage, int xOffset, int yOffset, int widthOrig, int heightOrig, PFCENGINE *pEngine, PFCPROFILE pImageProfile, PFCPARAM ¶m, int iOpacity=100)
Apply correction locally.
int yawAngle
The Yaw or profile angle, from -90 (left profile) to 90 (right profile)
Vivid - good for landscapes and other general photography. This is in the 'Perfectly Clear Essentials...
-4 Pointer pImage is NULL, source image missing
int FAE[3]
Internal data for Face Aware Exposure.
float radius
only for MASK_ROUNDRECT - corner radius, relative to image w.
Darkens skin, makes it look naturally tanned.
iAuto Details - legacy preset for backwards compability. This is in the 'Athentech Legacy' group in E...
0.0 everywhere, don't apply
PFCPOINT rightEye
Point of right eye in detected face.
int iStrength
Set the strength of exposure correction. If Automatic Strength Selection is enabled, the recommended value is put in this variable upon function return. Range 0 to 150.
int confidence
A numerical parameter describing the confidence attributed by the detection algorithm to each face...
BOOL bInfrared
Set to TRUE (recommended default) to enable infrared correction. It's a good idea to turn Infrared Co...
Less aggressive in exposure correction.
void PFC_SetSingleThreadedEngine(PFCENGINE *p, bool bSingleThreaded)
Force processing to be single threaded.
Struct defining parameters for building BG mask.
unsigned char * data
Pointer pointing to the first byte of image data buffer.
int iCatchLight
Catchlight level. Range 0 to 100.
-11 Wrong format version of WASM certificate
Makes skin look lighter and more pale.
BOOL bEnabled
Set to TRUE to enable entire face beautification.
PFCINTERNAL pInternal
Internal use only.
BOOL bEnlarge
Set to TRUE to enable eye enlargement.
-1 Pointer pProfile is NULL
SKINMODE eSkinToningMode
Use SKINMODE_FACE to apply correction ONLY on skin regions included in faces. Use SKINMODE_BODY to ap...
Structure encapsulating Noise Removal parameters.
PFCFB_STATUS FB_Status
Status code for Face Beautification pre-calc analysis.
bool PFC_GetFaceInfo(PFCIMAGEPROFILE *pImageProfile, PFCFBFACEINFO *pFace, int index)
Utility function to query geometry of detected faces.
void PFC_ApplyStrengthToParam(PFCPARAM ¶m, int strength)
Apply overall strength to parameters, same as Strength in Perfecly Clear products Reads the correctio...
PFCRE_STATUS
Enumeration defining status of Red Eye pre-calculation.
int iPreprocessEV
EV correction amount (Image Ambulace)
6 Unable to create SFB Engine object for processing
Calculates for Perfectly Clear Core correction.
int smileLevel
Indicates the presence of a smile.
PFCINTERNAL pNoiseParam
Internal use only.
PFCREJECTOPTION
Enumeration defining rejection flags.
struct PFCCOREMask PFCCOREMask
Struct describing mask for grad filter, all coordinates are relative (Y/height, X/width) in final cro...
BOOL bSharpen
Set to TRUE to enable sharpening.
-9 WASM certificate invalid or not matching APIKEY and domain
BOOL bLightDiffusion
Set to TRUE to enable light diffusion during DCF correction.
int iDeltaR
Delta R correction amount.
PFCPIXELFORMAT format
Defines byte order of input buffer.
int PFC_ReadPresets(PFCPARAM ¶m, char *filename)
Load image processing settings from a .preset file. Use this function to load image processing settin...
int heightImage
image height
void PFC_SetAddonPath(const char *utf8AddonPath)
Set path to directory containing runtime add-ons such as .looks file(s) This enables searching for ad...
float feather
relative length of gradient, from where it starts (1.0) to where it is 0.0,
Calculates for Perfectly Clear Noise Removal.
PFCRECT rcEyeL
Specifies the bounding rectangle of the left eye.
#define PFCINTERNAL
Internal used pointer type.
Apply auto calculated bias mode and strength.
bool PFC_HasFaceBeautification(PFCENGINE *pEngine)
Check if Face Beautification is available.
BOOL bCatchLight
Set to TRUE to enable catchlight removal.
Beautify - provides a good default set of corrections for portratis and other photos of people...
Struct describing mask for grad filter, all coordinates are relative (Y/height, X/width) in final cro...
Based on iAuto 21, but with brighter Skin & Depth Bias for truer skin tone.
BOOL bLocalContrast
Set to true to enable Local Contrast.
PFCAPPLYSTATUS
Enumeration defining return code from the Apply() function.
struct PFCFaceRect PFCFACERECT
Structure defining face attributes detected by the Face Detection library.
bool invert
invert mask (x = 1.0 - x). NOTE: UI meaning of invert is: if one mask layer set invert = true ...
PFCPRESETID
ENUM for presets support by this SDK.
Structure defining face area detected from the SFB library.
PFCNR_STATUS NR_Status
Status code for Noise Removal pre-calc analysis.
BIASMODE
Enumeration defining BIAS analysis mode.
Skip Face Aware Exposure pre-calculations during Core pre-calculations.
The subtle correction removes the wrinkles and spots alone while it keeps the texture of the face unc...
-10 WASM certificate has expired
BOOL bTeeth
Set to TRUE to enable teeth whitening.
int iFinishHighlights
Highlights correction amount.
int iFinishExposure
Exposure correction amount.
10 Face beautification feature not available
int iSkinToning
Skin Toning level. Range 0 to 100.
void PFC_ReleaseAddonPath()
Releases resources from PFC_SetAddonPath function call.
3 Source image (pImage) is missing
float fDCF
Scale value to control intensity of Digital Color Fidelity correction. Range 0.0 to 1...
SKINSMOOTHTYPE
Enumeration defining types of Skin Smoothing correction.
BOOL bEnhance
Set to TRUE to enable eye enhancement.
int iLocalContrast
Amount of Local Contrast to apply. Range 0 to 100.
3 Source image (pImage) is missing
Calculates for Red Eye Removal.
The iAuto you love plus newly tuned settings for sharper images, accurate skin correction, and more depth. Read more here: https://eyeq.photos/business/iauto-2021.
int iFinishPositiveContrast
Positive Contrast correction amount.
int iMaxStrength
Use this value to limit the maximum Exposure to be applied on the Automatic Exposure Strength Selecti...
Fine touch of sharpening.
CONTRASTMODE
Enumeration defining contrast mode.
Reject simple images that don't benefit from correction, like solid colors. This was the default befo...
Turn off bias correction.
int iDeltaB
Delta B correction amount.
int iFinishSaturation
Saturation correction amount.
int PFC_SetProtectionPath(const char *utf8FolderPath, const char *liceseCode=NULL)
Set path to location of SDK License files This enables license protection and allows activation using...
Lip details are coarsely pronounced.
int iLipSharpen
Lip sharpening level. Range 0 to 100.
int iBlemish
Blemish removal level. Range 0 to 100.
int iBlush
Blush level. Range 0 to 100.
LIPSHARPENTYPE
Enumeration defining Lip Sharpening mode.
float fLightDiffusion
Scale value to control intensity of light diffusion correction.
int y
y coordinate of this point.
int iVibrancy
Degree of color vibrancy. This value will only be use when bVibrancy is TRUE. Very large values can p...
Optimized to bring higher contrast to the image.
int iFinishTint
Tint correction amount.
iAuto for even better image corrections
BOOL bSlim
Set to TRUE to enable face slimming.
SKINTONINGTYPE
Enumeration defining type of Skin Toning correction.
PFCRE_STATUS RE_Status
Status code for Red Eye pre-calc analysis.
PFCENGINESTATUS status
Status of engine defined in PFCENGINESTATUS. For NO-SFB version the status will always be ENGINESTATU...
float fSharpenScale
Sharpening intensity. This value controls how much sharpening to be applied. Range 0...
TINTCORRECTION eTintMode
ENUM value defined in TINTCORRECTION. It sets the aggressiveness of Tint Removal. ...
BOOL bSmooth
Set to TRUE to enable face smoothing.
PFCINTERNAL pRedEyeParam
Internal use only.
int PFC_AutoCorrect(PFCIMAGE *pImage, PFCIMAGE *pImageds, PFCPARAM ¶m, int iISO=-1, char *pCameraModel=NULL, BOOL bFastFAE=FALSE, PFC_PROGRESS progfn=NULL)
Single function to perform Perfectly Clear correction.
linear from 1.0 on bottom
Aggressive detection of tint.
int iFinishBlacks
Blacks correction amount.
If set, the library is unable to load the SFB library.
BOOL bDeFlash
Set to TRUE to enable deflash.
Calculates for Face Beautification.
LPPFCFACERECT PFC_EnumFAEFaceRect(PFCIMAGEPROFILE *pImageProfile, LPPFCFACERECT p)
Utility function to enumerate faces detected during Face Aware Exposure analysis. ...
int iSlim
Face slimming level. Range 0 to 100.