Package 

Class WebPAnimEncoder


  • 
    public final class WebPAnimEncoder
    
                        

    Constructs a WebP animation encoder with the specified width, height, and options.

    • Constructor Detail

      • WebPAnimEncoder

        WebPAnimEncoder(Integer width, Integer height, WebPAnimEncoderOptions options)
        Parameters:
        width - The width of the animation frames in pixels.
        height - The height of the animation frames in pixels.
        options - The optional encoding options for the WebP animation.
    • Method Detail

      • configure

         final WebPAnimEncoder configure(WebPConfig config, WebPPreset preset)

        Configures the WebP encoder with the specified configuration.

        Parameters:
        config - The WebP configuration to be applied.
        preset - The optional preset to be used for configuring the encoder.
      • addFrame

         final WebPAnimEncoder addFrame(Context context, Long timestamp, Uri srcUri)

        Adds a frame to the WebP animation with the specified timestamp and source Uri.

        Parameters:
        context - The Android context.
        timestamp - The timestamp of the frame.
        srcUri - The source Uri pointing to the image file to be added as a frame.
      • addFrame

         final WebPAnimEncoder addFrame(Long timestamp, Bitmap srcBitmap)

        Adds a frame to the WebP animation with the specified timestamp and source bitmap.

        Parameters:
        timestamp - The timestamp of the frame.
        srcBitmap - The source bitmap to be added as a frame.
      • assemble

         final WebPAnimEncoder assemble(Context context, Long timestamp, Uri dstUri)

        Assembles the WebP animation and saves it to the specified destination Uri.

        Parameters:
        context - The Android context.
        timestamp - The end timestamp of the animation.
        dstUri - The destination Uri where the WebP animation will be saved.
      • cancel

         final Unit cancel()

        Cancels the ongoing WebP animation encoding process.

      • release

         final Unit release()

        Releases any resources associated with the WebP encoder.