Class ICNSImageReader
- java.lang.Object
-
- javax.imageio.ImageReader
-
- com.twelvemonkeys.imageio.ImageReaderBase
-
- com.twelvemonkeys.imageio.plugins.icns.ICNSImageReader
-
public final class ICNSImageReader extends ImageReaderBase
ImageReader for Apple Icon Image (ICNS) format.- Version:
- $Id: ICNSImageReader.java,v 1.0 25.10.11 18:42 haraldk Exp$
- See Also:
- Macintosh Icons, Apple Icon Image format (Wikipedia)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
ICNSImageReader.ICNSBitMaskColorModel
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<IconResource>
icons
private IconResource
lastResourceRead
private int
length
private java.util.List<IconResource>
masks
-
Fields inherited from class com.twelvemonkeys.imageio.ImageReaderBase
imageInput
-
-
Constructor Summary
Constructors Constructor Description ICNSImageReader()
ICNSImageReader(javax.imageio.spi.ImageReaderSpi provider)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addResource(IconResource resource)
private static int[]
createBandOffsets(int bandLen)
private IconResource
findMaskResource(IconResource iconResource)
private java.lang.String
getForeignFormat(javax.imageio.stream.ImageInputStream stream)
int
getHeight(int imageIndex)
javax.imageio.metadata.IIOMetadata
getImageMetadata(int imageIndex)
Default implementation that always returnsnull
.java.util.Iterator<javax.imageio.ImageTypeSpecifier>
getImageTypes(int imageIndex)
int
getNumImages(boolean allowSearch)
Default implementation that always returns1
.javax.imageio.ImageTypeSpecifier
getRawImageType(int imageIndex)
int
getWidth(int imageIndex)
static void
main(java.lang.String[] args)
java.awt.image.BufferedImage
read(int imageIndex, javax.imageio.ImageReadParam param)
private void
readeFileHeader()
private java.awt.image.BufferedImage
readForeignFormat(int imageIndex, javax.imageio.ImageReadParam param, IconResource resource)
private java.awt.image.BufferedImage
readICNSFormat(int imageIndex, javax.imageio.ImageReadParam param, IconResource resource)
private IconResource
readIconResource(int imageIndex)
private java.awt.image.Raster
readMask(IconResource resource)
private IconResource
readNextIconResource()
protected void
resetMembers()
Resets all member variables.-
Methods inherited from class com.twelvemonkeys.imageio.ImageReaderBase
assertInput, checkBounds, dispose, fakeAOI, fakeSubsampling, getDestination, 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, 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 Detail
-
icons
private final java.util.List<IconResource> icons
-
masks
private final java.util.List<IconResource> masks
-
lastResourceRead
private IconResource lastResourceRead
-
length
private int length
-
-
Method Detail
-
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
-
getWidth
public int getWidth(int imageIndex) throws java.io.IOException
- Specified by:
getWidth
in classjavax.imageio.ImageReader
- Throws:
java.io.IOException
-
getHeight
public int getHeight(int imageIndex) throws java.io.IOException
- Specified by:
getHeight
in classjavax.imageio.ImageReader
- Throws:
java.io.IOException
-
getRawImageType
public javax.imageio.ImageTypeSpecifier getRawImageType(int imageIndex) throws java.io.IOException
- Overrides:
getRawImageType
in classjavax.imageio.ImageReader
- Throws:
java.io.IOException
-
createBandOffsets
private static int[] createBandOffsets(int bandLen)
-
getImageTypes
public java.util.Iterator<javax.imageio.ImageTypeSpecifier> getImageTypes(int imageIndex) throws java.io.IOException
- Specified by:
getImageTypes
in classjavax.imageio.ImageReader
- Throws:
java.io.IOException
-
getNumImages
public int getNumImages(boolean allowSearch) throws java.io.IOException
Description copied from class:ImageReaderBase
Default implementation that always returns1
.- Overrides:
getNumImages
in classImageReaderBase
- Parameters:
allowSearch
- ignored, unless overridden- Returns:
1
, unless overridden- Throws:
java.io.IOException
- never, unless overridden
-
read
public java.awt.image.BufferedImage read(int imageIndex, javax.imageio.ImageReadParam param) throws java.io.IOException
- Specified by:
read
in classjavax.imageio.ImageReader
- Throws:
java.io.IOException
-
readICNSFormat
private java.awt.image.BufferedImage readICNSFormat(int imageIndex, javax.imageio.ImageReadParam param, IconResource resource) throws java.io.IOException
- Throws:
java.io.IOException
-
readMask
private java.awt.image.Raster readMask(IconResource resource) throws java.io.IOException
- Throws:
java.io.IOException
-
findMaskResource
private IconResource findMaskResource(IconResource iconResource) throws java.io.IOException
- Throws:
java.io.IOException
-
readForeignFormat
private java.awt.image.BufferedImage readForeignFormat(int imageIndex, javax.imageio.ImageReadParam param, IconResource resource) throws java.io.IOException
- Throws:
java.io.IOException
-
getForeignFormat
private java.lang.String getForeignFormat(javax.imageio.stream.ImageInputStream stream) throws java.io.IOException
- Throws:
java.io.IOException
-
readIconResource
private IconResource readIconResource(int imageIndex) throws java.io.IOException
- Throws:
java.io.IOException
-
readNextIconResource
private IconResource readNextIconResource() throws java.io.IOException
- Throws:
java.io.IOException
-
addResource
private void addResource(IconResource resource)
-
readeFileHeader
private void readeFileHeader() throws java.io.IOException
- Throws:
java.io.IOException
-
getImageMetadata
public javax.imageio.metadata.IIOMetadata getImageMetadata(int imageIndex) throws java.io.IOException
Description copied from class:ImageReaderBase
Default implementation that always returnsnull
.- Overrides:
getImageMetadata
in classImageReaderBase
- Parameters:
imageIndex
- ignored, unless overridden- Returns:
null
, unless overridden- Throws:
java.io.IOException
- never, unless overridden.
-
main
public static void main(java.lang.String[] args) throws java.io.IOException
- Throws:
java.io.IOException
-
-