Package ch.randelshofer.media.jpeg
Class CMYKJPEGImageReader
java.lang.Object
javax.imageio.ImageReader
ch.randelshofer.media.jpeg.CMYKJPEGImageReader
Reads a JPEG image with colors in the CMYK color space.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BufferedImagecreateRGBAImageFromRGBA(Raster rgbaRaster, ICC_Profile rgbaProfile) Creates a buffered image from a raster in the RGBA color space, converting the colors to RGB using the provided CMYK ICC_Profile.static BufferedImagecreateRGBImageFromCMYK(Raster cmykRaster, ICC_Profile cmykProfile) Creates a buffered image from a raster in the CMYK color space, converting the colors to RGB using the provided CMYK ICC_Profile.static BufferedImagecreateRGBImageFromInvertedYCCK(Raster ycckRaster, ICC_Profile cmykProfile) Creates a buffered image from a raster in the inverted YCCK color space, converting the colors to RGB using the provided CMYK ICC_Profile.static BufferedImagecreateRGBImageFromYCCK(Raster ycckRaster, ICC_Profile cmykProfile) Creates a buffered image from a raster in the YCCK color space, converting the colors to RGB using the provided CMYK ICC_Profile.intgetHeight(int imageIndex) getImageMetadata(int imageIndex) getImageTypes(int imageIndex) intgetNumImages(boolean allowSearch) intgetWidth(int imageIndex) booleanread(int imageIndex, ImageReadParam param) static BufferedImageread(ImageInputStream in, boolean inverseYCCKColors) static BufferedImageReads a JPEG image from the provided InputStream.static BufferedImagereadRGBAImageFromRGBA(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 BufferedImagereadRGBImageFromCMYK(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 BufferedImagereadRGBImageFromInvertedYCCK(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 BufferedImagereadRGBImageFromYCCK(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.voidsetYCCKInversed(boolean newValue) Methods inherited from class javax.imageio.ImageReader
abort, addIIOReadProgressListener, addIIOReadUpdateListener, addIIOReadWarningListener, canReadRaster, dispose, getAspectRatio, getAvailableLocales, getDefaultReadParam, getFormatName, getImageMetadata, getInput, getLocale, getMinIndex, getNumThumbnails, getOriginatingProvider, getRawImageType, getStreamMetadata, getThumbnailHeight, getThumbnailWidth, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, hasThumbnails, isIgnoringMetadata, isImageTiled, isRandomAccessEasy, isSeekForwardOnly, read, readAll, readAll, readAsRenderedImage, readerSupportsThumbnails, readRaster, readThumbnail, readTile, readTileRaster, removeAllIIOReadProgressListeners, removeAllIIOReadUpdateListeners, removeAllIIOReadWarningListeners, removeIIOReadProgressListener, removeIIOReadUpdateListener, removeIIOReadWarningListener, reset, setInput, setInput, setInput, setLocale
-
Constructor Details
-
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
-
isYCCKInversed
public boolean isYCCKInversed()- Returns:
- the YCCKInversed property.
-
setYCCKInversed
public void setYCCKInversed(boolean newValue) - Parameters:
newValue- the new value
-
read
- Throws:
IOException
-
readRGBImageFromCMYK
public static BufferedImage readRGBImageFromCMYK(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 converted into the RGB color space.
- Throws:
IOException
-
readRGBAImageFromRGBA
public static BufferedImage readRGBAImageFromRGBA(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 converted into the RGB color space.
- Throws:
IOException
-
readRGBImageFromYCCK
public static BufferedImage readRGBImageFromYCCK(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 converted into the RGB color space.
- Throws:
IOException
-
readRGBImageFromInvertedYCCK
public static BufferedImage readRGBImageFromInvertedYCCK(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 converted into the RGB color space.
- Throws:
IOException
-
createRGBImageFromYCCK
Creates a buffered image from a raster in the YCCK color space, converting the colors to RGB using the provided CMYK ICC_Profile.- Parameters:
ycckRaster- A raster with (at least) 4 bands of samples.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 in the RGB color space.
-
createRGBImageFromInvertedYCCK
public static BufferedImage createRGBImageFromInvertedYCCK(Raster ycckRaster, ICC_Profile cmykProfile) Creates a buffered image from a raster in the inverted YCCK color space, converting the colors to RGB using the provided CMYK ICC_Profile.- Parameters:
ycckRaster- A raster with (at least) 4 bands of samples.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 in the RGB color space.
-
createRGBImageFromCMYK
Creates a buffered image from a raster in the CMYK color space, converting the colors to RGB using the provided CMYK ICC_Profile. As seen from a comment made by 'phelps' at http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4799903- Parameters:
cmykRaster- A raster with (at least) 4 bands of samples.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 in the RGB color space.
-
createRGBAImageFromRGBA
Creates a buffered image from a raster in the RGBA color space, converting the colors to RGB using the provided CMYK ICC_Profile. As seen from a comment made by 'phelps' at http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4799903- Parameters:
rgbaRaster- A raster with (at least) 4 bands of samples.rgbaProfile- 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 in the RGB color space.
-
readImageFromYUVorGray
Reads a JPEG image from the provided InputStream. The image data must be in the YUV or the Gray color space.Use this method, if you have already determined that the input stream contains a YUV or Gray JPEG image.
- Parameters:
in- An InputStream, preferably an ImageInputStream, in the JPEG File Interchange Format (JFIF).- Returns:
- a BufferedImage containing the decoded image converted into the RGB color space.
- Throws:
IOException
-