APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.imageio.plugins.bmp

public Class BMPImageReader

extends ImageReader
implements BMPConstants
Class Inheritance
All Implemented Interfaces
com.sun.imageio.plugins.bmp.BMPConstants
Imports
java.awt.Point, .Rectangle, java.awt.color.ColorSpace, .ICC_ColorSpace, .ICC_Profile, java.awt.image.BufferedImage, .ColorModel, .ComponentSampleModel, .DataBuffer, .DataBufferByte, .DataBufferInt, .DataBufferUShort, .DirectColorModel, .IndexColorModel, .MultiPixelPackedSampleModel, .PixelInterleavedSampleModel, .Raster, .SampleModel, .SinglePixelPackedSampleModel, .WritableRaster, java.io.ByteArrayInputStream, .IOException, java.nio.ByteOrder, java.util.ArrayList, .Iterator, .List, javax.imageio.IIOException, .ImageIO, .ImageReadParam, .ImageReader, .ImageTypeSpecifier, javax.imageio.event.IIOReadProgressListener, .IIOReadUpdateListener, .IIOReadWarningListener, javax.imageio.metadata.IIOMetadata, javax.imageio.spi.ImageReaderSpi, javax.imageio.stream.ImageInputStream, com.sun.imageio.plugins.common.I18N, .ImageUtil, .ReaderUtil

This class is the Java Image IO plugin reader for BMP images. It may subsample the image, clip the image, select sub-bands, and shift the decoded image origin if the proper decoding parameter are set in the provided ImageReadParam. This class supports Microsoft Windows Bitmap Version 3-5, as well as OS/2 Bitmap Version 2.x (for single-image BMP file). It also supports undocumented DIB header of type BITMAPV2INFOHEADER & BITMAPV3INFOHEADER.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private int
private BufferedImage
bi

The destination image.

private long
private long
private long
private int
private int
private ColorModel
private long
private int[]
destBands

source and destination bands.

private Rectangle
destinationRegion

The destination region.

private boolean
gotHeader

Indicates whether the header is read.

private int
private int
height

The original image height.

private ImageInputStream
iis

The input stream where reads from

private long
private int
private boolean
private static Boolean
private BMPMetadata
metadata

The metadata from the stream.

private boolean
noTransform

Indicates whether subsampled, subregion is required, and offset is defined

private int
private ColorModel
private SampleModel
private byte[]
private int
private SampleModel
private int
scaleX

The scaling factors.

private int
scaleY

The scaling factors.

private boolean
seleBand

Indicates whether subband is selected.

private int[]
sourceBands

source and destination bands.

private Rectangle
sourceRegion

The source region.

private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private int
width

The original image width.

Inherited from javax.imageio.ImageReader:
availableLocalesignoreMetadatainputlocaleminIndexoriginatingProviderprogressListenersseekForwardOnlyupdateListenerswarningListenerswarningLocales

Constructor Summary

AccessConstructor and Description
public
BMPImageReader(ImageReaderSpi originator)

Constructs BMPImageReader from the provided ImageReaderSpi.

Method Summary

Modifier and TypeMethod and Description
public boolean
canReadRaster()

Overrides javax.imageio.ImageReader.canReadRaster.

Returns true if this plug-in supports reading just a Raster of pixel data.

private void
checkIndex(int imageIndex)

private boolean
copyRLE4ScanlineToDst(int lineNo, byte[] val, byte[] bdata)

private boolean
copyRLE8ScanlineToDst(int lineNo, byte[] val, byte[] bdata)

private void
decodeRLE4(int imSize, int padding, byte[] values, byte[] bdata)

private void
decodeRLE8(int imSize, int padding, byte[] values, byte[] bdata)

public ImageReadParam
getDefaultReadParam()

Overrides javax.imageio.ImageReader.getDefaultReadParam.

Returns a default ImageReadParam object appropriate for this format.

public int
getHeight(int imageIndex)

Implements abstract javax.imageio.ImageReader.getHeight.

Returns the height in pixels of the given image within the input source.

public IIOMetadata
getImageMetadata(int imageIndex)

Implements abstract javax.imageio.ImageReader.getImageMetadata.

Returns an IIOMetadata object containing metadata associated with the given image, or null if the reader does not support reading metadata, is set to ignore metadata, or if no metadata is available.

public Iterator<ImageTypeSpecifier>
getImageTypes(int imageIndex)

Implements abstract javax.imageio.ImageReader.getImageTypes.

Returns an Iterator containing possible image types to which the given image may be decoded, in the form of ImageTypeSpecifierss.

public int
getNumImages(boolean allowSearch)

Implements abstract javax.imageio.ImageReader.getNumImages.

Returns the number of images, not including thumbnails, available from the current input source.

public IIOMetadata
getStreamMetadata()

Implements abstract javax.imageio.ImageReader.getStreamMetadata.

Returns an IIOMetadata object representing the metadata associated with the input source as a whole (i.e., not associated with any particular image), or null if the reader does not support reading metadata, is set to ignore metadata, or if no metadata is available.

public int
getWidth(int imageIndex)

Implements abstract javax.imageio.ImageReader.getWidth.

Returns the width in pixels of the given image within the input source.

private static boolean
public boolean
isRandomAccessEasy(int imageIndex)

Overrides javax.imageio.ImageReader.isRandomAccessEasy.

Returns true if the storage format of the given image places no inherent impediment on random access to pixels.

public BufferedImage
read(int imageIndex, ImageReadParam param)

Implements abstract javax.imageio.ImageReader.read.

Reads the image indexed by imageIndex and returns it as a complete BufferedImage, using a supplied ImageReadParam.

private void
read16Bit(short[] sdata)

private void
read1Bit(byte[] bdata)

private void
read24Bit(byte[] bdata)

private void
read32Bit(int[] idata)

private void
read4Bit(byte[] bdata)

private void
read8Bit(byte[] bdata)

private void
readColorPalette(int sizeOfPalette)

private BufferedImage
readEmbedded(int type, BufferedImage
The destination BufferedImage.
bi
,
ImageReadParam
The ImageReadParam for decoding this BMP image. The parameters for subregion, band selection and subsampling are used in decoding the jpeg image.
bmpParam
)

Decodes the jpeg/png image embedded in the bitmap using any jpeg ImageIO-style plugin.

protected void
readHeader()

Process the image header.

public Raster
readRaster(int imageIndex, ImageReadParam param)

Overrides javax.imageio.ImageReader.readRaster.

Returns a new Raster object containing the raw pixel data from the image stream, without any color conversion applied.

private void
readRLE4(byte[] bdata)

private void
readRLE8(byte[] bdata)

public void
reset()

Overrides javax.imageio.ImageReader.reset.

Restores the ImageReader to its initial state.

private void
public void
setInput(Object input, boolean seekForwardOnly, boolean ignoreMetadata)

Overrides javax.imageio.ImageReader.setInput.

Sets the input source to use to the given ImageInputStream or other Object.

Inherited from javax.imageio.ImageReader:
abortabortRequestedaddIIOReadProgressListeneraddIIOReadUpdateListeneraddIIOReadWarningListenercheckReadParamBandSettingsclearAbortRequestcomputeRegionsdisposegetAspectRatiogetAvailableLocalesgetDestinationgetFormatNamegetImageMetadatagetInputgetLocalegetMinIndexgetNumThumbnailsgetOriginatingProvidergetRawImageTypegetSourceRegiongetStreamMetadatagetThumbnailHeightgetThumbnailWidthgetTileGridXOffsetgetTileGridYOffsetgetTileHeightgetTileWidthhasThumbnailsisIgnoringMetadataisImageTiledisSeekForwardOnlyprocessImageCompleteprocessImageProgressprocessImageStartedprocessImageUpdateprocessPassCompleteprocessPassStartedprocessReadAbortedprocessSequenceCompleteprocessSequenceStartedprocessThumbnailCompleteprocessThumbnailPassCompleteprocessThumbnailPassStartedprocessThumbnailProgressprocessThumbnailStartedprocessThumbnailUpdateprocessWarningOccurredprocessWarningOccurredreadreadAllreadAllreadAsRenderedImagereaderSupportsThumbnailsreadThumbnailreadTilereadTileRasterremoveAllIIOReadProgressListenersremoveAllIIOReadUpdateListenersremoveAllIIOReadWarningListenersremoveIIOReadProgressListenerremoveIIOReadUpdateListenerremoveIIOReadWarningListenersetInputsetInputsetLocale

