Perfectly Clear SDK Documentation  8.3.4.175
PerfectlyClearPro.h File Reference

Public Interface for the Perfeclty 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  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  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...
 

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  PFCCORE_MASK_TYPE
 Enumeration describing mapping of PFCMask and PFC_MASK_TYPE with 'PFC' -> 'PFCCORE'. More...
 

Functions

bool PFC_HasFaceBeautification (PFCENGINE *pEngine)
 Check if Face Beautification is available. More...
 
int PFC_FBFaceCount (PFCPROFILE pImageProfile)
 Return number of faces detected. 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_GetFaceInfo (PFCIMAGEPROFILE *pImageProfile, PFCFBFACEINFO *pFace, int index)
 Utility function to query geometry of detected faces. More...
 
bool PFC_AbnormalTintDetected (PFCIMAGEPROFILE *pImageProfile, TINTCORRECTION eTintMethod)
 Query if abnormal tint is detected. More...
 
void PFC_SetParam (PFCPARAM &param, PFCPRESETID id=PRESET_INTELLIGENTAUTO)
 Initialize a PFCPARAM structure. 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...
 
PFCAPPLYSTATUS PFC_ApplyLocal (PFCIMAGE *pImage, int xOffset, int yOffset, int widthOrig, int heightOrig, PFCENGINE *pEngine, PFCPROFILE pImageProfile, PFCPARAM &param, int iOpacity=100)
 Apply correction locally. 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, BOOL bRejectMonolith=TRUE)
 Perform initial analysis on images. More...
 
PFCENGINEPFC_CreateEngine ()
 Create PFCENGINE instance. More...
 
void PFC_DestroyEngine (PFCENGINE *p)
 Destroy PFCENGINE instance and release associated resources. More...
 
void PFC_ReleaseProfile (PFCPROFILE pProfile)
 Release PFCPROFILE instance. More...
 
int PFC_AutoCorrect (PFCIMAGE *pImage, PFCIMAGE *pImageds, PFCPARAM &param, int iISO=-1, char *pCameraModel=NULL, BOOL bFastFAE=FALSE, PFC_PROGRESS progfn=NULL)
 Single function to perform Perfectly Clear correction. More...
 
int PFC_AutoCorrectPreset (PFCIMAGE *pImage, PFCIMAGE *pImageds, PFCPRESETID id=PRESET_INTELLIGENTAUTO, int iISO=-1, char *pCameraModel=NULL, BOOL bFastFAE=FALSE, PFC_PROGRESS progfn=NULL)
 Single function to perform Perfectly Clear corrections. More...
 
int PFC_ReadPresets (PFCPARAM &param, char *filename)
 Load image processing settings from a .preset file. 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...
 
int PFC_Resize (PFCIMAGE *pImageSrc, PFCIMAGE *pImageDst)
 Perform image resizing. More...
 
int PFC_SetProtectionPath (const char *utf8FolderPath)
 Set path to location of SDK License files This enables license protection and allows activation using a license key file provided by Athentech. More...
 
PFCBGPROFILE PFC_CreateBGProfile ()
 Create and initialize a PFCBGPROFILE instance.
 
void PFC_ReleaseBGProfile (PFCBGPROFILE pProfile)
 Release a PFCBGPROFILE instance. More...
 
void PFC_ResetBGProfile (PFCBGPROFILE pProfile)
 Reset a PFCBGPROFILE instance for next use. More...
 
void PFC_CombineBGProfile (void *pProfile1, void *pProfile2)
 Combine two PFCBGPROFILE instance. More...
 
void PFC_ScaleBGProfile (void *pProfile, double scaleR, double scaleG, double scaleB)
 Apply scaling to the PFCBGPROFILE instance. More...
 
int PFC_BGSyncCalc (PFCIMAGE *pImage, PFCENGINE *pEngine, PFCBGPROFILE pProfile, BOOL bFastFAE=TRUE)
 Background sync calculations. More...
 
int PFC_BGSyncApply (PFCIMAGE *pImage, PFCENGINE *pEngine, PFCBGPROFILE pProfile, BOOL bFastFAE=TRUE)
 Performs background sync. More...
 

Detailed Description

Public Interface for the Perfeclty Clear SDK.


Definition in file PerfectlyClearPro.h.

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 276 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.

BIAS_BRIGHTER_PREFERENCE 

Average usage with brighter tone.

Definition at line 284 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 262 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 269 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 318 of file PerfectlyClearPro.h.

◆ PFCAPPLYSTATUS

Enumeration defining return code from the Apply() function.

Enumerator
APPLY_SUCCESS 

Success.

APPLY_ERROR_PROFILE_MISSING 

Pointer pProfile is NULL.

APPLY_ERROR_ENGINE_MISSING 

Pointer pEngine is NULL.

APPLY_CANCELLED 

Operation cancelled by user.

APPLY_NOSOURCE 

Pointer pImage is NULL.

