![]() |
Perfectly Clear SDK Documentation
9.1.1.325
|
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. | |
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.
profile | [in] - Profile returned from Calc() function. |
tintMethod | [in] - TINTCORRECTION enum to specify tint detection method used. |
native ByteBuffer allocNativeBuffer | ( | long | size | ) |
Allocate memory from native function.
size | [in] - Byte size of memory requested. |
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.
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. |
0 | The correction is successful. | ||||||||||
> 0 |
| ||||||||||
< 0 | PFCAPPLYSTATUS enum. |
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.
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. |
0 | The correction is successful. |
> 0 | PFCCORE_STATUS enum. |
< 0 | PFCAPPLYSTATUS enum. |
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.
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. |
0 | The correction is successful. | ||||||||||
> 0 |
| ||||||||||
< 0 | PFCAPPLYSTATUS enum. |
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.
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. |
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().
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. |
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.
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.
bbEngine | [in] - ByteBuffer of PFCENGINE instance to be released. |
native int FBFaceCount | ( | ByteBuffer | profile | ) |
Return number of faces detected.
Get number of faces detected in the Face Beautification processing.
profile | [in] - Profile instance returned from Calc function. |
native void freeNativeBuffer | ( | ByteBuffer | b | ) |
Deallocate memory allocated with allocNativeBuffer.
b | [in] - ByteBuffer of the allocated memory. |
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 } }
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. |
native boolean HasFaceBeautification | ( | ByteBuffer | engine | ) |
Check if Face Beautification is available.
engine | [in] - Pointer returned from CreateEngine() function. |
native boolean IsNoiseDetected | ( | ByteBuffer | profile, |
int | iNoisePreset | ||
) |
Query if noise is detected.
profile | [in] - Profile returned from PFC_Calc() function. |
iNoisePreset | [in] - Noise preset to be checked. |
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.
param | [in, out] - PFCPARAM structure to fill with the process parameters. |
filename | [in] - Path and filename for the .preset file to read and load. |
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.
param | [in, out] - PFCParam structure to fill with the process parameters. |
s | [in] - String instance that reads and loads presets from. |
native void ReleaseProfile | ( | ByteBuffer | profile | ) |
Release PFCPROFILE instance.
Release PFCPROFILE instance and its associated resources.
profile | [in] - ByteBuffer of PFCPROFILE instance returned from Calc funciton. |
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.
param | [in, out] - PFCParam structure to be set. |
id | [in] - enum PFCPRESETID (default to PRESET_IAUTO_21). |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |