Package com.itextpdf.io.image
Class GifImageData
java.lang.Object
com.itextpdf.io.image.GifImageData
Holds the logical screen properties and decoded frames of a GIF image.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedGifImageData(byte[] data) Creates GIF data from encoded bytes.protectedGifImageData(URL url) Creates GIF data to be loaded from a URL. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAppends a decoded frame.protected byte[]getData()Gets the encoded GIF bytes.Gets the decoded GIF frames.floatGets the logical screen height.floatGets the logical screen width.protected URLgetUrl()Gets the source URL.voidsetLogicalHeight(float logicalHeight) Sets the logical screen height.voidsetLogicalWidth(float logicalWidth) Sets the logical screen width.
-
Constructor Details
-
GifImageData
Creates GIF data to be loaded from a URL.- Parameters:
-
url- source URL, notnull
-
GifImageData
protected GifImageData(byte[] data) Creates GIF data from encoded bytes.- Parameters:
-
data- encoded GIF bytes; the array is retained
-
-
Method Details
-
getLogicalHeight
public float getLogicalHeight()Gets the logical screen height.- Returns:
- height in pixels
-
setLogicalHeight
public void setLogicalHeight(float logicalHeight) Sets the logical screen height.- Parameters:
-
logicalHeight- height in pixels
-
getLogicalWidth
public float getLogicalWidth()Gets the logical screen width.- Returns:
- width in pixels
-
setLogicalWidth
public void setLogicalWidth(float logicalWidth) Sets the logical screen width.- Parameters:
-
logicalWidth- width in pixels
-
getFrames
Gets the decoded GIF frames.- Returns:
- list of frames in source order
-
getData
protected byte[] getData()Gets the encoded GIF bytes.- Returns:
-
retained bytes, or
nulluntil loaded
-
getUrl
Gets the source URL.- Returns:
-
source URL, or
nullwhen data was supplied directly
-
addFrame
Appends a decoded frame.- Parameters:
-
frame- decoded frame to append
-