Class AnimatedWebPFrame

java.lang.Object
dev.matrixlab.webp4j.model.AnimatedWebPFrame

public class AnimatedWebPFrame extends Object
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 Details

    • AnimatedWebPFrame

      public AnimatedWebPFrame()
      Public constructor.
    • AnimatedWebPFrame

      public AnimatedWebPFrame(BufferedImage image, int timestamp)
      Creates a frame with the given image and timestamp.
      Parameters:
      image - The fully composited frame image
      timestamp - Cumulative timestamp in milliseconds from animation start
  • Method Details

    • getImage

      public BufferedImage 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

      public void setImage(BufferedImage image)
      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

      public String toString()
      Overrides:
      toString in class Object