public class ImageUtils
extends java.lang.Object
| 构造器和说明 |
|---|
ImageUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static android.graphics.Bitmap |
alignBitmapForBgr24(android.graphics.Bitmap bitmap)
确保传给引擎的BGR24数据宽度为4的倍数
|
static android.graphics.Bitmap |
bgrToBitmap(byte[] bgr,
int width,
int height)
bgr数据转化为bitmap
|
static byte[] |
bitmapToBgr24(android.graphics.Bitmap image)
bitmap转化为bgr24数据
|
static byte[] |
cropBgr24(byte[] bgr24,
int width,
int height,
android.graphics.Rect rect)
裁剪BGR24数据
|
static android.graphics.Bitmap |
cropImage(android.graphics.Bitmap bitmap,
android.graphics.Rect rect)
裁剪bitmap
|
static byte[] |
cropNv21(byte[] nv21,
int width,
int height,
android.graphics.Rect rect)
裁剪NV21数据
|
static android.graphics.Bitmap |
rotateBitmap(android.graphics.Bitmap bitmap,
float rotateDegree)
旋转bitmap
|
public static byte[] bitmapToBgr24(android.graphics.Bitmap image)
image - 传入的bitmappublic static android.graphics.Bitmap bgrToBitmap(byte[] bgr,
int width,
int height)
bgr - 传入的bgr数据width - BGR数据宽度height - BGR数据高度public static android.graphics.Bitmap alignBitmapForBgr24(android.graphics.Bitmap bitmap)
bitmap - 传入的bitmappublic static android.graphics.Bitmap cropImage(android.graphics.Bitmap bitmap,
android.graphics.Rect rect)
bitmap - 传入的bitmaprect - 需要被裁剪的区域public static android.graphics.Bitmap rotateBitmap(android.graphics.Bitmap bitmap,
float rotateDegree)
bitmap - 传入的bitmaprotateDegree - 旋转角度public static byte[] cropNv21(byte[] nv21,
int width,
int height,
android.graphics.Rect rect)
nv21 - 传入的NV21数据width - NV21数据宽度height - NV21数据高度rect - 需要被裁剪的区域public static byte[] cropBgr24(byte[] bgr24,
int width,
int height,
android.graphics.Rect rect)
bgr24 - 传入的BGR24数据width - BGR24数据宽度height - BGR24数据高度rect - 需要被裁剪的区域