Perfectly Clear SDK Documentation  9.1.1.325
V9 Class Reference

Interface Class for Perfectly Clear SDK for Android. More...

Public Member Functions

native ByteBuffer CreateEngine ()
 Create PFCENGINE instance. More...
 
native void DestroyEngine (ByteBuffer bbEngine)
 Destroy PFCENGINE instance and release associated resources. More...
 
native void SetParam (PFCParam param, int id)
 Initialize a PFCParam class instance. More...
 
native int ReadPresets (PFCParam param, String filename)
 Load image processing settings from a .preset file. More...
 
native int ReadPresetsFromStream (PFCParam param, String s)
 Load image processing settings from a String instance. More...
 
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)
 Perform initial analysis on images. More...
 
native int Apply (int width, int height, int stride, int pixelFormat, ByteBuffer buffer, ByteBuffer engine, ByteBuffer profile, PFCParam param)
 Correct image with parameters. More...
 
native int ApplyLocal (int width, int height, int stride, int pixelFormat, ByteBuffer buffer, int xOffset, int yOffset, int widthOrig, int heightOrig, ByteBuffer engine, ByteBuffer profile, PFCParam param)
 Apply correction locally. More...
 
native void ReleaseProfile (ByteBuffer profile)
 Release PFCPROFILE instance. More...
 
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)
 Single function to perform Perfectly Clear correction. More...
 
native int AutoCorrectPreset (int width, int height, int stride, int pixelFormat, ByteBuffer buffer, int widthds, int heightds, int strideds, ByteBuffer bufferds, int PresetID, int bFastFAE)
 Single function to perform Perfectly Clear corrections. More...
 
native boolean HasFaceBeautification (ByteBuffer engine)
 Check if Face Beautification is available. More...
 
native int FBFaceCount (ByteBuffer profile)
 Return number of faces detected. More...
 
native boolean GetFaceInfo (ByteBuffer profile, FaceInfo pFace, int index)
 Utility function to query geometry of detected faces. More...
 
native boolean AbnormalTintDetected (ByteBuffer profile, int tintMethod)
 Query if abnormal tint is detected. More...
 
native ByteBuffer allocNativeBuffer (long size)
 
native void freeNativeBuffer (ByteBuffer b)
 
native boolean IsNoiseDetected (ByteBuffer profile, int iNoisePreset)
 Query if noise is detected. More...
 

Static Public Attributes

static final int PFC_PixelFormat24bppRGB = 0
 
static final int PFC_PixelFormat24bppBGR = 1
 
static final int PFC_PixelFormat32bppABGR = 2
 
static final int PFC_PixelFormat48bppRGB = 3
 
static final int PFC_PixelFormat64bppARGB = 4
 
static final int PFC_PixelFormat32bppARGB = 5
 
static final int PFC_PixelFormat48bppBGR = 6
 
static final int PFC_PixelFormat64bppABGR = 7
 
static final int PRESET_BEAUTIFY = 0
 Beautify.
 
static final int PRESET_BEAUTIFYPLUS = 1
 Beautify Plus.
 
static final int PRESET_DETAILS = 2
 Details.
 
static final int PRESET_VIVID = 3
 Vivid.
 
static final int PRESET_INTELLIGENTAUTO = 4
 Intelligent Auto.
 
static final int PRESET_IAUTO_2019 = 5
 iAuto 2019 - even better automatic corrections
 
static final int PRESET_IAUTO_2019_RE = 6
 iAuto 2019 with Red Eye Correction
 
static final int PRESET_IAUTO_21 = 7
 The iAuto you love plus newly tuned settings for sharper images, accurate skin correction, and more depth. Read more here: https://eyeq.photos/business/iauto-2021.
 
static final int PRESET_IAUTO_21_ASIA = 8
 Based on iAuto 21, but with brighter Skin & Depth Bias for truer skin tone.
 
static final int HIGH_CONTRAST = 0
 Optimized to bring higher contrast to the image.
 
static final int HIGH_DEFINITION = 1
 Optimized to bring out more details in the shadows, more details in the highlights, and more pleasing skin tones.
 
static final int TINTCORRECT_AGGRESSIVE = 0
 Aggressive detection of tint.
 
static final int TINTCORRECT_DEFAULT = 1
 Moderate level of tint detection.
 
static final int TINTCORRECT_CONSERVATIVE = 2
 Priority on minimum false positive detection.
 
