-
public final class DownsamplerDownsamples, decodes, and rotates images according to their exif orientation using .
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceDownsampler.DecodeCallbacksCallbacks for key points during decodes.
-
Field Summary
Fields Modifier and Type Field Description public final static Option<DecodeFormat>DECODE_FORMATpublic final static Option<PreferredColorSpace>PREFERRED_COLOR_SPACEpublic final static Option<DownsampleStrategy>DOWNSAMPLE_STRATEGYpublic final static Option<Boolean>FIX_BITMAP_SIZE_TO_REQUESTED_DIMENSIONSpublic final static Option<Boolean>ALLOW_HARDWARE_CONFIG
-
Constructor Summary
Constructors Constructor Description Downsampler(List<ImageHeaderParser> parsers, DisplayMetrics displayMetrics, BitmapPool bitmapPool, ArrayPool byteArrayPool)
-
Method Summary
Modifier and Type Method Description booleanhandles(InputStream is)booleanhandles(ByteBuffer byteBuffer)booleanhandles(ParcelFileDescriptor source)Resource<Bitmap>decode(InputStream is, int outWidth, int outHeight, Options options)Returns a Bitmap decoded from the given InputStream that is rotated to match any EXIFdata present in the stream and that is downsampled according to the given dimensions and anyprovided com.mobwith.imgmodule.load.resource.bitmap.DownsampleStrategy option. Resource<Bitmap>decode(ByteBuffer buffer, int requestedWidth, int requestedHeight, Options options)Identical to decode, except that it accepts a in place of an InputStream. Resource<Bitmap>decode(InputStream is, int requestedWidth, int requestedHeight, Options options, Downsampler.DecodeCallbacks callbacks)Returns a Bitmap decoded from the given InputStream that is rotated to match any EXIFdata present in the stream and that is downsampled according to the given dimensions and anyprovided com.mobwith.imgmodule.load.resource.bitmap.DownsampleStrategy option. Resource<Bitmap>decode(ParcelFileDescriptor parcelFileDescriptor, int outWidth, int outHeight, Options options)-
-
Constructor Detail
-
Downsampler
Downsampler(List<ImageHeaderParser> parsers, DisplayMetrics displayMetrics, BitmapPool bitmapPool, ArrayPool byteArrayPool)
-
-
Method Detail
-
handles
boolean handles(InputStream is)
-
handles
boolean handles(ByteBuffer byteBuffer)
-
handles
boolean handles(ParcelFileDescriptor source)
-
decode
Resource<Bitmap> decode(InputStream is, int outWidth, int outHeight, Options options)
Returns a Bitmap decoded from the given InputStream that is rotated to match any EXIFdata present in the stream and that is downsampled according to the given dimensions and anyprovided com.mobwith.imgmodule.load.resource.bitmap.DownsampleStrategy option.
-
decode
Resource<Bitmap> decode(ByteBuffer buffer, int requestedWidth, int requestedHeight, Options options)
Identical to decode, except that it accepts a in place of an InputStream.
-
decode
Resource<Bitmap> decode(InputStream is, int requestedWidth, int requestedHeight, Options options, Downsampler.DecodeCallbacks callbacks)
Returns a Bitmap decoded from the given InputStream that is rotated to match any EXIFdata present in the stream and that is downsampled according to the given dimensions and anyprovided com.mobwith.imgmodule.load.resource.bitmap.DownsampleStrategy option.
If a Bitmap is present in the whose dimensions exactly match thoseof the image for the given InputStream is available, the operation is much less expensive interms of memory.
- Parameters:
is- An InputStream to the data for the image.requestedWidth- The width the final image should be close to.requestedHeight- The height the final image should be close to.options- A set of options that may contain one or more supported options that influencehow a Bitmap will be decoded from the given stream.callbacks- A set of callbacks allowing callers to optionally respond to varioussignificant events during the decode process.
-
decode
@RequiresApi(value = Build.VERSION_CODES.LOLLIPOP) Resource<Bitmap> decode(ParcelFileDescriptor parcelFileDescriptor, int outWidth, int outHeight, Options options)
-
-
-
-