Back to Fresco

ImageTranscoder

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

3.6.015.5 KB
Original Source

Fresco

|

|

Packages | Classes

Interfaces

Classes

Annotations

Packages | Classes

Summary: Methods | [Expand All]

public interface

ImageTranscoder

| com.facebook.imagepipeline.transcoder.ImageTranscoder |

| Known Indirect Subclasses

NativeJpegTranscoder, SimpleImageTranscoder

| NativeJpegTranscoder | Transcoder for jpeg images, using native code and libjpeg-turbo library. | | SimpleImageTranscoder | Image transcoder using only the Android API. |

|

Class Overview

The abstraction for an image transcoder

Summary

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

Public Methods

public abstract 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 abstract 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 abstract String getIdentifier()

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

Returns
  • the identifier of the image transcoder.

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

| IOException | if I/O error happens when reading or writing the images. |

+Generated by Doclava. +