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 Directoryprivate final Map<DirectoryEntry, DIBHeader> private ImageReaderFields inherited from class ImageReaderBase
imageInputFields inherited from class ImageReader
availableLocales, ignoreMetadata, input, locale, minIndex, originatingProvider, progressListeners, seekForwardOnly, updateListeners, warningListeners, warningLocales -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidaddImage(Container parent, ImageReader reader, int imageNo) private static intadjustToPadding(int width) private static JFramecreateWindow(String title) private Directory(package private) final DirectoryEntrygetEntry(int imageIndex) private DIBHeadergetHeader(DirectoryEntry entry) intgetHeight(int imageIndex) getImageTypes(int imageIndex) private Iterator<ImageTypeSpecifier> getImageTypesPNG(DirectoryEntry entry) intgetNumImages(boolean allowSearch) Default implementation that always returns1.private ImageReaderintgetWidth(int imageIndex) private ImageReaderinitPNGReader(DirectoryEntry entry) private booleanisPNG(DirectoryEntry entry) static voidTest code below, ignore..read(int imageIndex, ImageReadParam param) private BufferedImagereadBitmap(DirectoryEntry entry) private voidreadBitmap16(BitmapDescriptor bitmap) private voidreadBitmap24(BitmapDescriptor bitmap) private voidreadBitmap32(BitmapDescriptor bitmap) private voidreadBitmapIndexed(BitmapIndexed bitmap) private voidreadBitmapIndexed1(BitmapIndexed bitmap, boolean asMask) private voidreadBitmapIndexed4(BitmapIndexed bitmap) private voidreadBitmapIndexed8(BitmapIndexed bitmap) private voidreadColorMap(BitmapIndexed bitmap) private voidprivate static voidreadImagesInFile(String fileName, ImageReader reader, Container container) private BufferedImagereadPNG(DirectoryEntry entry, ImageReadParam param) protected voidResets all member variables.Methods inherited from class ImageReaderBase
assertInput, checkBounds, dispose, fakeAOI, fakeSubsampling, getDestination, getImageMetadata, getStreamMetadata, hasExplicitDestination, reset, setInput, showItMethods inherited from class 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:ImageReaderBaseResets all member variables. This method is by default invoked from:- Specified by:
resetMembersin classImageReaderBase
-
getImageTypes
- Specified by:
getImageTypesin classImageReader- Throws:
IOException
-
getNumImages
Description copied from class:ImageReaderBaseDefault implementation that always returns1.- Overrides:
getNumImagesin classImageReaderBase- Parameters:
allowSearch- ignored, unless overridden- Returns:
1, unless overridden- Throws:
IOException- never, unless overridden
-
getWidth
- Specified by:
getWidthin classImageReader- Throws:
IOException
-
getHeight
- Specified by:
getHeightin classImageReader- Throws:
IOException
-
read
- Specified by:
readin 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
Test code below, ignore.. :-)- Throws:
IOException
-
readImagesInFile
private static void readImagesInFile(String fileName, ImageReader reader, Container container) throws IOException - Throws:
IOException
-
createWindow
-
addImage
- Throws:
IOException
-