java.lang.Object
javax.imageio.ImageReader
org.monte.media.jpeg.CMYKJPEGImageReader
Reads a JPEG image with colors in the CMYK color space.
For optimal performance with CMYK images, please run the JVM with the following VM option:
-Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider
- Author:
- Werner Randelshofer
-
Field Summary
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 TypeMethodDescriptionstatic ImageReadervoiddispose()Disposes of resources held internally by the reader.intgetHeight(int imageIndex) getImageMetadata(int imageIndex) getImageTypes(int imageIndex) intgetNumImages(boolean allowSearch) intgetWidth(int imageIndex) booleanbooleanread(int imageIndex, ImageReadParam param) static BufferedImageread(ImageInputStream in, boolean inverseYCCKColors, boolean ignoreProfile, ICC_Profile defaultProfile) static BufferedImagereadImageFromCMYK(InputStream in, ICC_Profile cmykProfile) Reads a CMYK JPEG image from the provided InputStream, converting the colors to RGB using the provided CMYK ICC_Profile.static BufferedImagereadImageFromInvertedCMYK(InputStream in, ICC_Profile rgbaProfile) Reads a RGBA JPEG image from the provided InputStream, converting the colors to RGBA using the provided RGBA ICC_Profile.static BufferedImagereadImageFromInvertedYCCK(InputStream in, ICC_Profile cmykProfile) Reads an inverted-YCCK JPEG image from the provided InputStream, converting the colors to RGB using the provided CMYK ICC_Profile.static BufferedImagereadImageFromRGB(InputStream in, ICC_Profile rgbaProfile) static BufferedImagereadImageFromYCC(InputStream in, ICC_Profile yccProfile) static BufferedImagereadImageFromYCCK(InputStream in, ICC_Profile cmykProfile) Reads a YCCK JPEG image from the provided InputStream, converting the colors to RGB using the provided CMYK ICC_Profile.voidsetDefaultIccProfile(ICC_Profile newValue) voidsetIgnoreIccProfile(boolean newValue) voidsetInvertColors(boolean newValue) Methods inherited from class javax.imageio.ImageReader
abort, abortRequested, addIIOReadProgressListener, addIIOReadUpdateListener, addIIOReadWarningListener, canReadRaster, checkReadParamBandSettings, clearAbortRequest, computeRegions, getAspectRatio, getAvailableLocales, getDefaultReadParam, getDestination, 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, reset, setInput, setInput, setInput, setLocale
-
Constructor Details
-
CMYKJPEGImageReader
public CMYKJPEGImageReader() -
CMYKJPEGImageReader
-
-
Method Details
-
getNumImages
- Specified by:
getNumImagesin classImageReader- Throws:
IOException
-
getWidth
- Specified by:
getWidthin classImageReader- Throws:
IOException
-
getHeight
- Specified by:
getHeightin classImageReader- Throws:
IOException
-
getImageTypes
- Specified by:
getImageTypesin classImageReader- Throws:
IOException
-
getStreamMetadata
- Specified by:
getStreamMetadatain classImageReader- Throws:
IOException
-
getImageMetadata
- Specified by:
getImageMetadatain classImageReader- Throws:
IOException
-
read
- Specified by:
readin classImageReader- Throws:
IOException
-
isInvertColors
public boolean isInvertColors()- Returns:
- the YCCKInversed property.
-
setInvertColors
public void setInvertColors(boolean newValue) - Parameters:
newValue- the new value
-
isIgnoreIccProfile
public boolean isIgnoreIccProfile() -
setIgnoreIccProfile
public void setIgnoreIccProfile(boolean newValue) -
getDefaultIccProfile
-
setDefaultIccProfile
-
read
public static BufferedImage read(ImageInputStream in, boolean inverseYCCKColors, boolean ignoreProfile, ICC_Profile defaultProfile) throws IOException - Throws:
IOException
-
createNativeJPEGReader
-
readImageFromCMYK
public static BufferedImage readImageFromCMYK(InputStream in, ICC_Profile cmykProfile) throws IOException Reads a CMYK JPEG image from the provided InputStream, converting the colors to RGB using the provided CMYK ICC_Profile. The image data must be in the CMYK color space.Use this method, if you have already determined that the input stream contains a CMYK JPEG image.
- Parameters:
in- An InputStream, preferably an ImageInputStream, in the JPEG File Interchange Format (JFIF).cmykProfile- An ICC_Profile for conversion from the CMYK color space to the RGB color space. If this parameter is null, a default profile is used.- Returns:
- a BufferedImage containing the decoded image
- Throws:
IOException
-
readImageFromInvertedCMYK
public static BufferedImage readImageFromInvertedCMYK(InputStream in, ICC_Profile rgbaProfile) throws IOException Reads a RGBA JPEG image from the provided InputStream, converting the colors to RGBA using the provided RGBA ICC_Profile. The image data must be in the RGBA color space.Use this method, if you have already determined that the input stream contains a RGBA JPEG image.
- Parameters:
in- An InputStream, preferably an ImageInputStream, in the JPEG File Interchange Format (JFIF).rgbaProfile- An ICC_Profile for conversion from the RGBA color space to the RGBA color space. If this parameter is null, a default profile is used.- Returns:
- a BufferedImage containing the decoded image.
- Throws:
IOException
-
readImageFromRGB
public static BufferedImage readImageFromRGB(InputStream in, ICC_Profile rgbaProfile) throws IOException - Throws:
IOException
-
readImageFromYCC
public static BufferedImage readImageFromYCC(InputStream in, ICC_Profile yccProfile) throws IOException - Throws:
IOException
-
readImageFromYCCK
public static BufferedImage readImageFromYCCK(InputStream in, ICC_Profile cmykProfile) throws IOException Reads a YCCK JPEG image from the provided InputStream, converting the colors to RGB using the provided CMYK ICC_Profile. The image data must be in the YCCK color space.Use this method, if you have already determined that the input stream contains a YCCK JPEG image.
- Parameters:
in- An InputStream, preferably an ImageInputStream, in the JPEG File Interchange Format (JFIF).cmykProfile- An ICC_Profile for conversion from the CMYK color space to the RGB color space. If this parameter is null, a default profile is used.- Returns:
- a BufferedImage containing the decoded image.
- Throws:
IOException
-
readImageFromInvertedYCCK
public static BufferedImage readImageFromInvertedYCCK(InputStream in, ICC_Profile cmykProfile) throws IOException Reads an inverted-YCCK JPEG image from the provided InputStream, converting the colors to RGB using the provided CMYK ICC_Profile. The image data must be in the inverted-YCCK color space.Use this method, if you have already determined that the input stream contains an inverted-YCCK JPEG image.
- Parameters:
in- An InputStream, preferably an ImageInputStream, in the JPEG File Interchange Format (JFIF).cmykProfile- An ICC_Profile for conversion from the CMYK color space to the RGB color space. If this parameter is null, a default profile is used.- Returns:
- a BufferedImage containing the decoded image.
- Throws:
IOException
-
dispose
public void dispose()Disposes of resources held internally by the reader.- Overrides:
disposein classImageReader
-