Interface JPEGTurboService

All Superinterfaces:
loci.common.services.Service
All Known Implementing Classes:
JPEGTurboServiceImpl

public interface JPEGTurboService extends loci.common.services.Service
Author:
Melissa Linkert melissa at glencoesoftware.com
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Free resources associated with the initialized stream.
    byte[]
    getCompressedTile(byte[] data, int xTile, int yTile)
    Similar to getTile(int, int), but returns the JPEG-compressed bytes.
    byte[]
    getCompressedTile(int xTile, int yTile)
    Similar to getTile(int, int), but returns the JPEG-compressed bytes.
    long[]
     
    byte[]
    getTile(byte[] buf, int xCoordinate, int yCoordinate, int width, int height)
    Get the uncompressed bytes representing the given bounding box.
    byte[]
    getTile(int xTile, int yTile)
    Get the uncompressed bytes representing the given tile index.
    int
     
    int
     
    int
     
    int
     
    void
    initialize(loci.common.RandomAccessInputStream jpeg, int width, int height)
    Initialize the given stream, which represents an image of the given width and height.
    boolean
     
    void
    setRestartMarkers(long[] markers)
     
  • Method Details

    • getRestartMarkers

      long[] getRestartMarkers()
      Returns:
      the restart markers associated with the current JPEG stream
    • setRestartMarkers

      void setRestartMarkers(long[] markers)
      Parameters:
      markers - precalculated restart markers associated with the current JPEG stream
    • initialize

      void initialize(loci.common.RandomAccessInputStream jpeg, int width, int height) throws loci.common.services.ServiceException, IOException
      Initialize the given stream, which represents an image of the given width and height. This service is primarily intended for very large JPEG images whose width and/or height exceed 65535 (the maximum that can be recorded in a JPEG stream).
      Parameters:
      jpeg - open stream containing JPEG data
      width - total image width
      height - total image height
      Throws:
      loci.common.services.ServiceException
      IOException
    • getTileWidth

      int getTileWidth()
      Returns:
      the width (in pixels) of a tile
    • getTileHeight

      int getTileHeight()
      Returns:
      the height (in pixels) of a tile
    • getTileRows

      int getTileRows()
      Returns:
      the number of rows of tiles
    • getTileColumns

      int getTileColumns()
      Returns:
      the number of columns of tiles
    • getTile

      byte[] getTile(byte[] buf, int xCoordinate, int yCoordinate, int width, int height) throws IOException
      Get the uncompressed bytes representing the given bounding box.
      Parameters:
      buf - array in which to store uncompressed bytes
      xCoordinate - upper-left X coordinate of bounding box
      yCoordinate - upper-left Y coordinate of bounding box
      width - width of bounding box
      height - height of bounding box
      Returns:
      uncompressed bytes
      Throws:
      IOException
    • getTile

      byte[] getTile(int xTile, int yTile) throws IOException
      Get the uncompressed bytes representing the given tile index.
      Parameters:
      xTile - column index of the tile
      yTile - row index of the tile
      Returns:
      uncompressed bytes
      Throws:
      IOException
    • getCompressedTile

      byte[] getCompressedTile(int xTile, int yTile) throws IOException
      Similar to getTile(int, int), but returns the JPEG-compressed bytes.
      Parameters:
      xTile - column index of the tile
      yTile - row index of the tile
      Returns:
      JPEG-compressed bytes
      Throws:
      IOException
    • getCompressedTile

      byte[] getCompressedTile(byte[] data, int xTile, int yTile) throws IOException
      Similar to getTile(int, int), but returns the JPEG-compressed bytes.
      Parameters:
      data - preallocated array for storing tile
      xTile - column index of the tile
      yTile - row index of the tile
      Returns:
      JPEG-compressed bytes
      Throws:
      IOException
    • close

      void close() throws IOException
      Free resources associated with the initialized stream.
      Throws:
      IOException
    • isLibraryLoaded

      boolean isLibraryLoaded()
      Returns:
      true if the underlying native library was successfully loaded