public class BaseImageDecoder extends java.lang.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 java.lang.String |
ERROR_CANT_DECODE_IMAGE |
protected static java.lang.String |
ERROR_NO_IMAGE_STREAM |
protected static java.lang.String |
LOG_FLIP_IMAGE |
protected static java.lang.String |
LOG_ROTATE_IMAGE |
protected static java.lang.String |
LOG_SCALE_IMAGE |
protected static java.lang.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(java.lang.String imageUri) |
protected BaseImageDecoder.ImageFileInfo |
defineImageSizeAndRotation(java.io.InputStream imageStream,
ImageDecodingInfo decodingInfo) |
protected java.io.InputStream |
getImageStream(ImageDecodingInfo decodingInfo) |
protected android.graphics.BitmapFactory.Options |
prepareDecodingOptions(ImageSize imageSize,
ImageDecodingInfo decodingInfo) |
protected java.io.InputStream |
resetStream(java.io.InputStream imageStream,
ImageDecodingInfo decodingInfo) |
protected static final java.lang.String LOG_SUBSAMPLE_IMAGE
protected static final java.lang.String LOG_SCALE_IMAGE
protected static final java.lang.String LOG_ROTATE_IMAGE
protected static final java.lang.String LOG_FLIP_IMAGE
protected static final java.lang.String ERROR_NO_IMAGE_STREAM
protected static final java.lang.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 java.io.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 imagejava.io.IOException
- if some I/O exception occurs during image readingjava.lang.UnsupportedOperationException
- if image URI has unsupported scheme(protocol)protected java.io.InputStream getImageStream(ImageDecodingInfo decodingInfo) throws java.io.IOException
java.io.IOException
protected BaseImageDecoder.ImageFileInfo defineImageSizeAndRotation(java.io.InputStream imageStream, ImageDecodingInfo decodingInfo) throws java.io.IOException
java.io.IOException
protected BaseImageDecoder.ExifInfo defineExifOrientation(java.lang.String imageUri)
protected android.graphics.BitmapFactory.Options prepareDecodingOptions(ImageSize imageSize, ImageDecodingInfo decodingInfo)
protected java.io.InputStream resetStream(java.io.InputStream imageStream, ImageDecodingInfo decodingInfo) throws java.io.IOException
java.io.IOException
protected android.graphics.Bitmap considerExactScaleAndOrientatiton(android.graphics.Bitmap subsampledBitmap, ImageDecodingInfo decodingInfo, int rotation, boolean flipHorizontal)