-
public final class WebPDecoderThe WebPDecoder class provides functionality for decoding WebP images.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classWebPDecoder.Companion
-
Constructor Summary
Constructors Constructor Description WebPDecoder(Context context)
-
Method Summary
Modifier and Type Method Description final BooleanaddDecodeListener(WebPDecodeListener listener)Adds a decode listener to receive decoding events. final BooleanremoveDecodeListener(WebPDecodeListener listener)Removes a decode listener. final WebPDecoderconfigure(DecoderConfig config)Configures this webp decoder. final UnitsetDataBuffer(Buffer buffer)Sets the data buffer for processing. final UnitsetDataSource(Uri srcUri)Sets the data source of the decoder. final WebPInfodecodeInfo()Decodes the image information of a WebP image. final BooleanhasNextFrame()Return true if frames are available to decode. final IntegernextFrameIndex()Returns index of the next frame. final FrameDecodeResultdecodeNextFrame()Decodes the next frame of the WebP. final UnitdecodeFrames(Uri dstUri)Decodes all frames of a WebP image and optionally saves them to a destination Uri. final Unitreset()Resets the decoder's state to its initial configuration and sets the current frame index to 0. final Unitcancel()Cancels the decoding process. final Unitrelease()Releases the resources used by the WebPDecoder object. -
-
Constructor Detail
-
WebPDecoder
WebPDecoder(Context context)
-
-
Method Detail
-
addDecodeListener
final Boolean addDecodeListener(WebPDecodeListener listener)
Adds a decode listener to receive decoding events.
- Parameters:
listener- The decode listener to add.
-
removeDecodeListener
final Boolean removeDecodeListener(WebPDecodeListener listener)
Removes a decode listener.
- Parameters:
listener- The decode listener to remove.
-
configure
final WebPDecoder configure(DecoderConfig config)
Configures this webp decoder.
- Parameters:
config- DecoderConfig to apply.
-
setDataBuffer
final Unit setDataBuffer(Buffer buffer)
Sets the data buffer for processing.
- Parameters:
buffer- The Java buffer containing the data to be processed.
-
setDataSource
final Unit setDataSource(Uri srcUri)
Sets the data source of the decoder.
- Parameters:
srcUri- The URI of the WebP file to be decoded.
-
decodeInfo
final WebPInfo decodeInfo()
Decodes the image information of a WebP image.
-
hasNextFrame
final Boolean hasNextFrame()
Return true if frames are available to decode.
-
nextFrameIndex
final Integer nextFrameIndex()
Returns index of the next frame.
-
decodeNextFrame
final FrameDecodeResult decodeNextFrame()
Decodes the next frame of the WebP.
-
decodeFrames
final Unit decodeFrames(Uri dstUri)
Decodes all frames of a WebP image and optionally saves them to a destination Uri.
- Parameters:
dstUri- The Uri of the destination directory to save the decoded frames (optional).
-
reset
final Unit reset()
Resets the decoder's state to its initial configuration and sets the current frame index to 0.
-
release
final Unit release()
Releases the resources used by the WebPDecoder object.
-
-
-
-