Class DIBImageReader
java.lang.Object
javax.imageio.ImageReader
com.twelvemonkeys.imageio.ImageReaderBase
com.twelvemonkeys.imageio.plugins.bmp.DIBImageReader
- Direct Known Subclasses:
CURImageReader
,ICOImageReader
ImageReader for Microsoft Windows ICO (icon) format.
1, 4, 8 bit palette support with bitmask transparency, and 16, 24 and 32 bit
true color support with alpha. Also supports Windows Vista PNG encoded icons.
- Version:
- $Id: ICOImageReader.java,v 1.0 25.feb.2006 00:29:44 haku Exp$
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map
<DirectoryEntry, BitmapDescriptor> private Directory
private final Map
<DirectoryEntry, DIBHeader> private ImageReader
Fields inherited from class com.twelvemonkeys.imageio.ImageReaderBase
imageInput
Fields inherited from class javax.imageio.ImageReader
availableLocales, ignoreMetadata, input, locale, minIndex, originatingProvider, progressListeners, seekForwardOnly, updateListeners, warningListeners, warningLocales
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
addImage
(Container parent, ImageReader reader, int imageNo) private static int
adjustToPadding
(int width) private static JFrame
createWindow
(String title) private Directory
(package private) final DirectoryEntry
getEntry
(int imageIndex) private DIBHeader
getHeader
(DirectoryEntry entry) int
getHeight
(int imageIndex) getImageTypes
(int imageIndex) private Iterator
<ImageTypeSpecifier> getImageTypesPNG
(DirectoryEntry entry) int
getNumImages
(boolean allowSearch) Default implementation that always returns1
.private ImageReader
int
getWidth
(int imageIndex) private ImageReader
initPNGReader
(DirectoryEntry entry) private boolean
isPNG
(DirectoryEntry entry) static void
read
(int imageIndex, ImageReadParam param) private BufferedImage
readBitmap
(DirectoryEntry entry) private void
readBitmap16
(BitmapDescriptor bitmap) private void
readBitmap24
(BitmapDescriptor bitmap) private void
readBitmap32
(BitmapDescriptor bitmap) private void
readBitmapIndexed
(BitmapIndexed bitmap) private void
readBitmapIndexed1
(BitmapIndexed bitmap, boolean asMask) private void
readBitmapIndexed4
(BitmapIndexed bitmap) private void
readBitmapIndexed8
(BitmapIndexed bitmap) private void
readColorMap
(BitmapIndexed bitmap) private void
private static void
readImagesInFile
(String fileName, ImageReader reader, Container container) private BufferedImage
readPNG
(DirectoryEntry entry, ImageReadParam param) protected void
Resets all member variables.Methods inherited from class com.twelvemonkeys.imageio.ImageReaderBase
assertInput, checkBounds, dispose, fakeAOI, fakeSubsampling, getDestination, getImageMetadata, getStreamMetadata, hasExplicitDestination, reset, setInput, showIt
Methods inherited from class javax.imageio.ImageReader
abort, abortRequested, addIIOReadProgressListener, addIIOReadUpdateListener, addIIOReadWarningListener, canReadRaster, checkReadParamBandSettings, clearAbortRequest, computeRegions, getAspectRatio, getAvailableLocales, getDefaultReadParam, getFormatName, getImageMetadata, getInput, getLocale, getMinIndex, getNumThumbnails, getOriginatingProvider, getRawImageType, getSourceRegion, getStreamMetadata, getThumbnailHeight, getThumbnailWidth, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, hasThumbnails, isIgnoringMetadata, isImageTiled, isRandomAccessEasy, isSeekForwardOnly, processImageComplete, processImageProgress, processImageStarted, processImageUpdate, processPassComplete, processPassStarted, processReadAborted, processSequenceComplete, processSequenceStarted, processThumbnailComplete, processThumbnailPassComplete, processThumbnailPassStarted, processThumbnailProgress, processThumbnailStarted, processThumbnailUpdate, processWarningOccurred, processWarningOccurred, read, readAll, readAll, readAsRenderedImage, readerSupportsThumbnails, readRaster, readThumbnail, readTile, readTileRaster, removeAllIIOReadProgressListeners, removeAllIIOReadUpdateListeners, removeAllIIOReadWarningListeners, removeIIOReadProgressListener, removeIIOReadUpdateListener, removeIIOReadWarningListener, setInput, setInput, setLocale
-
Field Details
-
directory
-
headers
-
descriptors
-
pngImageReader
-
-
Constructor Details
-
DIBImageReader
-
-
Method Details
-
resetMembers
protected void resetMembers()Description copied from class:ImageReaderBase
Resets all member variables. This method is by default invoked from:- Specified by:
resetMembers
in classImageReaderBase
-
getImageTypes
- Specified by:
getImageTypes
in classImageReader
- Throws:
IOException
-
getNumImages
Description copied from class:ImageReaderBase
Default implementation that always returns1
.- Overrides:
getNumImages
in classImageReaderBase
- Parameters:
allowSearch
- ignored, unless overridden- Returns:
1
, unless overridden- Throws:
IOException
- never, unless overridden
-
getWidth
- Specified by:
getWidth
in classImageReader
- Throws:
IOException
-
getHeight
- Specified by:
getHeight
in classImageReader
- Throws:
IOException
-
read
- Specified by:
read
in classImageReader
- Throws:
IOException
-
isPNG
- Throws:
IOException
-
readPNG
- Throws:
IOException
-
getImageTypesPNG
- Throws:
IOException
-
initPNGReader
- Throws:
IOException
-
getPNGReader
- Throws:
IIOException
-
getHeader
- Throws:
IOException
-
readBitmap
- Throws:
IOException
-
readBitmapIndexed
- Throws:
IOException
-
readColorMap
- Throws:
IOException
-
readBitmapIndexed1
- Throws:
IOException
-
readBitmapIndexed4
- Throws:
IOException
-
readBitmapIndexed8
- Throws:
IOException
-
adjustToPadding
private static int adjustToPadding(int width) - Parameters:
width
- Bytes per scan line (i.e., 1BPP, width = 9 -> bytes = 2)- Returns:
- padded width
-
readBitmap16
- Throws:
IOException
-
readBitmap24
- Throws:
IOException
-
readBitmap32
- Throws:
IOException
-
getDirectory
- Throws:
IOException
-
readFileHeader
- Throws:
IOException
-
getEntry
- Throws:
IOException
-
main
- Throws:
IOException
-
readImagesInFile
private static void readImagesInFile(String fileName, ImageReader reader, Container container) throws IOException - Throws:
IOException
-
createWindow
-
addImage
- Throws:
IOException
-