public class BaseImageDecoder extends Object implements ImageDecoder
Bitmap
, scales them to needed sizeImageDecodingInfo
Modifier and Type | Class and Description |
---|---|
protected static class |
BaseImageDecoder.ExifInfo |
protected static class |
BaseImageDecoder.ImageFileInfo |
Modifier and Type | Field and Description |
---|---|
protected static String |
ERROR_CANT_DECODE_IMAGE |
protected static String |
ERROR_NO_IMAGE_STREAM |
protected static String |
LOG_FLIP_IMAGE |
protected static String |
LOG_ROTATE_IMAGE |
protected static String |
LOG_SCALE_IMAGE |
protected static String |
LOG_SUBSAMPLE_IMAGE |
protected boolean |
loggingEnabled |
Constructor and Description |
---|
BaseImageDecoder(boolean loggingEnabled) |
Modifier and Type | Method and Description |
---|---|
protected android.graphics.Bitmap |
considerExactScaleAndOrientatiton(android.graphics.Bitmap subsampledBitmap,
ImageDecodingInfo decodingInfo,
int rotation,
boolean flipHorizontal) |
android.graphics.Bitmap |
decode(ImageDecodingInfo decodingInfo)
Decodes image from URI into
Bitmap . |
protected BaseImageDecoder.ExifInfo |
defineExifOrientation(String imageUri) |
protected BaseImageDecoder.ImageFileInfo |
defineImageSizeAndRotation(InputStream imageStream,
ImageDecodingInfo decodingInfo) |
protected InputStream |
getImageStream(ImageDecodingInfo decodingInfo) |
protected android.graphics.BitmapFactory.Options |
prepareDecodingOptions(ImageSize imageSize,
ImageDecodingInfo decodingInfo) |
protected InputStream |
resetStream(InputStream imageStream,
ImageDecodingInfo decodingInfo) |
protected static final String LOG_SUBSAMPLE_IMAGE
protected static final String LOG_SCALE_IMAGE
protected static final String LOG_ROTATE_IMAGE
protected static final String LOG_FLIP_IMAGE
protected static final String ERROR_NO_IMAGE_STREAM
protected static final String ERROR_CANT_DECODE_IMAGE
protected final boolean loggingEnabled
public BaseImageDecoder(boolean loggingEnabled)
loggingEnabled
- Whether debug logs will be written to LogCat. Usually should match ImageLoaderConfiguration.writeDebugLogs()
public android.graphics.Bitmap decode(ImageDecodingInfo decodingInfo) throws IOException
Bitmap
. Image is scaled close to incoming target size
during decoding (depend on incoming parameters).decode
in interface ImageDecoder
decodingInfo
- Needed data for decoding imageIOException
- if some I/O exception occurs during image readingUnsupportedOperationException
- if image URI has unsupported scheme(protocol)protected InputStream getImageStream(ImageDecodingInfo decodingInfo) throws IOException
IOException
protected BaseImageDecoder.ImageFileInfo defineImageSizeAndRotation(InputStream imageStream, ImageDecodingInfo decodingInfo) throws IOException
IOException
protected BaseImageDecoder.ExifInfo defineExifOrientation(String imageUri)
protected android.graphics.BitmapFactory.Options prepareDecodingOptions(ImageSize imageSize, ImageDecodingInfo decodingInfo)
protected InputStream resetStream(InputStream imageStream, ImageDecodingInfo decodingInfo) throws IOException
IOException
protected android.graphics.Bitmap considerExactScaleAndOrientatiton(android.graphics.Bitmap subsampledBitmap, ImageDecodingInfo decodingInfo, int rotation, boolean flipHorizontal)
Copyright © 2011-2015. All Rights Reserved.