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.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field 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. |
| Access | Constructor and Description |
|---|---|
| public | BMPImageReader(ImageReaderSpi originator)
Constructs |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | canReadRaster()
Overrides javax. Returns |
| private void | |
| private boolean | |
| private boolean | |
| private void | |
| private void | |
| public ImageReadParam | getDefaultReadParam()
Overrides javax. Returns a default |
| public int | getHeight(int imageIndex)
Implements abstract javax. Returns the height in pixels of the given image within the input source. |
| public IIOMetadata | getImageMetadata(int imageIndex)
Implements abstract javax. Returns an |
| public Iterator | getImageTypes(int imageIndex)
Implements abstract javax. Returns an |
| public int | getNumImages(boolean allowSearch)
Implements abstract javax. Returns the number of images, not including thumbnails, available from the current input source. |
| public IIOMetadata | getStreamMetadata()
Implements abstract javax. Returns an |
| public int | getWidth(int imageIndex)
Implements abstract javax. Returns the width in pixels of the given image within the input source. |
| private static boolean | |
| public boolean | isRandomAccessEasy(int imageIndex)
Overrides javax. Returns |
| public BufferedImage | read(int imageIndex, ImageReadParam param)
Implements abstract javax. Reads the image indexed by |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private BufferedImage | readEmbedded(int type, BufferedImage
The destination bi, ImageReadParam BufferedImage.The bmpParam)ImageReadParam for decoding this
BMP image. The parameters for subregion, band selection and
subsampling are used in decoding the jpeg image.Decodes the jpeg/png image embedded in the bitmap using any jpeg ImageIO-style plugin. |
| protected void | |
| public Raster | readRaster(int imageIndex, ImageReadParam param)
Overrides javax. Returns a new |
| private void | |
| private void | |
| public void | |
| private void | |
| public void | setInput(Object input, boolean seekForwardOnly, boolean ignoreMetadata)
Overrides javax. Sets the input source to use to the given
|
| alphaMask | back to summary |
|---|---|
| private int alphaMask | |
| bi | back to summary |
|---|---|
| private BufferedImage bi The destination image. | |
| bitmapFileSize | back to summary |
|---|---|
| private long bitmapFileSize | |
| bitmapOffset | back to summary |
|---|---|
| private long bitmapOffset | |
| bitmapStart | back to summary |
|---|---|
| private long bitmapStart | |
| bitsPerPixel | back to summary |
|---|---|
| private int bitsPerPixel | |
| blueMask | back to summary |
|---|---|
| private int blueMask | |
| colorModel | back to summary |
|---|---|
| private ColorModel colorModel | |
| compression | back to summary |
|---|---|
| private long compression | |
| destBands | back to summary |
|---|---|
| private int[] destBands source and destination bands. | |
| destinationRegion | back to summary |
|---|---|
| private Rectangle destinationRegion The destination region. | |
| gotHeader | back to summary |
|---|---|
| private boolean gotHeader Indicates whether the header is read. | |
| greenMask | back to summary |
|---|---|
| private int greenMask | |
| height | back to summary |
|---|---|
| private int height The original image height. | |
| iis | back to summary |
|---|---|
| private ImageInputStream iis The input stream where reads from | |
| imageSize | back to summary |
|---|---|
| private long imageSize | |
| imageType | back to summary |
|---|---|
| private int imageType | |
| isBottomUp | back to summary |
|---|---|
| private boolean isBottomUp | |
| isLinkedProfileAllowed | back to summary |
|---|---|
| private static Boolean isLinkedProfileAllowed | |
| metadata | back to summary |
|---|---|
| private BMPMetadata metadata The metadata from the stream. | |
| noTransform | back to summary |
|---|---|
| private boolean noTransform Indicates whether subsampled, subregion is required, and offset is defined | |
| numBands | back to summary |
|---|---|
| private int numBands | |
| originalColorModel | back to summary |
|---|---|
| private ColorModel originalColorModel | |
| originalSampleModel | back to summary |
|---|---|
| private SampleModel originalSampleModel | |
| palette | back to summary |
|---|---|
| private byte[] palette | |
| redMask | back to summary |
|---|---|
| private int redMask | |
| sampleModel | back to summary |
|---|---|
| private SampleModel sampleModel | |
| scaleX | back to summary |
|---|---|
| private int scaleX The scaling factors. | |
| scaleY | back to summary |
|---|---|
| private int scaleY The scaling factors. | |
| seleBand | back to summary |
|---|---|
| private boolean seleBand Indicates whether subband is selected. | |
| sourceBands | back to summary |
|---|---|
| private int[] sourceBands source and destination bands. | |
| sourceRegion | back to summary |
|---|---|
| private Rectangle sourceRegion The source region. | |
| VERSION_2_1_BIT | back to summary |
|---|---|
| private static final int VERSION_2_1_BIT | |
| VERSION_2_24_BIT | back to summary |
|---|---|
| private static final int VERSION_2_24_BIT | |
| VERSION_2_4_BIT | back to summary |
|---|---|
| private static final int VERSION_2_4_BIT | |
| VERSION_2_8_BIT | back to summary |
|---|---|
| private static final int VERSION_2_8_BIT | |
| VERSION_3_1_BIT | back to summary |
|---|---|
| private static final int VERSION_3_1_BIT | |
| VERSION_3_24_BIT | back to summary |
|---|---|
| private static final int VERSION_3_24_BIT | |
| VERSION_3_4_BIT | back to summary |
|---|---|
| private static final int VERSION_3_4_BIT | |
| VERSION_3_8_BIT | back to summary |
|---|---|
| private static final int VERSION_3_8_BIT | |
| VERSION_3_EXT_16_BIT | back to summary |
|---|---|
| private static final int VERSION_3_EXT_16_BIT | |
| VERSION_3_EXT_1_BIT | back to summary |
|---|---|
| private static final int VERSION_3_EXT_1_BIT | |
| VERSION_3_EXT_24_BIT | back to summary |
|---|---|
| private static final int VERSION_3_EXT_24_BIT | |
| VERSION_3_EXT_32_BIT | back to summary |
|---|---|
| private static final int VERSION_3_EXT_32_BIT | |
| VERSION_3_EXT_4_BIT | back to summary |
|---|---|
| private static final int VERSION_3_EXT_4_BIT | |
| VERSION_3_EXT_8_BIT | back to summary |
|---|---|
| private static final int VERSION_3_EXT_8_BIT | |
| VERSION_3_EXT_EMBEDDED | back to summary |
|---|---|
| private static final int VERSION_3_EXT_EMBEDDED | |
| VERSION_3_NT_16_BIT | back to summary |
|---|---|
| private static final int VERSION_3_NT_16_BIT | |
| VERSION_3_NT_32_BIT | back to summary |
|---|---|
| private static final int VERSION_3_NT_32_BIT | |
| VERSION_3_XP_EMBEDDED | back to summary |
|---|---|
| private static final int VERSION_3_XP_EMBEDDED | |
| VERSION_4_16_BIT | back to summary |
|---|---|
| private static final int VERSION_4_16_BIT | |
| VERSION_4_1_BIT | back to summary |
|---|---|
| private static final int VERSION_4_1_BIT | |
| VERSION_4_24_BIT | back to summary |
|---|---|
| private static final int VERSION_4_24_BIT | |
| VERSION_4_32_BIT | back to summary |
|---|---|
| private static final int VERSION_4_32_BIT | |
| VERSION_4_4_BIT | back to summary |
|---|---|
| private static final int VERSION_4_4_BIT | |
| VERSION_4_8_BIT | back to summary |
|---|---|
| private static final int VERSION_4_8_BIT | |
| VERSION_4_XP_EMBEDDED | back to summary |
|---|---|
| private static final int VERSION_4_XP_EMBEDDED | |
| VERSION_5_XP_EMBEDDED | back to summary |
|---|---|
| private static final int VERSION_5_XP_EMBEDDED | |
| width | back to summary |
|---|---|
| private int width The original image width. | |
| BMPImageReader | back to summary |
|---|---|
| public BMPImageReader(ImageReaderSpi originator) Constructs | |
| canReadRaster | back to summary |
|---|---|
| public boolean canReadRaster() Overrides javax. Doc from javax. Returns The default implementation returns
| |
| checkIndex | back to summary |
|---|---|
| private void checkIndex(int imageIndex) | |
| copyRLE4ScanlineToDst | back to summary |
|---|---|
| private boolean copyRLE4ScanlineToDst(int lineNo, byte[] val, byte[] bdata) throws IOException | |
| copyRLE8ScanlineToDst | back to summary |
|---|---|
| private boolean copyRLE8ScanlineToDst(int lineNo, byte[] val, byte[] bdata) | |
| decodeRLE4 | back to summary |
|---|---|
| private void decodeRLE4(int imSize, int padding, byte[] values, byte[] bdata) throws IOException | |
| decodeRLE8 | back to summary |
|---|---|
| private void decodeRLE8(int imSize, int padding, byte[] values, byte[] bdata) throws IOException | |
| getDefaultReadParam | back to summary |
|---|---|
| public ImageReadParam getDefaultReadParam() Overrides javax. Doc from javax. Returns a default The default implementation constructs and returns a new
| |
| getHeight | back to summary |
|---|---|
| public int getHeight(int imageIndex) throws IOException Implements abstract javax. Doc from javax. 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.
| |
| getImageMetadata | back to summary |
|---|---|
| public IIOMetadata getImageMetadata(int imageIndex) throws IOException Implements abstract javax. Doc from javax. Returns an
| |
| getImageTypes | back to summary |
|---|---|
| public Iterator Implements abstract javax. Doc from javax. Returns an 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.
| |
| getNumImages | back to summary |
|---|---|
| public int getNumImages(boolean allowSearch) throws IOException Implements abstract javax. Doc from javax. 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
| |
| getStreamMetadata | back to summary |
|---|---|
| public IIOMetadata getStreamMetadata() throws IOException Implements abstract javax. Doc from javax. Returns an
| |
| getWidth | back to summary |
|---|---|
| public int getWidth(int imageIndex) throws IOException Implements abstract javax. Doc from javax. 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.
| |
| isLinkedProfileAllowed | back to summary |
|---|---|
| private static boolean isLinkedProfileAllowed() | |
| isRandomAccessEasy | back to summary |
|---|---|
| public boolean isRandomAccessEasy(int imageIndex) throws IOException Overrides javax. Doc from javax. Returns 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 Note that formats that return A reader for which all images are guaranteed to support
easy random access, or are guaranteed not to support easy
random access, may return The default implementation returns
| |
| read | back to summary |
|---|---|
| public BufferedImage read(int imageIndex, ImageReadParam param) throws IOException Implements abstract javax. Doc from javax. Reads the image indexed by The actual Any registered The set of source bands to be read and destination bands to
be written is determined by calling If the supplied
| |
| read16Bit | back to summary |
|---|---|
| private void read16Bit(short[] sdata) throws IOException | |
| read1Bit | back to summary |
|---|---|
| private void read1Bit(byte[] bdata) throws IOException | |
| read24Bit | back to summary |
|---|---|
| private void read24Bit(byte[] bdata) throws IOException | |
| read32Bit | back to summary |
|---|---|
| private void read32Bit(int[] idata) throws IOException | |
| read4Bit | back to summary |
|---|---|
| private void read4Bit(byte[] bdata) throws IOException | |
| read8Bit | back to summary |
|---|---|
| private void read8Bit(byte[] bdata) throws IOException | |
| readColorPalette | back to summary |
|---|---|
| private void readColorPalette(int sizeOfPalette) throws IOException | |
| readEmbedded | back 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.
| |
| readHeader | back to summary |
|---|---|
| protected void readHeader() throws IOException, IllegalArgumentException Process the image header.
| |
| readRaster | back to summary |
|---|---|
| public Raster readRaster(int imageIndex, ImageReadParam param) throws IOException Overrides javax. Doc from javax. Returns a new 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 If If the supplied The default implementation throws an
| |
| readRLE4 | back to summary |
|---|---|
| private void readRLE4(byte[] bdata) throws IOException | |
| readRLE8 | back to summary |
|---|---|
| private void readRLE8(byte[] bdata) throws IOException | |
| reset | back to summary |
|---|---|
| public void reset() Overrides javax. Doc from javax. Restores the The default implementation calls
| |
| resetHeaderInfo | back to summary |
|---|---|
| private void resetHeaderInfo() | |
| setInput | back to summary |
|---|---|
| public void setInput(Object input, boolean seekForwardOnly, boolean ignoreMetadata) Overrides javax. Doc from javax. Sets the input source to use to the given
The The 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 The default implementation checks the
| |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | imageComplete(ImageReader src)
Implements javax. Reports that the current image read operation has completed. |
| public void | imageProgress(ImageReader src, float percentageDone)
Implements javax. Reports the approximate degree of completion of the current
|
| public void | imageStarted(ImageReader src, int imageIndex)
Implements javax. Reports that an image read operation is beginning. |
| public void | readAborted(ImageReader src)
Implements javax. Reports that a read has been aborted via the reader's
|
| public void | sequenceComplete(ImageReader src)
Implements javax. Reports that a sequence of read operations has completed. |
| public void | sequenceStarted(ImageReader src, int minIndex)
Implements javax. Reports that a sequence of read operations is beginning. |
| public void | thumbnailComplete(ImageReader src)
Implements javax. Reports that a thumbnail read operation has completed. |
| public void | thumbnailProgress(ImageReader src, float percentageDone)
Implements javax. Reports the approximate degree of completion of the current
|
| public void | thumbnailStarted(ImageReader src, int iIdx, int tIdx)
Implements javax. Reports that a thumbnail read operation is beginning. |
| EmbeddedProgressAdapter | back to summary |
|---|---|
| private EmbeddedProgressAdapter() | |
| imageComplete | back to summary |
|---|---|
| public void imageComplete(ImageReader src) Implements javax. Doc from javax. Reports that the current image read operation has completed.
All
| |
| imageProgress | back to summary |
|---|---|
| public void imageProgress(ImageReader src, float percentageDone) Implements javax. Doc from javax. Reports the approximate degree of completion of the current
The degree of completion is expressed as a percentage
varying from Each particular
| |
| imageStarted | back to summary |
|---|---|
| public void imageStarted(ImageReader src, int imageIndex) Implements javax. Doc from javax. Reports that an image read operation is beginning. All
| |
| readAborted | back to summary |
|---|---|
| public void readAborted(ImageReader src) Implements javax. Doc from javax. Reports that a read has been aborted via the reader's
| |
| sequenceComplete | back to summary |
|---|---|
| public void sequenceComplete(ImageReader src) Implements javax. Doc from javax. Reports that a sequence of read operations has completed.
| |
| sequenceStarted | back to summary |
|---|---|
| public void sequenceStarted(ImageReader src, int minIndex) Implements javax. Doc from javax. Reports that a sequence of read operations is beginning.
| |
| thumbnailComplete | back to summary |
|---|---|
| public void thumbnailComplete(ImageReader src) Implements javax. Doc from javax. Reports that a thumbnail read operation has completed. All
| |
| thumbnailProgress | back to summary |
|---|---|
| public void thumbnailProgress(ImageReader src, float percentageDone) Implements javax. Doc from javax. Reports the approximate degree of completion of the current
| |
| thumbnailStarted | back to summary |
|---|---|
| public void thumbnailStarted(ImageReader src, int iIdx, int tIdx) Implements javax. Doc from javax. Reports that a thumbnail read operation is beginning. All
| |