EyeQ Docs
Api reference

Java (JNI) API Reference

Reference documentation for the Perfectly Clear Java JNI API

The Java JNI API provides native bindings for the Perfectly Clear SDK, enabling high-performance image correction in Java applications on Linux, macOS, and Windows.

Package

All classes are in the photos.eyeq.pfcsdk.perfectlyclear package.

import photos.eyeq.pfcsdk.perfectlyclear.*;

Sections

  • Classes — PfC, PFCParam, PFCImageFile, and supporting classes

API correspondence

The JNI API mirrors both the C API and the Android SDK. This table shows the mapping between interfaces.

C APIJNI APIAndroid SDK
PFC_CreateEngine()sdk.createEngine()sdk.createEngine()
PFC_DestroyEngine()sdk.destroyEngine()sdk.destroyEngine()
PFC_LoadAIEngine()sdk.loadAIEngine()sdk.loadAIEngine()
PFC_Calc()sdk.calc()sdk.calc()
PFC_Apply()sdk.apply()sdk.apply()
PFC_AutoCorrect()sdk.autoCorrect()sdk.autoCorrect()
PFC_ReadPresets()sdk.readPresets()sdk.readPresets()
PFC_Resize()sdk.resize()
PFC_TransposeExif()sdk.transposeExif()
PFCPARAMPFCParamPFCParam
PFCFACERECTPFCFaceRectFaceRect

Native library loading

Load the JNI library before using any SDK classes. On Windows, dependencies must be loaded explicitly in order.

static {
    String os = System.getProperty("os.name").toLowerCase();
    if (os.contains("win")) {
        System.loadLibrary("PerfectlyClearPro");
        System.loadLibrary("exiv2");
        System.loadLibrary("PFCImageFile");
        System.loadLibrary("onnxrunt151");
    }
    System.loadLibrary("PerfectlyClearProJNI");
}

Set the library path at runtime:

java -Djava.library.path=/path/to/sdk/bin MyApp

Memory management

The JNI API uses ByteBuffer handles for native resources. Always release resources when finished:

// Engine lifecycle
ByteBuffer engine = sdk.createEngine();
// ... use engine ...
sdk.destroyEngine(engine);

// Profile lifecycle
ByteBuffer profile = sdk.calc(...);
// ... use profile ...
sdk.releaseProfile(profile);

// Image lifecycle
PFCImageFile image = new PFCImageFile();
image.LoadImageFile("input.jpg");
// ... process image ...
image.deletePFCImageFile();

Thread safety

Engine instances are not thread-safe. Create one engine per thread, or serialize access using synchronization.

// Option 1: One engine per thread
ThreadLocal<ByteBuffer> enginePerThread = ThreadLocal.withInitial(() -> {
    PfC sdk = new PfC();
    ByteBuffer engine = sdk.createEngine();
    sdk.loadAIEngine(engine, features, binPath);
    return engine;
});

// Option 2: Synchronized access
synchronized (engine) {
    sdk.apply(...);
}

PFC-SDK Version 11.0.0.1389 built from cc658dab3c675a529b3df2fa6421d4550810d77d on 06-29-2026.

Copyright © 2026 EyeQ Imaging Inc. All rights reserved.

On this page