Package 

Class WebPEncoder


  • 
    public final class WebPEncoder
    
                        

    The WebPEncoder class provides functionality for encoding images to the WebP format.

    • Constructor Detail

      • WebPEncoder

        WebPEncoder(Context context, Integer width, Integer height)
        Parameters:
        context - The Android context.
        width - The width of the image to be encoded.
        height - The height of the image to be encoded.
    • Method Detail

      • configure

         final WebPEncoder configure(WebPConfig config, WebPPreset preset)

        Configures the WebP encoder.

        Parameters:
        config - The WebP configuration object.
        preset - The optional WebP preset configuration.
      • encode

         final WebPEncoder encode(Uri srcUri, Uri dstUri)

        Encodes an image file from the given source Uri and saves the result to the specified destination Uri.

        Parameters:
        srcUri - The source Uri of the image file to encode.
        dstUri - The destination Uri to save the encoded image.
      • encode

         final WebPEncoder encode(Bitmap srcBitmap, Uri dstUri)

        Encodes a Bitmap image and saves the result to the specified destination Uri.

        Parameters:
        srcBitmap - The source Bitmap image to encode.
        dstUri - The destination Uri to save the encoded image.
      • cancel

         final Unit cancel()

        Cancels the ongoing encoding process.