Perfectly Clear SDK Documentation  10.7.1.1191
PerfectlyClearPro.h File Reference

Public Header for Perfectly Clear SDK. More...

Go to the source code of this file.

Data Structures

struct  PFCPOINT
 Struct defining a point. More...
 
struct  PFCRECT
 Struct defining a rectangle. More...
 
struct  PFCFBFACEINFO
 Structure defining face area detected from the SFB library. More...
 
struct  PFCFaceRect
 Structure defining face attributes detected by the Face Detection library. More...
 
struct  PFCENGINE
 Struct defining an PFC engine instance. More...
 
struct  PFCIMAGE
 Struct defining an image to be used in PFC library. More...
 
struct  SELECTIVECOLOR
 Structure holding selective color correction params. More...
 
struct  PFCCOREPARAM
 Structure encapsulating the CORE processing parameters. More...
 
struct  PFCFBPARAM
 Structure encapsulating Face Beautification parameters. More...
 
struct  PFCNRPARAM
 Structure encapsulating Noise Removal parameters. More...
 
struct  PFCREPARAM
 Structure encapsulating Red Eye Correction parameters. More...
 
struct  PFC3DLutInfo
 Struct. More...
 
struct  PFCCOREMask
 Struct describing mask for grad filter, all coordinates are relative (Y/height, X/width) in final crop-rotated image *‍/. More...
 
struct  PFCV3PARAM
 Struct describing V3 parameters. More...
 
struct  DP2PARAM
 Struct describing parameters used via AI White Balance. More...
 
struct  PFCPARAM
 Struct PFCPARAM the master structure of all processing parameters. More...
 
struct  PFCIMAGEPROFILE
 Struct defining an image profile as calculated from PFC_Calc() function. More...
 
struct  BGMASKPARAM
 Struct defining parameters for building BG mask. More...
 
struct  PFCSCENEDESCRIPTION
 Scene description. More...
 

Functions

Main PfC Functions

These are the most commonly used functions which will be used in nearly every Perfectly Clear implementation. These are presented in the order they will need to be called in most implemnetations.

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 a license key file provided by EyeQ. More...
 
void PFC_SetParam (PFCPARAM &param, PFCPRESETID id=PRESET_IAUTO_PEOPLE)
 Initialize a PFCPARAM structure. More...
 
int PFC_ReadPresets (PFCPARAM &param, char *filename)
 Load image processing settings from a .preset file. Use this function to load image processing settings from a .preset file. You can export these from Perfectly Clear Workbench or Perfectly Clear Complete. Note: the first preset in the file will be used to load the settings into the param struct - so please export a single preset at a time for this purpose. More...
 
int PFC_AutoCorrect (PFCIMAGE *pImage, PFCIMAGE *pImageds, PFCPARAM &param, int iISO=-1, char *pCameraModel=NULL, BOOL bFastFAE=FALSE, PFC_PROGRESS progfn=NULL, PFCENGINE *pEngineAI=NULL, BOOL bUseAutoSDPreset=FALSE)
 Single function to perform Perfectly Clear correction. More...
 
void PFC_ReleaseProtectionPath ()
 Releases resources from PFC_SetProtectionPath function call.
 
Used with separate Calc and Apply functions

The separate Calc and Apply functions presented in this group allow for faster subsequent processing when image parameters change - for example in end-user software where photographers experiment with different correction parameers.

PFCENGINEPFC_CreateEngine ()
 Create PFCENGINE instance. More...
 
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, PFCENGINE *pEngineAI=NULL)
 Perform initial analysis on images. More...
 
PFCAPPLYSTATUS PFC_Apply (PFCIMAGE *pImage, PFCENGINE *pEngine, PFCPROFILE pImageProfile, PFCPARAM &param, PFC_PROGRESS progfn=NULL, int iOpacity=100, void *pBGProfile=NULL)
 Correct image with parameters. More...
 
void PFC_ReleaseProfile (PFCPROFILE pProfile)
 Release PFCPROFILE instance. More...
 
void PFC_DestroyEngine (PFCENGINE *p)
 Destroy PFCENGINE instance and release associated resources. More...
 

Macros

#define NRRETCODE(x)   (x & 0x000000FF)
 Decode return status of Noise Removal from master return code.
 
#define CORERETCODE(x)   ((x >> 8) & 0x000000FF)
 Decode return status of Core correction from master return code.
 
#define FBRETCODE(x)   ((x >> 16) & 0x000000FF)
 Decode return status of Face Beautification from master return code.
 
#define RERETCODE(x)   ((x >> 24) & 0x000000FF)
 Decode return status of Red Eye correction from master return code.
 
#define PFCINTERNAL   void*
 Internal used pointer type.
 
#define PFCPROFILE   PFCIMAGEPROFILE*
 Define.
 
#define PFCBGPROFILE   PFCINTERNAL
 For use in background color synchronization.
 

Typedefs

typedef BOOL(* PFC_PROGRESS) (int iPercent)
 
typedef struct PFCFaceRect PFCFACERECT
 Structure defining face attributes detected by the Face Detection library. More...
 
typedef struct PFCCOREMask PFCCOREMask
 Struct describing mask for grad filter, all coordinates are relative (Y/height, X/width) in final crop-rotated image *‍/.
 

Enumerations

enum  PFCPIXELFORMAT
 defines the format of the image data More...
 
enum  PFCENGINESTATUS
 ENUM for engine initialization status. More...
 
enum  PFCFEATURE
 ENUM controlling types of calculations at the pre-calculation stage. More...
 
enum  PFCPRESETID
 ENUM for presets support by this SDK. More...
 
enum  TINTCORRECTION
 Enumeration defining different abnormal tint analysis mode. More...
 
enum  CONTRASTMODE
 Enumeration defining contrast mode. More...
 
enum  DCFMODE
 Enumeration defining DCF analysis mode. More...
 
enum  AGGRESSIVENESS
 Enumeration defining Auto Exposure calculation modes. More...
 
enum  BIASMODE
 Enumeration defining BIAS analysis mode. More...
 
enum  SKINMODE
 Enumeration defining modes in Perfect Smooth analysis. More...
 
enum  SKINSMOOTHTYPE
 Enumeration defining types of Skin Smoothing correction. More...
 
enum  SKINTONINGTYPE
 Enumeration defining type of Skin Toning correction. More...
 
enum  LIPSHARPENTYPE
 Enumeration defining Lip Sharpening mode. More...
 
enum  PFCNR_STATUS
 Enumeration defining status of Noise Removal pre-calculation. More...
 
enum  PFCCORE_STATUS
 Enumeration defining status of Core pre-calculation. More...
 
enum  PFCFB_STATUS
 Enumeration defining status of Face Beautification pre-calculation. More...
 
enum  PFCRE_STATUS
 Enumeration defining status of Red Eye pre-calculation. More...
 
enum  PFCAPPLYSTATUS
 Enumeration defining return code from the Apply() function. More...
 
enum  PFCREJECTOPTION
 Enumeration defining rejection flags. More...
 
enum  PFCCOMPOSITE
 Enumeration defining results of PFC_DetectCompositeImage. More...
 
enum  PFCCORE_MASK_TYPE
 Enumeration describing mapping of PFCMask and PFC_MASK_TYPE with 'PFC' -> 'PFCCORE'. More...
 

Helper functions

These are less commonly used functions that augment more standard uses of the SDK with advanced features

enum  PFCAIFEATURE
 Flags defining type of model(s) to load with PFC_LoadAIEngine(). More...
 
void PFC_SetAddonPath (const char *utf8AddonPath)
 Set path to directory containing runtime add-ons such as .looks file(s) This enables searching for add-on (such as v3.looks) in specified location instead of current working directory of the calling process. More...
 
void PFC_ReleaseAddonPath ()
 Releases resources from PFC_SetAddonPath function call.
 
void PFC_LoadAddonLooks (PFCENGINE *pEngine, const char *addonLooksBuf, int buflen)
 Load addon looks from contents of .looks file(s) Allows to use addon looks when filesystem is not available. More...
 
int PFC_GetLooks3DLut (PFCENGINE *pEngine, const char *lookGuids, int *iLookStrengths, int *iLookContrasts, int *iLookSaturations, int iLooksCount, float *final3Dlut)
 Get final 3D 16x16x16 lut for external application of looks Allows to use custom GPU processing to apply looks. More...
 
bool PFC_HasFaceBeautification (PFCENGINE *pEngine)
 Check if Face Beautification is available. More...
 
int PFC_FBFaceCount (PFCPROFILE pImageProfile)
 Return number of faces detected. More...
 
int PFC_FAEFaceCount (PFCIMAGEPROFILE *pImageProfile)
 Return number of faces detected during Face Aware Exposure analysis. More...
 
bool PFC_GetFaceInfo (PFCIMAGEPROFILE *pImageProfile, PFCFBFACEINFO *pFace, int index)
 Utility function to query geometry of detected faces. More...
 
LPPFCFACERECT PFC_EnumFAEFaceRect (PFCIMAGEPROFILE *pImageProfile, LPPFCFACERECT p)
 Utility function to enumerate faces detected during Face Aware Exposure analysis. More...
 
bool PFC_IsNoiseDetected (PFCIMAGEPROFILE *pImageProfile, int iNoisePreset)
 Query if noise is detected. More...
 
bool PFC_AbnormalTintDetected (PFCIMAGEPROFILE *pImageProfile, TINTCORRECTION eTintMethod)
 Query if abnormal tint is detected. More...
 
int PFC_AutoCorrectPreset (PFCIMAGE *pImage, PFCIMAGE *pImageds, PFCPRESETID id=PRESET_IAUTO_PEOPLE, int iISO=-1, char *pCameraModel=NULL, BOOL bFastFAE=FALSE, PFC_PROGRESS progfn=NULL, PFCENGINE *pEngineAI=NULL)
 Single function to perform Perfectly Clear corrections. More...
 
int PFC_ReadPresetsFromStream (PFCPARAM &param, const char *s)
 Load image processing settings from a char buffer. More...
 
void PFC_SetSingleThreadedEngine (PFCENGINE *p, bool bSingleThreaded)
 Force processing to be single threaded. More...
 
void PFC_GetVersion (char *buf, int *len, bool bFormatted=false)
 Get info string with version and features. More...
 
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 larger than 32 pixels on the shorter side and smaller than 100,000 pixels on the longer side. More...
 
PFCAPPLYSTATUS PFC_TransposeExif (PFCIMAGE *pImageSrc, int iEXIFOrientation)
 Transpose image upright from/to EXIF Orientation. More...
 
void PFC_ApplyStrengthToParam (PFCPARAM &param, int strength)
 Apply overall strength to parameters, same as Strength in Perfecly Clear products Reads the correction parameters, then adjusts them all by the desired strength level, using the same method as in Perfectly Clear Complete, QuickDesk, and Workbench. More...
 
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 domain where the app is served. More...
 
void PFC_TrackSave (const char *clientAPIKey)
 Report image save event from WASM SDK. More...
 
void PFC_GetRecommendedParam (PFCIMAGEPROFILE *profile, PFCCOREPARAM *dst, PFCCOREPARAM *src)
 Get recommended values of auto params using result of precalc. More...
 
int PFC_LoadAIEngine (PFCENGINE *pEngineAI, unsigned int aifeatures, const char *binPath)
 Load AI models into engine. Takes time and memory. Use single PFCENGINE with loaded modules, you can pass pointer to the instance of this engine to PFC_Apply or. More...
 
int PFC_LoadAIEngineNative (PFCENGINE *pEngineAI, unsigned int aifeatures, const char *modelDynamic, int lenDynamic, const char *modelSD, int lenSD, const char *modelSkintone, int lenSkintone, const char *modelAicolor, int lenAicolor, const char *modelFDFront, int lenFDFront, const char *modelFDBack, int lenFDBack, const char *modelFaceMesh, int lenFaceMesh, const char *modelBlendShape, int lenBlendShape, int bUseAngroidGPU, const char *apikey, const char *certificate, int *statusCertificate)
 Loads/reloads platform-native (CoreML or TFLite) version of AI models into engine. Implemented in iOS and Android SDK Takes time and memory. Use single PFCENGINE with loaded modules, you can pass pointer to the instance of this engine to PFC_Apply or. Can also be used to re-load models, typically SD and skintone models. If modelSD... pointer is not null will unload previously loaded model (if any) and load the new one. If pointer is null then respective model remains loadee (or not loaded) into engine. More...
 
int PFC_LoadScenePresets (PFCENGINE *pEngine, const char *filePath, int modelUuid=0, int *presetUuid=NULL, int arrProfileUUIDLen=0)
 Loads AI Scene Detection group presets from presets file, and optionally re-loading different Scene Detection .pnn files as needed by the preset. More...
 
int PFC_LoadScenePresetsFromStream (PFCENGINE *pEngine, const char *buf, int lenBuf, int modelUuid=0, int *presetUuid=NULL, int arrProfileUUIDLen=0)
 Loads AI Scene Detection group presets from buffer, and optionally re-loading different Scene Detection .pnn files as needed by the preset. More...
 
int PFC_ReadScenePreset (PFCPARAM &param, PFCENGINE *pEngineAI, int scene)
 Fill param for the scene from the engine with previously loaded scene presets with PFC_LoadScenePresets. More...
 
int PFC_GetScene (PFCPROFILE precalc, int *version)
 Get scene detection label from profile obtained with PFC_Calc For this to work you need to pass AI_SCENE_DETECTION enabled engine as a last param of PFC_Calc. More...
 
bool PFC_GetSceneDetectionEngineInfo (PFCENGINE *pEngine, int *groupUUID, int *arrProfileUUID, int *arrProfileUUIDLen)
 Get loaded (with PFC_LoadAIEngine) categorization model info Call first with arrProfileUUID=NULL to get arrProfileUUIDLen to preallocate. More...
 
bool PFC_GetSceneDescription (PFCENGINE *pEngine, int index, PFCSCENEDESCRIPTION *sceneDescription)
 Get the scene description for the given index number. More...
 
void PFC_GetLastSceneProperties (PFCENGINE *pEngine, int *lastSceneLabel, int *lastSceneConfidence=NULL)
 Get last detected scene properties. More...
 
int PFC_DetectCompositeImage (PFCIMAGE *pImage, PFCENGINE *pEngine)
 Run detection of composite image. More...
 
const char * PFC_GetAutoSkintoneParameters (int skintoneType, int *strengthLut, int *strengthExposure)
 Returns auto parameters (lut GUID, core.iSkintoneStrengthLut and core.iSkintoneStrengthExposure) for given skintoneType. More...
 
PFCAPPLYSTATUS PFC_FillAiAutoValues (PFCPARAM &param, PFCIMAGEPROFILE *profile)
 Fills PFCPARAM with final values depending on detection results contained in PFCIMAGEPROFILE, typically obtained from PFC_Calc with CALC_AICOLOR|CALC_SKINTONE feature. More...
 

Detailed Description

Public Header for Perfectly Clear SDK.

************************************************

Definition in file PerfectlyClearPro.h.

Function Documentation

◆ PFC_AbnormalTintDetected()

bool PFC_AbnormalTintDetected ( PFCIMAGEPROFILE pImageProfile,
TINTCORRECTION  eTintMethod 
)

Query if abnormal tint is detected.

Utility function to query if abnormal tint is detected at certain detection mode.

Parameters
pImageProfile[in] - Profile returned from PFC_Calc() function.
eTintMethod[in] - TINTCORRECTION enum to specify tint detection method used.
Returns
True if abnormal tint is detected when tint detection mode is eTintMethod. False otherwise. If Core calculation is not enabled during PFC_Calc(), this query returns False.

◆ PFC_Apply()

PFCAPPLYSTATUS PFC_Apply ( PFCIMAGE pImage,
PFCENGINE pEngine,
PFCPROFILE  pImageProfile,
PFCPARAM param,
PFC_PROGRESS  progfn = NULL,
int  iOpacity = 100,
void *  pBGProfile = NULL 
)

