Package dev.matrixlab.webp4j.model
Class AnimatedWebPFrame
java.lang.Object
dev.matrixlab.webp4j.model.AnimatedWebPFrame
Represents a single frame extracted from an animated WebP image.
Each frame contains the fully composited image data and its cumulative timestamp in milliseconds from the start of the animation.
-
Constructor Summary
ConstructorsConstructorDescriptionPublic constructor.AnimatedWebPFrame(BufferedImage image, int timestamp) Creates a frame with the given image and timestamp. -
Method Summary
Modifier and TypeMethodDescriptiongetImage()Gets the frame image.intGets the cumulative timestamp of this frame in milliseconds.voidsetImage(BufferedImage image) Sets the frame image.voidsetTimestamp(int timestamp) Sets the cumulative timestamp of this frame.toString()
-
Constructor Details
-
AnimatedWebPFrame
public AnimatedWebPFrame()Public constructor. -
AnimatedWebPFrame
Creates a frame with the given image and timestamp.- Parameters:
image- The fully composited frame imagetimestamp- Cumulative timestamp in milliseconds from animation start
-
-
Method Details
-
getImage
Gets the frame image.This is a fully reconstructed canvas-sized RGBA image, not just the frame sub-rectangle.
- Returns:
- The frame as a BufferedImage
-
setImage
Sets the frame image.- Parameters:
image- The frame image
-
getTimestamp
public int getTimestamp()Gets the cumulative timestamp of this frame in milliseconds.The timestamp represents the time at which this frame should be displayed, measured from the start of the animation.
- Returns:
- Timestamp in milliseconds
-
setTimestamp
public void setTimestamp(int timestamp) Sets the cumulative timestamp of this frame.- Parameters:
timestamp- Timestamp in milliseconds
-
toString
-