public class

RotationOptions

extends Object
java.lang.Object
   ↳ com.facebook.imagepipeline.common.RotationOptions

Class Overview

Options for rotation.

These options are applied to JPEG images only.

Describes how the image should be rotated, whether following image meta-data or a specified amount.

These options are only relevant for JPEG images. Fresco doesn't support rotation of other image formats.

The options also include whether the rotation can be deferred until the bitmap is rendered. This should be be false if a post-processor is used which needs to operate on the bitmap correctly oriented but can otherwise generally be true, particularly if using drawee.

Summary

Nested Classes
@interface RotationOptions.RotationAngle  
Constants
int NO_ROTATION
int ROTATE_180
int ROTATE_270
int ROTATE_90
Public Methods
static RotationOptions autoRotate()
Creates a new set of rotation options for JPEG images to use the rotation angle in the image metadata.
static RotationOptions autoRotateAtRenderTime()
Creates a new set of rotation options for JPEG images to use the rotation angle in the image metadata.
boolean canDeferUntilRendered()
static RotationOptions disableRotation()
Creates a new set of rotation options for JPEG images to load image without any rotation.
boolean equals(Object other)
static RotationOptions forceRotation(int angle)
Creates a new set of rotation options to use a specific rotation angle.
int getForcedAngle()
Gets the explicit angle to rotate to, if one was set.
int hashCode()
boolean rotationEnabled()
String toString()
boolean useImageMetadata()
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int NO_ROTATION

Constant Value: 0 (0x00000000)

public static final int ROTATE_180

Constant Value: 180 (0x000000b4)

public static final int ROTATE_270

Constant Value: 270 (0x0000010e)

public static final int ROTATE_90

Constant Value: 90 (0x0000005a)

Public Methods

public static RotationOptions autoRotate ()

Creates a new set of rotation options for JPEG images to use the rotation angle in the image metadata.

This is the default option for requests which don't specify rotation options.

The rotation will not be deferred for defensiveness but that can improve performance. To defer, use autoRotateAtRenderTime().

public static RotationOptions autoRotateAtRenderTime ()

Creates a new set of rotation options for JPEG images to use the rotation angle in the image metadata.

The rotation may be deferred until the image is rendered.

public boolean canDeferUntilRendered ()

public static RotationOptions disableRotation ()

Creates a new set of rotation options for JPEG images to load image without any rotation.

public boolean equals (Object other)

public static RotationOptions forceRotation (int angle)

Creates a new set of rotation options to use a specific rotation angle.

The rotation will be carried out in the pipeline.

Parameters
angle the angle to rotate - valid values are 0, 90, 180 and 270

public int getForcedAngle ()

Gets the explicit angle to rotate to, if one was set.

Throws
IllegalStateException if the instance was create using one of the autoRotate() constructors.

public int hashCode ()

public boolean rotationEnabled ()

public String toString ()

public boolean useImageMetadata ()