Perfectly Clear SDK Documentation  9.0.0.295
V8.java
Go to the documentation of this file.
1 
6 package PerfectlyClear;
7 
8 import java.nio.ByteBuffer;
9 
12 public class V8 {
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;
148 
149  // CONTRASTMODE
151  public static final int HIGH_CONTRAST = 0;
153  public static final int HIGH_DEFINITION = 1;
154 
155  // TINTCORRECTION
156 
158  public static final int TINTCORRECT_AGGRESSIVE = 0;
160  public static final int TINTCORRECT_DEFAULT = 1;
162  public static final int TINTCORRECT_CONSERVATIVE = 2;
164  public static final int TINTCORRECT_SPECIAL = 3;
165 
166  // DCFMODE
167 
169  public static final int DCF_STANDARD = 0;
171  public static final int DCF_VIVID = 1;
172 
173  // AGGRESSIVENESS
174 
176  public static final int AGGRESSIVENESS_CONSERVATIVE = 0;
178  public static final int AGGRESSIVENESS_MODERATE = 1;
180  public static final int AGGRESSIVENESS_AGGRESSIVE = 2;
181 
182  // BIASMODE
183 
185  public static final int BIAS_NONE = 0;
187  public static final int BIAS_ASIAN_PREFERENCE = 1;
189  public static final int BIAS_AVERAGE_PREFERENCE = 2;
191  public static final int BIAS_BRIGHTER_PREFERENCE = 3;
192 
193  // SKINMODE
194 
196  public static final int SKINMODE_FACE = 1;
198  public static final int SKINMODE_BODY = 2;
199 
200  // SKINSMOOTHTYPE
201 
203  public static final int SKINSMOOTHTYPE_SUBTLE = 1;
205  public static final int SKINSMOOTHTYPE_DEFAULT = 2;
207  public static final int SKINSMOOTHTYPE_SUPERSMOOTH = 3;
208 
209  // SKINTONINGTYPE
210 
212  public static final int SKINTONINGTYPE_WHITE = 1;
214  public static final int SKINTONINGTYPE_PALE = 2;
216  public static final int SKINTONINGTYPE_WARM = 3;
218  public static final int SKINTONINGTYPE_TAN = 4;
220  public static final int SKINTONINGTYPE_FOUNDATION = 5;
221 
222  // LIPSHARPENTYPE
223 
225  public static final int LIPSHARPENTYPE_FINE = 1;
227  public static final int LIPSHARPENTYPE_MEDIUM = 2;
229  public static final int LIPSHARPENTYPE_COARSE = 3;
230 
237  public native ByteBuffer CreateEngine();
238 
246  public native void DestroyEngine(ByteBuffer bbEngine);
247 
256  public native void SetParam(PFCParam param, int id);
257 
284  public native int ReadPresets(PFCParam param, String filename);
285 
312  public native int ReadPresetsFromStream(PFCParam param, String s);
313 
333  public native ByteBuffer Calc(int width, int height, int stride, int pixelFormat, ByteBuffer buffer,
334  int widthds, int heightds, int strideds, ByteBuffer bufferds,
335  ByteBuffer engine, int bFastFAE, int bNoTintCalc);
336 
366  public native int Apply(int width, int height, int stride, int pixelFormat, ByteBuffer buffer, ByteBuffer engine, ByteBuffer profile, PFCParam param);
367 
393  public native int ApplyLocal(int width, int height, int stride, int pixelFormat, ByteBuffer buffer,
394  int xOffset, int yOffset, int widthOrig, int heightOrig,
395  ByteBuffer engine, ByteBuffer profile, PFCParam param);
403  public native void ReleaseProfile(ByteBuffer profile);
434  public native int AutoCorrect(int width, int height, int stride, int pixelFormat, ByteBuffer buffer,
435  int widthds, int heightds, int strideds, ByteBuffer bufferds,
436  PFCParam param, int bFastFAE);
454  public native int AutoCorrectPreset(int width, int height, int stride, int pixelFormat, ByteBuffer buffer,
455  int widthds, int heightds, int strideds, ByteBuffer bufferds,
456  int PresetID, int bFastFAE);
457  public native int ProfileStatus(ByteBuffer profile);
458  public native int NRStatus(ByteBuffer profile);
459  public native int COREStatus(ByteBuffer profile);
460  public native int FBStatus(ByteBuffer profile);
461  public native int REStatus(ByteBuffer profile);
467  public native boolean HasFaceBeautification(ByteBuffer engine);
475  public native int FBFaceCount(ByteBuffer profile);
496  public native boolean GetFaceInfo(ByteBuffer profile, FaceInfo pFace, int index);
505  public native boolean AbnormalTintDetected(ByteBuffer profile, int tintMethod);
506  public native int GetREStatus(ByteBuffer profile);
512  public native ByteBuffer allocNativeBuffer(long size);
517  public native void freeNativeBuffer(ByteBuffer b);
526  public native boolean IsNoiseDetected(ByteBuffer profile, int iNoisePreset);
527 
528  public int NRRETCODE(int code)
529  {
530  return (code & 0x000000FF);
531  }
532  public int CORERETCODE(int code)
533  {
534  return ((code >> 8) & 0x000000FF);
535  }
536  public int FBRETCODE(int code)
537  {
538  return ((code >> 16) & 0x000000FF);
539  }
540  public int RERETCODE(int code)
541  {
542  return ((code >> 24) & 0x000000FF);
543  }
544 }
static final int LIPSHARPENTYPE_FINE
Fine touch of sharpening.
Definition: V8.java:225
static final int PRESET_BEAUTIFYPLUS
Beautify Plus.
Definition: V8.java:137
static final int HIGH_CONTRAST
Optimized to bring higher contrast to the image.
Definition: V8.java:151
static final int TINTCORRECT_DEFAULT
Moderate level of tint detection.
Definition: V8.java:160
static final int DCF_STANDARD
For normal photo.
Definition: V8.java:169
native boolean IsNoiseDetected(ByteBuffer profile, int iNoisePreset)
Query if noise is detected.
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.
static final int TINTCORRECT_CONSERVATIVE
Priority on minimum false positive detection.
Definition: V8.java:162
native boolean GetFaceInfo(ByteBuffer profile, FaceInfo pFace, int index)
Utility function to query geometry of detected faces.
native int ReadPresetsFromStream(PFCParam param, String s)
Load image processing settings from a String instance.
static final int BIAS_AVERAGE_PREFERENCE
For average usage.
Definition: V8.java:189
static final int PRESET_IAUTO_2019_RE
iAuto 2019 with Red Eye Correction
Definition: V8.java:147
static final int PRESET_DETAILS
Details.
Definition: V8.java:139
native void SetParam(PFCParam param, int id)
Initialize a PFCParam class instance.
static final int SKINTONINGTYPE_FOUNDATION
Adjust skin to user defined foundation color.
Definition: V8.java:220
native boolean HasFaceBeautification(ByteBuffer engine)
Check if Face Beautification is available.
static final int SKINSMOOTHTYPE_SUBTLE
The subtle correction removes the wrinkles and spots alone while it keeps the texture of the face unc...
Definition: V8.java:203
static final int PFC_PixelFormat32bppARGB
Definition: V8.java:102
static final int SKINTONINGTYPE_WHITE
Whitens (bleaches) face. Recommended mainly for darker skin.
Definition: V8.java:212
native int FBFaceCount(ByteBuffer profile)
Return number of faces detected.
static final int TINTCORRECT_SPECIAL
Highest sensitivity level of tint detection.
Definition: V8.java:164
static final int PFC_PixelFormat64bppABGR
Definition: V8.java:130
static final int SKINSMOOTHTYPE_DEFAULT
This type of correction provides a more uniform appearance to the complexion. It combines the natural...
Definition: V8.java:205
static final int BIAS_NONE
Turn off bias correction.
Definition: V8.java:185
static final int LIPSHARPENTYPE_MEDIUM
Stronger sharpening. Details are more pronounced.
Definition: V8.java:227
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.
static final int DCF_VIVID
For more color vibrancy.
Definition: V8.java:171
native boolean AbnormalTintDetected(ByteBuffer profile, int tintMethod)
Query if abnormal tint is detected.
static final int PFC_PixelFormat24bppRGB
Definition: V8.java:31
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.
static final int AGGRESSIVENESS_MODERATE
Moderate level of exposure correction.
Definition: V8.java:178
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 void freeNativeBuffer(ByteBuffer b)
static final int SKINTONINGTYPE_PALE
Makes skin look lighter and more pale.
Definition: V8.java:214
static final int SKINMODE_BODY
Apply correction on most skin regions regardless they are linked with a face or not.
Definition: V8.java:198
static final int BIAS_ASIAN_PREFERENCE
Fine tuned for Asian skin tone.
Definition: V8.java:187
static final int PFC_PixelFormat24bppBGR
Definition: V8.java:44
native ByteBuffer allocNativeBuffer(long size)
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: V8.java:153
static final int PFC_PixelFormat48bppRGB
Definition: V8.java:72
native int Apply(int width, int height, int stride, int pixelFormat, ByteBuffer buffer, ByteBuffer engine, ByteBuffer profile, PFCParam param)
Correct image with parameters.
native ByteBuffer CreateEngine()
Create PFCENGINE instance.
static final int BIAS_BRIGHTER_PREFERENCE
Average usage with brighter tone.
Definition: V8.java:191
static final int SKINMODE_FACE
Apply correction ONLY on skin regions included in faces.
Definition: V8.java:196
native void DestroyEngine(ByteBuffer bbEngine)
Destroy PFCENGINE instance and release associated resources.
static final int PFC_PixelFormat32bppABGR
Definition: V8.java:59
static final int PRESET_IAUTO_2019
iAuto 2019 - even better automatic corrections
Definition: V8.java:145
static final int SKINTONINGTYPE_TAN
Darkens skin, makes it look naturally tanned.
Definition: V8.java:218
static final int PRESET_VIVID
Vivid.
Definition: V8.java:141
static final int PRESET_BEAUTIFY
Beautify.
Definition: V8.java:135
static final int AGGRESSIVENESS_AGGRESSIVE
More aggressive in exposure correction.
Definition: V8.java:180
static final int AGGRESSIVENESS_CONSERVATIVE
Less aggressive in exposure correction.
Definition: V8.java:176
static final int SKINTONINGTYPE_WARM
Warms skin tone.
Definition: V8.java:216
static final int TINTCORRECT_AGGRESSIVE
Aggressive detection of tint.
Definition: V8.java:158
static final int PRESET_INTELLIGENTAUTO
Intelligent Auto.
Definition: V8.java:143
native void ReleaseProfile(ByteBuffer profile)
Release PFCPROFILE instance.
native int ReadPresets(PFCParam param, String filename)
Load image processing settings from a .preset file.
static final int PFC_PixelFormat64bppARGB
Definition: V8.java:87
static final int PFC_PixelFormat48bppBGR
Definition: V8.java:115
Interface Class for Perfectly Clear SDK for Android.
Definition: V8.java:12
static final int SKINSMOOTHTYPE_SUPERSMOOTH
This is a more aggressive and effective correction where the appearance of the entire skin (including...
Definition: V8.java:207
static final int LIPSHARPENTYPE_COARSE
Lip details are coarsely pronounced.
Definition: V8.java:229