public class ImageUtil
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
mFileIndex |
| Constructor and Description |
|---|
ImageUtil() |
| Modifier and Type | Method and Description |
|---|---|
static int |
ABGRToI420(byte[] rgba,
int width,
int height,
byte[] I420,
int arrayOffset,
boolean flipVertical) |
static int |
ConvertToI420(byte[] nv21,
int width,
int height,
byte[] I420,
int dstWidth,
int dstHight,
int rotateAngle,
int cropx,
int cropy,
int cropW,
int cropH)
This function crops, converts, and rotates.
|
static int |
ConvertToI420Ex(byte[] srcYUV,
int src_size,
byte[] I420,
int arrayOffset,
int cropx,
int cropy,
int src_width,
int src_height,
int crop_width,
int crop_height,
int rotateAngle,
int yuvFormat)
This function crops, converts, and rotates.
|
static android.graphics.Bitmap |
createImgae(byte[] bits,
int width,
int height) |
static java.lang.String |
getImageFormatName(int format) |
static java.lang.String |
getLogFileName() |
static int |
I420Scale(byte[] Src,
int arrayOffset,
int srcW,
int srcH,
byte[] Dst,
int dstW,
int dstH,
int fileterMode,
boolean hMirror)
Scale an I420 image
|
static int |
I420ToABGR(byte[] I420,
int width,
int height,
byte[] rgba,
boolean flipVertical) |
static int |
I420ToNV12(byte[] I420,
int arrayOffset,
int width,
int height,
byte[] nv12,
boolean flipVertical)
This function convert I420 buffer to NV12 buffer
|
static void |
I420ToNV21(byte[] yuv420p,
byte[] yuv420sp,
int width,
int height,
boolean swapUV) |
static void |
LogImage2Files(byte[] image,
java.lang.String imageType) |
static double |
psnrCoefRGBA2I420(byte[] rgba,
byte[] i420,
byte[] converter,
int width,
int height) |
static double |
psnrCoefRGBA2NV12(byte[] rgba,
byte[] nv12,
byte[] converter_yuv,
int width,
int height) |
static void |
RBGAtoYUV(byte[] argb,
int width,
int height,
byte[] yuv) |
static void |
save2DTextureToJPEG(int textureId,
int width,
int height) |
static void |
SaveEGLSurfaceToJpeg(int width,
int height) |
static void |
saveRGBAToFile(byte[] rgba,
int width,
int height) |
static void |
saveToFile(android.graphics.Bitmap bmp,
boolean recycle) |
static void |
saveYUV2File(byte[] data,
int width,
int height) |
static void |
saveYUV2JPEG(byte[] data,
int width,
int height) |
public static java.lang.String getLogFileName()
public static void LogImage2Files(byte[] image,
java.lang.String imageType)
public static void saveYUV2File(byte[] data,
int width,
int height)
public static void saveYUV2JPEG(byte[] data,
int width,
int height)
public static android.graphics.Bitmap createImgae(byte[] bits,
int width,
int height)
public static void saveToFile(android.graphics.Bitmap bmp,
boolean recycle)
public static void save2DTextureToJPEG(int textureId,
int width,
int height)
public static void SaveEGLSurfaceToJpeg(int width,
int height)
public static void saveRGBAToFile(byte[] rgba,
int width,
int height)
public static java.lang.String getImageFormatName(int format)
public static void RBGAtoYUV(byte[] argb,
int width,
int height,
byte[] yuv)
public static void I420ToNV21(byte[] yuv420p,
byte[] yuv420sp,
int width,
int height,
boolean swapUV)
public static double psnrCoefRGBA2NV12(byte[] rgba,
byte[] nv12,
byte[] converter_yuv,
int width,
int height)
public static double psnrCoefRGBA2I420(byte[] rgba,
byte[] i420,
byte[] converter,
int width,
int height)
public static int ConvertToI420(byte[] nv21,
int width,
int height,
byte[] I420,
int dstWidth,
int dstHight,
int rotateAngle,
int cropx,
int cropy,
int cropW,
int cropH)
nv21 - input NV21 buffer form camera capturewidth - NV21 src widthheight - NV21 src heightI420 - output I420 (IYUV) bufferdstWidth - output widthdstHight - output heightrotateAngle - rotate anglecropx - crop start pointcropy - crop start pointcropW - crop widthcropH - crop heightpublic static int ConvertToI420Ex(byte[] srcYUV,
int src_size,
byte[] I420,
int arrayOffset,
int cropx,
int cropy,
int src_width,
int src_height,
int crop_width,
int crop_height,
int rotateAngle,
int yuvFormat)
srcYUV - current support I420 YV12 NV21 NV12src_size - src YUV buffer sizeI420 - dst YUV bufferarrayOffset - dst YUV buffer data arrayOffset, the same as ByteBuffer arrayOffset()cropx - crop x coordinatecropy - crop y coordinatesrc_width - src YUV widthsrc_height - src YUV heightcrop_width - dst YUV widthcrop_height - dst YUV heightrotateAngle - rotate angleyuvFormat - src YUV format, support I420 YV12 NV21 NV12public static int I420ToNV12(byte[] I420,
int arrayOffset,
int width,
int height,
byte[] nv12,
boolean flipVertical)
I420 - input I420 bufferarrayOffset - native array 数据偏移width - input I420 buffer widthheight - input I420 buffer heightnv12 - outpu NV21 bufferflipVertical - flip NV21 image vertically or notpublic static int I420Scale(byte[] Src,
int arrayOffset,
int srcW,
int srcH,
byte[] Dst,
int dstW,
int dstH,
int fileterMode,
boolean hMirror)
Src - I420 source byte buffersrcW - src widthsrcH - src heightDst - I420 destination byte bufferdstW - dst widthdstH - dst heightfileterMode - see belowhMirror - horizontal mirrorpublic static int ABGRToI420(byte[] rgba,
int width,
int height,
byte[] I420,
int arrayOffset,
boolean flipVertical)
public static int I420ToABGR(byte[] I420,
int width,
int height,
byte[] rgba,
boolean flipVertical)