Package org.apache.fop.afp.ioca
Class ImageSegment
- All Implemented Interfaces:
Streamable
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
ConstructorDescriptionImageSegment
(Factory factory, String name) Constructor for the image segment with the specified name, the name must be a fixed length of eight characters. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Returns the image content object associated with this image segment.protected int
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.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
void
setTransparencyMask
(byte[] transparencyMask) void
Helper method to write the contents of the Object.protected void
writeEnd
(OutputStream os) Helper method to write the end of the Object.protected void
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 Details
-
ImageSegment
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 Details
-
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
-
setTransparencyMask
public void setTransparencyMask(byte[] transparencyMask) -
writeContent
Helper method to write the contents of the Object.- Overrides:
writeContent
in classAbstractStructuredObject
- 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 classAbstractNamedAFPObject
- Returns:
- the name length
-
writeStart
Helper method to write the start of the Object.- Overrides:
writeStart
in classAbstractStructuredObject
- Parameters:
os
- The stream to write to- Throws:
IOException
- throws an I/O exception if one occurred
-
writeEnd
Helper method to write the end of the Object.- Overrides:
writeEnd
in classAbstractStructuredObject
- Parameters:
os
- The stream to write to- Throws:
IOException
- an I/O exception if one occurred
-
setTileTOC
public void setTileTOC() -
addTile
-
IDEStructureParameter.setColorModel(byte)
instead.