public class CameraUtils
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
CameraUtils.BitmapCallback
Receives callbacks about a bitmap decoding operation.
|
| Constructor and Description |
|---|
CameraUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
decodeBitmap(byte[] source)
Decodes an input byte array and outputs a Bitmap that is ready to be displayed.
|
static void |
decodeBitmap(byte[] source,
CameraUtils.BitmapCallback callback)
Decodes an input byte array and outputs a Bitmap that is ready to be displayed.
|
static android.graphics.Bitmap |
decodeBitmap(byte[] source,
int maxWidth,
int maxHeight,
android.graphics.BitmapFactory.Options options)
Decodes an input byte array and outputs a Bitmap that is ready to be displayed.
|
static void |
decodeBitmap(byte[] source,
int maxWidth,
int maxHeight,
android.graphics.BitmapFactory.Options options,
CameraUtils.BitmapCallback callback)
Decodes an input byte array and outputs a Bitmap that is ready to be displayed.
|
static void |
decodeBitmap(byte[] source,
int maxWidth,
int maxHeight,
CameraUtils.BitmapCallback callback)
Decodes an input byte array and outputs a Bitmap that is ready to be displayed.
|
static boolean |
hasCameraFacing(android.content.Context context,
Facing facing)
Determines whether the device has a valid camera sensor with the given
Facing value, so that a session can be started.
|
static boolean |
hasCameras(android.content.Context context)
Determines whether the device has valid camera sensors, so the library
can be used.
|
public static boolean hasCameras(android.content.Context context)
context - a valid Contextpublic static boolean hasCameraFacing(android.content.Context context,
Facing facing)
context - a valid contextfacing - either Facing.BACK or Facing.FRONT@WorkerThread public static void decodeBitmap(byte[] source)
BitmapFactory.decodeByteArray(byte[], int, int)
is that this cares about orientation, reading it from the EXIF header.source - a JPEG byte arraypublic static void decodeBitmap(byte[] source,
CameraUtils.BitmapCallback callback)
BitmapFactory.decodeByteArray(byte[], int, int)
is that this cares about orientation, reading it from the EXIF header.
This is executed in a background thread, and returns the result to the original thread.source - a JPEG byte arraycallback - a callback to be notifiedpublic static void decodeBitmap(byte[] source,
int maxWidth,
int maxHeight,
CameraUtils.BitmapCallback callback)
BitmapFactory.decodeByteArray(byte[], int, int)
is that this cares about orientation, reading it from the EXIF header.
This is executed in a background thread, and returns the result to the original thread.
The image is also downscaled taking care of the maxWidth and maxHeight arguments.source - a JPEG byte arraymaxWidth - the max allowed widthmaxHeight - the max allowed heightcallback - a callback to be notifiedpublic static void decodeBitmap(byte[] source,
int maxWidth,
int maxHeight,
android.graphics.BitmapFactory.Options options,
CameraUtils.BitmapCallback callback)
BitmapFactory.decodeByteArray(byte[], int, int)
is that this cares about orientation, reading it from the EXIF header.
This is executed in a background thread, and returns the result to the original thread.
The image is also downscaled taking care of the maxWidth and maxHeight arguments.source - a JPEG byte arraymaxWidth - the max allowed widthmaxHeight - the max allowed heightoptions - the options to be passed to decodeByteArraycallback - a callback to be notified@WorkerThread
public static android.graphics.Bitmap decodeBitmap(byte[] source,
int maxWidth,
int maxHeight,
android.graphics.BitmapFactory.Options options)
BitmapFactory.decodeByteArray(byte[], int, int)
is that this cares about orientation, reading it from the EXIF header.
The image is also downscaled taking care of the maxWidth and maxHeight arguments.source - a JPEG byte arraymaxWidth - the max allowed widthmaxHeight - the max allowed heightoptions - the options to be passed to decodeByteArray