static final int TINTCORRECT_SPECIAL = 3
 Highest sensitivity level of tint detection.
 
static final int DCF_STANDARD = 0
 For normal photo.
 
static final int DCF_VIVID = 1
 For more color vibrancy.
 
static final int AGGRESSIVENESS_CONSERVATIVE = 0
 Less aggressive in exposure correction.
 
static final int AGGRESSIVENESS_MODERATE = 1
 Moderate level of exposure correction.
 
static final int AGGRESSIVENESS_AGGRESSIVE = 2
 More aggressive in exposure correction.
 
static final int BIAS_NONE = 0
 Turn off bias correction.
 
static final int BIAS_ASIAN_PREFERENCE = 1
 Fine tuned for Asian skin tone.
 
static final int BIAS_AVERAGE_PREFERENCE = 2
 For average usage.
 
static final int BIAS_BRIGHTER_PREFERENCE = 3
 Average usage with brighter tone.
 
static final int SKINMODE_FACE = 1
 Apply correction ONLY on skin regions included in faces.
 
static final int SKINMODE_BODY = 2
 Apply correction on most skin regions regardless they are linked with a face or not.
 
static final int SKINSMOOTHTYPE_SUBTLE = 1
 The subtle correction removes the wrinkles and spots alone while it keeps the texture of the face unchanged.
 
static final int SKINSMOOTHTYPE_DEFAULT = 2
 This type of correction provides a more uniform appearance to the complexion. It combines the natural look of the SUBTLE mode with the improved efficiency of SUPERSMOOTH.
 
static final int SKINSMOOTHTYPE_SUPERSMOOTH = 3
 This is a more aggressive and effective correction where the appearance of the entire skin (including wrinkles, spots, hot spots) is changed (softened).
 
static final int SKINTONINGTYPE_WHITE = 1
 Whitens (bleaches) face. Recommended mainly for darker skin.
 
static final int SKINTONINGTYPE_PALE = 2
 Makes skin look lighter and more pale.
 
static final int SKINTONINGTYPE_WARM = 3
 Warms skin tone.
 
static final int SKINTONINGTYPE_TAN = 4
 Darkens skin, makes it look naturally tanned.
 
static final int SKINTONINGTYPE_FOUNDATION = 5
 Adjust skin to user defined foundation color.
 
static final int LIPSHARPENTYPE_FINE = 1
 Fine touch of sharpening.
 
static final int LIPSHARPENTYPE_MEDIUM = 2
 Stronger sharpening. Details are more pronounced.
 
static final int LIPSHARPENTYPE_COARSE = 3
 Lip details are coarsely pronounced.
 

Detailed Description

Interface Class for Perfectly Clear SDK for Android.

Definition at line 12 of file V9.java.

Member Function Documentation

◆ AbnormalTintDetected()

native boolean AbnormalTintDetected ( ByteBuffer  profile,
int  tintMethod 
)

Query if abnormal tint is detected.

Utility function to query if abnormal tint is detected at certain detection mode.

Parameters
profile[in] - Profile returned from Calc() function.
tintMethod[in] - TINTCORRECTION enum to specify tint detection method used.
Returns
True if abnormal tint is detected when tint detection mode is eTintMethod. False otherwise. If Core calculation is not enabled during PFC_Calc(), this query returns False.

◆ allocNativeBuffer()

native ByteBuffer allocNativeBuffer ( long  size)

Allocate memory from native function.

Parameters
size[in] - Byte size of memory requested.
Returns
ByteBuffer containing the allocated memory.

◆ Apply()

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

Correct image with parameters.

Perform correction to image using user parameters as defined in a PFCParam class. Correction requires profile as calculated by the Calc() function.

Parameters
width[in] - Width of image.
height[in] - Height of image.
stride[in] - Stride of image.
pixelFormat[in] - One of PFC_PixelFormatxxxxx values specifying the byte format of image buffer.
buffer[in] - ByteBuffer containing the image data.
engine[in] - PFCENGINE instance (contained in ByteBuffer instance) returned from the CreateEngine() function.
profile[in] - Profile calculated (returned) from Calc().
param[in] - PFCParam instance containing user parameters.
Returns
int showing status
Return value
0The correction is successful.
> 0
Use macros to map out return code for each feature:
NRRETCODEReturns PFCNR_STATUS Noise Removal correction status.
CORERETCODEReturns PFCCORE_STATUS Core correction status.
FBRETCODEReturns PFCFB_STATUS Face Beautification correction status.
RERETCODEReturns PFCRE_STATUS Red Eye correction status.
< 0PFCAPPLYSTATUS enum.