Field Detail

alphaMaskback to summary
private int alphaMask
biback to summary
private BufferedImage bi

The destination image.

bitmapFileSizeback to summary
private long bitmapFileSize
bitmapOffsetback to summary
private long bitmapOffset
bitmapStartback to summary
private long bitmapStart
bitsPerPixelback to summary
private int bitsPerPixel
blueMaskback to summary
private int blueMask
colorModelback to summary
private ColorModel colorModel
compressionback to summary
private long compression
destBandsback to summary
private int[] destBands

source and destination bands.

destinationRegionback to summary
private Rectangle destinationRegion

The destination region.

gotHeaderback to summary
private boolean gotHeader

Indicates whether the header is read.

greenMaskback to summary
private int greenMask
heightback to summary
private int height

The original image height.

iisback to summary
private ImageInputStream iis

The input stream where reads from

imageSizeback to summary
private long imageSize
imageTypeback to summary
private int imageType
isBottomUpback to summary
private boolean isBottomUp
isLinkedProfileAllowedback to summary
private static Boolean isLinkedProfileAllowed
metadataback to summary
private BMPMetadata metadata

The metadata from the stream.

noTransformback to summary
private boolean noTransform

Indicates whether subsampled, subregion is required, and offset is defined

numBandsback to summary
private int numBands
originalColorModelback to summary
private ColorModel originalColorModel
originalSampleModelback to summary
private SampleModel originalSampleModel
paletteback to summary
private byte[] palette
redMaskback to summary
private int redMask
sampleModelback to summary
private SampleModel sampleModel
scaleXback to summary
private int scaleX

The scaling factors.

scaleYback to summary
private int scaleY

The scaling factors.

seleBandback to summary
private boolean seleBand

Indicates whether subband is selected.

sourceBandsback to summary
private int[] sourceBands

source and destination bands.

sourceRegionback to summary
private Rectangle sourceRegion

The source region.

VERSION_2_1_BITback to summary
private static final int VERSION_2_1_BIT
VERSION_2_24_BITback to summary
private static final int VERSION_2_24_BIT
VERSION_2_4_BITback to summary
private static final int VERSION_2_4_BIT
VERSION_2_8_BITback to summary
private static final int VERSION_2_8_BIT
VERSION_3_1_BITback to summary
private static final int VERSION_3_1_BIT
VERSION_3_24_BITback to summary
private static final int VERSION_3_24_BIT
VERSION_3_4_BITback to summary
private static final int VERSION_3_4_BIT
VERSION_3_8_BITback to summary
private static final int VERSION_3_8_BIT
VERSION_3_EXT_16_BITback to summary
private static final int VERSION_3_EXT_16_BIT
VERSION_3_EXT_1_BITback to summary
private static final int VERSION_3_EXT_1_BIT
VERSION_3_EXT_24_BITback to summary
private static final int VERSION_3_EXT_24_BIT
VERSION_3_EXT_32_BITback to summary
private static final int VERSION_3_EXT_32_BIT
VERSION_3_EXT_4_BITback to summary
private static final int VERSION_3_EXT_4_BIT
VERSION_3_EXT_8_BITback to summary
private static final int VERSION_3_EXT_8_BIT
VERSION_3_EXT_EMBEDDEDback to summary
private static final int VERSION_3_EXT_EMBEDDED
VERSION_3_NT_16_BITback to summary
private static final int VERSION_3_NT_16_BIT
VERSION_3_NT_32_BITback to summary
private static final int VERSION_3_NT_32_BIT
VERSION_3_XP_EMBEDDEDback to summary
private static final int VERSION_3_XP_EMBEDDED
VERSION_4_16_BITback to summary
private static final int VERSION_4_16_BIT
VERSION_4_1_BITback to summary
private static final int VERSION_4_1_BIT
VERSION_4_24_BITback to summary
private static final int VERSION_4_24_BIT
VERSION_4_32_BITback to summary
private static final int VERSION_4_32_BIT
VERSION_4_4_BITback to summary
private static final int VERSION_4_4_BIT
VERSION_4_8_BITback to summary
private static final int VERSION_4_8_BIT
VERSION_4_XP_EMBEDDEDback to summary
private static final int VERSION_4_XP_EMBEDDED
VERSION_5_XP_EMBEDDEDback to summary
private static final int VERSION_5_XP_EMBEDDED
widthback to summary
private int width

