public class ImageUtils
extends java.lang.Object
Constructor and Description |
---|
ImageUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
convertYUV420SPToARGB8888(byte[] input,
int width,
int height,
int[] output) |
static void |
convertYUV420ToARGB8888(byte[] yData,
byte[] uData,
byte[] vData,
int width,
int height,
int yRowStride,
int uvRowStride,
int uvPixelStride,
int[] out) |
static android.graphics.Matrix |
getTransformationMatrix(int srcWidth,
int srcHeight,
int dstWidth,
int dstHeight,
int applyRotation,
boolean maintainAspectRatio)
Returns a transformation matrix from one reference frame into another.
|
static int |
getYUVByteSize(int width,
int height)
Utility method to compute the allocated size in bytes of a YUV420SP image
of the given dimensions.
|
static android.graphics.Bitmap |
rotateImage(android.graphics.Bitmap bitmap,
int rotation) |
static void |
saveBitmap(android.graphics.Bitmap bitmap)
Saves a Bitmap object to disk for analysis.
|
static void |
saveBitmap(android.graphics.Bitmap bitmap,
java.lang.String filename)
Saves a Bitmap object to disk for analysis.
|
public static android.graphics.Bitmap rotateImage(android.graphics.Bitmap bitmap, int rotation)
public static int getYUVByteSize(int width, int height)
public static void saveBitmap(android.graphics.Bitmap bitmap)
bitmap
- The bitmap to save.public static void saveBitmap(android.graphics.Bitmap bitmap, java.lang.String filename)
bitmap
- The bitmap to save.filename
- The location to save the bitmap to.public static void convertYUV420SPToARGB8888(byte[] input, int width, int height, int[] output)
public static void convertYUV420ToARGB8888(byte[] yData, byte[] uData, byte[] vData, int width, int height, int yRowStride, int uvRowStride, int uvPixelStride, int[] out)
public static android.graphics.Matrix getTransformationMatrix(int srcWidth, int srcHeight, int dstWidth, int dstHeight, int applyRotation, boolean maintainAspectRatio)
srcWidth
- Width of source frame.srcHeight
- Height of source frame.dstWidth
- Width of destination frame.dstHeight
- Height of destination frame.applyRotation
- Amount of rotation to apply from one frame to another.
Must be a multiple of 90.maintainAspectRatio
- If true, will ensure that scaling in x and y remains constant,
cropping the image if necessary.Copyright © 2012 PayPal, Inc. All Rights Reserved.