-
public class DecodeUtilsA collection of useful utility methods for decoding images.
-
-
Field Summary
Fields Modifier and Type Field Description public final static DecodeUtilsINSTANCE
-
Method Summary
Modifier and Type Method Description final static IntegercalculateInSampleSize(@Px() Integer srcWidth, @Px() Integer srcHeight, @Px() Integer dstWidth, @Px() Integer dstHeight, Scale scale)Calculate the BitmapFactory.Options.inSampleSize given the source dimensions of the image (srcWidth and srcHeight), the output dimensions (dstWidth, dstHeight), and the scale. final static DoublecomputeSizeMultiplier(@Px() Integer srcWidth, @Px() Integer srcHeight, @Px() Integer dstWidth, @Px() Integer dstHeight, Scale scale)Calculate the percentage to multiply the source dimensions by to fit/fill the destination dimensions while preserving aspect ratio. final static FloatcomputeSizeMultiplier(@Px() Float srcWidth, @Px() Float srcHeight, @Px() Float dstWidth, @Px() Float dstHeight, Scale scale)final static DoublecomputeSizeMultiplier(@Px() Double srcWidth, @Px() Double srcHeight, @Px() Double dstWidth, @Px() Double dstHeight, Scale scale)-
-
Method Detail
-
calculateInSampleSize
final static Integer calculateInSampleSize(@Px() Integer srcWidth, @Px() Integer srcHeight, @Px() Integer dstWidth, @Px() Integer dstHeight, Scale scale)
-
computeSizeMultiplier
final static Double computeSizeMultiplier(@Px() Integer srcWidth, @Px() Integer srcHeight, @Px() Integer dstWidth, @Px() Integer dstHeight, Scale scale)
Calculate the percentage to multiply the source dimensions by to fit/fill the destination dimensions while preserving aspect ratio.
-
computeSizeMultiplier
final static Float computeSizeMultiplier(@Px() Float srcWidth, @Px() Float srcHeight, @Px() Float dstWidth, @Px() Float dstHeight, Scale scale)
-
-
-
-