Functions
Complete function reference for the Perfectly Clear C API.
This page documents all functions in the Perfectly Clear C API, grouped by purpose.
Main PfC functions
These are the most commonly used functions which will be used in nearly every Perfectly Clear implementation.
PFC_SetProtectionPath
Initializes the SDK license system by specifying the location of license files.
int PFC_SetProtectionPath(const char* utf8FolderPath, const char* licenseCode);Parameters:
| Name | Type | Description |
|---|---|---|
| utf8FolderPath | const char* | UTF-8 encoded path to the folder containing SDK license files |
| licenseCode | const char* | Optional 18-digit license code to use instead of license.key file |
Returns: int status code. See License Status Codes.
PFC_SetParam
Initializes a PFCPARAM structure with parameters from a built-in preset.
void PFC_SetParam(PFCPARAM ¶m, PFCPRESETID id);Parameters:
| Name | Type | Description |
|---|---|---|
| param | PFCPARAM ref | Structure to initialize |
| id | PFCPRESETID | Preset identifier, default is PRESET_IAUTO_PEOPLE |
PFC_ReadPresets
Loads image processing settings from a .preset file exported from Perfectly Clear Workbench or Perfectly Clear Complete.
int PFC_ReadPresets(PFCPARAM ¶m, char* filename);Parameters:
| Name | Type | Description |
|---|---|---|
| param | PFCPARAM ref | Structure to fill with loaded parameters |
| filename | char* | Path to the .preset file |
Returns: int status code. See Preset File Status Codes.
PFC_AutoCorrect
Performs complete image correction in a single call by combining engine creation, calculation, and application.
int PFC_AutoCorrect(
PFCIMAGE* pImage,
PFCIMAGE* pImageds,
PFCPARAM& param,
int iISO,
char* pCameraModel,
BOOL bFastFAE,
PFC_PROGRESS progfn,
PFCENGINE* pEngineAI,
BOOL bUseAutoSDPreset
);Parameters:
| Name | Type | Description |
|---|---|---|
| pImage | PFCIMAGE* | Image to process, modified in place |
| pImageds | PFCIMAGE* | Optional downsampled image for faster analysis |
| param | PFCPARAM ref | Correction parameters |
| iISO | int | ISO value when image was taken, use -1 if unknown |
| pCameraModel | char* | Camera model string, use NULL if unknown |
| bFastFAE | BOOL | TRUE for faster Face Aware Exposure calculation |
| progfn | PFC_PROGRESS | Optional progress callback |
| pEngineAI | PFCENGINE* | Optional AI-enabled engine |
| bUseAutoSDPreset | BOOL | If TRUE, use auto-detected preset from scene detection |
Returns: int. See PFCAPPLYSTATUS. Use decode macros for warnings greater than 0.
PFC_ReleaseProtectionPath
Releases resources allocated by PFC_SetProtectionPath when license validation is no longer needed.
void PFC_ReleaseProtectionPath();Calc and Apply functions
These functions provide separate calculation and application steps, enabling faster processing when applying different parameters to the same image.
PFC_CreateEngine
Creates a new processing engine instance required for the Calc and Apply workflow.
PFCENGINE* PFC_CreateEngine();Returns: Pointer to a new PFCENGINE instance.
PFC_Calc
Analyzes an image and calculates correction profiles that can be reused with different parameters.
PFCPROFILE PFC_Calc(
PFCIMAGE* pImage,
PFCIMAGE* pImageds,
PFCENGINE* pEngine,
unsigned int feature,
int iISO,
char* pCameraModel,
PFCPROFILE pImageProfile,
PFC_PROGRESS progfn,
int iRejectOption,
PFCENGINE* pEngineAI
);Parameters:
| Name | Type | Description |
|---|---|---|
| pImage | PFCIMAGE* | Image to analyze |
| pImageds | PFCIMAGE* | Optional downsampled image |
| pEngine | PFCENGINE* | Engine from PFC_CreateEngine |
| feature | PFCFEATURE | Calculation flags, combinable with bitwise OR |
| iISO | int | ISO value, use -1 if unknown |
| pCameraModel | char* | Camera model, use NULL if unknown |
| pImageProfile | PFCPROFILE | Existing profile for incremental calculation, or NULL |
| progfn | PFC_PROGRESS | Optional progress callback |
| iRejectOption | PFCREJECTOPTION | Image rejection mode |
| pEngineAI | PFCENGINE* | Optional AI-enabled engine |
Returns: PFCIMAGEPROFILE containing analysis results.
PFC_Apply
Applies corrections to an image using a previously calculated profile and the specified parameters.
PFCAPPLYSTATUS PFC_Apply(
PFCIMAGE* pImage,
PFCENGINE* pEngine,
PFCPROFILE pImageProfile,
PFCPARAM& param,
PFC_PROGRESS progfn,
int iOpacity,
void* pBGProfile
);Parameters:
| Name | Type | Description |
|---|---|---|
| pImage | PFCIMAGE* | Image to correct, modified in place |
| pEngine | PFCENGINE* | Engine from PFC_CreateEngine |
| pImageProfile | PFCPROFILE | Profile from PFC_Calc |
| param | PFCPARAM ref | Correction parameters |
| progfn | PFC_PROGRESS | Optional progress callback |
| iOpacity | int | Opacity of corrections from 0 to 100 |
| pBGProfile | void* | Optional background profile for sync |
Returns: PFCAPPLYSTATUS
PFC_ReleaseProfile
Releases memory and resources associated with a calculated image profile.
void PFC_ReleaseProfile(PFCPROFILE pProfile);PFC_DestroyEngine
Destroys an engine instance and releases all associated resources when processing is complete.
void PFC_DestroyEngine(PFCENGINE* p);Helper functions
These utility functions provide additional capabilities for face detection, image manipulation, and SDK configuration.
PFC_SetAddonPath
Specifies the directory containing runtime add-on files such as .looks files for Creative LOOKs Filters.
void PFC_SetAddonPath(const char* utf8AddonPath);PFC_HasFaceBeautification
Checks whether the Face Beautification feature is available in the current engine configuration.
bool PFC_HasFaceBeautification(PFCENGINE* pEngine);Returns: true if Face Beautification is available.
PFC_FBFaceCount
Returns the number of faces detected during Face Beautification analysis.
int PFC_FBFaceCount(PFCPROFILE pImageProfile);Returns: Number of faces detected.
PFC_FAEFaceCount
Returns the number of faces detected during Face Aware Exposure analysis.
int PFC_FAEFaceCount(PFCIMAGEPROFILE* pImageProfile);Returns: Number of faces detected.
PFC_GetFaceInfo
Retrieves detailed geometry information for a specific detected face by index.
bool PFC_GetFaceInfo(PFCIMAGEPROFILE* pImageProfile, PFCFBFACEINFO* pFace, int index);Parameters:
| Name | Type | Description |
|---|---|---|
| pImageProfile | PFCIMAGEPROFILE* | Profile from PFC_Calc |
| pFace | PFCFBFACEINFO* | Structure to receive face data |
| index | int | Face index from 0 to face count minus 1 |
Returns: true if face info retrieved successfully.
PFC_EnumFAEFaceRect
Iterates through all faces detected during Face Aware Exposure analysis using a linked list pattern.
LPPFCFACERECT PFC_EnumFAEFaceRect(PFCIMAGEPROFILE* pImageProfile, LPPFCFACERECT p);Parameters:
| Name | Type | Description |
|---|---|---|
| pImageProfile | PFCIMAGEPROFILE* | Profile from PFC_Calc |
| p | LPPFCFACERECT | Previous face rect, or NULL to start |
Returns: Pointer to next PFCFACERECT, or NULL when done.
Example:
PFCFACERECT* face = NULL;
while ((face = PFC_EnumFAEFaceRect(pProfile, face))) {
// Use face->rect, face->ptEyeL, face->ptEyeR
}PFC_IsNoiseDetected
Determines whether noise was detected in the image for a specific noise preset configuration.
bool PFC_IsNoiseDetected(PFCIMAGEPROFILE* pImageProfile, int iNoisePreset);Returns: true if noise is detected.
PFC_AbnormalTintDetected
Determines whether an abnormal color tint was detected in the image.
bool PFC_AbnormalTintDetected(PFCIMAGEPROFILE* pImageProfile, TINTCORRECTION eTintMethod);Returns: true if abnormal tint detected.
PFC_SetSingleThreadedEngine
Configures an engine to use single-threaded processing instead of the default multi-threaded mode.
void PFC_SetSingleThreadedEngine(PFCENGINE* p, bool bSingleThreaded);PFC_GetVersion
Retrieves the SDK version string and feature information for diagnostics and compatibility checks.
void PFC_GetVersion(char* buf, int* len, bool bFormatted);Parameters:
| Name | Type | Description |
|---|---|---|
| buf | char* | Buffer to receive string, or NULL to get required length |
| len | int* | On input buffer size, on output required or actual length |
| bFormatted | bool | true for key=value format |
PFC_Resize
Resizes an image from source dimensions to the dimensions specified in the destination structure.
PFCAPPLYSTATUS PFC_Resize(PFCIMAGE* pImageSrc, PFCIMAGE* pImageDst);PFC_TransposeExif
Rotates and flips an image to match or reverse EXIF orientation metadata.
PFCAPPLYSTATUS PFC_TransposeExif(PFCIMAGE* pImageSrc, int iEXIFOrientation);Parameters:
| Name | Type | Description |
|---|---|---|
| pImageSrc | PFCIMAGE* | Image to transpose, modified in place |
| iEXIFOrientation | int | EXIF orientation tag from 1 to 8, use negative to reverse |
PFC_ApplyStrengthToParam
Scales all correction parameters by a global strength multiplier for easy intensity adjustment.
void PFC_ApplyStrengthToParam(PFCPARAM& param, int strength);Parameters:
| Name | Type | Description |
|---|---|---|
| param | PFCPARAM ref | Parameters to adjust |
| strength | int | 0 means off, 100 means default, 200 means max |
AI functions
These functions enable AI-powered features including Scene Detection, AI Corrections, and AI Color for intelligent automatic adjustments.
PFC_LoadAIEngine
Loads AI model files into an engine to enable AI-powered correction features.
int PFC_LoadAIEngine(
PFCENGINE* pEngineAI,
unsigned int aifeatures,
const char* binPath
);Parameters:
| Name | Type | Description |
|---|---|---|
| pEngineAI | PFCENGINE* | Engine to load models into |
| aifeatures | PFCAIFEATURE | Features to load, combinable with bitwise OR |
| binPath | const char* | UTF-8 path to folder containing .pnn model files |
Returns: Bitwise OR of successfully loaded PFCAIFEATURE flags.
Example:
PFCENGINE* pEngineAI = PFC_CreateEngine();
int loaded = PFC_LoadAIEngine(pEngineAI,
AI_SCENE_DETECTION | AI_CORRECTIONS | AI_COLOR,
"/path/to/models");PFC_LoadScenePresets
Loads scene-specific preset configurations from a file for use with AI Scene Detection.
int PFC_LoadScenePresets(
PFCENGINE* pEngine,
const char* filePath,
int modelUuid,
int* presetUuid,
int arrProfileUUIDLen
);Returns: Same as PFC_ReadPresets.
PFC_ReadScenePreset
Populates correction parameters with values optimized for a specific detected scene type.
int PFC_ReadScenePreset(PFCPARAM& param, PFCENGINE* pEngineAI, int scene);PFC_GetScene
Retrieves the AI-detected scene classification label from a calculated profile.
int PFC_GetScene(PFCPROFILE precalc, int* version);Returns: Detected scene label, or -1 if none.
PFC_DetectCompositeImage
Analyzes an image to determine whether it is a photograph or a composite graphic.
int PFC_DetectCompositeImage(PFCIMAGE* pImage, PFCENGINE* pEngine);Returns: PFCCOMPOSITE detection result.
PFC_GetSceneDescription
Retrieves human-readable metadata about a scene detection classification by index.
bool PFC_GetSceneDescription(PFCENGINE* pEngine, int index, PFCSCENEDESCRIPTION* sceneDescription);Returns: true on success.
Callback types
These type definitions specify function signatures for callbacks used during SDK operations.
PFC_PROGRESS
Defines the signature for progress callback functions that receive processing status updates.
typedef BOOL (*PFC_PROGRESS)(int iPercent);Parameters:
| Name | Type | Description |
|---|---|---|
| iPercent | int | Progress percentage from 0 to 100 |
Returns: TRUE to cancel processing, FALSE to continue.
PFC-SDK Version 10.7.2.1269 built from 4fa849d8101945eea725a08dd0dae5101f090fa0 on 11-10-2025.
Copyright © 2026 EyeQ Imaging Inc. All rights reserved.