Package dev.matrixlab.webp4j.model
Class AnimationInfo
java.lang.Object
dev.matrixlab.webp4j.model.AnimationInfo
Holds animation metadata extracted from GIF images.
This class provides information about a GIF image without performing the full conversion. It's useful for determining whether a GIF is animated, its dimensions, and other properties before conversion.
Instances of this class are immutable after being populated by the native layer or GIF decoder.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGets the number of frames in the GIF animation.intGets the height of the GIF image in pixels.intGets the loop count for the animation.intgetWidth()Gets the width of the GIF image in pixels.booleanChecks if the GIF has transparency (transparent color index).booleanChecks if the GIF is animated (has multiple frames).voidsetFrameCount(int frameCount) Called by WebPCodec or native code.voidsetHasTransparency(boolean hasTransparency) Called by WebPCodec or native code.voidsetHeight(int height) Called by WebPCodec or native code.voidsetLoopCount(int loopCount) Called by WebPCodec or native code.voidsetWidth(int width) Called by WebPCodec or native code.toString()
-
Constructor Details
-
AnimationInfo
public AnimationInfo()Public constructor. Instances can be created by any code including WebPCodec, native code, or external packages.
-
-
Method Details
-
getFrameCount
public int getFrameCount()Gets the number of frames in the GIF animation.- Returns:
- Frame count (1 for static GIF, >1 for animated GIF)
-
setFrameCount
public void setFrameCount(int frameCount) Called by WebPCodec or native code. -
getWidth
public int getWidth()Gets the width of the GIF image in pixels.- Returns:
- Image width
-
setWidth
public void setWidth(int width) Called by WebPCodec or native code. -
getHeight
public int getHeight()Gets the height of the GIF image in pixels.- Returns:
- Image height
-
setHeight
public void setHeight(int height) Called by WebPCodec or native code. -
getLoopCount
public int getLoopCount()Gets the loop count for the animation.- Returns:
- Loop count (0=infinite loop, N=loop N times)
-
setLoopCount
public void setLoopCount(int loopCount) Called by WebPCodec or native code. -
hasTransparency
public boolean hasTransparency()Checks if the GIF has transparency (transparent color index).- Returns:
- true if the GIF has at least one transparent pixel
-
setHasTransparency
public void setHasTransparency(boolean hasTransparency) Called by WebPCodec or native code. -
isAnimated
public boolean isAnimated()Checks if the GIF is animated (has multiple frames).- Returns:
- true if frame count > 1
-
toString
-