Correct image with parameters.

Perform correction to image as defined by the PFCIMAGE structure using user parameters as defined in a PFCPARAM structure. Correction requires profile as calculated by the PFC_Calc() function.

Parameters
pImage[in, out] - Pointer to a PFCIMAGE structure that defines the image to be processed.
pEngine[in] - Pointer returned from PFC_CreateEngine() function.
pImageProfile[in] - Pointer to PFCPROFILE structure which is returned from the PFC_Calc() function.
param[in] - PFCPARAM structure that carries the process parameters.
progfn[in] - Pointer to progress monitoring function. See definition of PFC_PROGRESS.
iOpacity[in] - Control opacity of NR and CORE corrections. Range from 0 (non applied) to 100 (fully applied).
pBGProfile[in, out] - pointer to PFCBGPROFILE used for PFC_BGSync and BGApply
Returns
PFCAPPLYSTATUS described here PFC_Apply_Return_Values

◆ PFC_ApplyStrengthToParam()

void PFC_ApplyStrengthToParam ( PFCPARAM param,
int  strength 
)

Apply overall strength to parameters, same as Strength in Perfecly Clear products Reads the correction parameters, then adjusts them all by the desired strength level, using the same method as in Perfectly Clear Complete, QuickDesk, and Workbench.

Parameters
param[in, out] - PFCPARAM structure to read and modify
strength[in] - Strength of correction to apply. 0 = totally off 100 = default, 200 = Max

◆ PFC_AutoCorrect()

int PFC_AutoCorrect ( PFCIMAGE pImage,
PFCIMAGE pImageds,
PFCPARAM param,
int  iISO = -1,
char *  pCameraModel = NULL,
BOOL  bFastFAE = FALSE,
PFC_PROGRESS  progfn = NULL,
PFCENGINE pEngineAI = NULL,
BOOL  bUseAutoSDPreset = FALSE 
)

Single function to perform Perfectly Clear correction.

Single function that takes an input picture and enhances it base on user parameters. This function encapsulates all the details such as PFCENGINE, PFCPROFILE etc. and is suitable for use in server type mass processing environment. See sample project "SampleBasic" for usage details.

Parameters
pImage[in, out] - Pointer to a PFCIMAGE structure that defines the image to be processed.
pImageds[in] - Pointer to a PFCIMAGE structure that defines a supplementary down sampled image to be used in pre-calc analysis. This parameter can be NULL. However the use of such supplementary image is highly recommended.
param[in] - PFCPARAM structure that carries the process parameters.
iISO[in] - ISO value when the image is taken. Use -1 if not known.
pCameraModel[in] - Text string of camera model which the picture is taken with. Set to NULL if not known.
bFastFAE[in] - Set to true to run a faster Face Aware Exposure Calculation. Default is false.
progfn[in] - Pointer to progress monitoring function. See definition of PFC_PROGRESS.
pEngineAI[in] - optional pointer to instance of PFCENGINE with enabled AI (PFC_LoadAIEngine)
bUseAutoSDPreset[in] - if TRUE and if pEngineAI has AI_SCENE_DETECTION enabled auto detected scene preset will be applied instead of param
Returns
int representing PFCAPPLYSTATUS described here:
Return value
0The correction is successful.
> 0
Warning: Use macros to map out return code for each feature:
NRRETCODEReturns PFCNR_STATUS Noise Removal correction status.
CORERETCODEReturns PFCCORE_STATUS Core correction status.
FBRETCODEReturns PFCFB_STATUS Face Beautification correction status.
RERETCODEReturns PFCRE_STATUS Red Eye correction status.
< 0Error: PFCAPPLYSTATUS enum.
See Status Value Decoder page to convert a return code to human-readable messages.

◆ PFC_AutoCorrectPreset()

int PFC_AutoCorrectPreset ( PFCIMAGE pImage,
PFCIMAGE pImageds,
PFCPRESETID  id = PRESET_IAUTO_PEOPLE,
int  iISO = -1,
char *  pCameraModel = NULL,
BOOL  bFastFAE = FALSE,
PFC_PROGRESS  progfn = NULL,
PFCENGINE pEngineAI = NULL 
)

Single function to perform Perfectly Clear corrections.

Composite function that takes an input picture and enhances it using preset parameters specified by PFCPRESETID id.

Parameters
pImage[in, out] - Pointer to a PFCIMAGE structure that defines the image to be processed.
pImageds[in] - Pointer to a PFCIMAGE structure that defines a supplementary down sampled image to be used in pre-calc analysis. This parameter can be NULL. However the use of such supplementary image is highly recommended.
id[in] - PFCPRESETID to specify a preset to use.
iISO[in] - ISO value when the image is taken. Use -1 if not known.
pCameraModel[in] - Text string of camera model which the picture is taken with. Set to NULL if not known.
bFastFAE[in] - Set to true to run a faster Face Aware Exposure Calculation. Default is false.
progfn[in] - Pointer to progress monitoring function. See definition of PFC_PROGRESS.
pEngineAI[in] - optional pointer to instance of PFCENGINE with enabled AI (PFC_LoadAIEngine)
Returns
int representing PFCAPPLYSTATUS described here PFC_Apply_Return_Values

◆ PFC_Calc()

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,
PFCENGINE pEngineAI = NULL 
)

Perform initial analysis on images.

Performs initial analysis and calculation of image specific profile parameters. Profile calculation can be done incrementally. For example if calculation is done initially on Perfectly Clear Core. Calculation of other feature, say Face Beautification, can be done in subsequent calls to PFC_Calc().

Parameters
pImage[in] - Pointer to a PFCIMAGE structure that defines the image to be processed.
pImageds[in] - Pointer to a PFCIMAGE structure that defines a supplementary down sampled image (approx. 1024 longest dimension) to aid in red eye detection. Set this parameter to NULL if you don't supply this image.
pEngine[in] - Pointer returned from the PFC_CreateEngine() function.
feature[in] - Specify the type of calculations. Possible values are:
CALC_CORECalculates for Perfectly Clear Core correction.
CALC_NRCalculates for Perfectly Clear Noise Removal.
CALC_FBCalculates for Face Beautification.
CALC_RECalculates for Red Eye Removal.
CALC_ALLCalculates for all of the above.
CALC_NOTINTCALCDo not calculate Tint correction parameters.
CALC_NOFAEDo not use Face Aware Exposure
CALC_FAEHISPEEDUse High Speed Face Detection for FAE calculation
iISO[in] - ISO value when the image is taken. Use -1 if not known.
pCameraModel[in] - Text string of camera model which the picture is taken with. Set to NULL if not known.
pImageProfile[in] - Pointer to PFCPROFILE. Leave as NULL if this is first time calling the PFC_Calc function.
progfn[in] - Pointer to progress monitoring function. See definition of PFC_PROGRESS.
iRejectOption[in] - Set to a value from PFCREJECTOPTION. By default, this is set to PFC_REJECT_CLIPART
pEngineAI[in] - optional pointer to instance of PFCENGINE with enabled AI (PFC_LoadAIEngine)
Returns
PFCPROFILE of the image that was processed

◆ PFC_CreateEngine()

PFCENGINE* PFC_CreateEngine ( )

Create PFCENGINE instance.

Create core engine for use in Perfectly Clear image processing pipeline. The PFCENGINE module created by this function can be used in the entire session before PFC_DestroyEngine() is called.

Returns
PFCENGINE

◆ PFC_DestroyEngine()

void PFC_DestroyEngine ( PFCENGINE p)

Destroy PFCENGINE instance and release associated resources.

Release PFCENGINE module created by function PFC_CreateEngine() and release all resouces used by the PFCENGINE.

Parameters
p[in] - pointer to PFCENGINE instance to be released.

◆ PFC_DetectCompositeImage()

int PFC_DetectCompositeImage ( PFCIMAGE pImage,
PFCENGINE pEngine 
)

Run detection of composite image.

Parameters
pImage[in] - image to process
pEngine[in] - PFCENGINE instance AI-enabled with PFC_LoadAIEngine() with AI_COMPOSITE feature
Returns
int detection result with values from PFCCOMPOSITE enum