APPLY_BADFORMAT 

Pixel format not supported.

APPLY_INVALIDLICENSE 

Invalid License or validation failed.

Definition at line 377 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 487 of file PerfectlyClearPro.h.

◆ PFCCORE_STATUS

Enumeration defining status of Core pre-calculation.

Enumerator
PFC_CORE_SUCCESS 

Success.

PFC_CORE_NOTENABLED 

Feature not enabled.

PFC_CORE_CANCELLED 

Process cancelled.

PFC_CORE_NOSOURCEIMAGE 

Full res source image (pImage) is missing.

PFC_CORE_INSUFFICIENTMEMORY 

Process aborted because of insufficient memory.

PFC_CORE_MONOLITHIMAGE 

Monolith source image.

PFC_CORE_BELOWMINSIZE 

Image side dimension smaller than 32 pixels.

Definition at line 338 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 

Success.

PFC_FB_NOTENABLED 

Feature not enabled.

PFC_FB_WARNING 

Warning. e.g. face not detected.

PFC_FB_FULLRES_REQUIRED 

Full res image (pImage) is missing.

PFC_FB_CANCELLED 

Process cancelled.

PFC_FB_FUNCTION_ERROR 

Unable to locate function in the SFBEngine library.

PFC_FB_CREATE_ENGINE_FAILED 

Unable to create SFB Engine object for processing.

PFC_FB_ANALYSIS_FAILED 

The face analysis did not complete successfully.

PFC_FB_NO_CORRECTION 

No correction occur during process.

PFC_FB_NOT_EXECUTED 

Not executed.

PFC_FB_NOT_AVAILABLE 

Face beautification feature not available.

Definition at line 349 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 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.

Definition at line 162 of file PerfectlyClearPro.h.

◆ PFCNR_STATUS

Enumeration defining status of Noise Removal pre-calculation.

Enumerator
PFC_NR_SUCCESS 

Success.

PFC_NR_NOTENABLED 

Feature not enabled.

PFC_NR_FULLRES_REQUIRED 

Full res image (pImage) is missing.

PFC_NR_CANCELLED 

Process cancelled.

PFC_NR_ERRBITMAP 

Error reading image data.

PFC_NR_ERRSETTINGS 

Error in settings.

PFC_NR_MISC_ERROR 

Misc. errors.

PFC_NR_NOTFOUND 

Noise not found.

Definition at line 326 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_BEAUTIFY 

Beautify.

PRESET_BEAUTIFYPLUS 

Beautify Plus.

PRESET_DETAILS 

Details.

PRESET_VIVID 

Vivid.

PRESET_INTELLIGENTAUTO 

Intelligent Auto.

Definition at line 174 of file PerfectlyClearPro.h.

◆ PFCRE_STATUS

Enumeration defining status of Red Eye pre-calculation.

Enumerator
PFC_RE_SUCCESS 

Success.

PFC_RE_NOTENABLED 

Feature not enabled.

PFC_RE_FULLRES_REQUIRED 

Full res image (pImage) is missing.

PFC_RE_NOT_FOUND 

Red eye not found.

PFC_RE_GEN_ERROR 

General error.

PFC_RE_INVALID_PARAMETER 

Invalid parameter.

PFC_RE_NO_MEMORY 

Insufficient memory.

PFC_RE_CANCELLED 

Process cancelled.

PFC_RE_NOT_SUPPORTED 

Not supported.

Definition at line 364 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 293 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 300 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 308 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 253 of 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.

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.

Parameters
pImageProfile[in] - Profile returned from PFC_Calc() function.
eTintMethod[in] - TINTCORRECTION enum to specify tint detection method used.

◆ 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.

Return value
0The correction is successful.
> 0
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.
< 0PFCAPPLYSTATUS enum.
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

◆ PFC_ApplyLocal()

PFCAPPLYSTATUS PFC_ApplyLocal ( PFCIMAGE pImage,
int  xOffset,
int  yOffset,
int  widthOrig,
int  heightOrig,
PFCENGINE pEngine,
PFCPROFILE  pImageProfile,
PFCPARAM param,
int  iOpacity = 100 
)

Apply correction locally.

Perform CORE correction only to partial 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.IMPORTANT: Only the core correction is applied.

Return value
0The correction is successful.
> 0PFCCORE_STATUS enum.
< 0PFCAPPLYSTATUS enum.
Parameters
pImage[in, out] - Pointer to PFCIMAGE structure that defines the image to be processed.
xOffset[in] - Horizontal (x) offset of image segment defined in pImage with respect to the original image.
yOffset[in] - Vertical (y) offset of image segment defined in pImage with respect to the original image.
widthOrig[in] - Pixel width of the original image.
heightOrig[in] - Pixel height of the original image.
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.
iOpacity[in] - Control opacity of NR and CORE corrections. Range from 0 (non applied) to 100 (fully applied).

◆ PFC_AutoCorrect()

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

Single function to perform Perfectly Clear correction.

Composite 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.

Return value
0The correction is successful.
> 0
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.
< 0PFCAPPLYSTATUS enum.
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.

◆ PFC_AutoCorrectPreset()

int PFC_AutoCorrectPreset ( PFCIMAGE pImage,
PFCIMAGE pImageds,
PFCPRESETID  id = PRESET_INTELLIGENTAUTO,
int  iISO = -1,
char *  pCameraModel = NULL,
BOOL  bFastFAE = FALSE,
PFC_PROGRESS  progfn = 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.

Return value
0The correction is successful.
> 0
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.
< 0PFCAPPLYSTATUS enum.
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.

◆ PFC_BGSyncApply()

int PFC_BGSyncApply ( PFCIMAGE pImage,
PFCENGINE pEngine,
PFCBGPROFILE  pProfile,
BOOL  bFastFAE = TRUE 
)

Performs background sync.

Function for background sync application.

Return 0 Success. -1 Face detection not available.

Parameters
pImage[in] - PFCIMAGE instance encapsulating the buffer to be synced.
pEngine[in] PFCENGINE instance created for this session.
pProfile[in,out] - BGPROFILE instance.
bFastFAE[in] - TRUE to enable fast mode of FAE calculation.

◆ PFC_BGSyncCalc()

int PFC_BGSyncCalc ( PFCIMAGE pImage,
PFCENGINE pEngine,
PFCBGPROFILE  pProfile,
BOOL  bFastFAE = TRUE 
)

Background sync calculations.

Function for background sync calculation.

Return 0 Success. -1 Face detection not available.

Parameters
pImage[in] - PFCIMAGE instance encapsulating the buffer to be calculated.
pEngine[in] PFCENGINE instance created for this session.
pProfile[in,out] - BGPROFILE instance.
bFastFAE[in] - TRUE to enable fast mode of FAE calculation.

◆ 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,
BOOL  bRejectMonolith = TRUE 
)

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.
bRejectMonolith[in] - Set to TRUE to enable rejection of simple graphics on which Perfectly Clear processing might not be desirable.

◆ PFC_CombineBGProfile()

void PFC_CombineBGProfile ( void *  pProfile1,
void *  pProfile2 
)

Combine two PFCBGPROFILE instance.

pProfile1 = pProfile1 + pProfile2

Parameters
pProfile1[in, out] PFCBGPROFILE instance to add
pProfile2[in] PFCBGPROFILE instance to add to pProfile1

◆ 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.

◆ 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_EnumFAEFaceRect()

LPPFCFACERECT PFC_EnumFAEFaceRect ( PFCIMAGEPROFILE pImageProfile,
LPPFCFACERECT  p 
)

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

Utility function to provide a way for user to enumerate through information of faces detected during Face Aware Exposure analysis. Pointer to the next face info as described in PFCFACERECT.

Usage: LPPFCFACERECT 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.

◆ 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.

◆ 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 PFCFBFACEINFO face; 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.

◆ 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.Return TRUE is 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.

◆ 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.

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
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.

◆ 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.

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
Parameters
param[in, out] - PFCPARAM structure to fill with the process parameters.
s[in] - const char buffer to read and load presets from.

◆ PFC_ReleaseBGProfile()

void PFC_ReleaseBGProfile ( PFCBGPROFILE  pProfile)

Release a PFCBGPROFILE instance.

Parameters
pProfile[in] - PFCBGPROFILE instance to be released.

◆ 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_ResetBGProfile()

void PFC_ResetBGProfile ( PFCBGPROFILE  pProfile)

Reset a PFCBGPROFILE instance for next use.

Parameters
pProfile[in] - PFCBGPROFILE instance to be reset.

◆ PFC_Resize()

int PFC_Resize ( PFCIMAGE pImageSrc,
PFCIMAGE pImageDst 
)

Perform image resizing.

Parameters
pImageSrc[in] - Input image
pImageDst[out] - output image

◆ PFC_ScaleBGProfile()

void PFC_ScaleBGProfile ( void *  pProfile,
double  scaleR,
double  scaleG,
double  scaleB 
)

Apply scaling to the PFCBGPROFILE instance.

Parameters
pProfile[in,out] PFCBGPROFILE instance to scale
scaleR[in] amount to scale Red channel
scaleB[in] amount to scale Blue channel
scaleG[in] amount to scale Green channel

◆ PFC_SetParam()

void PFC_SetParam ( PFCPARAM param,
PFCPRESETID  id = PRESET_INTELLIGENTAUTO 
)

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_INTELLIGENTAUTO).

◆ PFC_SetProtectionPath()

int PFC_SetProtectionPath ( const char *  utf8FolderPath)

Set path to location of SDK License files This enables license protection and allows activation using a license key file provided by Athentech.

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
Parameters
utf8FolderPath[in] - UTF8 encoded path to the folder that contains the SDK license files

◆ 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.