public class ImageUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ImageUtils.ImageSize |
static interface |
ImageUtils.InputStreamFactory
Utility class for when an InputStream needs to be read multiple times.
|
Modifier and Type | Field and Description |
---|---|
static ImageUtils.ImageSize |
sUseImageSize |
Constructor and Description |
---|
ImageUtils() |
Modifier and Type | Method and Description |
---|---|
static PhotoBitmapLoaderInterface.BitmapResult |
createLocalBitmap(ContentResolver resolver,
Uri uri,
int maxSize)
Create a bitmap from a local URI
|
static Bitmap |
decodeStream(ImageUtils.InputStreamFactory factory,
Rect outPadding,
BitmapFactory.Options opts)
Wrapper around
BitmapFactory.decodeStream(InputStream, Rect,
BitmapFactory.Options) that returns null on OutOfMemoryError . |
static boolean |
isImageMimeType(String mimeType) |
public static final ImageUtils.ImageSize sUseImageSize
public static boolean isImageMimeType(String mimeType)
public static PhotoBitmapLoaderInterface.BitmapResult createLocalBitmap(ContentResolver resolver, Uri uri, int maxSize)
resolver
- The ContentResolveruri
- The local URImaxSize
- The maximum size (either width or height)public static Bitmap decodeStream(ImageUtils.InputStreamFactory factory, Rect outPadding, BitmapFactory.Options opts) throws FileNotFoundException
BitmapFactory.decodeStream(InputStream, Rect,
BitmapFactory.Options)
that returns null
on OutOfMemoryError
.factory
- Used to create input streams that holds the raw data to be decoded into a
bitmap.outPadding
- If not null, return the padding rect for the bitmap if
it exists, otherwise set padding to [-1,-1,-1,-1]. If
no bitmap is returned (null) then padding is
unchanged.opts
- null-ok; Options that control downsampling and whether the
image should be completely decoded, or just is size returned.FileNotFoundException