◆ PFC_EnumFAEFaceRect()

LPPFCFACERECT PFC_EnumFAEFaceRect ( PFCIMAGEPROFILE pImageProfile,
LPPFCFACERECT  p 
)

Utility function to enumerate faces detected during Face Aware Exposure analysis.

Pointer to the next face info as described in PFCFACERECT.

Example:

PFCFACERECT face = null;
while (face = PFC_EnumFAEFaceRect(pProfile, face))
{
// Use face info in PFCFACERECT
}
Parameters
pImageProfile[in] - Pointer to PFCPROFILE structure which is returned from the PFC_Calc() function.
p[in] - LPPFCFACERECT type. Last face rect returned from this function.
Returns
LPPFCFACERECT containing face data

◆ PFC_FAEFaceCount()

int PFC_FAEFaceCount ( PFCIMAGEPROFILE pImageProfile)

Return number of faces detected during Face Aware Exposure analysis.

Get number of faces detected during Face Aware Exposure analysis.

Parameters
pImageProfile[in] - Pointer to PFCPROFILE structure which is returned from the PFC_Calc() function.
Returns
int of number of faces found

◆ PFC_FBFaceCount()

int PFC_FBFaceCount ( PFCPROFILE  pImageProfile)

Return number of faces detected.

Get number of faces detected in the Face Beautification processing.

Parameters
pImageProfile[in] - Profile instance returned from PFC_Calc function.
Returns
int of number of faces found

◆ PFC_FillAiAutoValues()

PFCAPPLYSTATUS PFC_FillAiAutoValues ( PFCPARAM param,
PFCIMAGEPROFILE profile 
)

Fills PFCPARAM with final values depending on detection results contained in PFCIMAGEPROFILE, typically obtained from PFC_Calc with CALC_AICOLOR|CALC_SKINTONE feature.

Parameters
param[in, out] - PFCPARAM
profile[in] - PFCPROFILE obtained from PFC_Calc with CALC_AICOLOR|CALC_SKINTONE or filled with PFC_SetAiCorrectionsDetection
Returns
APPLY_SUCCESS on success or APPLY_ERROR_AI_CORRECTION_MISSING if pImageProfile does not contain successful result of aicolor/skintone detection

◆ PFC_GetAutoSkintoneParameters()

const char* PFC_GetAutoSkintoneParameters ( int  skintoneType,
int *  strengthLut,
int *  strengthExposure 
)

Returns auto parameters (lut GUID, core.iSkintoneStrengthLut and core.iSkintoneStrengthExposure) for given skintoneType.

Parameters
skintoneType[in] - same as core.iSkintoneType
strengthLut[out] - auto value of core.iSkintoneStrengthLut for given skintoneType
strengthExposure[out] - auto value of core.strengthExposure for given skintoneType
Returns
zero terminated string of lut guid

◆ PFC_GetFaceInfo()

bool PFC_GetFaceInfo ( PFCIMAGEPROFILE pImageProfile,
PFCFBFACEINFO pFace,
int  index 
)

Utility function to query geometry of detected faces.

Return True if face information is retrieved successfully. False if face is not detected or index is out of bound.

Example:

// Declare PFCFBFACEINFO structure
int numFaces = PFC_FBFaceCount(pProfile);
for(int i = 0; i < numFaces; i++)
{
if (PFC_GetFaceInfo(pProfile, &face, i))
{
// Do something with face info
}
}
Parameters
pImageProfile[in] - Profile returned from PFC_Calc() function.
pFace[in] - Pointer to PFCFBFACEINFO structure that carries face and eye details upon successful retrieval.
index[in] - Index navigating the list. Must be >=0 and < number of faces.
Returns
bool of success or failure

◆ PFC_GetLastSceneProperties()

void PFC_GetLastSceneProperties ( PFCENGINE pEngine,
int *  lastSceneLabel,
int *  lastSceneConfidence = NULL 
)

Get last detected scene properties.

Parameters
pEngine[in] - PFCENGINE instance AI-enabled with PFC_LoadAIEngine()
lastSceneLabel[out] - 0-based scene identifier
lastSceneConfidence[out] - 0 to 100 confidence of the assigned scene label

◆ PFC_GetLooks3DLut()

int PFC_GetLooks3DLut ( PFCENGINE pEngine,
const char *  lookGuids,
int *  iLookStrengths,
int *  iLookContrasts,
int *  iLookSaturations,
int  iLooksCount,
float *  final3Dlut 
)

Get final 3D 16x16x16 lut for external application of looks Allows to use custom GPU processing to apply looks.

Parameters
pEngine[in] - PFCENGINE instance
lookGuids[in] - zero-terminated concatenated string of fixed length (32 chars each) look guids
iLookStrengths[in] - array of looks strengths, each 0 .. 200
iLookContrasts[in] - array of contrasts, each -100 .. 100
iLookSaturations[in] - array of saturations, each -100 .. 100
iLooksCount[in] - count of looks (array elements)
final3Dlut[in, out] - preallocated buffer 16x16x16x3xsizeof(float) to fill with final 3D lut
Returns
1 on success, 0 on failure - if one of look guids is not found

◆ PFC_GetRecommendedParam()

void PFC_GetRecommendedParam ( PFCIMAGEPROFILE profile,
PFCCOREPARAM dst,
PFCCOREPARAM src 
)

Get recommended values of auto params using result of precalc.

Parameters
profile[in] - obtained from PFC_Calc
dst[in, out] - destination PFCCOREPARAM
src[in] - source PFCCOREPARAM

◆ PFC_GetScene()

int PFC_GetScene ( PFCPROFILE  precalc,
int *  version 
)

Get scene detection label from profile obtained with PFC_Calc For this to work you need to pass AI_SCENE_DETECTION enabled engine as a last param of PFC_Calc.

Parameters
precalc[in] - result of PFC_Calc
version[out] - version of detection engine
Returns
label of detected scene, -1 if none

◆ PFC_GetSceneDescription()

bool PFC_GetSceneDescription ( PFCENGINE pEngine,
int  index,
PFCSCENEDESCRIPTION sceneDescription 
)

Get the scene description for the given index number.

Parameters
pEngine[in] - PFCENGINE instance AI-enabled with PFC_LoadAIEngine()
index[in] - 0-based index to get the name for a given scene, unrelated to the scene guid
sceneDescription[out] - array of 100 characters to copy utf8 encoded scene name
Returns
true on success false otherwise

Example:

PFCSCENEDESCRIPTION sceneDescription;
int categoryIndex = 0;
while(PFC_GetSceneDescription(pEngine, index, &sceneDescription)) {
// use sceneDescription
++index;
}

◆ PFC_GetSceneDetectionEngineInfo()

bool PFC_GetSceneDetectionEngineInfo ( PFCENGINE pEngine,
int *  groupUUID,
int *  arrProfileUUID,
int *  arrProfileUUIDLen 
)

Get loaded (with PFC_LoadAIEngine) categorization model info Call first with arrProfileUUID=NULL to get arrProfileUUIDLen to preallocate.

Parameters
pEngine[in] - PFCENGINE instance AI-enabled with PFC_LoadAIEngine()
groupUUID[out] - UUID of categories group supported by the model, to match preset loaded with PFC_LoadScenePresets()
arrProfileUUID[out] - array of preset UUIDS inside the categories group, if NULL fills arrProfileUUIDLen
arrProfileUUIDLen[out] - length of array to preallocate, if NULL only reports groupUUID
Returns
false if AI engine was not loaded to pEngine or AI engine does not support categorization

◆ PFC_GetVersion()

void PFC_GetVersion ( char *  buf,
int *  len,
bool  bFormatted = false 
)

Get info string with version and features.

Parameters
buf[in, out] - receives zero terminate string of no more than len lenght, if NULL len will receive length to be allocated
len[in, out] - call with NULL first param to get necessary len to allocate, then pass it on next call
bFormatted- output key=value formatted ("version=x.x.x;commit=xxxx;avx=1;..."), or ("x.x.x xxx avx ...")

