Package org.apache.fop.afp.ioca
Class ImageSegment
- java.lang.Object
-
- 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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.fop.afp.modca.AbstractAFPObject
AbstractAFPObject.Category, AbstractAFPObject.Type
-
-
Field Summary
-
Fields inherited from class org.apache.fop.afp.modca.AbstractNamedAFPObject
name
-
Fields inherited from class org.apache.fop.afp.modca.AbstractTripletStructuredObject
triplets
-
Fields inherited from class org.apache.fop.afp.modca.AbstractAFPObject
LOG, SF_CLASS, SF_HEADER_LENGTH
-
-
Constructor Summary
Constructors Constructor Description ImageSegment(Factory factory, java.lang.String name)
Constructor for the image segment with the specified name, the name must be a fixed length of eight characters.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addTile(Tile tile)
ImageContent
getImageContent()
Returns the image content object associated with this image segment.protected int
getNameLength()
Returns the name lengthvoid
setCompression(byte compression)
Sets the image compression.void
setData(byte[] imageData)
Set the data image data.void
setEncoding(byte encoding)
Sets the image encoding.void
setIDEColorModel(byte colorModel)
Deprecated.UseIDEStructureParameter.setColorModel(byte)
instead.void
setIDESize(byte size)
Sets the image IDE size.void
setImageSize(int hsize, int vsize, int hresol, int vresol)
Sets the image size parameters resolution, hsize and vsize.void
setSubtractive(boolean subtractive)
Deprecated.UseIDEStructureParameter.setSubtractive(boolean)
instead.void
setTileTOC()
void
writeContent(java.io.OutputStream os)
Helper method to write the contents of the Object.protected void
writeEnd(java.io.OutputStream os)
Helper method to write the end of the Object.protected void
writeStart(java.io.OutputStream os)
Helper method to write the start of the Object.-
Methods inherited from class org.apache.fop.afp.modca.AbstractNamedAFPObject
copySF, getName, getNameBytes, setName, toString
-
Methods inherited from class org.apache.fop.afp.modca.AbstractTripletStructuredObject
addTriplet, addTriplets, getFullyQualifiedName, getTripletDataLength, getTriplets, hasTriplet, hasTriplets, setComment, setFullyQualifiedName, setFullyQualifiedName, setObjectClassification, writeTriplets
-
Methods inherited from class org.apache.fop.afp.modca.AbstractStructuredObject
writeToStream
-
Methods inherited from class org.apache.fop.afp.modca.AbstractAFPObject
copySF, truncate, writeChunksToStream, writeObjects
-
-
-
-
Constructor Detail
-
ImageSegment
public ImageSegment(Factory factory, java.lang.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 factoryname
- the name of the image.
-
-
Method Detail
-
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)
Deprecated.UseIDEStructureParameter.setColorModel(byte)
instead.Sets the image IDE color model.- Parameters:
colorModel
- the IDE color model.
-
setSubtractive
public void setSubtractive(boolean subtractive)
Deprecated.UseIDEStructureParameter.setSubtractive(boolean)
instead.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
-
writeContent
public void writeContent(java.io.OutputStream os) throws java.io.IOException
Helper method to write the contents of the Object.- Overrides:
writeContent
in classAbstractStructuredObject
- Parameters:
os
- The stream to write to- Throws:
java.io.IOException
- throws an I/O exception if one occurred
-
getNameLength
protected int getNameLength()
Returns the name length- Overrides:
getNameLength
in classAbstractNamedAFPObject
- Returns:
- the name length
-
writeStart
protected void writeStart(java.io.OutputStream os) throws java.io.IOException
Helper method to write the start of the Object.- Overrides:
writeStart
in classAbstractStructuredObject
- Parameters:
os
- The stream to write to- Throws:
java.io.IOException
- throws an I/O exception if one occurred
-
writeEnd
protected void writeEnd(java.io.OutputStream os) throws java.io.IOException
Helper method to write the end of the Object.- Overrides:
writeEnd
in classAbstractStructuredObject
- Parameters:
os
- The stream to write to- Throws:
java.io.IOException
- an I/O exception if one occurred
-
setTileTOC
public void setTileTOC()
-
addTile
public void addTile(Tile tile)
-
-