Package ij.io
Class ImageReader
java.lang.Object
ij.io.ImageReader
public class ImageReader extends Object
Reads raw 8-bit, 16-bit or 32-bit (float or RGB)
images from a stream or URL.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ImageReader(FileInfo fi)
Constructs a new ImageReader using a FileInfo object to describe the file to be read. -
Method Summary
Modifier and Type Method Description byte[]
lzwUncompress(byte[] input)
Utility method for decoding an LZW-compressed image strip.byte[]
packBitsUncompress(byte[] input, int expected)
Based on the Bio-Formats PackbitsCodec written by Melissa Linkert.Object
readPixels(InputStream in)
Reads the image from the InputStream and returns the pixel array (byte, short, int or float).Object
readPixels(InputStream in, long skipCount)
Skips the specified number of bytes, then reads an image and returns the pixel array (byte, short, int or float).Object
readPixels(String url)
Reads the image from a URL and returns the pixel array (byte, short, int or float).byte[]
zipUncompress(byte[] input)
TIFF Adobe ZIP support contributed by Jason Newton.
-
Field Details
-
Constructor Details
-
ImageReader
Constructs a new ImageReader using a FileInfo object to describe the file to be read.- See Also:
FileInfo
-
-
Method Details
-
readPixels
Reads the image from the InputStream and returns the pixel array (byte, short, int or float). Returns null if there was an IO exception. Does not close the InputStream. -
readPixels
Skips the specified number of bytes, then reads an image and returns the pixel array (byte, short, int or float). Returns null if there was an IO exception. Does not close the InputStream. -
readPixels
Reads the image from a URL and returns the pixel array (byte, short, int or float). Returns null if there was an IO exception. -
zipUncompress
public byte[] zipUncompress(byte[] input)TIFF Adobe ZIP support contributed by Jason Newton. -
lzwUncompress
public byte[] lzwUncompress(byte[] input)Utility method for decoding an LZW-compressed image strip. Adapted from the TIFF 6.0 Specification: http://partners.adobe.com/asn/developer/pdfs/tn/TIFF6.pdf (page 61) Author: Curtis Rueden (ctrueden at wisc.edu) -
packBitsUncompress
public byte[] packBitsUncompress(byte[] input, int expected)Based on the Bio-Formats PackbitsCodec written by Melissa Linkert.
-