public class J2KImageReader extends ImageReader implements MsgLogger
J2KImageReadParam
.Modifier and Type | Field and Description |
---|---|
private boolean |
gotHeader
Indicates whether the header is read.
|
private HeaderDecoder |
hd
The J2K HeaderDecoder defined in jj2000 packages.
|
private int |
height
The image height.
|
private ImageInputStream |
iis
The input stream where reads from
|
private J2KMetadata |
imageMetadata
Image metadata, valid for the imageMetadataIndex only.
|
private int |
imageMetadataIndex
The image index for the cached metadata.
|
private boolean |
logJJ2000Msg
Whether to log JJ2000 messages.
|
private J2KReadState |
readState
The J2KReadState for this reading session based on the current input
and J2KImageReadParam.
|
private long |
streamPosition0
Stream position when setInput() was called.
|
private int |
width
The image width.
|
availableLocales, ignoreMetadata, input, locale, minIndex, originatingProvider, progressListeners, seekForwardOnly, updateListeners, warningListeners, warningLocales
Constructor and Description |
---|
J2KImageReader(ImageReaderSpi originator)
Constructs
J2KImageReader from the provided
ImageReaderSpi . |
Modifier and Type | Method and Description |
---|---|
boolean |
canReadRaster() |
private void |
checkIndex(int imageIndex) |
static void |
checkReadParamBandSettingsWrapper(ImageReadParam param,
int numSrcBands,
int numDstBands)
Wrapper for the protected method
checkReadParamBandSettings . |
static void |
computeRegionsWrapper(ImageReadParam param,
boolean allowZeroDestOffset,
int srcWidth,
int srcHeight,
BufferedImage image,
Rectangle srcRegion,
Rectangle destRegion)
Wrapper for the protected method
computeRegions . |
void |
dispose() |
void |
flush()
Writes any buffered data from the println() method to the device.
|
boolean |
getAbortRequest()
This method wraps the protected method
abortRequested
to allow the abortions be monitored by J2KReadState . |
ImageReadParam |
getDefaultReadParam() |
int |
getHeight(int imageIndex) |
IIOMetadata |
getImageMetadata(int imageIndex) |
private ImageTypeSpecifier |
getImageType(int imageIndex) |
Iterator |
getImageTypes(int imageIndex) |
int |
getNumImages(boolean allowSearch)
Overrides the method defined in the superclass.
|
(package private) static Rectangle |
getReducedRect(Rectangle r,
int maxLevel,
int level,
int subX,
int subY)
Convert a rectangle provided in the coordinate system of the JPEG2000
reference grid to coordinates at a lower resolution level where zero
denotes the lowest resolution level.
|
IIOMetadata |
getStreamMetadata() |
int |
getTileGridXOffset(int imageIndex) |
int |
getTileGridYOffset(int imageIndex) |
int |
getTileHeight(int imageIndex) |
int |
getTileWidth(int imageIndex) |
int |
getWidth(int imageIndex) |
boolean |
isImageTiled(int imageIndex) |
boolean |
isRandomAccessEasy(int imageIndex) |
void |
println(String str,
int flind,
int ind)
Prints the string 'str' to the output device, appending a line
return.
|
void |
printmsg(int sev,
String msg)
Prints the message 'msg' to the output device, appending a newline,
with severity 'sev'.
|
void |
processImageProgressWrapper(float percentageDone)
Wrapper for the protected method
processImageProgress
So it can be access from the classes which are not in
ImageReader hierarchy. |
void |
processImageUpdateWrapper(BufferedImage theImage,
int minX,
int minY,
int width,
int height,
int periodX,
int periodY,
int[] bands)
Wrapper for the protected method
processImageUpdate
So it can be access from the classes which are not in
ImageReader hierarchy. |
BufferedImage |
read(int imageIndex,
ImageReadParam param) |
RenderedImage |
readAsRenderedImage(int imageIndex,
ImageReadParam param) |
void |
readHeader() |
Raster |
readRaster(int imageIndex,
ImageReadParam param) |
void |
reset() |
void |
setInput(Object input,
boolean seekForwardOnly,
boolean ignoreMetadata)
Overrides the method defined in the superclass.
|
abort, abortRequested, addIIOReadProgressListener, addIIOReadUpdateListener, addIIOReadWarningListener, checkReadParamBandSettings, clearAbortRequest, computeRegions, getAspectRatio, getAvailableLocales, getDestination, getFormatName, getImageMetadata, getInput, getLocale, getMinIndex, getNumThumbnails, getOriginatingProvider, getRawImageType, getSourceRegion, getStreamMetadata, getThumbnailHeight, getThumbnailWidth, hasThumbnails, isIgnoringMetadata, isSeekForwardOnly, processImageComplete, processImageProgress, processImageStarted, processImageUpdate, processPassComplete, processPassStarted, processReadAborted, processSequenceComplete, processSequenceStarted, processThumbnailComplete, processThumbnailPassComplete, processThumbnailPassStarted, processThumbnailProgress, processThumbnailStarted, processThumbnailUpdate, processWarningOccurred, processWarningOccurred, read, readAll, readAll, readerSupportsThumbnails, readThumbnail, readTile, readTileRaster, removeAllIIOReadProgressListeners, removeAllIIOReadUpdateListeners, removeAllIIOReadWarningListeners, removeIIOReadProgressListener, removeIIOReadUpdateListener, removeIIOReadWarningListener, setInput, setInput, setLocale
private ImageInputStream iis
private long streamPosition0
private boolean gotHeader
private int width
private int height
private J2KMetadata imageMetadata
private int imageMetadataIndex
private HeaderDecoder hd
private J2KReadState readState
private boolean logJJ2000Msg
public J2KImageReader(ImageReaderSpi originator)
J2KImageReader
from the provided
ImageReaderSpi
.public static void computeRegionsWrapper(ImageReadParam param, boolean allowZeroDestOffset, int srcWidth, int srcHeight, BufferedImage image, Rectangle srcRegion, Rectangle destRegion)
computeRegions
. So it
can be access from the classes which are not in ImageReader
hierarchy.public static void checkReadParamBandSettingsWrapper(ImageReadParam param, int numSrcBands, int numDstBands)
checkReadParamBandSettings
.
So it can be access from the classes which are not in
ImageReader
hierarchy.static Rectangle getReducedRect(Rectangle r, int maxLevel, int level, int subX, int subY)
r
- A rectangle in references grid coordinates.maxLevel
- The highest resolution level in the image.level
- The resolution level of the returned rectangle.subX
- The horizontal subsampling step size.subY
- The vertical subsampling step size.IllegalArgumentException
- if null
,
maxLevel
or level
is negative, or
level
is greater than maxLevel
.public void processImageUpdateWrapper(BufferedImage theImage, int minX, int minY, int width, int height, int periodX, int periodY, int[] bands)
processImageUpdate
So it can be access from the classes which are not in
ImageReader
hierarchy.public void processImageProgressWrapper(float percentageDone)
processImageProgress
So it can be access from the classes which are not in
ImageReader
hierarchy.public void setInput(Object input, boolean seekForwardOnly, boolean ignoreMetadata)
setInput
in class ImageReader
public int getNumImages(boolean allowSearch) throws IOException
getNumImages
in class ImageReader
IOException
public int getWidth(int imageIndex) throws IOException
getWidth
in class ImageReader
IOException
public int getHeight(int imageIndex) throws IOException
getHeight
in class ImageReader
IOException
public int getTileGridXOffset(int imageIndex) throws IOException
getTileGridXOffset
in class ImageReader
IOException
public int getTileGridYOffset(int imageIndex) throws IOException
getTileGridYOffset
in class ImageReader
IOException
public int getTileWidth(int imageIndex) throws IOException
getTileWidth
in class ImageReader
IOException
public int getTileHeight(int imageIndex) throws IOException
getTileHeight
in class ImageReader
IOException
private void checkIndex(int imageIndex)
public void readHeader()
public Iterator getImageTypes(int imageIndex) throws IOException
getImageTypes
in class ImageReader
IOException
public ImageReadParam getDefaultReadParam()
getDefaultReadParam
in class ImageReader
public IIOMetadata getImageMetadata(int imageIndex) throws IOException
getImageMetadata
in class ImageReader
IOException
public IIOMetadata getStreamMetadata() throws IOException
getStreamMetadata
in class ImageReader
IOException
public BufferedImage read(int imageIndex, ImageReadParam param) throws IOException
read
in class ImageReader
IOException
public RenderedImage readAsRenderedImage(int imageIndex, ImageReadParam param) throws IOException
readAsRenderedImage
in class ImageReader
IOException
public boolean canReadRaster()
canReadRaster
in class ImageReader
public boolean isRandomAccessEasy(int imageIndex) throws IOException
isRandomAccessEasy
in class ImageReader
IOException
public Raster readRaster(int imageIndex, ImageReadParam param) throws IOException
readRaster
in class ImageReader
IOException
public boolean isImageTiled(int imageIndex)
isImageTiled
in class ImageReader
public void reset()
reset
in class ImageReader
public boolean getAbortRequest()
abortRequested
to allow the abortions be monitored by J2KReadState
.private ImageTypeSpecifier getImageType(int imageIndex) throws IOException
IOException
public void dispose()
dispose
in class ImageReader
public void flush()
MsgLogger
public void println(String str, int flind, int ind)
MsgLogger
public void printmsg(int sev, String msg)
MsgLogger
Copyright © 2016 Open Microscopy Environment