Class GifImageData

java.lang.Object
com.itextpdf.io.image.GifImageData

public class GifImageData extends Object
Holds the logical screen properties and decoded frames of a GIF image.
  • Constructor Details

    • GifImageData

      protected GifImageData (URL url)
      Creates GIF data to be loaded from a URL.
      Parameters:
      url - source URL, not null
    • 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

      public List<ImageData> 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 null until loaded
    • getUrl

      protected URL getUrl()
      Gets the source URL.
      Returns:
      source URL, or null when data was supplied directly
    • addFrame

      protected void addFrame (ImageData frame)
      Appends a decoded frame.
      Parameters:
      frame - decoded frame to append