-
public class DownsampleUtil
-
-
Field Summary
Fields Modifier and Type Field Description private final IntegerDEFAULT_SAMPLE_SIZEpublic final static DownsampleUtilINSTANCE
-
Method Summary
Modifier and Type Method Description final static IntegerdetermineSampleSize(RotationOptions rotationOptions, ResizeOptions resizeOptions, EncodedImage encodedImage, Integer maxBitmapSize)Get the factor between the dimensions of the encodedImage (actual image) and the ones of the imageRequest (requested size). final static IntegerdetermineSampleSizeJPEG(EncodedImage encodedImage, Integer pixelSize, Integer maxBitmapSizeInBytes)final static FloatdetermineDownsampleRatio(RotationOptions rotationOptions, ResizeOptions resizeOptions, EncodedImage encodedImage)final static IntegerratioToSampleSize(Float ratio)final static IntegerratioToSampleSizeJPEG(Float ratio)final static IntegerroundToPowerOfTwo(Integer sampleSize)final IntegergetDEFAULT_SAMPLE_SIZE()-
-
Method Detail
-
determineSampleSize
final static Integer determineSampleSize(RotationOptions rotationOptions, ResizeOptions resizeOptions, EncodedImage encodedImage, Integer maxBitmapSize)
Get the factor between the dimensions of the encodedImage (actual image) and the ones of the imageRequest (requested size).
- Parameters:
rotationOptions- the rotations options of the requestresizeOptions- the resize options of the requestencodedImage- the encoded image with the actual dimensionsmaxBitmapSize- the maximum supported bitmap size (in pixels) when not specified in the encoded image resizeOptions.
-
determineSampleSizeJPEG
final static Integer determineSampleSizeJPEG(EncodedImage encodedImage, Integer pixelSize, Integer maxBitmapSizeInBytes)
-
determineDownsampleRatio
final static Float determineDownsampleRatio(RotationOptions rotationOptions, ResizeOptions resizeOptions, EncodedImage encodedImage)
-
ratioToSampleSize
final static Integer ratioToSampleSize(Float ratio)
-
ratioToSampleSizeJPEG
final static Integer ratioToSampleSizeJPEG(Float ratio)
-
roundToPowerOfTwo
final static Integer roundToPowerOfTwo(Integer sampleSize)
-
getDEFAULT_SAMPLE_SIZE
final Integer getDEFAULT_SAMPLE_SIZE()
-
-
-
-