-
public final class WebPEncoderThe WebPEncoder class provides functionality for encoding images to the WebP format.
-
-
Constructor Summary
Constructors Constructor Description WebPEncoder(Context context, Integer width, Integer height)
-
Method Summary
Modifier and Type Method Description final BooleanaddProgressListener(WebPEncoderProgressListener listener)Adds a progress listener to receive encoding progress updates. final BooleanremoveProgressListener(WebPEncoderProgressListener listener)Removes a progress listener to stop receiving encoding progress updates. final WebPEncoderconfigure(WebPConfig config, WebPPreset preset)Configures the WebP encoder. final WebPEncoderencode(Uri srcUri, Uri dstUri)Encodes an image file from the given source Uri and saves the result to the specified destination Uri. final WebPEncoderencode(Bitmap srcBitmap, Uri dstUri)Encodes a Bitmap image and saves the result to the specified destination Uri. final Unitcancel()Cancels the ongoing encoding process. final Unitrelease()Releases the resources associated with the WebPEncoder instance. -
-
Method Detail
-
addProgressListener
final Boolean addProgressListener(WebPEncoderProgressListener listener)
Adds a progress listener to receive encoding progress updates.
- Parameters:
listener- The progress listener to add.
-
removeProgressListener
final Boolean removeProgressListener(WebPEncoderProgressListener listener)
Removes a progress listener to stop receiving encoding progress updates.
- Parameters:
listener- The progress listener to remove.
-
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)
-
encode
final WebPEncoder encode(Bitmap srcBitmap, Uri dstUri)
-
release
final Unit release()
Releases the resources associated with the WebPEncoder instance.
-
-
-
-