WebpResourceAnimationReader
class WebpResourceAnimationReader
Implements: IResourceAnimationReader
Package: dev.joid.lib.resource.animation.impl · Module: core · Source: WebpResourceAnimationReader.java
Reads the frames of an animated WebP.
Description
Section titled “Description”A frame duration of 10 ms or less shows for 100 ms.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
| WebpResourceAnimationReader() | Creates the reader. |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
ResourceAnimation | read(InputStream stream) | Reads every frame of the WebP, composed with its blend and disposal, and its play count. |
boolean | isWebp(byte[] bytes) static | If true, bytes start with a RIFF header of type WEBP. |
boolean | isAnimated(byte[] bytes) static | If true, bytes are a WebP whose extended header has the animation flag. |
Creation details
Section titled “Creation details”WebpResourceAnimationReader
Section titled “WebpResourceAnimationReader”WebpResourceAnimationReader()
Creates the reader.
Method details
Section titled “Method details”ResourceAnimation read(InputStream stream)
Throws:
IllegalArgumentException: The file does not start with a RIFF WEBP header, it is not a WebP image: check the file and its extensionIllegalArgumentException: The WebP chunk … runs past the end of the file, the file is damaged: export it againIllegalArgumentException: The WebP has no ANMF frame or no VP8X size, it is not an animated WebP: draw it as a still image or export it with its animation
Reads every frame of the WebP, composed with its blend and disposal, and its play count.
Throws IllegalArgumentException when the file is not a WebP, has no animation frame, or holds a chunk that runs past its end.
isWebp
Section titled “isWebp”boolean isWebp(byte[] bytes) static
If true, bytes start with a RIFF header of type WEBP.
isAnimated
Section titled “isAnimated”boolean isAnimated(byte[] bytes) static
If true, bytes are a WebP whose extended header has the animation flag.
fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses
