Package 

Class NativeJpegTranscoder

  • All Implemented Interfaces:
    com.facebook.imagepipeline.transcoder.ImageTranscoder

    
    public class NativeJpegTranscoder
     implements ImageTranscoder
                        

    Transcoder for jpeg images, using native code and libjpeg-turbo library.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final static String TAG
    • Constructor Summary

      Constructors 
      Constructor Description
      NativeJpegTranscoder(boolean resizingEnabled, int maxBitmapSize, boolean useDownsamplingRatio, boolean ensureTranscoderLibraryLoaded)
    • Method Summary

      Modifier and Type Method Description
      boolean canResize(EncodedImage encodedImage, @Nullable() RotationOptions rotationOptions, @Nullable() ResizeOptions resizeOptions)
      boolean canTranscode(ImageFormat imageFormat)
      String getIdentifier()
      ImageTranscodeResult transcode(EncodedImage encodedImage, OutputStream outputStream, @Nullable() RotationOptions rotationOptions, @Nullable() ResizeOptions resizeOptions, @Nullable() ImageFormat outputFormat, @Nullable() Integer quality, @Nullable() ColorSpace colorSpace)
      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.
      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.
      • Methods inherited from class com.facebook.imagepipeline.transcoder.ImageTranscoder

        canResize, canTranscode, getIdentifier, transcode
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NativeJpegTranscoder

        NativeJpegTranscoder(boolean resizingEnabled, int maxBitmapSize, boolean useDownsamplingRatio, boolean ensureTranscoderLibraryLoaded)
    • Method Detail

      • canResize

         boolean canResize(EncodedImage encodedImage, @Nullable() RotationOptions rotationOptions, @Nullable() ResizeOptions resizeOptions)
      • canTranscode

         boolean canTranscode(ImageFormat imageFormat)
      • 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 270
        scaleNumerator - 1 - 16, image will be scaled using scaleNumerator/8 factor
        quality - 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 270
        scaleNumerator - 1 - 16, image will be scaled using scaleNumerator/8 factor
        quality - 1 - 100