Classes
Main classes in the Perfectly Clear .NET API.
This page documents the main classes in the Perfectly Clear .NET API.
PerfectlyClear
The primary class for applying Perfectly Clear image corrections, implementing IDisposable for proper resource management.
public unsafe class PerfectlyClear : IDisposableConstructors
These constructors create instances of the PerfectlyClear class with different initialization options.
PerfectlyClear default constructor
Creates an instance for multi-threaded scenarios where SetProtectionPath has already been called.
public PerfectlyClear()PerfectlyClear with license path
Creates an instance with license validation in a single-threaded scenario.
public PerfectlyClear(string path, string licenseCode = "")Properties
These properties provide access to correction parameters and operation status.
m_Param
Exposes the current correction parameters structure for direct modification.
public PFCPARAM m_Param;LastStatus
Contains the detailed status information from the most recent Calc or Apply operation.
public PFCSTATUS LastStatus;Static methods
These methods configure shared resources and should be called before creating instances in multi-threaded applications.
SetProtectionPath
Initializes the license system for multi-threaded usage before creating PerfectlyClear instances.
public static int SetProtectionPath(string path, string licenseCode)ReleaseProtectionPath
Releases license resources when all processing is complete.
public static void ReleaseProtectionPath()SetAddonPath
Specifies the directory containing .looks files for Creative LOOKs Filters.
public static void SetAddonPath(string dirPath)Methods
These instance methods perform image analysis, correction, and configuration.
SetParam
Initializes the m_Param structure with optimized values from a built-in preset.
public void SetParam(PFCPRESETID id)ReadPresets
Loads correction parameters from a .preset file exported from Perfectly Clear applications.
public int ReadPresets(string path)Returns: 0 on success, negative on error.
Calc
Analyzes an image and calculates correction profiles for subsequent Apply operations.
public ADPTRRETURNCODE Calc(ref Bitmap bm)
public ADPTRRETURNCODE Calc(ref Bitmap bm, PFCFEATURE feature)
public ADPTRRETURNCODE Calc(ref Bitmap bm, PFCFEATURE feature, int ISO, string CameraModel, PFCREJECTOPTION rejectOption)
public ADPTRRETURNCODE Calc(ref PFCImageFile imgfile, PFCFEATURE feature, int ISO, string CameraModel, PFCREJECTOPTION rejectOption)Apply
Applies corrections to an image using the previously calculated profile.
public PFCAPPLYSTATUS Apply(ref Bitmap bm)
public PFCAPPLYSTATUS Apply(ref Bitmap bm, int iOpacity)
public PFCAPPLYSTATUS Apply(ref PFCImageFile imgfile, int iOpacity)AutoCorrect
Performs complete image correction by combining Calc and Apply in a single convenient call.
public int AutoCorrect(ref Bitmap bm)
public int AutoCorrect(ref Bitmap bm, int ISO, string CameraModel, bool bFastFAE)
public int AutoCorrect(ref Bitmap bm, string pathPreset)
public int AutoCorrect(ref PFCImageFile imgfile)LoadAiEngine
Loads AI model files to enable AI-powered correction features.
public int LoadAiEngine(PFCAIFEATURE aifeatures, string binPath)Example:
int loaded = pfc.LoadAiEngine(
PFCAIFEATURE.AI_SCENE_DETECTION | PFCAIFEATURE.AI_CORRECTIONS,
"path/to/models");ApplyStrengthToParam
Scales all correction parameters by a global strength multiplier.
public void ApplyStrengthToParam(int strength)HasFaceBeautification
Determines whether Face Beautification is available in the current configuration.
public bool HasFaceBeautification()FBFaceCount
Returns the count of faces detected during Face Beautification analysis.
public int FBFaceCount()GetFaceInfo
Retrieves detailed geometry information for a specific detected face.
public bool GetFaceInfo(ref PFCFBFACEINFO info, int index)ReadImage
Loads an image file into a Bitmap object for processing.
public Bitmap ReadImage(string filename)Dispose
Releases all resources associated with the PerfectlyClear instance.
public void Dispose()PFCImageFile
Provides advanced file handling with EXIF metadata preservation and color space conversion support.
public unsafe class PFCImageFile : IDisposablePFCImageFile Methods
These methods handle image file loading and saving with metadata support.
LoadImage
Loads an image from file with optional color space conversion to sRGB.
public PFC_FILE_LOAD_STATUS LoadImage(string filename, bool bConvertToSRGB, string iccFolderPath)
public PFC_FILE_LOAD_STATUS LoadImage(string filename, PFC_FILETYPE type, bool bConvertToSRGB, string iccFolderPath)SaveImageFile
Saves the image to file with configurable quality, color space, and metadata options.
public bool SaveImageFile(string filename, int jpegQuality, bool bConvertToOriginalColorSpace, bool bEmbedOriginalMetadata)PFCImageFile Properties
These properties expose image metadata and dimensions.
| Property | Type | Description |
|---|---|---|
| width | int | Image width |
| height | int | Image height |
| stride | int | Bytes per row |
| pfcImageFormat | int | Pixel format |
| exifOrientation | int | EXIF orientation |
PFC-SDK Version 10.7.2.1269 built from 4fa849d8101945eea725a08dd0dae5101f090fa0 on 11-10-2025.
Copyright © 2026 EyeQ Imaging Inc. All rights reserved.