-
- All Implemented Interfaces:
-
com.facebook.imagepipeline.transcoder.ImageTranscoder
public class NativeJpegTranscoder implements ImageTranscoderTranscoder for jpeg images, using native code and libjpeg-turbo library.
-
-
Constructor Summary
Constructors Constructor Description NativeJpegTranscoder(boolean resizingEnabled, int maxBitmapSize, boolean useDownsamplingRatio, boolean ensureTranscoderLibraryLoaded)
-
Method Summary
Modifier and Type Method Description booleancanResize(EncodedImage encodedImage, @Nullable() RotationOptions rotationOptions, @Nullable() ResizeOptions resizeOptions)booleancanTranscode(ImageFormat imageFormat)StringgetIdentifier()ImageTranscodeResulttranscode(EncodedImage encodedImage, OutputStream outputStream, @Nullable() RotationOptions rotationOptions, @Nullable() ResizeOptions resizeOptions, @Nullable() ImageFormat outputFormat, @Nullable() Integer quality, @Nullable() ColorSpace colorSpace)static voidtranscodeJpeg(InputStream inputStream, OutputStream outputStream, int rotationAngle, int scaleNumerator, int quality)Transcodes an image to match the specified rotation angle and the scale factor. static voidtranscodeJpegWithExifOrientation(InputStream inputStream, OutputStream outputStream, int exifOrientation, int scaleNumerator, int quality)Transcodes an image to match the specified exif orientation and the scale factor. -
-
Method Detail
-
canResize
boolean canResize(EncodedImage encodedImage, @Nullable() RotationOptions rotationOptions, @Nullable() ResizeOptions resizeOptions)
-
canTranscode
boolean canTranscode(ImageFormat imageFormat)
-
getIdentifier
String getIdentifier()
-
transcode
ImageTranscodeResult transcode(EncodedImage encodedImage, OutputStream outputStream, @Nullable() RotationOptions rotationOptions, @Nullable() ResizeOptions resizeOptions, @Nullable() ImageFormat outputFormat, @Nullable() Integer quality, @Nullable() ColorSpace colorSpace)
-
transcodeJpeg
static void transcodeJpeg(InputStream inputStream, OutputStream outputStream, int rotationAngle, int scaleNumerator, int quality)
Transcodes an image to match the specified rotation angle and the scale factor.
- Parameters:
inputStream- The InputStream of the image that will be transcoded.outputStream- The OutputStream where the newly created image is written to.rotationAngle- 0, 90, 180 or 270scaleNumerator- 1 - 16, image will be scaled using scaleNumerator/8 factorquality- 1 - 100
-
transcodeJpegWithExifOrientation
static void transcodeJpegWithExifOrientation(InputStream inputStream, OutputStream outputStream, int exifOrientation, int scaleNumerator, int quality)
Transcodes an image to match the specified exif orientation and the scale factor.
- Parameters:
inputStream- The InputStream of the image that will be transcoded.outputStream- The OutputStream where the newly created image is written to.exifOrientation- 0, 90, 180 or 270scaleNumerator- 1 - 16, image will be scaled using scaleNumerator/8 factorquality- 1 - 100
-
-
-
-