◆ ApplyLocal()

native int ApplyLocal ( int  width,
int  height,
int  stride,
int  pixelFormat,
ByteBuffer  buffer,
int  xOffset,
int  yOffset,
int  widthOrig,
int  heightOrig,
ByteBuffer  engine,
ByteBuffer  profile,
PFCParam  param 
)

Apply correction locally.

Perform CORE correction only to partial image as defined by the PFCIMAGE structure using user parameters as defined in a PFCPARAM structure. Correction requires profile as calculated by the PFC_Calc() function.IMPORTANT: Only the core correction is applied.

Parameters
width[in] - Width of image.
height[in] - Height of image.
stride[in] - Stride of image.
pixelFormat[in] - One of PFC_PixelFormatxxxxx values specifying the byte format of image buffer.
buffer[in] - ByteBuffer containing the image data.
xOffset[in] - X offset to top left corner of ROI.
yOffset[in] - Y offset to top left corner of ROI.
widthOrig[in] - Width of original image.
heightOrig[in] - Height of original image.
engine[in] - PFCENGINE instance (contained in ByteBuffer instance) returned from the CreateEngine() function.
profile[in] - Profile calculated (returned) from Calc().
param[in] - PFCParam instance containing user parameters.
Returns
int showing status
Return value
0The correction is successful.
> 0PFCCORE_STATUS enum.
< 0PFCAPPLYSTATUS enum.

◆ AutoCorrect()

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 
)

Single function to perform Perfectly Clear correction.

Composite function that takes an input picture and enhances it base on user parameters. This function encapsulates all the details such as PFCENGINE, PFCPROFILE etc. and is suitable for use in server type mass processing environment. See sample project "SampleBasic" for usage details.

Parameters
width[in] - Width of image.
height[in] - Height of image.
stride[in] - Stride of image.
pixelFormat[in] - One of PFC_PixelFormatxxxxx values specifying the byte format of image buffer.
buffer[in] - ByteBuffer containing the image data.
widthds[in] - Width of down sampled image.
heightds[in] - Height of down sampled image.
strideds[in] - Stride of down sampled image.
bufferds[in] - ByteBuffer instance containing data of down sampled image. Set to null if down sampled image is not supplied.
param[in] - PFCParam instance containing user parameters.
bFastFAE[in] - Set to true to enable fast mode of FAE calculation.
Returns
int showing status
Return value
0The correction is successful.
> 0
Use macros to map out return code for each feature:
NRRETCODEReturns PFCNR_STATUS Noise Removal correction status.
CORERETCODEReturns PFCCORE_STATUS Core correction status.
FBRETCODEReturns PFCFB_STATUS Face Beautification correction status.
RERETCODEReturns PFCRE_STATUS Red Eye correction status.
< 0PFCAPPLYSTATUS enum.

◆ AutoCorrectPreset()

native int AutoCorrectPreset ( int  width,
int  height,
int  stride,
int  pixelFormat,
ByteBuffer  buffer,
int  widthds,
int  heightds,
int  strideds,
ByteBuffer  bufferds,
int  PresetID,
int  bFastFAE 
)

Single function to perform Perfectly Clear corrections.

Composite function that takes an input picture and enhances it using preset parameters specified by PFCPRESETID id.

Parameters
width[in] - Width of image.
height[in] - Height of image.
stride[in] - Stride of image.
pixelFormat[in] - One of PFC_PixelFormatxxxxx values specifying the byte format of image buffer.
buffer[in] - ByteBuffer containing the image data.
widthds[in] - Width of down sampled image.
heightds[in] - Height of down sampled image.
strideds[in] - Stride of down sampled image.
bufferds[in] - ByteBuffer instance containing data of down sampled image. Set to null if down sampled image is not supplied.
PresetID[in] - index of the preset to apply.
bFastFAE[in] - Set to true to enable fast mode of FAE calculation.
Returns
int showing status defined here AutoCorrect_Return_Values

◆ Calc()

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 
)

Perform initial analysis on images.