◆ PFC_HasFaceBeautification()

bool PFC_HasFaceBeautification ( PFCENGINE pEngine)

Check if Face Beautification is available.

Parameters
pEngine[in] - Pointer returned from PFC_CreateEngine() function
Returns
TRUE if Face Beautification is available. FALSE otherwise.

◆ PFC_IsNoiseDetected()

bool PFC_IsNoiseDetected ( PFCIMAGEPROFILE pImageProfile,
int  iNoisePreset 
)

Query if noise is detected.

True if noise is detected when noise preset is iPreset. False otherwise. If Noise calculation is not enabled during PFC_Calc(), this query returns False.

Parameters
pImageProfile[in] - Profile returned from PFC_Calc() function.
iNoisePreset[in] - Noise preset to be checked.
Returns
True if noise is detected in the image

◆ PFC_LoadAddonLooks()

void PFC_LoadAddonLooks ( PFCENGINE pEngine,
const char *  addonLooksBuf,
int  buflen 
)

Load addon looks from contents of .looks file(s) Allows to use addon looks when filesystem is not available.

Parameters
pEngine[in] - PFCENGINE instance
addonLooksBuf[in] - buffer with contents of .looks file, can be freed after call
buflen[in] - length of buffer

◆ PFC_LoadAIEngine()

int PFC_LoadAIEngine ( PFCENGINE pEngineAI,
unsigned int  aifeatures,
const char *  binPath 
)

Load AI models into engine. Takes time and memory. Use single PFCENGINE with loaded modules, you can pass pointer to the instance of this engine to PFC_Apply or.

This function takes a list of features to load, and a path to the folder containing the models.

Parameters
pEngineAI[in, out] - PFCENGINE instance which will keep loaded models
aifeatures[in] - PFCAIFEATURE flags e.g. AI_SCENE_DETECTION | AI_CORRECTIONS | AI_COLOR
binPath[in] - utf8 path to folder containing dependency libs and models (.pnn)
Returns
bitwise 'or' of successfully loaded PFCAIFEATURE(s)

◆ PFC_LoadAIEngineNative()

int PFC_LoadAIEngineNative ( PFCENGINE pEngineAI,
unsigned int  aifeatures,
const char *  modelDynamic,
int  lenDynamic,
const char *  modelSD,
int  lenSD,
const char *  modelSkintone,
int  lenSkintone,
const char *  modelAicolor,
int  lenAicolor,
const char *  modelFDFront,
int  lenFDFront,
const char *  modelFDBack,
int  lenFDBack,
const char *  modelFaceMesh,
int  lenFaceMesh,
const char *  modelBlendShape,
int  lenBlendShape,
int  bUseAngroidGPU,
const char *  apikey,
const char *  certificate,
int *  statusCertificate 
)

Loads/reloads platform-native (CoreML or TFLite) version of AI models into engine. Implemented in iOS and Android SDK Takes time and memory. Use single PFCENGINE with loaded modules, you can pass pointer to the instance of this engine to PFC_Apply or. Can also be used to re-load models, typically SD and skintone models. If modelSD... pointer is not null will unload previously loaded model (if any) and load the new one. If pointer is null then respective model remains loadee (or not loaded) into engine.

Parameters
pEngineAI[in, out] - PFCENGINE instance which will keep loaded models
aifeatures[in] - PFCAIFEATURE flags e.g. AI_SCENE_DETECTION | AI_CORRECTIONS | AI_COLOR
modelDynamic[in] - iOS: utf8 path to PFC Dynamic model (.pnnc); Android: buffer with file contents, or nullptr.
lenDynamic[in] - iOS: ignored; Android: buffer length
modelSD[in] - iOS: utf8 path to PFC scene detection model (.pnn); Android: buffer with file contents, or nullptr.
lenSD[in] - iOS: ignored; Android: buffer length
modelSkintone[in] - iOS: utf8 path to PFC skintone detection model (.pnn); Android: buffer with file contents, or nullptr.
lenSkintone[in] - iOS: ignored; Android: buffer length
modelAicolor[in] - iOS: utf8 path to PFC aicolor detection model (.pnn); Android: buffer with file contents, or nullptr.
lenAicolor[in] - iOS: ignored; Android: buffer length
modelFDFront[in] - iOS: utf8 path to PFC fdfront detection model (.pnn); Android: buffer with file contents, or nullptr.
lenFDFront[in] - iOS: ignored; Android: buffer length
modelFDBack[in] - iOS: utf8 path to PFC fdback detection model (.pnn); Android: buffer with file contents, or nullptr.
lenFDBack[in] - iOS: ignored; Android: buffer length
modelFaceMesh[in] - iOS: utf8 path to PFC facemesh detection model (.pnn); Android: buffer with file contents, or nullptr.
lenFaceMesh[in] - iOS: ignored; Android: buffer length
modelBlendShape[in] - iOS: utf8 path to PFC blendshape detection model (.pnn); Android: buffer with file contents, or nullptr.
lenBlendShape[in] - iOS: ignored; Android: buffer length
bUseAngroidGPU[in] - iOS: ignored; Android: use GPU TFLite delegate
apikey[in] - iOS SDK apikey
certificate[in] - iOS SDK certificate
statusCertificate[out] - status of certificate, values > -1 are OK, mean remaining validity days
Returns
bitwise 'or' of successfully loaded PFCAIFEATURE(s)

◆ PFC_LoadScenePresets()

int PFC_LoadScenePresets ( PFCENGINE pEngine,
const char *  filePath,
int  modelUuid = 0,
int *  presetUuid = NULL,
int  arrProfileUUIDLen = 0 
)

Loads AI Scene Detection group presets from presets file, and optionally re-loading different Scene Detection .pnn files as needed by the preset.

If engine has Scene Detection (SD) enabled with PFC_LoadAIEngine(): Preset (or modelUuid) is checked for compatibility with loaded scene detection model, and if the proper model is not already loaded, it will automatically unload and attempt to reload the correct SD models.

If Engine does not have its own SD: It can be used to parse and analayze the preset: requiredModelUUID tells which SD model this preset needs, and PFC_ReadScenePreset() can be used to read scene params if scene detection was done separately

Parameters
pEngine[in] - PFCENGINE instance, optionally with already loaded AI Engine with PFC_LoadAIEngine()
filePath[in] - path to .preset file or NULL to load presets embedded into default SD model.
modelUuid[in] - if filePath is 0 will try to load SD model of this uuid and use presets embedded to the model. O means default SD uuid.
presetUuid[in, out] - if preset is SD preset, returns required SD model uuid, otherwise -1
arrProfileUUIDLen[in] - unused
Returns
0 on success or same error codes as PFC_ReadPresets()

◆ PFC_LoadScenePresetsFromStream()

int PFC_LoadScenePresetsFromStream ( PFCENGINE pEngine,
const char *  buf,
int  lenBuf,
int  modelUuid = 0,
int *  presetUuid = NULL,
int  arrProfileUUIDLen = 0 
)

Loads AI Scene Detection group presets from buffer, and optionally re-loading different Scene Detection .pnn files as needed by the preset.

If engine has Scene Detection (SD) enabled with PFC_LoadAIEngine(): Preset is checked for compatibility with loaded scene detection model, and if the proper model is not already loaded, it will automatically unload and attempt to reload the correct SD models.

If Engine does not have its own SD: It can be used to parse and analayze the preset: requiredModelUUID tells which SD model this preset needs, and PFC_ReadScenePreset() can be used to read scene params if scene detection was done separately

Parameters
pEngine[in] - PFCENGINE instance, optionally with already loaded AI Engine with PFC_LoadAIEngine()
buf[in] - buffer containing preset string
lenBuf[in] - length of preset string
modelUuid[in] - if filePath is 0 will try to load SD model of this uuid and use presets embedded to the model. O means default SD uuid.
presetUuid[in, out] - if preset is SD preset, returns required SD model uuid, otherwise -1
arrProfileUUIDLen[in] - unused
Returns
0 on success or same error codes as PFC_ReadPresets()

◆ PFC_ReadPresets()

int PFC_ReadPresets ( PFCPARAM param,
char *  filename 
)

Load image processing settings from a .preset file. Use this function to load image processing settings from a .preset file. You can export these from Perfectly Clear Workbench or Perfectly Clear Complete. Note: the first preset in the file will be used to load the settings into the param struct - so please export a single preset at a time for this purpose.

Parameters
param[in, out] - PFCPARAM structure to fill with the process parameters.
filename[in] - Path and filename for the .preset file to read and load.
Returns
int showing Status
return code meaning
0 OK
-1 Attribute errors
-2 Unable to open file
-3 File read error
-4 Parse error
-5 Cannot convert text
-6 No text node
-7 Element depth exceeded
-8 Invalid preset file
-9 Preset file contains an unexpected group
-10 Preset file requires a Scene Detection model that is not available

◆ PFC_ReadPresetsFromStream()

int PFC_ReadPresetsFromStream ( PFCPARAM param,
const char *  s 
)

Load image processing settings from a char buffer.

Use this function to load image processing settings from a char buffer (stream). You can export these from Perfectly Clear Workbench or Perfectly Clear Complete. Note: the first preset in the file will be used to load the settings into the param struct - so please export a single preset at a time for this purpose. This function is very similar to PFC_ReadPresets, but accepts the preset data from a file stream instead of from a file on disk.

Parameters
param[in, out] - PFCPARAM structure to fill with the process parameters.
s[in] - const char buffer to read and load presets from.
Returns
0 on success or same error codes as PFC_ReadPresets

◆ PFC_ReadScenePreset()

int PFC_ReadScenePreset ( PFCPARAM param,
PFCENGINE pEngineAI,
int  scene 
)

Fill param for the scene from the engine with previously loaded scene presets with PFC_LoadScenePresets.

Parameters
param[in, out] - PFCPARAM to be filled
pEngineAI[in] - PFCENGINE instance with already loaded PFC_LoadScenePresets
scene[in] - detected scene
Returns
0 on success or same error codes as PFC_ReadPresets()

◆ PFC_ReleaseProfile()

void PFC_ReleaseProfile ( PFCPROFILE  pProfile)

Release PFCPROFILE instance.

Release PFCPROFILE instance and its associated resources.

Parameters
pProfile[in] - pointer to PFCPROFILE instance returned from PFC_Calc funciton.

◆ PFC_Resize()

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 larger than 32 pixels on the shorter side and smaller than 100,000 pixels on the longer side.

Parameters
pImageSrc[in] - Input image
pImageDst[out] - output image, should have same format as pImageSrc or PFC_PixelFormat24bppBGR
Returns
PFCAPPLYSTATUS showing status

◆ PFC_SetAddonPath()

void PFC_SetAddonPath ( const char *  utf8AddonPath)

Set path to directory containing runtime add-ons such as .looks file(s) This enables searching for add-on (such as v3.looks) in specified location instead of current working directory of the calling process.

Parameters
utf8AddonPath[in] - UTF8 encoded path to the folder that contains .looks file(s)

◆ PFC_SetParam()

void PFC_SetParam ( PFCPARAM param,
PFCPRESETID  id = PRESET_IAUTO_PEOPLE 
)

Initialize a PFCPARAM structure.

SetParam initializes a PFCPARAM structure with parameters pertaining to Athentech preset as identified by the PFCPRESETID. If preset id is not provided, the default preset values will be used.

Parameters
param[in, out] - PFCPARAM structure to be set.
id[in] - enum PFCPRESETID (default to PRESET_IAUTO_PEOPLE).

◆ PFC_SetProtectionPath()

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 a license key file provided by EyeQ.

Parameters
utf8FolderPath[in] - UTF8 encoded path to the folder that contains the SDK license files
liceseCode[in] - optional 18-digits license code to be used instead of license.key in utf8FolderPath
Returns
int showing status
return code meaning
0 OK
101 Undetermined errors
102 Success: Active license
103 Success: Active trial
104 License expired
105 System time tampered
106 Product not authorized
107 Product not found
108 Invalid license
109 License returned
110 Product inactive
111 Invalid trial period
112 Too many activation
113 Trial expired
114 License number inactive
115 Exceed allowed activation
116 Subscription expired
117 Invalid system date
118 Product in invalid state
119 No available licenses
120 Duplicate device ID
121 High missing heartbeat

◆ PFC_SetSingleThreadedEngine()

void PFC_SetSingleThreadedEngine ( PFCENGINE p,
bool  bSingleThreaded 
)

Force processing to be single threaded.

Set bSingleThreaded to TRUE to force processing in single thread mode.

Parameters
p[in, out] - pointer to PFCENGINE instance as returned from PFC_CreateEngine().
bSingleThreaded[in] - set to TRUE to enable single thread processing.

◆ PFC_TrackSave()

void PFC_TrackSave ( const char *  clientAPIKey)

Report image save event from WASM SDK.

Parameters
clientAPIKey[in] - WASM API Key issued by EyeQ

◆ PFC_TransposeExif()

PFCAPPLYSTATUS PFC_TransposeExif ( PFCIMAGE pImageSrc,
int  iEXIFOrientation 
)

Transpose image upright from/to EXIF Orientation.

Parameters
pImageSrc[in, out] - image to transpose
iEXIFOrientation[in] - EXIF orientation tag value. Use negative to do reverse (upright to orientation)
Returns
PFCAPPLYSTATUS showing status

◆ PFC_WasmSetCertificate()

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 domain where the app is served.

Parameters
pEngine[in] - PFCENGINE instance
clientAPIKey[in] - WASM API Key issued by EyeQ
certificate[in] - certificate obtained for API Key and domain from EyeQ
Returns
int positive: seconds valid, negative: PFCAPPLYSTATUS of the error

Typedef Documentation

◆ PFC_PROGRESS

typedef BOOL(* PFC_PROGRESS) (int iPercent)

defines the call format of a progress function. return TRUE to cancel processing. FALSE to continue.

Definition at line 36 of file PerfectlyClearPro.h.

◆ PFCFACERECT

typedef struct PFCFaceRect PFCFACERECT

Structure defining face attributes detected by the Face Detection library.

Detection levels:*

  • -1 = not detected
  • 0 = not able to detect
  • 1 to 100 = attribute detected, higher value means higher confidence, with 50 being a good trade-off between detection and false-positive.

Enumeration Type Documentation

◆ AGGRESSIVENESS

Enumeration defining Auto Exposure calculation modes.

Enumerator
AGGRESSIVENESS_CONSERVATIVE 

Less aggressive in exposure correction.

AGGRESSIVENESS_MODERATE 

Moderate level of exposure correction.

AGGRESSIVENESS_AGGRESSIVE 

More aggressive in exposure correction.

Definition at line 288 of file PerfectlyClearPro.h.

◆ BIASMODE

enum BIASMODE

Enumeration defining BIAS analysis mode.

Enumerator
BIAS_NONE 

Turn off bias correction.

BIAS_ASIAN_PREFERENCE 

Fine tuned for Asian skin tone.

BIAS_AVERAGE_PREFERENCE 

For average usage, corresponds to "Normal" in PfC Products.

BIAS_BRIGHTER_PREFERENCE 

Average usage with brighter tone, corresponds to "Bright" in PfC Products.

BIAS_DONT_BOTHER 

Reserved, never use.

BIAS_AUTO 

Apply auto calculated bias mode and strength.

Definition at line 296 of file PerfectlyClearPro.h.

◆ CONTRASTMODE

Enumeration defining contrast mode.

Enumerator
HIGH_CONTRAST 

Optimized to bring higher contrast to the image.

HIGH_DEFINITION 

Optimized to bring out more details in the shadows, more details in the highlights, and more pleasing skin tones.

Definition at line 274 of file PerfectlyClearPro.h.

◆ DCFMODE

enum DCFMODE

Enumeration defining DCF analysis mode.

Enumerator
DCF_STANDARD 

For normal photo.

DCF_VIVID 

For more color vibrancy.

Definition at line 281 of file PerfectlyClearPro.h.

