public class FileFormatWriter extends Object implements FileFormatBoxes
FileFormatReader| Modifier and Type | Field and Description | 
|---|---|
| private int[] | bpcBits per component | 
| private static int | BPC_LENGTHbase length of Bits Per Component box | 
| private boolean | bpcVariesFlag indicating whether number of bits per component varies | 
| private int | clengthLength of codestream | 
| private ColorModel | colorModelThe color model of the image to be compressed. | 
| private static int | CSB_LENGTHLength of Colour Specification Box | 
| private File | fileThe name of the file from which to read the codestream and to write
 the JP2 file | 
| (package private) J2KMetadataFormat | formatcache the  J2KMetadataFormat | 
| private static int | FTB_LENGTHLength of File Type Box | 
| private int | heightImage height | 
| private static int | IHB_LENGTHLength of Image Header Box | 
| private boolean | isIndexedIndicates that the  colorModelis aIndexColorModel | 
| private J2KMetadata | metadataThe sample model of the image to be compressed. | 
| private int | ncNumber of components | 
| private int | otherLengthThe length not counted by the orginal JJ2000 packages. | 
| private SampleModel | sampleModelThe sample model of the image to be compressed. | 
| private ImageOutputStream | stream | 
| private int | widthImage width | 
BITS_PER_COMPONENT_BOX, CAPTURE_RESOLUTION_BOX, CHANNEL_DEFINITION_BOX, COLOUR_SPECIFICATION_BOX, COMPONENT_MAPPING_BOX, CONTIGUOUS_CODESTREAM_BOX, CSB_APPROX, CSB_ENUM_GREY, CSB_ENUM_SRGB, CSB_ENUM_YCC, CSB_METH, CSB_PREC, DEFAULT_DISPLAY_RESOLUTION_BOX, FILE_TYPE_BOX, FT_BR, IMAGE_HEADER_BOX, IMB_C, IMB_IPR, IMB_UnkC, IMB_VERS, INTELLECTUAL_PROPERTY_BOX, JP2_HEADER_BOX, JP2_SIGNATURE_BOX, PALETTE_BOX, RESOLUTION_BOX, URL_BOX, UUID_BOX, UUID_INFO_BOX, UUID_LIST_BOX, XML_BOX| Constructor and Description | 
|---|
| FileFormatWriter(File file,
                ImageOutputStream stream,
                int height,
                int width,
                int nc,
                int[] bpc,
                int clength,
                ColorModel colorModel,
                SampleModel sampleModel,
                J2KMetadata metadata)The constructor of the FileFormatWriter. | 
| Modifier and Type | Method and Description | 
|---|---|
| private int | computeLength(IIOMetadataNode root) | 
| private void | writeBox(IIOMetadataNode node) | 
| void | writeContiguousCodeStreamBox()This method writes the Contiguous codestream box | 
| int | writeFileFormat()This method reads the codestream and writes the file format wrapper and
 the codestream to the same file | 
| private void | writeMetadata(J2KMetadata metadata) | 
| private void | writeSuperBox(IIOMetadataNode node) | 
private File file
private ImageOutputStream stream
private int height
private int width
private int nc
private int[] bpc
private boolean bpcVaries
private int clength
private static final int CSB_LENGTH
private static final int FTB_LENGTH
private static final int IHB_LENGTH
private static final int BPC_LENGTH
private ColorModel colorModel
private SampleModel sampleModel
private J2KMetadata metadata
private boolean isIndexed
colorModel is a
  IndexColorModelprivate int otherLength
J2KMetadataFormat format
J2KMetadataFormatpublic FileFormatWriter(File file, ImageOutputStream stream, int height, int width, int nc, int[] bpc, int clength, ColorModel colorModel, SampleModel sampleModel, J2KMetadata metadata)
file - The name of the file that is to be made a JP2 fileheight - The height of the imagewidth - The width of the imagenc - The number of componentsbpc - The number of bits per componentclength - Length of codestreamcolorModel - The color model of the image to be compressed.public int writeFileFormat()
                    throws IOException
IOException - If an I/O error ocurred.private void writeMetadata(J2KMetadata metadata) throws IOException
IOExceptionprivate void writeSuperBox(IIOMetadataNode node) throws IOException
IOExceptionprivate void writeBox(IIOMetadataNode node) throws IOException
IOExceptionprivate int computeLength(IIOMetadataNode root)
public void writeContiguousCodeStreamBox()
                                  throws IOException
IOException - If an I/O error ocurred.Copyright © 2015 Open Microscopy Environment