Perfectly Clear SDK Documentation  9.1.1.325
V9.java
Go to the documentation of this file.
1 
6 package PerfectlyClear;
7 
8 import java.nio.ByteBuffer;
9 
12 public class V9 {
13  static {
14  System.loadLibrary("PerfectlyClearPro");
15  }
16 
17  // PFCPIXELFORMAT
18 
31  public static final int PFC_PixelFormat24bppRGB = 0;
44  public static final int PFC_PixelFormat24bppBGR = 1;
59  public static final int PFC_PixelFormat32bppABGR = 2;
72  public static final int PFC_PixelFormat48bppRGB = 3;
87  public static final int PFC_PixelFormat64bppARGB = 4;
102  public static final int PFC_PixelFormat32bppARGB = 5;
115  public static final int PFC_PixelFormat48bppBGR = 6;
130  public static final int PFC_PixelFormat64bppABGR = 7;
131 
132  // PFCPRESETID
133 
135  public static final int PRESET_BEAUTIFY = 0;
137  public static final int PRESET_BEAUTIFYPLUS = 1;
139  public static final int PRESET_DETAILS = 2;
141  public static final int PRESET_VIVID = 3;
143  public static final int PRESET_INTELLIGENTAUTO = 4;
145  public static final int PRESET_IAUTO_2019 = 5;
147  public static final int PRESET_IAUTO_2019_RE = 6;
149  public static final int PRESET_IAUTO_21 = 7;
151  public static final int PRESET_IAUTO_21_ASIA = 8;
152 
153 
154  // CONTRASTMODE
156  public static final int HIGH_CONTRAST = 0;
158  public static final int HIGH_DEFINITION = 1;
159 
160  // TINTCORRECTION
161 
163  public static final int TINTCORRECT_AGGRESSIVE = 0;
165  public static final int TINTCORRECT_DEFAULT = 1;
167  public static final int TINTCORRECT_CONSERVATIVE = 2;
169  public static final int TINTCORRECT_SPECIAL = 3;
170 
171  // DCFMODE
172 
174  public static final int DCF_STANDARD = 0;
176  public static final int DCF_VIVID = 1;
177 
178  // AGGRESSIVENESS
179 
181  public static final int AGGRESSIVENESS_CONSERVATIVE = 0;
183  public static final int AGGRESSIVENESS_MODERATE = 1;
185  public static final int AGGRESSIVENESS_AGGRESSIVE = 2;
186 
187  // BIASMODE
188 
190  public static final int BIAS_NONE = 0;
192  public static final int BIAS_ASIAN_PREFERENCE = 1;
194  public static final int BIAS_AVERAGE_PREFERENCE = 2;
196  public static final int BIAS_BRIGHTER_PREFERENCE = 3;
197 
198  // SKINMODE
199 
201  public static final int SKINMODE_FACE = 1;
203  public static final int SKINMODE_BODY = 2;
204 
205  // SKINSMOOTHTYPE
206 
208  public static final int SKINSMOOTHTYPE_SUBTLE = 1;
210  public static final int SKINSMOOTHTYPE_DEFAULT = 2;
212  public static final int SKINSMOOTHTYPE_SUPERSMOOTH = 3;
213 
214  // SKINTONINGTYPE
215 
217  public static final int SKINTONINGTYPE_WHITE = 1;
219  public static final int SKINTONINGTYPE_PALE = 2;
221  public static final int SKINTONINGTYPE_WARM = 3;
223  public static final int SKINTONINGTYPE_TAN = 4;
225  public static final int SKINTONINGTYPE_FOUNDATION = 5;
226 
227  // LIPSHARPENTYPE
228 
230  public static final int LIPSHARPENTYPE_FINE = 1;
232  public static final int LIPSHARPENTYPE_MEDIUM = 2;
234  public static final int LIPSHARPENTYPE_COARSE = 3;
235 
242  public native ByteBuffer CreateEngine();
243 
251  public native void DestroyEngine(ByteBuffer bbEngine);
252 
261  public native void SetParam(PFCParam param, int id);
262 
289  public native int ReadPresets(PFCParam param, String filename);
290 
317  public native int ReadPresetsFromStream(PFCParam param, String s);
318 
338  public native ByteBuffer Calc(int width, int height, int stride, int pixelFormat, ByteBuffer buffer,
339  int widthds, int heightds, int strideds, ByteBuffer bufferds,
340  ByteBuffer engine, int bFastFAE, int bNoTintCalc);
341 
371  public native int Apply(int width, int height, int stride, int pixelFormat, ByteBuffer buffer, ByteBuffer engine, ByteBuffer profile, PFCParam param);
372 
398  public native int ApplyLocal(int width, int height, int stride, int pixelFormat, ByteBuffer buffer,
399  int xOffset, int yOffset, int widthOrig, int heightOrig,
400  ByteBuffer engine, ByteBuffer profile, PFCParam param);
408  public native void ReleaseProfile(ByteBuffer profile);
439  public native int AutoCorrect(int width, int height, int stride, int pixelFormat, ByteBuffer buffer,
440  int widthds, int heightds, int strideds, ByteBuffer bufferds,
441  PFCParam param, int bFastFAE);
459  public native int AutoCorrectPreset(int width, int height, int stride, int pixelFormat, ByteBuffer buffer,
460  int widthds, int heightds, int strideds, ByteBuffer bufferds,
461  int PresetID, int bFastFAE);
462  public native int ProfileStatus(ByteBuffer profile);
463  public native int NRStatus(ByteBuffer profile);
464  public native int COREStatus(ByteBuffer profile);
465  public native int FBStatus(ByteBuffer profile);
466  public native int REStatus(ByteBuffer profile);
472  public native boolean HasFaceBeautification(ByteBuffer engine);
480  public native int FBFaceCount(ByteBuffer profile);
501  public native boolean GetFaceInfo(ByteBuffer profile, FaceInfo pFace, int index);
510  public native boolean AbnormalTintDetected(ByteBuffer profile, int tintMethod);
511  public native int GetREStatus(ByteBuffer profile);
517  public native ByteBuffer allocNativeBuffer(long size);
522  public native void freeNativeBuffer(ByteBuffer b);
531  public native boolean IsNoiseDetected(ByteBuffer profile, int iNoisePreset);
532 
533  public native void SetAddonPath(String s);
534  public native void ReleaseAddonPath();
535 
536  public int NRRETCODE(int code)
537  {
538  return (code & 0x000000FF);
539  }
540  public int CORERETCODE(int code)
541  {
542  return ((code >> 8) & 0x000000FF);
543  }
544  public int FBRETCODE(int code)
545  {
546  return ((code >> 16) & 0x000000FF);
547  }
548  public int RERETCODE(int code)
549  {
550  return ((code >> 24) & 0x000000FF);
551  }
552 }
static final int PRESET_IAUTO_2019
iAuto 2019 - even better automatic corrections
Definition: V9.java:145
static final int PRESET_INTELLIGENTAUTO
Intelligent Auto.
Definition: V9.java:143
native boolean IsNoiseDetected(ByteBuffer profile, int iNoisePreset)
Query if noise is detected.
native void freeNativeBuffer(ByteBuffer b)
static final int SKINTONINGTYPE_WHITE
Whitens (bleaches) face. Recommended mainly for darker skin.
Definition: V9.java:217
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.
native ByteBuffer allocNativeBuffer(long size)
static final int PFC_PixelFormat32bppARGB
Definition: V9.java:102
static final int SKINTONINGTYPE_PALE
Makes skin look lighter and more pale.
Definition: V9.java:219
static final int AGGRESSIVENESS_CONSERVATIVE
Less aggressive in exposure correction.
Definition: V9.java:181
native boolean HasFaceBeautification(ByteBuffer engine)
Check if Face Beautification is available.
static final int TINTCORRECT_SPECIAL
Highest sensitivity level of tint detection.
Definition: V9.java:169
static final int PRESET_BEAUTIFYPLUS
Beautify Plus.
Definition: V9.java:137
static final int PFC_PixelFormat32bppABGR
Definition: V9.java:59
static final int LIPSHARPENTYPE_MEDIUM
Stronger sharpening. Details are more pronounced.
Definition: V9.java:232
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.
native int FBFaceCount(ByteBuffer profile)
Return number of faces detected.
static final int PFC_PixelFormat64bppARGB
Definition: V9.java:87
native void SetParam(PFCParam param, int id)
Initialize a PFCParam class instance.
static final int SKINSMOOTHTYPE_SUBTLE
The subtle correction removes the wrinkles and spots alone while it keeps the texture of the face unc...
Definition: V9.java:208
Interface Class for Perfectly Clear SDK for Android.
Definition: V9.java:12
native int ReadPresetsFromStream(PFCParam param, String s)
Load image processing settings from a String instance.
native ByteBuffer CreateEngine()
Create PFCENGINE instance.
static final int DCF_STANDARD
For normal photo.
Definition: V9.java:174
static final int AGGRESSIVENESS_MODERATE
Moderate level of exposure correction.
Definition: V9.java:183
native boolean AbnormalTintDetected(ByteBuffer profile, int tintMethod)
Query if abnormal tint is detected.
static final int PFC_PixelFormat64bppABGR
Definition: V9.java:130
native void DestroyEngine(ByteBuffer bbEngine)
Destroy PFCENGINE instance and release associated resources.
static final int PRESET_IAUTO_2019_RE
iAuto 2019 with Red Eye Correction
Definition: V9.java:147
static final int HIGH_DEFINITION
Optimized to bring out more details in the shadows, more details in the highlights, and more pleasing skin tones.
Definition: V9.java:158
static final int BIAS_BRIGHTER_PREFERENCE
Average usage with brighter tone.
Definition: V9.java:196
static final int TINTCORRECT_DEFAULT
Moderate level of tint detection.
Definition: V9.java:165
static final int PFC_PixelFormat24bppRGB
Definition: V9.java:31
static final int BIAS_NONE
Turn off bias correction.
Definition: V9.java:190
static final int SKINSMOOTHTYPE_SUPERSMOOTH
This is a more aggressive and effective correction where the appearance of the entire skin (including...
Definition: V9.java:212
static final int SKINSMOOTHTYPE_DEFAULT
This type of correction provides a more uniform appearance to the complexion. It combines the natural...
Definition: V9.java:210
static final int HIGH_CONTRAST
Optimized to bring higher contrast to the image.
Definition: V9.java:156
native void ReleaseProfile(ByteBuffer profile)
Release PFCPROFILE instance.
native int Apply(int width, int height, int stride, int pixelFormat, ByteBuffer buffer, ByteBuffer engine, ByteBuffer profile, PFCParam param)
Correct image with parameters.
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.
native int ReadPresets(PFCParam param, String filename)
Load image processing settings from a .preset file.
static final int PFC_PixelFormat48bppBGR
Definition: V9.java:115
static final int TINTCORRECT_AGGRESSIVE
Aggressive detection of tint.
Definition: V9.java:163
static final int SKINMODE_FACE
Apply correction ONLY on skin regions included in faces.
Definition: V9.java:201
static final int BIAS_ASIAN_PREFERENCE
Fine tuned for Asian skin tone.
Definition: V9.java:192
static final int PFC_PixelFormat24bppBGR
Definition: V9.java:44
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.
native boolean GetFaceInfo(ByteBuffer profile, FaceInfo pFace, int index)
Utility function to query geometry of detected faces.
static final int PRESET_IAUTO_21_ASIA
Based on iAuto 21, but with brighter Skin & Depth Bias for truer skin tone.
Definition: V9.java:151
static final int BIAS_AVERAGE_PREFERENCE
For average usage.
Definition: V9.java:194
static final int SKINMODE_BODY
Apply correction on most skin regions regardless they are linked with a face or not.
Definition: V9.java:203
static final int DCF_VIVID
For more color vibrancy.
Definition: V9.java:176
static final int SKINTONINGTYPE_TAN
Darkens skin, makes it look naturally tanned.
Definition: V9.java:223
static final int PRESET_DETAILS
Details.
Definition: V9.java:139
static final int TINTCORRECT_CONSERVATIVE
Priority on minimum false positive detection.
Definition: V9.java:167
static final int SKINTONINGTYPE_FOUNDATION
Adjust skin to user defined foundation color.
Definition: V9.java:225
static final int PRESET_VIVID
Vivid.
Definition: V9.java:141
static final int LIPSHARPENTYPE_COARSE
Lip details are coarsely pronounced.
Definition: V9.java:234
static final int LIPSHARPENTYPE_FINE
Fine touch of sharpening.
Definition: V9.java:230
static final int PFC_PixelFormat48bppRGB
Definition: V9.java:72
static final int PRESET_IAUTO_21
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.
Definition: V9.java:149
static final int PRESET_BEAUTIFY
Beautify.
Definition: V9.java:135
static final int AGGRESSIVENESS_AGGRESSIVE
More aggressive in exposure correction.
Definition: V9.java:185
static final int SKINTONINGTYPE_WARM
Warms skin tone.
Definition: V9.java:221