◆ LIPSHARPENTYPE

Enumeration defining Lip Sharpening mode.

Enumerator
LIPSHARPENTYPE_FINE 

Fine touch of sharpening.

LIPSHARPENTYPE_MEDIUM 

Stronger sharpening. Details are more pronounced.

LIPSHARPENTYPE_COARSE 

Lip details are coarsely pronounced.

Definition at line 332 of file PerfectlyClearPro.h.

◆ PFCAIFEATURE

Flags defining type of model(s) to load with PFC_LoadAIEngine().

Enumerator
AI_SCENE_DETECTION 

Loads scene detection model, requiring one or two pnn files with filenames like pro_and_universal_20211221.pnn or skintone_20211221.pnn

AI_CORRECTIONS 

Loads AI-based corrections model, requiring the file dynamic.pnn

AI_COMPOSITE 

Loads composite detection model, requiring the file composite.pnn

AI_SKINTONE 

Loads skintone detection model. This is enabled automatically when using AI_SCENE_DETECTION.

AI_COLOR 

Loads AI White Balance color corrections model, requiring the file aicolor.pnn

Definition at line 1107 of file PerfectlyClearPro.h.

◆ PFCAPPLYSTATUS

Enumeration defining return code from the Apply() function.

Enumerator
APPLY_SUCCESS 

0 Success.

APPLY_ERROR_PROFILE_MISSING 

-1 Pointer pProfile is NULL

APPLY_ERROR_ENGINE_MISSING 

-2 Pointer pEngine is NULL

APPLY_CANCELLED 

-3 Operation cancelled

APPLY_NOSOURCE 

-4 Pointer pImage is NULL, source image missing

APPLY_BADFORMAT 

-5 Pixel format not supported

APPLY_INVALIDLICENSE 

-6 Invalid License or validation failed

APPLY_WASM_INVALID_DOMAIN 

-7 Wrong domain for WASM certificate

APPLY_WASM_INVALID_APIKEY 

-8 Wrong APIKEY for WASM certificate

APPLY_WASM_INVALID_CERTIFICATE 

-9 WASM certificate invalid or not matching APIKEY and domain

APPLY_WASM_EXPIRED_CERTIFICATE 

-10 WASM certificate has expired

APPLY_WASM_CERTIFICATE_WRONG_VERSION 

-11 Wrong format version of WASM certificate

APPLY_LOOKS_MISSING 

-12 tried to apply a LUT but the LUTs file was not found

APPLY_ERROR_AI_CORRECTION_MISSING 

-13 Tried to apply AI-based correction but is not available

Definition at line 392 of file PerfectlyClearPro.h.

◆ PFCCOMPOSITE

Enumeration defining results of PFC_DetectCompositeImage.

Enumerator
PFC_COMPOSITE_FAILED 

detection failed or not available, do not perform composite segmentation

PFC_COMPOSITE_SKIP 

is unsupported composite, skip processing

PFC_COMPOSITE_PHOTO 

is photo, do not perform composite segmentation

PFC_COMPOSITE_TYPE_0 

is composite, do segmentation of type 0

PFC_COMPOSITE_TYPE_1 

is composite, do segmentation of type 1

PFC_COMPOSITE_V2_0 

v2 label 0. Skip processing this segmented rect

PFC_COMPOSITE_V2_1 

v2 label 1. Process this rect

PFC_COMPOSITE_V2_2 

v2 label 2. If all segmented rects are 2, process full page as photo, if mix of 2 and non-2 labels, skip entire page

Definition at line 419 of file PerfectlyClearPro.h.

◆ PFCCORE_MASK_TYPE

Enumeration describing mapping of PFCMask and PFC_MASK_TYPE with 'PFC' -> 'PFCCORE'.

Enumerator
MASK_NONE 

0.0 everywhere, don't apply

MASK_ALL 

1.0 everywhere (background)

MASK_RADIAL 

ellipse

MASK_TOP 

linear from 1.0 on top

MASK_BOTTOM 

linear from 1.0 on bottom

MASK_ROUNDRECT 

rounded rect

Definition at line 558 of file PerfectlyClearPro.h.

◆ PFCCORE_STATUS

Enumeration defining status of Core pre-calculation.

Enumerator
PFC_CORE_SUCCESS 

0 Success

PFC_CORE_NOTENABLED 

1 Feature not enabled

PFC_CORE_CANCELLED 

2 Process cancelled

PFC_CORE_NOSOURCEIMAGE 

3 Source image (pImage) is missing

PFC_CORE_INSUFFICIENTMEMORY 

4 Process aborted because of insufficient memory

PFC_CORE_MONOLITHIMAGE 

5 Image skipped due to legacy clipart detection method

PFC_CORE_BELOWMINSIZE 

6 Image skipped, too small ( < 32 pixels )

PFC_CORE_CLIPARTIMAGE 

7 Image skipped due AI Clipart detection

Definition at line 352 of file PerfectlyClearPro.h.

◆ PFCENGINESTATUS

ENUM for engine initialization status.

Enumerator
ENGINESTATUS_OK 

Engine created successfully.

ENGINESTATUS_FB_LIBRARY_LOAD_FAIL 

If set, the library is unable to load the SFB library.

ENGINESTATUS_FB_FUNCTION_NOT_FOUND 

If set, the library is unable to locate SFB functions from the loaded library.

Definition at line 155 of file PerfectlyClearPro.h.

◆ PFCFB_STATUS

Enumeration defining status of Face Beautification pre-calculation.

Enumerator
PFC_FB_SUCCESS 

0 Success

PFC_FB_NOTENABLED 

1 Feature not enabled

PFC_FB_WARNING 

2 Warning: face not detected

PFC_FB_FULLRES_REQUIRED 

3 Source image (pImage) is missing

PFC_FB_CANCELLED 

4 Process cancelled

PFC_FB_FUNCTION_ERROR 

5 Unable to locate function in the SFBEngine library

PFC_FB_CREATE_ENGINE_FAILED 

6 Unable to create SFB Engine object for processing

PFC_FB_ANALYSIS_FAILED 

7 The face analysis did not complete successfully

PFC_FB_NO_CORRECTION 

8 No correction occur during process

PFC_FB_NOT_EXECUTED 

9 Not executed

PFC_FB_NOT_AVAILABLE 

10 Face beautification feature not available

Definition at line 364 of file PerfectlyClearPro.h.

◆ PFCFEATURE

enum PFCFEATURE

ENUM controlling types of calculations at the pre-calculation stage.

Enumerator
CALC_CORE 

Calculates for Perfectly Clear Core correction.

CALC_NR 

Calculates for Perfectly Clear Noise Removal.

CALC_FB 

Calculates for Face Beautification.

CALC_RE 

Calculates for Red Eye Removal.

CALC_ALL 

Calculates for all classic features, all of the above.

CALC_NOTINTCALC 

Skip pre-calculations on Abnormal Tint Correction during Core pre-calculations.

CALC_NOFAE 

Skip Face Aware Exposure pre-calculations during Core pre-calculations.

CALC_FAEHISPEED 

Use Fast mode of Face Aware Exposure pre-calculations.

CALC_CARTOON_DETECTOR 

Calculate legacy cartoon detector.

CALC_SCENE_DETECTION 

Calculate Scene Detection.

CALC_COMPOSITE 

Calculate Composite Detection.

CALC_SKINTONE 

Calculate Skintone Detection.

CALC_AICOLOR 

Calculate Auto WB params.

Definition at line 162 of file PerfectlyClearPro.h.

◆ PFCNR_STATUS

Enumeration defining status of Noise Removal pre-calculation.

Enumerator
PFC_NR_SUCCESS 

0 Success

PFC_NR_NOTENABLED 

1 Feature not enabled

PFC_NR_FULLRES_REQUIRED 

2 Source image (pImage) is missing

PFC_NR_CANCELLED 

3 Process cancelled

PFC_NR_ERRBITMAP 

4 Error reading image data

PFC_NR_ERRSETTINGS 

5 Invalid parameter

PFC_NR_MISC_ERROR 

6 General error

PFC_NR_NOTFOUND 

7 Noise not found

Definition at line 340 of file PerfectlyClearPro.h.

◆ PFCPIXELFORMAT

defines the format of the image data

Enumerator
PFC_PixelFormat24bppRGB 

24 bit RGB - the format is 24 bits per pixel; 8 bits each are used for the red, green, and blue components.

B0 G0 R0 B1 G1 R1 ...
PFC_PixelFormat24bppBGR 

24 bit RGB - the format is 24 bits per pixel; 8 bits each are used for the red, green, and blue components.

R0 G0 B0 R1 G1 B1 ...
PFC_PixelFormat32bppABGR 

32 bit ABGR - the format is 32 bits per pixel; 8 bits each are used for the alpha, red, green, and blue components.

R0 G0 B0 A0 R1 G1 B1 A1 ...
PFC_PixelFormat48bppRGB 

48 bit RGB - the format is 48 bits per pixel; 16 bits each are used for the red, green, and blue components. The 16 bit word is Little-endian.

B0 G0 R0 B1 G1 R1 ...
PFC_PixelFormat64bppARGB 

64 bit ARGB - the format is 64 bits per pixel; 16 bits each are used for the alpha, red, green, and blue components. The 16 bit word is Little-endian.

B0 G0 R0 A0 B1 G1 R1 A1 ...
PFC_PixelFormat32bppARGB 

32 bit ARGB - the format is 32 bits per pixel; 8 bits each are used for the alpha, red, green, and blue components.

B0 G0 R0 A0 B1 G1 R1 A1 ...
PFC_PixelFormat48bppBGR 

48 bit BGR - the format is 48 bits per pixel; 16 bits each are used for the red, green, and blue components. The 16 bit word is Little-endian.

R0 G0 B0 R1 G1 B1 ...
PFC_PixelFormat64bppABGR 

64 bit ABGR - the format is 64 bits per pixel; 16 bits each are used for the alpha, red, green, and blue components. The 16 bit word is Little-endian.

R0 G0 B0 A0 R1 G1 B1 A1 ...

Definition at line 39 of file PerfectlyClearPro.h.

◆ PFCPRESETID

ENUM for presets support by this SDK.

Enumerator
PRESET_NONE 

All off.

PRESET_BEAUTIFY 

Beautify - provides a good default set of corrections for portratis and other photos of people. This is in the 'Perfectly Clear Essentials' group in EyeQ products.

PRESET_BEAUTIFYPLUS 

Beautify Plus provides stronger beautification corrections. This is in the 'Perfectly Clear Essentials' group in EyeQ products.

PRESET_DETAILS 

iAuto Details - legacy preset for backwards compability. This is in the 'Athentech Legacy' group in EyeQ products.

PRESET_VIVID 

Vivid - good for landscapes and other general photography. This is in the 'Perfectly Clear Essentials' group in EyeQ products.

PRESET_INTELLIGENTAUTO 

Intelligent Auto - this has been superceded by iAuto 2019 and is here for backwards compatability. The corrections it provides are still very good!

PRESET_IAUTO_2019 

iAuto for even better image corrections

PRESET_IAUTO_2019_RE 

iAuto 2019 with Red Eye correciton enabled

PRESET_IAUTO_21 

The iAuto you love plus newly (2021) tuned settings for sharper images, accurate skin correction, and more depth.

PRESET_IAUTO_21_ASIA 

Based on iAuto 21, but with brighter Skin & Depth Bias for truer skin tone.

PRESET_IAUTO_PEOPLE 

New default preset for 2023 - same corrections as iAuto People from the Universal AI Preset Selection group.

Definition at line 180 of file PerfectlyClearPro.h.

◆ PFCRE_STATUS

Enumeration defining status of Red Eye pre-calculation.

Enumerator
PFC_RE_SUCCESS 

0 Success

PFC_RE_NOTENABLED 

1 Feature not enabled

PFC_RE_FULLRES_REQUIRED 

2 Source image (pImage) is missing

PFC_RE_NOT_FOUND 

3 Red eye not found

PFC_RE_GEN_ERROR 

4 General error

PFC_RE_INVALID_PARAMETER 

5 Invalid parameter

PFC_RE_NO_MEMORY 

6 Insufficient memory

PFC_RE_CANCELLED 

7 Process cancelled

PFC_RE_NOT_SUPPORTED 

8 Not supported

Definition at line 379 of file PerfectlyClearPro.h.

◆ PFCREJECTOPTION

Enumeration defining rejection flags.

Enumerator
PFC_REJECT_NONE 

Disable image rejection.

PFC_REJECT_MONOLITH 

Reject simple images that don't benefit from correction, like solid colors. This was the default before version 8.5.

PFC_REJECT_CLIPART 

Reject images classified as clipart, used by default.

Definition at line 411 of file PerfectlyClearPro.h.

◆ SKINMODE

enum SKINMODE

Enumeration defining modes in Perfect Smooth analysis.

Enumerator
SKINMODE_FACE 

Apply correction ONLY on skin regions included in faces.

SKINMODE_BODY 

Apply correction on most skin regions regardless they are linked with a face or not.

Definition at line 307 of file PerfectlyClearPro.h.

◆ SKINSMOOTHTYPE

Enumeration defining types of Skin Smoothing correction.

Enumerator
SKINSMOOTHTYPE_SUBTLE 

The subtle correction removes the wrinkles and spots alone while it keeps the texture of the face unchanged.

SKINSMOOTHTYPE_DEFAULT 

This type of correction provides a more uniform appearance to the complexion. It combines the natural look of the SUBTLE mode with the improved efficiency of SUPERSMOOTH.

SKINSMOOTHTYPE_SUPERSMOOTH 

This is a more aggressive and effective correction where the appearance of the entire skin (including wrinkles, spots, hot spots) is changed (softened).

Definition at line 314 of file PerfectlyClearPro.h.

◆ SKINTONINGTYPE

Enumeration defining type of Skin Toning correction.

Enumerator
SKINTONINGTYPE_WHITE 

Whitens (bleaches) face. Recommended mainly for darker skin.

SKINTONINGTYPE_PALE 

Makes skin look lighter and more pale.

SKINTONINGTYPE_WARM 

Warms skin tone.

SKINTONINGTYPE_TAN 

Darkens skin, makes it look naturally tanned.

SKINTONINGTYPE_FOUNDATION 

Adjust skin to user defined foundation color.

Definition at line 322 of file PerfectlyClearPro.h.

◆ TINTCORRECTION

Enumeration defining different abnormal tint analysis mode.

Enumerator
TINTCORRECT_AGGRESSIVE 

Aggressive detection of tint.

TINTCORRECT_DEFAULT 

Moderate level of tint detection.

TINTCORRECT_CONSERVATIVE 

Priority on minimum false positive detection.

TINTCORRECT_STRONGEST 

Highest sensitivity level of tint detection.

Definition at line 265 of file PerfectlyClearPro.h.

PFC_GetFaceInfo
bool PFC_GetFaceInfo(PFCIMAGEPROFILE *pImageProfile, PFCFBFACEINFO *pFace, int index)
Utility function to query geometry of detected faces.
PFC_EnumFAEFaceRect
LPPFCFACERECT PFC_EnumFAEFaceRect(PFCIMAGEPROFILE *pImageProfile, LPPFCFACERECT p)
Utility function to enumerate faces detected during Face Aware Exposure analysis.
PFCSCENEDESCRIPTION
Scene description.
Definition: PerfectlyClearPro.h:1231
PFC_FBFaceCount
int PFC_FBFaceCount(PFCPROFILE pImageProfile)
Return number of faces detected.
PFC_GetSceneDescription
bool PFC_GetSceneDescription(PFCENGINE *pEngine, int index, PFCSCENEDESCRIPTION *sceneDescription)
Get the scene description for the given index number.
PFCFaceRect
Structure defining face attributes detected by the Face Detection library.
Definition: PerfectlyClearPro.h:227
PFCFBFACEINFO
Structure defining face area detected from the SFB library.
Definition: PerfectlyClearPro.h:211