-
public class JpegTranscoderUtils
-
-
Field Summary
Fields Modifier and Type Field Description private final IntegerMIN_QUALITYprivate final IntegerMAX_QUALITYprivate final IntegerMIN_SCALE_NUMERATORprivate final IntegerMAX_SCALE_NUMERATORprivate final IntegerSCALE_DENOMINATORpublic final ImmutableList<Integer>INVERTED_EXIF_ORIENTATIONSprivate final IntegerDEFAULT_JPEG_QUALITYpublic final static JpegTranscoderUtilsINSTANCE
-
Method Summary
Modifier and Type Method Description final static BooleanisRotationAngleAllowed(Integer degrees)final static BooleanisExifOrientationAllowed(Integer exifOrientation)final static IntegergetSoftwareNumerator(RotationOptions rotationOptions, ResizeOptions resizeOptions, EncodedImage encodedImage, Boolean resizingEnabled)final static IntegergetRotationAngle(RotationOptions rotationOptions, EncodedImage encodedImage)final static IntegergetForceRotatedInvertedExifOrientation(RotationOptions rotationOptions, EncodedImage encodedImage)Get an inverted exif orientation (2, 4, 5, 7) but adjusted to take the force rotation angle into consideration final static FloatdetermineResizeRatio(ResizeOptions resizeOptions, Integer width, Integer height)final static IntegerroundNumerator(Float maxRatio, Float roundUpFraction)final static IntegercalculateDownsampleNumerator(Integer downsampleRatio)This method calculate the ratio in case the downsampling was enabled final static MatrixgetTransformationMatrix(EncodedImage encodedImage, RotationOptions rotationOptions)Compute the transformation matrix needed to rotate the image. final IntegergetMIN_QUALITY()final IntegergetMAX_QUALITY()final IntegergetMIN_SCALE_NUMERATOR()final IntegergetMAX_SCALE_NUMERATOR()final IntegergetSCALE_DENOMINATOR()final ImmutableList<Integer>getINVERTED_EXIF_ORIENTATIONS()Inverted EXIF orientations in clockwise rotation order. final IntegergetDEFAULT_JPEG_QUALITY()-
-
Method Detail
-
isRotationAngleAllowed
final static Boolean isRotationAngleAllowed(Integer degrees)
-
isExifOrientationAllowed
final static Boolean isExifOrientationAllowed(Integer exifOrientation)
-
getSoftwareNumerator
final static Integer getSoftwareNumerator(RotationOptions rotationOptions, ResizeOptions resizeOptions, EncodedImage encodedImage, Boolean resizingEnabled)
-
getRotationAngle
final static Integer getRotationAngle(RotationOptions rotationOptions, EncodedImage encodedImage)
-
getForceRotatedInvertedExifOrientation
final static Integer getForceRotatedInvertedExifOrientation(RotationOptions rotationOptions, EncodedImage encodedImage)
Get an inverted exif orientation (2, 4, 5, 7) but adjusted to take the force rotation angle into consideration
-
determineResizeRatio
final static Float determineResizeRatio(ResizeOptions resizeOptions, Integer width, Integer height)
-
roundNumerator
final static Integer roundNumerator(Float maxRatio, Float roundUpFraction)
-
calculateDownsampleNumerator
final static Integer calculateDownsampleNumerator(Integer downsampleRatio)
This method calculate the ratio in case the downsampling was enabled
- Parameters:
downsampleRatio- The ratio from downsampling
-
getTransformationMatrix
final static Matrix getTransformationMatrix(EncodedImage encodedImage, RotationOptions rotationOptions)
Compute the transformation matrix needed to rotate the image. If no transformation is needed, it returns null.
- Parameters:
encodedImage- The EncodedImage used when computing the matrix.rotationOptions- The RotationOptions used when computing the matrix
-
getMIN_QUALITY
final Integer getMIN_QUALITY()
-
getMAX_QUALITY
final Integer getMAX_QUALITY()
-
getMIN_SCALE_NUMERATOR
final Integer getMIN_SCALE_NUMERATOR()
-
getMAX_SCALE_NUMERATOR
final Integer getMAX_SCALE_NUMERATOR()
-
getSCALE_DENOMINATOR
final Integer getSCALE_DENOMINATOR()
-
getINVERTED_EXIF_ORIENTATIONS
final ImmutableList<Integer> getINVERTED_EXIF_ORIENTATIONS()
Inverted EXIF orientations in clockwise rotation order. Rotating 90 degrees clockwise gets you the next item in the list
-
getDEFAULT_JPEG_QUALITY
final Integer getDEFAULT_JPEG_QUALITY()
-
-
-
-