Class JPEG2000Writer

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

public class JPEG2000Writer extends loci.formats.FormatWriter
JPEG2000Writer is the file format writer for JPEG2000 files.
  • Field Summary

    Fields inherited from class loci.formats.FormatWriter

    cm, compression, compressionTypes, fps, initialized, interleaved, metadataRetrieve, options, out, resolution, resolutionData, sequential, series, validBits

    Fields inherited from class loci.formats.FormatHandler

    COMPRESSION_SUFFIXES, currentId, format, LOGGER, metadataOptions, suffixes
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Overridden to indicate that stacks are not supported.
    byte[]
    compressBuffer(int no, byte[] buf, int x, int y, int w, int h)
    Compresses the buffer.
    int[]
    Overridden to return the formats supported by the writer.
    void
    saveBytes(int no, byte[] buf, int x, int y, int w, int h)
     

    Methods inherited from class loci.formats.FormatWriter

    changeOutputFile, checkParams, close, createOutputStream, getCodecOptions, getColorModel, getCompression, getCompressionTypes, getFramesPerSecond, getMetadataRetrieve, getPixelTypes, getPlaneCount, getPlaneCount, getResolution, getResolutionCount, getResolutions, getSamplesPerPixel, getSamplesPerPixel, getSeries, getSizeX, getSizeY, getTileSizeX, getTileSizeY, hasResolutions, isFullPlane, isInterleaved, isSupportedType, saveBytes, saveBytes, savePlane, savePlane, savePlane, seekToPlaneOffset, setCodecOptions, setColorModel, setCompression, setFramesPerSecond, setId, setInterleaved, setMetadataRetrieve, setResolution, setResolutions, setSeries, setTileSizeX, setTileSizeY, setValidBitsPerPixel, setWriteSequentially

    Methods inherited from class loci.formats.FormatHandler

    checkSuffix, checkSuffix, getFormat, getMetadataOptions, getNativeDataType, getSuffixes, getSupportedMetadataLevels, isThisType, setMetadataOptions

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface loci.formats.ICompressedTileWriter

    getCodec, saveCompressedBytes

    Methods inherited from interface loci.formats.IFormatHandler

    getFormat, getNativeDataType, getSuffixes, isThisType

    Methods inherited from interface loci.formats.IMetadataConfigurable

    getMetadataOptions, getSupportedMetadataLevels, setMetadataOptions
  • 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 loci.formats.FormatException, IOException
      Throws:
      loci.formats.FormatException
      IOException
      See Also:
      • IFormatWriter.saveBytes(int, byte[], int, int, int, int)
    • compressBuffer

      public byte[] compressBuffer(int no, byte[] buf, int x, int y, int w, int h) throws loci.formats.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:
      loci.formats.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 loci.formats.IFormatWriter
      Overrides:
      canDoStacks in class loci.formats.FormatWriter
      See Also:
      • IFormatWriter.canDoStacks()
    • getPixelTypes

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