Back to Fresco

SimpleImageTranscoder

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

3.6.018.0 KB
Original Source

Fresco

|

|

Packages | Classes

Interfaces

Classes

Annotations

Packages | Classes

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

public class

SimpleImageTranscoder

extends Object
implements ImageTranscoder

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

Class Overview

Image transcoder using only the Android API. Clients can use this if they don't want to use the native implementation. This image transcoder requires more memory.

Summary

Public Constructors
Public Methods
boolean
Whether the input image is resized to make subsequent decodings faster.
boolean
Whether the input ImageFormat can be transcoded by the image transcoder.
String
Gets the identifier of the image transcoder.
ImageTranscodeResult
Transcodes an image to match the specified rotation and resize options.

| [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() |

| | From interface com.facebook.imagepipeline.transcoder.ImageTranscoder

| abstract boolean | canResize(EncodedImage encodedImage, RotationOptions rotationOptions, ResizeOptions resizeOptions) Whether the input image is resized to make subsequent decodings faster. | | abstract boolean | canTranscode(ImageFormat imageFormat) Whether the input ImageFormat can be transcoded by the image transcoder. | | abstract String | getIdentifier() Gets the identifier of the image transcoder. | | abstract ImageTranscodeResult | transcode(EncodedImage encodedImage, OutputStream outputStream, RotationOptions rotationOptions, ResizeOptions resizeOptions, ImageFormat outputFormat, Integer quality) Transcodes an image to match the specified rotation and resize options. |

|

Public Constructors

public SimpleImageTranscoder(boolean resizingEnabled, int maxBitmapSize)

Public Methods

public boolean canResize(EncodedImage encodedImage, RotationOptions rotationOptions, ResizeOptions resizeOptions)

Whether the input image is resized to make subsequent decodings faster.

Parameters

| encodedImage | The EncodedImage that will be transcoded. | | rotationOptions | The RotationOptions used when transcoding the image. | | resizeOptions | The ResizeOptions used when transcoding the image. |

Returns
  • true if the image is resized, else false.

public boolean canTranscode(ImageFormat imageFormat)

Whether the input ImageFormat can be transcoded by the image transcoder.

Parameters

| imageFormat | The ImageFormat that will be transcoded. |

Returns
  • true if this image format is handled by the image transcoder, else false.

public String getIdentifier()

Gets the identifier of the image transcoder. This is mostly used for logging purposes.

Returns
  • the identifier of the image transcoder.

public ImageTranscodeResult transcode(EncodedImage encodedImage, OutputStream outputStream, RotationOptions rotationOptions, ResizeOptions resizeOptions, ImageFormat outputFormat, Integer quality)

Transcodes an image to match the specified rotation and resize options. The most common-use case is to create a resized version of an input image to make subsequent decodings faster.

Parameters

| encodedImage | The EncodedImage that will be transcoded. | | outputStream | The OutputStream where the newly created image is written to. | | rotationOptions | The RotationOptions used when transcoding the image. | | resizeOptions | The ResizeOptions used when transcoding the image. | | outputFormat | The desired ImageFormat of the newly created image. If this is null the same format as the input image will be used. | | quality | The desired quality of the newly created image. If this is null, the default quality of the transcoder will be applied. |

Returns
  • The ImageTranscodeResult generated when encoding the image.

+Generated by Doclava. +