Package loci.formats.services
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 TypeMethodDescriptionvoidclose()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.intintintintvoidinitialize(loci.common.RandomAccessInputStream jpeg, int width, int height) Initialize the given stream, which represents an image of the given width and height.booleanvoidsetRestartMarkers(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 datawidth- total image widthheight- total image height- Throws:
loci.common.services.ServiceExceptionIOException
-
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 bytesxCoordinate- upper-left X coordinate of bounding boxyCoordinate- upper-left Y coordinate of bounding boxwidth- width of bounding boxheight- height of bounding box- Returns:
- uncompressed bytes
- Throws:
IOException
-
getTile
Get the uncompressed bytes representing the given tile index.- Parameters:
xTile- column index of the tileyTile- row index of the tile- Returns:
- uncompressed bytes
- Throws:
IOException
-
getCompressedTile
Similar to getTile(int, int), but returns the JPEG-compressed bytes.- Parameters:
xTile- column index of the tileyTile- row index of the tile- Returns:
- JPEG-compressed bytes
- Throws:
IOException
-
getCompressedTile
Similar to getTile(int, int), but returns the JPEG-compressed bytes.- Parameters:
data- preallocated array for storing tilexTile- column index of the tileyTile- row index of the tile- Returns:
- JPEG-compressed bytes
- Throws:
IOException
-
close
Free resources associated with the initialized stream.- Throws:
IOException
-
isLibraryLoaded
boolean isLibraryLoaded()- Returns:
- true if the underlying native library was successfully loaded
-