Package jj2000.j2k.fileformat.writer
Class FileFormatWriter
- java.lang.Object
-
- jj2000.j2k.fileformat.writer.FileFormatWriter
-
- All Implemented Interfaces:
FileFormatBoxes
public class FileFormatWriter extends Object implements FileFormatBoxes
This class writes the file format wrapper that may or may not exist around a valid JPEG 2000 codestream. This class writes the simple possible legal fileformat- See Also:
FileFormatReader
-
-
Field Summary
-
Fields inherited from interface jj2000.j2k.fileformat.FileFormatBoxes
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 Summary
Constructors Constructor 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
writeContiguousCodeStreamBox()
This method writes the Contiguous codestream boxint
writeFileFormat()
This method reads the codestream and writes the file format wrapper and the codestream to the same file
-
-
-
Constructor Detail
-
FileFormatWriter
public 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. It receives all the information necessary about a codestream to generate a legal JP2 file- Parameters:
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.
-
-
Method Detail
-
writeFileFormat
public int writeFileFormat() throws IOException
This method reads the codestream and writes the file format wrapper and the codestream to the same file- Returns:
- The number of bytes increases because of the file format
- Throws:
IOException
- If an I/O error ocurred.
-
writeContiguousCodeStreamBox
public void writeContiguousCodeStreamBox() throws IOException
This method writes the Contiguous codestream box- Throws:
IOException
- If an I/O error ocurred.
-
-