The original image width.

Constructor Detail

BMPImageReaderback to summary
public BMPImageReader(ImageReaderSpi originator)

Constructs BMPImageReader from the provided ImageReaderSpi.

Method Detail

canReadRasterback to summary
public boolean canReadRaster()

Overrides javax.imageio.ImageReader.canReadRaster.

Doc from javax.imageio.ImageReader.canReadRaster.

Returns true if this plug-in supports reading just a Raster of pixel data. If this method returns false, calls to readRaster or readTileRaster will throw an UnsupportedOperationException.

The default implementation returns false.

Annotations
@Override
checkIndexback to summary
private void checkIndex(int imageIndex)
copyRLE4ScanlineToDstback to summary
private boolean copyRLE4ScanlineToDst(int lineNo, byte[] val, byte[] bdata) throws IOException
copyRLE8ScanlineToDstback to summary
private boolean copyRLE8ScanlineToDst(int lineNo, byte[] val, byte[] bdata)
decodeRLE4back to summary
private void decodeRLE4(int imSize, int padding, byte[] values, byte[] bdata) throws IOException
decodeRLE8back to summary
private void decodeRLE8(int imSize, int padding, byte[] values, byte[] bdata) throws IOException
getDefaultReadParamback to summary
public ImageReadParam getDefaultReadParam()

Overrides javax.imageio.ImageReader.getDefaultReadParam.

Doc from javax.imageio.ImageReader.getDefaultReadParam.

Returns a default ImageReadParam object appropriate for this format. All subclasses should define a set of default values for all parameters and return them with this call. This method may be called before the input source is set.

