Package 

Class BitmapDecoder

  • All Implemented Interfaces:
    com.cloudinary.android.preprocess.ResourceDecoder

    
    public class BitmapDecoder
     implements ResourceDecoder<Bitmap>
                        

    Decodes a bitmap from a payload. If given width and height the decoding process will take them into account to decode the bitmap efficiently but will not necessarily resize the bitmap.

    • Constructor Summary

      Constructors 
      Constructor Description
      BitmapDecoder() Create a new decoder.
      BitmapDecoder(int width, int height) Create a new decoder taking the required width and height into account to decode the bitmap efficiently.
    • Method Summary

      Modifier and Type Method Description
      Bitmap decode(Context context, Payload payload) Decodes a bitmap from the given payload.
      • Methods inherited from class com.cloudinary.android.preprocess.ResourceDecoder

        decode
      • Methods inherited from class java.lang.Object

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

      • BitmapDecoder

        BitmapDecoder()
        Create a new decoder.
      • BitmapDecoder

        BitmapDecoder(int width, int height)
        Create a new decoder taking the required width and height into account to decode the bitmap efficiently.
        Parameters:
        width - Required width
        height - Required height
    • Method Detail

      • decode

         Bitmap decode(Context context, Payload payload)

        Decodes a bitmap from the given payload. If the bitmap is at least two times larger than the requireddimensions it will decode a version scaled down by a factor. Note: The dimensions of the decoded bitmapwill not necessarily be equal to width and height. Forexact resizing combine this decoder with Limit processing step, or use limitDimensionsChain.

        Parameters:
        context - Android context.
        payload - Payload to extract the bitmap from