EyeQ Docs

JNI Classes

Complete class reference for the Perfectly Clear Java JNI API

This page documents all public classes in the photos.eyeq.pfcsdk.perfectlyclear package.


PfC

The main SDK interface class. Provides engine management, image analysis, correction, and scene detection.

public class PfC

Engine lifecycle

createEngine

Creates a native engine instance.

public native ByteBuffer createEngine()

Returns a ByteBuffer handle to the native engine. Reuse across multiple images; destroy when done.

destroyEngine

Releases an engine instance and all associated resources.

public native void destroyEngine(ByteBuffer engine)

loadAIEngine

Loads AI models into the engine.

public native int loadAIEngine(ByteBuffer engine, int features, String binPath)
ParameterDescription
engineEngine handle from createEngine()
featuresBitwise OR of feature flags (see below)
binPathPath to directory containing .pnn model files

Feature flags:

FlagValueDescription
Scene Detection1Enable AI scene classification
Corrections2Enable AI-based corrections
FaceMesh32Enable face mesh detection

Returns the bitwise sum of successfully loaded features.

Image processing

calc

Performs pre-analysis on an image and creates a correction profile.

public native ByteBuffer calc(
    int width, int height, int stride, int pixelFormat, ByteBuffer buffer,
    int widthds, int heightds, int strideds, ByteBuffer bufferds,
    ByteBuffer engine, int bFastFAE, int bNoTintCalc
)
ParameterDescription
widthImage width in pixels
heightImage height in pixels
strideBytes per row
pixelFormatPixel format constant (e.g., PfC.PFC_PixelFormat32bppABGR)
bufferDirect ByteBuffer containing pixel data
widthdsDownsampled width (0 = not used)
heightdsDownsampled height (0 = not used)
stridedsDownsampled stride (0 = not used)
bufferdsDownsampled buffer (null = not used)
engineEngine handle
bFastFAENon-zero enables fast Face Aware Exposure
bNoTintCalcNon-zero skips tint calculation

Returns a profile ByteBuffer. Release with releaseProfile() when done.

apply

Applies corrections to an image using a calculated profile.

public native int apply(
    int width, int height, int stride, int pixelFormat, ByteBuffer buffer,
    ByteBuffer engine, ByteBuffer profile, PFCParam param
)

Returns 0 on success, or a negative error code.

autoCorrect

Single-call convenience method that performs calc + apply in one step.

public native int autoCorrect(
    int width, int height, int stride, int pixelFormat, ByteBuffer buffer,
    int widthds, int heightds, int strideds, ByteBuffer bufferds,
    PFCParam param, int bFastFAE
)

releaseProfile

Releases a profile handle.

public native void releaseProfile(ByteBuffer profile)

Presets and parameters

readPresets

Loads the first preset from a .preset file into a parameter object.

public native int readPresets(PFCParam param, String filename)

readPresetsFromStream

Loads preset settings from an in-memory XML string.

public native int readPresetsFromStream(PFCParam param, String xml)

applyStrengthToParam

Applies an overall strength multiplier to all parameters.

public native int applyStrengthToParam(PFCParam param, int strength)
StrengthEffect
0Disables corrections
100Default (no change)
200Maximum strength

Scene detection

loadScenePresets

Loads scene presets from a memory-mapped .preset file.

public native int loadScenePresets(ByteBuffer engine, MappedByteBuffer scenePresets)

getDetectedScene

Returns the detected scene label from a profile.

public native int getDetectedScene(ByteBuffer profile)

getSceneDescription

Returns a human-readable scene description.

public native String getSceneDescription(ByteBuffer engine, int index, int[] profileUUID)

The profileUUID array receives the scene's profile UUID at index 0.

readScenePreset

Fills a parameter object with settings for a detected scene.

public native int readScenePreset(PFCParam param, ByteBuffer engine, int scene)

Face detection

fbFaceCount

Returns the number of faces detected for Face Beautification.

public native int fbFaceCount(ByteBuffer profile)

getFaceInfo

Copies face geometry into a FaceInfo object.

public native boolean getFaceInfo(ByteBuffer profile, FaceInfo info, int index)

faeFaceCount

Returns the number of faces detected for Face Aware Exposure.

public native int faeFaceCount(ByteBuffer profile)

getFAEFaceRect

