EyeQ Docs

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:

NameTypeDescription
utf8FolderPathconst char*UTF-8 encoded path to the folder containing SDK license files
licenseCodeconst 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 &param, PFCPRESETID id);

Parameters:

NameTypeDescription
paramPFCPARAM refStructure to initialize
idPFCPRESETIDPreset 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 &param, char* filename);

Parameters:

NameTypeDescription
paramPFCPARAM refStructure to fill with loaded parameters
filenamechar*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:

NameTypeDescription
pImagePFCIMAGE*Image to process, modified in place
pImagedsPFCIMAGE*Optional downsampled image for faster analysis
paramPFCPARAM refCorrection parameters
iISOintISO value when image was taken, use -1 if unknown
pCameraModelchar*Camera model string, use NULL if unknown
bFastFAEBOOLTRUE for faster Face Aware Exposure calculation
progfnPFC_PROGRESSOptional progress callback
pEngineAIPFCENGINE*Optional AI-enabled engine
bUseAutoSDPresetBOOLIf 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:

NameTypeDescription
pImagePFCIMAGE*Image to analyze
pImagedsPFCIMAGE*Optional downsampled image
pEnginePFCENGINE*Engine from PFC_CreateEngine
featurePFCFEATURECalculation flags, combinable with bitwise OR
iISOintISO value, use -1 if unknown
pCameraModelchar*Camera model, use NULL if unknown
pImageProfilePFCPROFILEExisting profile for incremental calculation, or NULL
progfnPFC_PROGRESSOptional progress callback
iRejectOptionPFCREJECTOPTIONImage rejection mode
pEngineAIPFCENGINE*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:

NameTypeDescription
pImagePFCIMAGE*Image to correct, modified in place
pEnginePFCENGINE*Engine from PFC_CreateEngine
pImageProfilePFCPROFILEProfile from PFC_Calc
paramPFCPARAM refCorrection parameters
progfnPFC_PROGRESSOptional progress callback
iOpacityintOpacity of corrections from 0 to 100
pBGProfilevoid*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:

NameTypeDescription
pImageProfilePFCIMAGEPROFILE*Profile from PFC_Calc
pFacePFCFBFACEINFO*Structure to receive face data
indexintFace 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:

NameTypeDescription
pImageProfilePFCIMAGEPROFILE*Profile from PFC_Calc
pLPPFCFACERECTPrevious 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:

NameTypeDescription
bufchar*Buffer to receive string, or NULL to get required length
lenint*On input buffer size, on output required or actual length
bFormattedbooltrue 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:

NameTypeDescription
pImageSrcPFCIMAGE*Image to transpose, modified in place
iEXIFOrientationintEXIF 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:

NameTypeDescription
paramPFCPARAM refParameters to adjust
strengthint0 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:

NameTypeDescription
pEngineAIPFCENGINE*Engine to load models into
aifeaturesPFCAIFEATUREFeatures to load, combinable with bitwise OR
binPathconst 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:

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

On this page