Back to Fresco

JpegTranscoderUtils

docs/javadoc/reference/com/facebook/imagepipeline/transcoder/JpegTranscoderUtils.html

3.6.018.3 KB
Original Source

Fresco

|

|

Packages | Classes

Interfaces

Classes

Annotations

Packages | Classes

Summary: Constants | Fields | Ctors | Methods | Inherited Methods | [Expand All]

public class

JpegTranscoderUtils

extends Object

| java.lang.Object | | ↳ | com.facebook.imagepipeline.transcoder.JpegTranscoderUtils |

Summary

Constants
int
int
int
int
int
int
Fields
public static final ImmutableList<Integer>
Public Constructors
Public Methods
static int
This method calculate the ratio in case the downsampling was enabled
static float
static int
Get an inverted exif orientation (2, 4, 5, 7) but adjusted to take the force rotation angle into consideration
static int
static int
static Matrix
Compute the transformation matrix needed to rotate the image.
static boolean
static boolean
static int

| [Expand] Inherited Methods | | --- | | From class java.lang.Object

| Object | clone() | | boolean | equals(Object arg0) | | void | finalize() | | final Class<?> | getClass() | | int | hashCode() | | final void | notify() | | final void | notifyAll() | | String | toString() | | final void | wait(long arg0, int arg1) | | final void | wait(long arg0) | | final void | wait() |

|

Constants

public static final int DEFAULT_JPEG_QUALITY

Constant Value: 85 (0x00000055)

public static final int MAX_QUALITY

Constant Value: 100 (0x00000064)

public static final int MAX_SCALE_NUMERATOR

Constant Value: 16 (0x00000010)

public static final int MIN_QUALITY

Constant Value: 0 (0x00000000)

public static final int MIN_SCALE_NUMERATOR

Constant Value: 1 (0x00000001)

public static final int SCALE_DENOMINATOR

Constant Value: 8 (0x00000008)

Fields

public static final ImmutableList<Integer> INVERTED_EXIF_ORIENTATIONS

Public Constructors

public JpegTranscoderUtils()

Public Methods

public static int calculateDownsampleNumerator(int downsampleRatio)

This method calculate the ratio in case the downsampling was enabled

Parameters

| downsampleRatio | The ratio from downsampling |

Returns
  • The ratio to use for software resize using the downsampling limitation

public static float determineResizeRatio(ResizeOptions resizeOptions, int width, int height)

public static int getForceRotatedInvertedExifOrientation(RotationOptions rotationOptions, EncodedImage encodedImage)

Get an inverted exif orientation (2, 4, 5, 7) but adjusted to take the force rotation angle into consideration

Throws

| IllegalArgumentException | if encoded image passed doesn't have an inverted EXIF orientation |

public static int getRotationAngle(RotationOptions rotationOptions, EncodedImage encodedImage)

public static int getSoftwareNumerator(RotationOptions rotationOptions, ResizeOptions resizeOptions, EncodedImage encodedImage, boolean resizingEnabled)

public 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 |

Returns
  • The transformation matrix, or null if no transformation is required.

public static boolean isExifOrientationAllowed(int exifOrientation)

Returns
  • true if and only if given value is a valid EXIF orientation

public static boolean isRotationAngleAllowed(int degrees)

Returns
  • true if and only if given number of degrees is allowed rotation angle, that is it is equal to 0, 90, 180 or 270

public static int roundNumerator(float maxRatio, float roundUpFraction)

+Generated by Doclava. +