Copies detailed face data into a PFCFaceRect object.

public native boolean getFAEFaceRect(ByteBuffer profile, PFCFaceRect rect, int index)

hasFaceBeautification

Returns whether Face Beautification models are loaded.

public native boolean hasFaceBeautification(ByteBuffer engine)

Status methods

profileStatus

Returns the aggregated pre-calc status bitmask.

public native int profileStatus(ByteBuffer profile)

coreStatus

Returns the core correction status.

public native int coreStatus(ByteBuffer profile)

fbStatus

Returns the Face Beautification status.

public native int fbStatus(ByteBuffer profile)

nrStatus

Returns the noise reduction status.

public native int nrStatus(ByteBuffer profile)

reStatus / getREStatus

Returns the red-eye detection status.

public native int reStatus(ByteBuffer profile)
public native int getREStatus(ByteBuffer profile)

abnormalTintDetected

Returns whether abnormal tint was detected.

public native boolean abnormalTintDetected(ByteBuffer profile, int tintMethod)

isNoiseDetected

Returns whether noise exceeds the preset threshold.

public native boolean isNoiseDetected(ByteBuffer profile, int noisePreset)

Memory management

allocNativeBuffer

Allocates a native direct buffer.

public native ByteBuffer allocNativeBuffer(long size)

freeNativeBuffer

Frees a buffer allocated with allocNativeBuffer().

public native void freeNativeBuffer(ByteBuffer buffer)

Add-ons and LUTs

setAddonPath

Sets the search path for .looks files.

public native void setAddonPath(String path)

releaseAddonPath

Releases resources from setAddonPath().

public native void releaseAddonPath()

loadAddonLooks

Loads creative looks from a memory-mapped .looks file.

public native int loadAddonLooks(ByteBuffer engine, MappedByteBuffer addonLooks)

Image utilities

resize

Resizes an image buffer using native bilinear scaling.

public native int resize(
    int widthSrc, int heightSrc, int strideSrc, int pixelFormatSrc, ByteBuffer bufferSrc,
    int widthDst, int heightDst, int strideDst, int pixelFormatDst, ByteBuffer bufferDst
)
ParameterDescription
widthSrcSource image width in pixels
heightSrcSource image height in pixels
strideSrcSource image stride in bytes
pixelFormatSrcSource pixel format constant
bufferSrcDirect ByteBuffer containing source pixel data
widthDstDestination image width in pixels
heightDstDestination image height in pixels
strideDstDestination image stride in bytes
pixelFormatDstDestination pixel format (should match source or be PFC_PixelFormat24bppBGR)
bufferDstDirect ByteBuffer for destination pixel data

Returns 0 on success.

transposeExif

Transposes an image buffer according to an EXIF orientation tag.

public native int transposeExif(
    int width, int height, int stride, int pixelFormat, ByteBuffer buffer,
    int exifOrientation
)
ParameterDescription
widthImage width in pixels
heightImage height in pixels
strideImage stride in bytes
pixelFormatPixel format constant
bufferDirect ByteBuffer holding pixel data (modified in place)
exifOrientationEXIF orientation tag value (1–8). Use negative values to reverse (upright to orientation).

Returns 0 on success.

Utility

getVersion

Returns the SDK version string.

public native String getVersion()

Return code helpers

Helper methods to extract status bytes from combined return codes.

public int NRRETCODE(int code)    // Noise reduction byte
public int CORERETCODE(int code)  // Core correction byte
public int FBRETCODE(int code)    // Face beautification byte
public int RERETCODE(int code)    // Red-eye byte

Constants

Pixel formats

ConstantValueDescription
PFC_PixelFormat24bppRGB024-bit RGB
PFC_PixelFormat24bppBGR124-bit BGR
PFC_PixelFormat32bppABGR232-bit ABGR
PFC_PixelFormat48bppRGB348-bit RGB
PFC_PixelFormat64bppARGB464-bit ARGB
PFC_PixelFormat32bppARGB532-bit ARGB
PFC_PixelFormat48bppBGR648-bit BGR
PFC_PixelFormat64bppABGR764-bit ABGR

Preset IDs

ConstantValueDescription
PRESET_BEAUTIFY0Portrait defaults
PRESET_BEAUTIFYPLUS1Stronger portrait
PRESET_DETAILS2Legacy iAuto Details
PRESET_VIVID3Landscapes
PRESET_INTELLIGENTAUTO4Legacy
PRESET_I_AUTO_20195iAuto 2019
PRESET_I_AUTO_2019_RE6iAuto 2019 + Red Eye
PRESET_I_AUTO_217iAuto 2021
PRESET_I_AUTO_21_ASIA8iAuto 2021 Asia
PRESET_I_AUTO_PEOPLE9Default 2023

Contrast modes

ConstantValue
HIGH_CONTRAST0
HIGH_DEFINITION1

Tint correction modes

ConstantValue
TINT_CORRECT_AGGRESSIVE0
TINT_CORRECT_DEFAULT1
TINT_CORRECT_CONSERVATIVE2
TINT_CORRECT_SPECIAL3

DCF modes

ConstantValue
DCF_STANDARD0
DCF_VIVID1

Aggressiveness levels

ConstantValue
AGGRESSIVENESS_CONSERVATIVE0
AGGRESSIVENESS_MODERATE1
AGGRESSIVENESS_AGGRESSIVE2

Bias modes

ConstantValue
BIAS_NONE0
BIAS_ASIAN_PREFERENCE1
BIAS_AVERAGE_PREFERENCE2
BIAS_BRIGHTER_PREFERENCE3

Skin modes

ConstantValue
SKIN_MODE_FACE1
SKIN_MODE_BODY2

Skin smooth types

ConstantValue
SKIN_SMOOTH_TYPE_SUBTLE1
SKIN_SMOOTH_TYPE_DEFAULT2
SKIN_SMOOTH_TYPE_SUPER_SMOOTH3

Skin toning types

ConstantValue
SKIN_TONING_TYPE_WHITE1
SKIN_TONING_TYPE_PALE2
SKIN_TONING_TYPE_WARM3
SKIN_TONING_TYPE_TAN4
SKIN_TONING_TYPE_FOUNDATION5

Lip sharpen types

ConstantValue
LIP_SHARPEN_TYPE_FINE1
LIP_SHARPEN_TYPE_MEDIUM2
LIP_SHARPEN_TYPE_COARSE3

PFCParam

Image processing parameters. Mirrors the native PFCPARAM structure.

public class PFCParam

Field names follow the convention group_fieldName where group is:

  • core_ — Core correction parameters
  • nr_ — Noise reduction parameters
  • fb_ — Face beautification parameters
  • re_ — Red-eye parameters
  • v3_ — V3 advanced parameters

Constructor

public PFCParam()

Creates a parameter object with default values (all corrections disabled).

Core correction parameters

FieldTypeDescription
core_bEnabledbooleanMaster enable
core_iStrengthintExposure strength (0–150)
core_bUseAutomaticStrengthSelectionbooleanAuto strength selection
core_bUseFAEbooleanFace Aware Exposure
core_eAggressivenessintAggressiveness level
core_bContrastbooleanEnable contrast
core_iContrastintContrast level (0–100)
core_eContrastintContrast type
core_bVibrancybooleanEnable vibrancy
core_iVibrancyintVibrancy level (0–100)
core_bSharpenbooleanEnable sharpening
core_fSharpenScalefloatSharpen scale (0.0–3.0)
core_bHighlightPreservationbooleanEnable highlight preservation
core_iHighlightPreservationintHighlight level (0–100)
core_bLocalContrastbooleanEnable local contrast
core_iLocalContrastintLocal contrast level (0–100)
core_bAbnormalTintRemovalbooleanEnable tint removal
core_eTintintTint correction mode
core_fTintScalefloatTint scale (0.0–1.0)
core_iBlackEnhancementintBlack enhancement level
core_eBiasintBias mode
core_fBiasScalefloatBias scale
core_iMaxStrengthintMaximum strength limit
core_bInfraredbooleanEnable infrared correction
core_fInfraredfloatInfrared correction ratio
core_bLightDiffusionbooleanEnable light diffusion
core_fLightDiffusionfloatLight diffusion level
core_bDynamicRangebooleanEnable dynamic range
core_bDCFbooleanEnable DCF
core_eDCFModeintDCF mode
core_fDCFfloatDCF level (0.0–1.0)
core_bSkintoneAutobooleanAuto skin tone
core_iSkintoneAutoStrengthintAuto skin tone strength
core_iSkintoneStrengthExposureintSkin tone exposure strength
core_iSkintoneStrengthLutintSkin tone LUT strength
core_iSkintoneTypeintSkin tone category
core_bSelectiveColorbooleanEnable selective color
core_oSelectiveColorSelectiveColor[]Array of 8 selective color entries
core_iSplitColorWarmintSplit toning warm value
core_iSplitColorColdintSplit toning cold value
iMinStrengthintMinimum strength

Noise reduction parameters

FieldTypeDescription
nr_bEnabledbooleanMaster enable
nr_iPresetintPreset level (0–4)
nr_iStrengthOffsetintStrength offset (-5 to 5)
nr_iDetailOffsetintDetail offset (-30 to 30)

Face beautification parameters

FieldTypeDescription
fb_bEnabledbooleanMaster enable
fb_bSmoothbooleanEnable skin smoothing
fb_iSmoothLevelintSmooth level (0–100)
fb_bEnlargebooleanEnable eye enlargement
fb_iEnlargeLevelintEnlarge level (0–100)
fb_bEnhancebooleanEnable eye enhancement
fb_iEnhanceLevelintEnhance level (0–100)
fb_bEyeCircbooleanEnable eye circle removal
fb_iEyeCircintEye circle level (0–100)
fb_bTeethbooleanEnable teeth whitening
fb_iTeethLevelintTeeth level (0–100)
fb_bBlemishbooleanEnable blemish removal
fb_iBlemishintBlemish level (0–100)
fb_bDeFlashbooleanEnable shine removal
fb_iDeFlashintDeflash level (0–100)
fb_bDepthVolumebooleanEnable Depth and Volume
fb_iDepthVolumeintDepth and Volume level (0–100)
fb_iSmoothModeintNo longer used
fb_iSmoothTypeintNo longer used
fb_bSlimbooleanNo longer used
fb_iSlimintNo longer used
fb_bCatchLightbooleanNo longer used
fb_iCatchLightintNo longer used
fb_iCatchLightModeintNo longer used
fb_iSkinToningModeintNo longer used
fb_iSkinToningTypeintNo longer used
fb_bLipSharpenbooleanNo longer used
fb_iLipSharpenintNo longer used
fb_iLipSharpenTypeintNo longer used
fb_bBlushbooleanNo longer used
fb_iBlushintNo longer used
fb_colorSkinToninglongNo longer used
fb_colorBlushlongNo longer used

Red-eye parameters

FieldTypeDescription
re_bEnabledbooleanEnable red-eye removal

V3 advanced parameters

FieldTypeDescription
v3_bPreprocessEVbooleanEnable EV preprocessing
v3_iPreprocessEVintPreprocess EV value
v3_iNeutralDensityintNeutral density
v3_iColorVibrancyintColor vibrancy (0–200)
v3_iDarkSkinintDark skin correction
v3_lutInputCorrectiveGUIDStringInput corrective LUT GUID
v3_lutInputCorrectiveStrengthintInput corrective LUT strength
v3_lutInputSkyGUIDStringInput sky LUT GUID
v3_lutInputSkyStrengthintInput sky LUT strength
v3_lutInputFoliageGreenGUIDStringInput foliage green LUT GUID
v3_lutInputFoliageGreenStrengthintInput foliage green LUT strength
v3_lutInputFoliageBrownGUIDStringInput foliage brown LUT GUID
v3_lutInputFoliageBrownStrengthintInput foliage brown LUT strength
v3_lutOutputGUIDStringOutput LUT GUID
v3_lutOutputStrengthintOutput LUT strength (0–200)
v3_iFinishTempintTemperature (-100 to 100)
v3_iFinishTintintTint (-100 to 100)
v3_iFinishExposureintExposure (-100 to 100)
v3_iFinishBlacksintBlacks (-100 to 100)
v3_iFinishShadowsintShadows (-100 to 100)
v3_iFinishHighlightsintHighlights (-100 to 100)
v3_iFinishWhitesintWhites (-100 to 100)
v3_iFinishSaturationintSaturation (-100 to 100)
v3_iFinishVibrancyintVibrancy (-100 to 100)
v3_iFinishContrastintContrast (-100 to 100)
v3_iFinishPositiveContrastintPositive contrast
v3_iDeltaRintRed channel delta
v3_iDeltaGintGreen channel delta
v3_iDeltaBintBlue channel delta
v3_bDynamicbooleanEnable dynamic correction
v3_iDynamicintDynamic strength (0–100)
v3_iDynamicWBintDynamic white balance (0–100)
v3_iOutLUTsaturationintOutput LUT saturation
v3_iOutLUTcontrastintOutput LUT contrast
v3_bPortraitLightbooleanEnable portrait light
v3_iPortraitLightintPortrait light strength
v3_iPortraitLightDepthintPortrait light depth
v3_iPortraitLightFeatherintPortrait light feather

PFCImageFile

Helper class for loading and saving images with metadata and color space handling.

public class PFCImageFile

Properties

PropertyTypeDescription
widthintImage width in pixels
heightintImage height in pixels
strideintBytes per row
bytes_per_pixelintBytes per pixel
pixelFormatintPixel format constant
sourceSRGBbooleanTrue if source is sRGB

Constructor

public PFCImageFile()

Creates an empty image wrapper.

Methods

LoadImageFile

Loads an image from disk.

public ByteBuffer LoadImageFile(String filename)
public ByteBuffer LoadImageFile(String filename, boolean convertToSRGB)
public ByteBuffer LoadImageFile(String filename, boolean convertToSRGB, String supportPath)
ParameterDescription
filenamePath to image file
convertToSRGBConvert to sRGB color space (default: true)
supportPathPath to ICC profiles folder (optional)

Returns a ByteBuffer containing pixel data.

SaveImageFile

Saves the image to disk.

public boolean SaveImageFile(String filename)
public boolean SaveImageFile(String filename, int quality)
public boolean SaveImageFile(String filename, int quality, boolean convertToOriginal)
public boolean SaveImageFile(String filename, int quality, boolean convertToOriginal, boolean embedMetadata)
ParameterDescription
filenameOutput path
qualityJPEG quality 0–100 (default: 90). For PNGs, 100 = no compression.
convertToOriginalConvert back to original color space (default: true)
embedMetadataPreserve original metadata (default: true)

Returns true on success.

deletePFCImageFile

Releases native resources.

public void deletePFCImageFile()

PFCFaceRect

Face detection result with geometry and attributes. Used by PfC.getFAEFaceRect().

public class PFCFaceRect

Properties

Face bounding box:

PropertyTypeDescription
faceLeftintLeft edge
faceTopintTop edge
faceWidthintWidth
faceHeightintHeight

Eye geometry:

PropertyTypeDescription
eyeLLeft, eyeLTop, eyeLWidth, eyeLHeightintLeft eye bounding box
eyeRLeft, eyeRTop, eyeRWidth, eyeRHeightintRight eye bounding box
eyeLX, eyeLYintLeft eye center
eyeRX, eyeRYintRight eye center

Mouth geometry:

PropertyTypeDescription
mouthLeft, mouthTop, mouthWidth, mouthHeightintMouth bounding box

Attributes:

PropertyTypeDescription
angleintFace roll angle
yawAngleintFace yaw angle (-90 to 90)
blinkLevelintOverall blink level
blinkLevelLintLeft eye blink
blinkLevelRintRight eye blink
confidenceintDetection confidence
smileLevelintSmile intensity
widthImageintSource image width
heightImageintSource image height

Detection levels use the convention: -1 = not detected, 0 = unable to detect, 1–100 = confidence level.


FaceInfo

Simplified face geometry for Face Beautification. Used by PfC.getFaceInfo().

public class FaceInfo

Properties

PropertyTypeDescription
face_leftintLeft edge of face
face_topintTop edge of face
face_widthintFace width
face_heightintFace height
leftEye_xintLeft eye X
leftEye_yintLeft eye Y
rightEye_xintRight eye X
rightEye_yintRight eye Y

SelectiveColor

Per-hue color adjustment. Eight instances populate PFCParam.core_oSelectiveColor.

public class SelectiveColor

Properties

PropertyTypeRangeDescription
rintHue ramp start
aintFlat range start
mintFlat range end
pintHue ramp end
Hint-180 to 180Hue shift
Sint-100 to 100Saturation shift
Lint-100 to 100Luminance shift

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