-
public final class WebPAnimEncoderConstructs a WebP animation encoder with the specified width, height, and options.
-
-
Constructor Summary
Constructors Constructor Description WebPAnimEncoder(Context context, Integer width, Integer height, WebPAnimEncoderOptions options)
-
Method Summary
Modifier and Type Method Description final BooleanaddProgressListener(WebPAnimEncoderProgressListener listener)Adds a progress listener to the WebP animation encoder. final BooleanremoveProgressListener(WebPAnimEncoderProgressListener listener)Removes a progress listener from the WebP animation encoder. final WebPAnimEncoderconfigure(WebPConfig config, WebPPreset preset)Configures the WebP encoder with the specified configuration. final WebPAnimEncoderaddFrame(Long timestamp, Uri srcUri)Adds a frame to the WebP animation with the specified timestamp and source Uri. final WebPAnimEncoderaddFrame(Long timestamp, Bitmap srcBitmap)Adds a frame to the WebP animation with the specified timestamp and source bitmap. final WebPAnimEncoderassemble(Long timestamp, Uri dstUri)Assembles the WebP animation and saves it to the specified destination Uri. final Unitcancel()Cancels the ongoing WebP animation encoding process. final Unitrelease()Releases any resources associated with the WebP encoder. -
-
Constructor Detail
-
WebPAnimEncoder
WebPAnimEncoder(Context context, Integer width, Integer height, WebPAnimEncoderOptions options)
- Parameters:
context- The Android context.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
-
addProgressListener
final Boolean addProgressListener(WebPAnimEncoderProgressListener listener)
Adds a progress listener to the WebP animation encoder.
- Parameters:
listener- The progress listener to be added.
-
removeProgressListener
final Boolean removeProgressListener(WebPAnimEncoderProgressListener listener)
Removes a progress listener from the WebP animation encoder.
- Parameters:
listener- The progress listener to be removed.
-
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(Long timestamp, Uri srcUri)
Adds a frame to the WebP animation with the specified timestamp and source Uri.
- Parameters:
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(Long timestamp, Uri dstUri)
Assembles the WebP animation and saves it to the specified destination Uri.
- Parameters:
timestamp- The end timestamp of the animation.dstUri- The destination Uri where the WebP animation will be saved.
-
-
-
-