The default implementation constructs and returns a new ImageReadParam object that does not allow source scaling (i.e., it returns new ImageReadParam().

Annotations
@Override
getHeightback to summary
public int getHeight(int imageIndex) throws IOException

Implements abstract javax.imageio.ImageReader.getHeight.

Doc from javax.imageio.ImageReader.getHeight.

Returns the height in pixels of the given image within the input source.

If the image can be rendered to a user-specified size, then this method returns the default height.

Annotations
@Override
Exceptions
IOException:
if an error occurs reading the height information from the input source.
getImageMetadataback to summary
public IIOMetadata getImageMetadata(int imageIndex) throws IOException

Implements abstract javax.imageio.ImageReader.getImageMetadata.

Doc from javax.imageio.ImageReader.getImageMetadata.

Returns an IIOMetadata object containing metadata associated with the given image, or null if the reader does not support reading metadata, is set to ignore metadata, or if no metadata is available.

Annotations
@Override
Exceptions
IOException:
if an error occurs during reading.
getImageTypesback to summary
public Iterator<ImageTypeSpecifier> getImageTypes(int imageIndex) throws IOException

Implements abstract javax.imageio.ImageReader.getImageTypes.

Doc from javax.imageio.ImageReader.getImageTypes.

Returns an Iterator containing possible image types to which the given image may be decoded, in the form of ImageTypeSpecifierss. At least one legal image type will be returned.

The first element of the iterator should be the most "natural" type for decoding the image with as little loss as possible. For example, for a JPEG image the first entry should be an RGB image, even though the image data is stored internally in a YCbCr color space.

Annotations
@Override
Exceptions
IOException:
if an error occurs reading the format information from the input source.
getNumImagesback to summary
public int getNumImages(boolean allowSearch) throws IOException

Implements abstract javax.imageio.ImageReader.getNumImages.

Doc from javax.imageio.ImageReader.getNumImages.

Returns the number of images, not including thumbnails, available from the current input source.

Note that some image formats (such as animated GIF) do not specify how many images are present in the stream. Thus determining the number of images will require the entire stream to be scanned and may require memory for buffering. If images are to be processed in order, it may be more efficient to simply call read with increasing indices until an IndexOutOfBoundsException is thrown to indicate that no more images are available. The allowSearch parameter may be set to false to indicate that an exhaustive search is not desired; the return value will be -1 to indicate that a search is necessary. If the input has been specified with seekForwardOnly set to true, this method throws an IllegalStateException if allowSearch is set to true.

Annotations
@Override
Exceptions
IOException:
if an error occurs reading the information from the input source.
getStreamMetadataback to summary
public IIOMetadata getStreamMetadata() throws IOException

Implements abstract javax.imageio.ImageReader.getStreamMetadata.

Doc from javax.imageio.ImageReader.getStreamMetadata.

Returns an IIOMetadata object representing the metadata associated with the input source as a whole (i.e., not associated with any particular image), or null if the reader does not support reading metadata, is set to ignore metadata, or if no metadata is available.

Annotations
@Override
Exceptions
IOException:
if an error occurs during reading.
getWidthback to summary
public int getWidth(int imageIndex) throws IOException

Implements abstract javax.imageio.ImageReader.getWidth.

Doc from javax.imageio.ImageReader.getWidth.

Returns the width in pixels of the given image within the input source.

If the image can be rendered to a user-specified size, then this method returns the default width.

Annotations
@Override
Exceptions
IOException:
if an error occurs reading the width information from the input source.
isLinkedProfileAllowedback to summary
private static boolean isLinkedProfileAllowed()
isRandomAccessEasyback to summary
public boolean isRandomAccessEasy(int imageIndex) throws IOException

Overrides javax.imageio.ImageReader.isRandomAccessEasy.

Doc from javax.imageio.ImageReader.isRandomAccessEasy.

Returns true if the storage format of the given image places no inherent impediment on random access to pixels. For most compressed formats, such as JPEG, this method should return false, as a large section of the image in addition to the region of interest may need to be decoded.

This is merely a hint for programs that wish to be efficient; all readers must be able to read arbitrary regions as specified in an ImageReadParam.

Note that formats that return false from this method may nonetheless allow tiling (e.g. Restart Markers in JPEG), and random access will likely be reasonably efficient on tiles. See isImageTiled.

A reader for which all images are guaranteed to support easy random access, or are guaranteed not to support easy random access, may return true or false respectively without accessing any image data. In such cases, it is not necessary to throw an exception even if no input source has been set or the image index is out of bounds.

The default implementation returns false.

Annotations
@Override
Exceptions
IOException:
if an error occurs during reading.
readback to summary
public BufferedImage read(int imageIndex, ImageReadParam param) throws IOException

Implements abstract javax.imageio.ImageReader.read.

Doc from javax.imageio.ImageReader.read.

Reads the image indexed by imageIndex and returns it as a complete BufferedImage, using a supplied ImageReadParam.

The actual BufferedImage returned will be chosen using the algorithm defined by the getDestination method.

Any registered IIOReadProgressListener objects will be notified by calling their imageStarted method, followed by calls to their imageProgress method as the read progresses. Finally their imageComplete method will be called. IIOReadUpdateListener objects may be updated at other times during the read as pixels are decoded. Finally, IIOReadWarningListener objects will receive notification of any non-fatal warnings that occur during decoding.

The set of source bands to be read and destination bands to be written is determined by calling getSourceBands and getDestinationBands on the supplied ImageReadParam. If the lengths of the arrays returned by these methods differ, the set of source bands contains an index larger that the largest available source index, or the set of destination bands contains an index larger than the largest legal destination index, an IllegalArgumentException is thrown.

If the supplied ImageReadParam contains optional setting values not supported by this reader (e.g. source render size or any format-specific settings), they will be ignored.

Annotations
@Override
Exceptions
IOException:
if an error occurs during reading.
read16Bitback to summary
private void read16Bit(short[] sdata) throws IOException
read1Bitback to summary
private void read1Bit(byte[] bdata) throws IOException
read24Bitback to summary
private void read24Bit(byte[] bdata) throws IOException
read32Bitback to summary
private void read32Bit(int[] idata) throws IOException
read4Bitback to summary
private void read4Bit(byte[] bdata) throws IOException
read8Bitback to summary
private void read8Bit(byte[] bdata) throws IOException
readColorPaletteback to summary
private void readColorPalette(int sizeOfPalette) throws IOException
readEmbeddedback to summary
private BufferedImage readEmbedded(int type, BufferedImage bi, ImageReadParam bmpParam) throws IOException

Decodes the jpeg/png image embedded in the bitmap using any jpeg ImageIO-style plugin.

Parameters
bi:BufferedImage

The destination BufferedImage.

bmpParam:ImageReadParam

The ImageReadParam for decoding this BMP image. The parameters for subregion, band selection and subsampling are used in decoding the jpeg image.

readHeaderback to summary
protected void readHeader() throws IOException, IllegalArgumentException

Process the image header.

Exceptions
IOException:
if image stream is corrupted.
IllegalArgumentException:
if the image stream does not contain a BMP image, or if a sample model instance to describe the image can not be created.
IllegalStateException:
if source stream is not set.
readRasterback to summary
public Raster readRaster(int imageIndex, ImageReadParam param) throws IOException

Overrides javax.imageio.ImageReader.readRaster.

Doc from javax.imageio.ImageReader.readRaster.

Returns a new Raster object containing the raw pixel data from the image stream, without any color conversion applied. The application must determine how to interpret the pixel data by other means. Any destination or image-type parameters in the supplied ImageReadParam object are ignored, but all other parameters are used exactly as in the read method, except that any destination offset is used as a logical rather than a physical offset. The size of the returned Raster will always be that of the source region clipped to the actual image. Logical offsets in the stream itself are ignored.

This method allows formats that normally apply a color conversion, such as JPEG, and formats that do not normally have an associated colorspace, such as remote sensing or medical imaging data, to provide access to raw pixel data.

Any registered readUpdateListeners are ignored, as there is no BufferedImage, but all other listeners are called exactly as they are for the read method.

If canReadRaster() returns false, this method throws an UnsupportedOperationException.

If the supplied ImageReadParam contains optional setting values not supported by this reader (e.g. source render size or any format-specific settings), they will be ignored.

The default implementation throws an UnsupportedOperationException.

Annotations
@Override
Exceptions
IOException:
if an error occurs during reading.
readRLE4back to summary
private void readRLE4(byte[] bdata) throws IOException
readRLE8back to summary
private void readRLE8(byte[] bdata) throws IOException
resetback to summary
public void reset()

Overrides javax.imageio.ImageReader.reset.

Doc from javax.imageio.ImageReader.reset.

Restores the ImageReader to its initial state.

The default implementation calls setInput(null, false), setLocale(null), removeAllIIOReadUpdateListeners(), removeAllIIOReadWarningListeners(), removeAllIIOReadProgressListeners(), and clearAbortRequest.

Annotations
@Override
resetHeaderInfoback to summary
private void resetHeaderInfo()
setInputback to summary
public void setInput(Object input, boolean seekForwardOnly, boolean ignoreMetadata)

Overrides javax.imageio.ImageReader.setInput.

Doc from javax.imageio.ImageReader.setInput.

Sets the input source to use to the given ImageInputStream or other Object. The input source must be set before any of the query or read methods are used. If input is null, any currently set input source will be removed. In any case, the value of minIndex will be initialized to 0.

The seekForwardOnly parameter controls whether the value returned by getMinIndex will be increased as each image (or thumbnail, or image metadata) is read. If seekForwardOnly is true, then a call to read(index) will throw an IndexOutOfBoundsException if index < this.minIndex; otherwise, the value of minIndex will be set to index. If seekForwardOnly is false, the value of minIndex will remain 0 regardless of any read operations.

The ignoreMetadata parameter, if set to true, allows the reader to disregard any metadata encountered during the read. Subsequent calls to the getStreamMetadata and getImageMetadata methods may return null, and an IIOImage returned from readAll may return null from their getMetadata method. Setting this parameter may allow the reader to work more efficiently. The reader may choose to disregard this setting and return metadata normally.

Subclasses should take care to remove any cached information based on the previous stream, such as header information or partially decoded image data.

Use of a general Object other than an ImageInputStream is intended for readers that interact directly with a capture device or imaging protocol. The set of legal classes is advertised by the reader's service provider's getInputTypes method; most readers will return a single-element array containing only ImageInputStream.class to indicate that they accept only an ImageInputStream.

The default implementation checks the input argument against the list returned by originatingProvider.getInputTypes() and fails if the argument is not an instance of one of the classes in the list. If the originating provider is set to null, the input is accepted only if it is an ImageInputStream.

Annotations
@Override
com.sun.imageio.plugins.bmp back to summary

private Class BMPImageReader.EmbeddedProgressAdapter

extends Object
implements IIOReadProgressListener
Class Inheritance
  • java.lang.Object
  • com.sun.imageio.plugins.bmp.BMPImageReader.EmbeddedProgressAdapter
All Implemented Interfaces
javax.imageio.event.IIOReadProgressListener, java.util.EventListener

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
imageComplete(ImageReader src)

Implements javax.imageio.event.IIOReadProgressListener.imageComplete.

Reports that the current image read operation has completed.

public void
imageProgress(ImageReader src, float percentageDone)

Implements javax.imageio.event.IIOReadProgressListener.imageProgress.

Reports the approximate degree of completion of the current read call of the associated ImageReader.

public void
imageStarted(ImageReader src, int imageIndex)

Implements javax.imageio.event.IIOReadProgressListener.imageStarted.

Reports that an image read operation is beginning.

public void
readAborted(ImageReader src)

Implements javax.imageio.event.IIOReadProgressListener.readAborted.

Reports that a read has been aborted via the reader's abort method.

public void
sequenceComplete(ImageReader src)

Implements javax.imageio.event.IIOReadProgressListener.sequenceComplete.

Reports that a sequence of read operations has completed.

public void
sequenceStarted(ImageReader src, int minIndex)

Implements javax.imageio.event.IIOReadProgressListener.sequenceStarted.

Reports that a sequence of read operations is beginning.

public void
thumbnailComplete(ImageReader src)

Implements javax.imageio.event.IIOReadProgressListener.thumbnailComplete.

Reports that a thumbnail read operation has completed.

public void
thumbnailProgress(ImageReader src, float percentageDone)

Implements javax.imageio.event.IIOReadProgressListener.thumbnailProgress.

Reports the approximate degree of completion of the current getThumbnail call within the associated ImageReader.

public void
thumbnailStarted(ImageReader src, int iIdx, int tIdx)

Implements javax.imageio.event.IIOReadProgressListener.thumbnailStarted.

Reports that a thumbnail read operation is beginning.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

EmbeddedProgressAdapterback to summary
private EmbeddedProgressAdapter()

Method Detail

imageCompleteback to summary
public void imageComplete(ImageReader src)

Implements javax.imageio.event.IIOReadProgressListener.imageComplete.

Doc from javax.imageio.event.IIOReadProgressListener.imageComplete.

Reports that the current image read operation has completed. All ImageReader implementations are required to call this method exactly once upon completion of each image read operation.

Annotations
@Override
imageProgressback to summary
public void imageProgress(ImageReader src, float percentageDone)

Implements javax.imageio.event.IIOReadProgressListener.imageProgress.

Doc from javax.imageio.event.IIOReadProgressListener.imageProgress.

Reports the approximate degree of completion of the current read call of the associated ImageReader.

The degree of completion is expressed as a percentage varying from 0.0F to 100.0F. The percentage should ideally be calculated in terms of the remaining time to completion, but it is usually more practical to use a more well-defined metric such as pixels decoded or portion of input stream consumed. In any case, a sequence of calls to this method during a given read operation should supply a monotonically increasing sequence of percentage values. It is not necessary to supply the exact values 0 and 100, as these may be inferred by the callee from other methods.

Each particular ImageReader implementation may call this method at whatever frequency it desires. A rule of thumb is to call it around each 5 percent mark.

Annotations
@Override
imageStartedback to summary
public void imageStarted(ImageReader src, int imageIndex)

Implements javax.imageio.event.IIOReadProgressListener.imageStarted.

Doc from javax.imageio.event.IIOReadProgressListener.imageStarted.

Reports that an image read operation is beginning. All ImageReader implementations are required to call this method exactly once when beginning an image read operation.

Annotations
@Override
readAbortedback to summary
public void readAborted(ImageReader src)

Implements javax.imageio.event.IIOReadProgressListener.readAborted.

Doc from javax.imageio.event.IIOReadProgressListener.readAborted.

Reports that a read has been aborted via the reader's abort method. No further notifications will be given.

Annotations
@Override
sequenceCompleteback to summary
public void sequenceComplete(ImageReader src)

Implements javax.imageio.event.IIOReadProgressListener.sequenceComplete.

Doc from javax.imageio.event.IIOReadProgressListener.sequenceComplete.

Reports that a sequence of read operations has completed. ImageReader implementations are required to call this method exactly once from their readAll(Iterator) method.

Annotations
@Override
sequenceStartedback to summary
public void sequenceStarted(ImageReader src, int minIndex)

Implements javax.imageio.event.IIOReadProgressListener.sequenceStarted.

Doc from javax.imageio.event.IIOReadProgressListener.sequenceStarted.

Reports that a sequence of read operations is beginning. ImageReader implementations are required to call this method exactly once from their readAll(Iterator) method.

Annotations
@Override
thumbnailCompleteback to summary
public void thumbnailComplete(ImageReader src)

Implements javax.imageio.event.IIOReadProgressListener.thumbnailComplete.

Doc from javax.imageio.event.IIOReadProgressListener.thumbnailComplete.

Reports that a thumbnail read operation has completed. All ImageReader implementations are required to call this method exactly once upon completion of each thumbnail read operation.

Annotations
@Override
thumbnailProgressback to summary
public void thumbnailProgress(ImageReader src, float percentageDone)

Implements javax.imageio.event.IIOReadProgressListener.thumbnailProgress.

Doc from javax.imageio.event.IIOReadProgressListener.thumbnailProgress.

Reports the approximate degree of completion of the current getThumbnail call within the associated ImageReader. The semantics are identical to those of imageProgress.

Annotations
@Override
thumbnailStartedback to summary
public void thumbnailStarted(ImageReader src, int iIdx, int tIdx)

Implements javax.imageio.event.IIOReadProgressListener.thumbnailStarted.

Doc from javax.imageio.event.IIOReadProgressListener.thumbnailStarted.

Reports that a thumbnail read operation is beginning. All ImageReader implementations are required to call this method exactly once when beginning a thumbnail read operation.

Annotations
@Override