Class ImageSegment

All Implemented Interfaces:
Streamable

public class ImageSegment extends AbstractNamedAFPObject
An Image Segment is represented by a set of self-defining fields, fields that describe their own contents. It starts with a Begin Segment, and ends with an End Segment. Between the Begin Segment and End Segment is the image information to be processed, called the Image Content. Only one Image Content can exist within a single IOCA Image Segment.
  • Constructor Details

    • ImageSegment

      public ImageSegment(Factory factory, String name)
      Constructor for the image segment with the specified name, the name must be a fixed length of eight characters.
      Parameters:
      factory - the object factory
      name - the name of the image.
  • Method Details

    • getImageContent

      public ImageContent getImageContent()
      Returns the image content object associated with this image segment.
      Returns:
      the image content
    • setImageSize

      public void setImageSize(int hsize, int vsize, int hresol, int vresol)
      Sets the image size parameters resolution, hsize and vsize.
      Parameters:
      hsize - The horizontal size of the image.
      vsize - The vertical size of the image.
      hresol - The horizontal resolution of the image.
      vresol - The vertical resolution of the image.
    • setEncoding

      public void setEncoding(byte encoding)
      Sets the image encoding.
      Parameters:
      encoding - The image encoding.
    • setCompression

      public void setCompression(byte compression)
      Sets the image compression.
      Parameters:
      compression - The image compression.
    • setIDESize

      public void setIDESize(byte size)
      Sets the image IDE size.
      Parameters:
      size - The IDE size.
    • setIDEColorModel

      public void setIDEColorModel(byte colorModel)
      Sets the image IDE color model.
      Parameters:
      colorModel - the IDE color model.
    • setSubtractive

      public void setSubtractive(boolean subtractive)
      Set either additive or subtractive mode (used for ASFLAG).
      Parameters:
      subtractive - true for subtractive mode, false for additive mode
    • setData

      public void setData(byte[] imageData)
      Set the data image data.
      Parameters:
      imageData - the image data
    • setTransparencyMask

      public void setTransparencyMask(byte[] transparencyMask)
    • writeContent

      public void writeContent(OutputStream os) throws IOException
      Helper method to write the contents of the Object.
      Overrides:
      writeContent in class AbstractStructuredObject
      Parameters:
      os - The stream to write to
      Throws:
      IOException - throws an I/O exception if one occurred
    • getNameLength

      protected int getNameLength()
      Returns the name length
      Overrides:
      getNameLength in class AbstractNamedAFPObject
      Returns:
      the name length
    • writeStart

      protected void writeStart(OutputStream os) throws IOException
      Helper method to write the start of the Object.
      Overrides:
      writeStart in class AbstractStructuredObject
      Parameters:
      os - The stream to write to
      Throws:
      IOException - throws an I/O exception if one occurred
    • writeEnd

      protected void writeEnd(OutputStream os) throws IOException
      Helper method to write the end of the Object.
      Overrides:
      writeEnd in class AbstractStructuredObject
      Parameters:
      os - The stream to write to
      Throws:
      IOException - an I/O exception if one occurred
    • setTileTOC

      public void setTileTOC()
    • addTile

      public void addTile(Tile tile)