Package 

Class ImageDecodeOptionsBuilder

    • Constructor Detail

      • ImageDecodeOptionsBuilder

        ImageDecodeOptionsBuilder()
    • Method Detail

      • setMinDecodeIntervalMs

         T setMinDecodeIntervalMs(int intervalMs)

        Sets the minimum decode interval.

        Decoding of intermediate results won't happen more often that intervalMs. If anotherintermediate result comes too soon, it will be decoded only after intervalMs since the lastdecode. If there were more intermediate results in between, only the last one gets decoded.

        Parameters:
        intervalMs - the minimum decode interval in milliseconds
      • setMaxDimensionPx

         T setMaxDimensionPx(int maxDimensionPx)

        Sets the maximum image dimension (width or height).

        Parameters:
        maxDimensionPx - the maximum image dimension in pixels
      • getMaxDimensionPx

         int getMaxDimensionPx()

        Gets the maximum image dimension (width or height).

      • setDecodePreviewFrame

         T setDecodePreviewFrame(boolean decodePreviewFrame)

        Sets whether to decode a preview frame for animated images.

        Parameters:
        decodePreviewFrame - whether to decode a preview frame
      • getDecodePreviewFrame

         boolean getDecodePreviewFrame()

        Gets whether to decode a preview frame for animated images.

      • getUseLastFrameForPreview

         boolean getUseLastFrameForPreview()

        Gets whether to use the last frame for the preview image (defaults to the first frame).

      • setUseLastFrameForPreview

         T setUseLastFrameForPreview(boolean useLastFrameForPreview)

        Sets whether to use the last frame for the preview image (defaults to the first frame).

        Parameters:
        useLastFrameForPreview - whether to use the last frame for the preview image
      • getDecodeAllFrames

         boolean getDecodeAllFrames()

        Gets whether to decode all the frames and store them in memory. This should only ever be usedfor animations that are known to be small (e.g. stickers). Caching dozens of large Bitmaps inmemory for general GIFs or WebP's will not fit in memory.

      • setDecodeAllFrames

         T setDecodeAllFrames(boolean decodeAllFrames)

        Sets whether to decode all the frames and store them in memory. This should only ever be usedfor animations that are known to be small (e.g. stickers). Caching dozens of large Bitmaps inmemory for general GIFs or WebP's will not fit in memory.

        Parameters:
        decodeAllFrames - whether to decode all the frames and store them in memory
      • setForceStaticImage

         T setForceStaticImage(boolean forceStaticImage)

        Sets whether to force animated image formats to be decoded as static, non-animated images.

        Parameters:
        forceStaticImage - whether to force the image to be decoded as a static image
      • setCustomImageDecoder

         T setCustomImageDecoder(@Nullable() ImageDecoder customImageDecoder)

        Set a custom image decoder override to be used for the given image. This will bypass alldefault decoders and only use the provided custom image decoder for the given image.

        Parameters:
        customImageDecoder - the custom decoder to use
      • getForceStaticImage

         boolean getForceStaticImage()

        Gets whether to force animated image formats to be decoded as static, non-animated images.

      • setBitmapConfig

         T setBitmapConfig(Bitmap.Config bitmapConfig)

        Sets which config static image will be decode with;

        Parameters:
        bitmapConfig - which config static image will be decode with;
      • setAnimatedBitmapConfig

         T setAnimatedBitmapConfig(Bitmap.Config animatedBitmapConfig)

        Sets which config the animated image will be decode with;

        Parameters:
        animatedBitmapConfig - which config animated image will be decode with;
      • setColorSpace

         T setColorSpace(ColorSpace colorSpace)

        Sets the target color space for decoding. When possible, the color space transformation will beperformed at load time. This requires SDK version >= 26, otherwise it's a no-op.

        Parameters:
        colorSpace - target color space for decoding.