Performs initial analysis and calculation of image specific profile parameters. Profile calculation can be done incrementally. For example if calculation is done initially on Perfectly Clear Core. Calculation of other feature, say Face Beautification, can be done in subsequent calls to PFC_Calc().

Parameters
width[in] - Width of image.
height[in] - Height of image.
stride[in] - Stride of image.
pixelFormat[in] - One of PFC_PixelFormatxxxxx values specifying the byte format of image buffer.
buffer[in] - ByteBuffer containing the image data.
widthds[in] - Width of down sampled image.
heightds[in] - Height of down sampled image.
strideds[in] - Stride of down sampled image.
bufferds[in] - ByteBuffer instance containing data of down sampled image. Set to null if down sampled image is not supplied.
engine[in] - PFCENGINE instance (contained in ByteBuffer instance) returned from the CreateEngine() function.
bFastFAE[in] - Set to true to enable fast FAE calculation.
bNoTintCalc[in] - Set to true to skip Abnormal Tint Removal pre-calc.
Returns
Precalc profile of image contained in ByteBuffer instance.

◆ CreateEngine()

native ByteBuffer CreateEngine ( )

Create PFCENGINE instance.

Create core engine for use in Perfectly Clear image processing pipeline. The PFCENGINE module created by this function can be used in the entire session before PFC_DestroyEngine() is called.

Returns
ByteBuffer containing the Engine instance.

◆ DestroyEngine()

native void DestroyEngine ( ByteBuffer  bbEngine)

Destroy PFCENGINE instance and release associated resources.

Release PFCENGINE module created by function PFC_CreateEngine() and release all resouces used by the PFCENGINE.

Parameters
bbEngine[in] - ByteBuffer of PFCENGINE instance to be released.
Returns

◆ FBFaceCount()

native int FBFaceCount ( ByteBuffer  profile)

Return number of faces detected.

Get number of faces detected in the Face Beautification processing.

Parameters
profile[in] - Profile instance returned from Calc function.
Returns
number of faces found

◆ freeNativeBuffer()

native void freeNativeBuffer ( ByteBuffer  b)

Deallocate memory allocated with allocNativeBuffer.

Parameters
b[in] - ByteBuffer of the allocated memory.
Returns

◆ GetFaceInfo()

native boolean GetFaceInfo ( ByteBuffer  profile,
FaceInfo  pFace,
int  index 
)

Utility function to query geometry of detected faces.

Example: Declare PFCFBFACEINFO structure PFCFBFACEINFO face; int numFaces = PFC_FBFaceCount(pProfile); for(int i = 0; i < numFaces; i++) { if (PFC_GetFaceInfo(pProfile, &face, i)) { Do something with face info } }

Parameters
profile[in] - Profile returned from PFC_Calc() function.
pFace[in] - Pointer to PFCFBFACEINFO structure that carries face and eye details upon successful retrieval.
index[in] - Index navigating the list. Must be >=0 and < number of faces.
Returns
True if face information is retrieved successfully. False if face is not detected or index is out of bound.

◆ HasFaceBeautification()

native boolean HasFaceBeautification ( ByteBuffer  engine)

Check if Face Beautification is available.

Parameters
engine[in] - Pointer returned from CreateEngine() function.
Returns
TRUE is Face Beautification is available. FALSE otherwise.

◆ IsNoiseDetected()

native boolean IsNoiseDetected ( ByteBuffer  profile,
int  iNoisePreset 
)

Query if noise is detected.

Parameters
profile[in] - Profile returned from PFC_Calc() function.
iNoisePreset[in] - Noise preset to be checked.
Returns
True if noise is detected when noise preset is iPreset. False otherwise. If Noise calculation is not enabled during PFC_Calc(), this query returns False.

◆ ReadPresets()

native int ReadPresets ( PFCParam  param,
String  filename 
)

Load image processing settings from a .preset file.

Use this function to load image processing settings from a .preset file. You can export these from Perfectly Clear Workbench or Perfectly Clear Complete. Note: the first preset in the file will be used to load the settings into the param struct - so please export a single preset at a time for this purpose.

Parameters
param[in, out] - PFCPARAM structure to fill with the process parameters.
filename[in] - Path and filename for the .preset file to read and load.
Returns
int showing status
Return value
0Success: param now contains the settings in filename.
< 0
Failure: settings were not loaded:
-1Attribute errors
-2Unable to open file
-3File read error
-4Parse error
-5Cannot convert text
-6No text node
-7Element depth exceeded

