Class JPEG2000Writer

All Implemented Interfaces:
Closeable, AutoCloseable, ICompressedTileWriter, IFormatHandler, IFormatWriter, IMetadataConfigurable, IPyramidHandler

public class JPEG2000Writer extends FormatWriter
JPEG2000Writer is the file format writer for JPEG2000 files.
  • Constructor Details

    • JPEG2000Writer

      public JPEG2000Writer()
      Creates a new instance.
  • Method Details

    • saveBytes

      public void saveBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, IOException
      Description copied from interface: IFormatWriter
      Saves the given image tile to the current series in the current file.
      Parameters:
      no - the plane index within the series.
      buf - the byte array that represents the image tile.
      x - the X coordinate of the upper-left corner of the image tile.
      y - the Y coordinate of the upper-left corner of the image tile.
      w - the width (in pixels) of the image tile.
      h - the height (in pixels) of the image tile.
      Throws:
      FormatException - if one of the parameters is invalid.
      IOException - if there was a problem writing to the file.
      See Also:
    • compressBuffer

      public byte[] compressBuffer(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, IOException
      Compresses the buffer.
      Parameters:
      no - the plane index within the series.
      buf - the byte array that represents the image tile.
      x - the X coordinate of the upper-left corner of the image tile.
      y - the Y coordinate of the upper-left corner of the image tile.
      w - the width (in pixels) of the image tile.
      h - the height (in pixels) of the image tile.
      Throws:
      FormatException - if one of the parameters is invalid.
      IOException - if there was a problem writing to the file.
    • canDoStacks

      public boolean canDoStacks()
      Overridden to indicate that stacks are not supported.
      Specified by:
      canDoStacks in interface IFormatWriter
      Overrides:
      canDoStacks in class FormatWriter
      See Also:
    • getPixelTypes

      public int[] getPixelTypes(String codec)
      Overridden to return the formats supported by the writer.
      Specified by:
      getPixelTypes in interface IFormatWriter
      Overrides:
      getPixelTypes in class FormatWriter
      See Also: