Perfectly Clear SDK Documentation  8.3.1.149
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;
144 
145  // CONTRASTMODE
147  public static final int HIGH_CONTRAST = 0;
149  public static final int HIGH_DEFINITION = 1;
150 
151  // TINTCORRECTION
152 
154  public static final int TINTCORRECT_AGGRESSIVE = 0;
156  public static final int TINTCORRECT_DEFAULT = 1;
158  public static final int TINTCORRECT_CONSERVATIVE = 2;
160  public static final int TINTCORRECT_SPECIAL = 3;
161 
162  // DCFMODE
163 
165  public static final int DCF_STANDARD = 0;
167  public static final int DCF_VIVID = 1;
168 
169  // AGGRESSIVENESS
170 
172  public static final int AGGRESSIVENESS_CONSERVATIVE = 0;
174  public static final int AGGRESSIVENESS_MODERATE = 1;
176  public static final int AGGRESSIVENESS_AGGRESSIVE = 2;
177 
178  // BIASMODE
179 
181  public static final int BIAS_NONE = 0;
183  public static final int BIAS_ASIAN_PREFERENCE = 1;
185  public static final int BIAS_AVERAGE_PREFERENCE = 2;
187  public static final int BIAS_BRIGHTER_PREFERENCE = 3;
188 
189  // SKINMODE
190 
192  public static final int SKINMODE_FACE = 1;
194  public static final int SKINMODE_BODY = 2;
195 
196  // SKINSMOOTHTYPE
197 
199  public static final int SKINSMOOTHTYPE_SUBTLE = 1;
201  public static final int SKINSMOOTHTYPE_DEFAULT = 2;
203  public static final int SKINSMOOTHTYPE_SUPERSMOOTH = 3;
204 
205  // SKINTONINGTYPE
206 
208  public static final int SKINTONINGTYPE_WHITE = 1;
210  public static final int SKINTONINGTYPE_PALE = 2;
212  public static final int SKINTONINGTYPE_WARM = 3;
214  public static final int SKINTONINGTYPE_TAN = 4;
216  public static final int SKINTONINGTYPE_FOUNDATION = 5;
217 
218  // LIPSHARPENTYPE
219 
221  public static final int LIPSHARPENTYPE_FINE = 1;
223  public static final int LIPSHARPENTYPE_MEDIUM = 2;
225  public static final int LIPSHARPENTYPE_COARSE = 3;
226 
233  public native ByteBuffer CreateEngine();
234 
241  public native void DestroyEngine(ByteBuffer bbEngine);
242 
250  public native void SetParam(PFCParam param, int id);
251 
278  public native int ReadPresets(PFCParam param, String filename);
279 
306  public native int ReadPresetsFromStream(PFCParam param, String s);
307 
328  public native ByteBuffer Calc(int width, int height, int stride, int pixelFormat, ByteBuffer buffer,
329  int widthds, int heightds, int strideds, ByteBuffer bufferds,
330  ByteBuffer engine, int bFastFAE, int bNoTintCalc);
331 
361  public native int Apply(int width, int height, int stride, int pixelFormat, ByteBuffer buffer, ByteBuffer engine, ByteBuffer profile, PFCParam param);
362 
386  public native int ApplyLocal(int width, int height, int stride, int pixelFormat, ByteBuffer buffer,
387  int xOffset, int yOffset, int widthOrig, int heightOrig,
388  ByteBuffer engine, ByteBuffer profile, PFCParam param);
395  public native void ReleaseProfile(ByteBuffer profile);
426  public native int AutoCorrect(int width, int height, int stride, int pixelFormat, ByteBuffer buffer,
427  int widthds, int heightds, int strideds, ByteBuffer bufferds,
428  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);
473  public native boolean HasFaceBeautification(ByteBuffer engine);
480  public native int FBFaceCount(ByteBuffer profile);
502  public native boolean GetFaceInfo(ByteBuffer profile, FaceInfo pFace, int index);
512  public native boolean AbnormalTintDetected(ByteBuffer profile, int tintMethod);
513  public native int GetREStatus(ByteBuffer profile);
518  public native ByteBuffer allocNativeBuffer(long size);
522  public native void freeNativeBuffer(ByteBuffer b);
530  public native boolean IsNoiseDetected(ByteBuffer profile, int iNoisePreset);
531 
532  public int NRRETCODE(int code)
533  {
534  return (code & 0x000000FF);
535  }
536  public int CORERETCODE(int code)
537  {
538  return ((code >> 8) & 0x000000FF);
539  }
540  public int FBRETCODE(int code)
541  {
542  return ((code >> 16) & 0x000000FF);
543  }
544  public int RERETCODE(int code)
545  {
546  return ((code >> 24) & 0x000000FF);
547  }
548 }
static final int LIPSHARPENTYPE_FINE
Fine touch of sharpening.
Definition: V8.java:221
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:147
static final int TINTCORRECT_DEFAULT
Moderate level of tint detection.
Definition: V8.java:156
static final int DCF_STANDARD
For normal photo.
Definition: V8.java:165
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:158
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:185
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:216
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:199
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:208
native int FBFaceCount(ByteBuffer profile)
Return number of faces detected.
static final int TINTCORRECT_SPECIAL
Highest sensitivity level of tint detection.
Definition: V8.java:160
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:201
static final int BIAS_NONE
Turn off bias correction.
Definition: V8.java:181
static final int LIPSHARPENTYPE_MEDIUM
Stronger sharpening. Details are more pronounced.
Definition: V8.java:223
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:167
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:174
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:210
static final int SKINMODE_BODY
Apply correction on most skin regions regardless they are linked with a face or not.
Definition: V8.java:194
static final int BIAS_ASIAN_PREFERENCE
Fine tuned for Asian skin tone.
Definition: V8.java:183
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:149
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:187
static final int SKINMODE_FACE
Apply correction ONLY on skin regions included in faces.
Definition: V8.java:192
native void DestroyEngine(ByteBuffer bbEngine)
Destroy PFCENGINE instance and release associated resources.
static final int PFC_PixelFormat32bppABGR
Definition: V8.java:59
static final int SKINTONINGTYPE_TAN
Darkens skin, makes it look naturally tanned.
Definition: V8.java:214
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:176
static final int AGGRESSIVENESS_CONSERVATIVE
Less aggressive in exposure correction.
Definition: V8.java:172
static final int SKINTONINGTYPE_WARM
Warms skin tone.
Definition: V8.java:212
static final int TINTCORRECT_AGGRESSIVE
Aggressive detection of tint.
Definition: V8.java:154
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:203
static final int LIPSHARPENTYPE_COARSE
Lip details are coarsely pronounced.
Definition: V8.java:225