◆ ReadPresetsFromStream()

native int ReadPresetsFromStream ( PFCParam  param,
String  s 
)

Load image processing settings from a String instance.

Use this function to load image processing settings from a String (stream). You can export these from Perfectly Clear Workbench or Perfectly Clear Complete. Note: the first preset in the file will be used to load the settings into the param struct - so please export a single preset at a time for this purpose. This function is very similar to PFC_ReadPresets, but accepts the preset data from a file stream instead of from a file on disk.

Parameters
param[in, out] - PFCParam structure to fill with the process parameters.
s[in] - String instance that reads and loads presets from.
Returns
int showing status
Return value
0Success: param now contains the settings in filename.
< 0
Failure: settings were not loaded:
-1Attribute errors
-2Unable to open file
-3File read error
-4Parse error
-5Cannot convert text
-6No text node
-7Element depth exceeded

◆ ReleaseProfile()

native void ReleaseProfile ( ByteBuffer  profile)

Release PFCPROFILE instance.

Release PFCPROFILE instance and its associated resources.

Parameters
profile[in] - ByteBuffer of PFCPROFILE instance returned from Calc funciton.
Returns

◆ SetParam()

native void SetParam ( PFCParam  param,
int  id 
)

Initialize a PFCParam class instance.

SetParam initializes a PFCParam structure with parameters pertaining to Athentech preset as identified by the PFCPRESETID. If preset id is not provided, the default preset values will be used.

Parameters
param[in, out] - PFCParam structure to be set.
id[in] - enum PFCPRESETID (default to PRESET_IAUTO_21).
Returns

Field Documentation

◆ PFC_PixelFormat24bppBGR

final int PFC_PixelFormat24bppBGR = 1
static

24 bit RGB - the format is 24 bits per pixel; 8 bits each are used for the red, green, and blue components.

R0 G0 B0 R1 G1 B1 ...

Definition at line 44 of file V9.java.

◆ PFC_PixelFormat24bppRGB

final int PFC_PixelFormat24bppRGB = 0
static

24 bit RGB - the format is 24 bits per pixel; 8 bits each are used for the red, green, and blue components.

B0 G0 R0 B1 G1 R1 ...

Definition at line 31 of file V9.java.

◆ PFC_PixelFormat32bppABGR

final int PFC_PixelFormat32bppABGR = 2
static

32 bit ABGR - the format is 32 bits per pixel; 8 bits each are used for the alpha, red, green, and blue components.

R0 G0 B0 A0 R1 G1 B1 A1 ...

Definition at line 59 of file V9.java.

◆ PFC_PixelFormat32bppARGB

final int PFC_PixelFormat32bppARGB = 5
static

32 bit ARGB - the format is 32 bits per pixel; 8 bits each are used for the alpha, red, green, and blue components.

B0 G0 R0 A0 B1 G1 R1 A1 ...

Definition at line 102 of file V9.java.

◆ PFC_PixelFormat48bppBGR

final int PFC_PixelFormat48bppBGR = 6
static

48 bit BGR - the format is 48 bits per pixel; 16 bits each are used for the red, green, and blue components. The 16 bit word is Little-endian.

R0 G0 B0 R1 G1 B1 ...

Definition at line 115 of file V9.java.

◆ PFC_PixelFormat48bppRGB

final int PFC_PixelFormat48bppRGB = 3
static

48 bit RGB - the format is 48 bits per pixel; 16 bits each are used for the red, green, and blue components. The 16 bit word is Little-endian.

B0 G0 R0 B1 G1 R1 ...

Definition at line 72 of file V9.java.

◆ PFC_PixelFormat64bppABGR

final int PFC_PixelFormat64bppABGR = 7
static

64 bit ABGR - the format is 64 bits per pixel; 16 bits each are used for the alpha, red, green, and blue components. The 16 bit word is Little-endian.

R0 G0 B0 A0 R1 G1 B1 A1 ...

Definition at line 130 of file V9.java.

◆ PFC_PixelFormat64bppARGB

final int PFC_PixelFormat64bppARGB = 4
static

64 bit ARGB - the format is 64 bits per pixel; 16 bits each are used for the alpha, red, green, and blue components. The 16 bit word is Little-endian.

B0 G0 R0 A0 B1 G1 R1 A1 ...

Definition at line 87 of file V9.java.


The documentation for this class was generated from the following file: