final class SampledImageReader
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static org.apache.commons.logging.Log |
LOG |
Modifier | Constructor and Description |
---|---|
private |
SampledImageReader() |
Modifier and Type | Method and Description |
---|---|
private static java.awt.image.BufferedImage |
applyColorKeyMask(java.awt.image.BufferedImage image,
java.awt.image.BufferedImage mask) |
private static java.awt.Rectangle |
clipRegion(PDImage pdImage,
java.awt.Rectangle region) |
private static java.awt.image.BufferedImage |
from1Bit(PDImage pdImage,
java.awt.Rectangle clipped,
int subsampling,
int width,
int height) |
private static java.awt.image.BufferedImage |
from8bit(PDImage pdImage,
java.awt.image.WritableRaster raster,
java.awt.Rectangle clipped,
int subsampling,
int width,
int height) |
private static java.awt.image.BufferedImage |
fromAny(PDImage pdImage,
java.awt.image.WritableRaster raster,
COSArray colorKey,
java.awt.Rectangle clipped,
int subsampling,
int width,
int height) |
private static float[] |
getDecodeArray(PDImage pdImage) |
static java.awt.image.BufferedImage |
getRGBImage(PDImage pdImage,
COSArray colorKey)
Returns the content of the given image as an AWT buffered image with an RGB color space.
|
static java.awt.image.BufferedImage |
getRGBImage(PDImage pdImage,
java.awt.Rectangle region,
int subsampling,
COSArray colorKey)
Returns the content of the given image as an AWT buffered image with an RGB color space.
|
static java.awt.image.BufferedImage |
getStencilImage(PDImage pdImage,
java.awt.Paint paint)
Returns an ARGB image filled with the given paint and using the given image as a mask.
|
public static java.awt.image.BufferedImage getStencilImage(PDImage pdImage, java.awt.Paint paint) throws java.io.IOException
paint
- the paint to fill the visible portions of the image withjava.io.IOException
- if the image cannot be readjava.lang.IllegalStateException
- if the image is not a stencil.public static java.awt.image.BufferedImage getRGBImage(PDImage pdImage, COSArray colorKey) throws java.io.IOException
pdImage
- the image to readcolorKey
- an optional color key maskjava.io.IOException
- if the image cannot be readprivate static java.awt.Rectangle clipRegion(PDImage pdImage, java.awt.Rectangle region)
public static java.awt.image.BufferedImage getRGBImage(PDImage pdImage, java.awt.Rectangle region, int subsampling, COSArray colorKey) throws java.io.IOException
pdImage
- the image to readregion
- The region of the source image to get, or null if the entire image is needed.
The actual region will be clipped to the dimensions of the source image.subsampling
- The amount of rows and columns to advance for every output pixel, a value
of 1 meaning every pixel will be read. It must not be larger than the image width or height.colorKey
- an optional color key maskjava.io.IOException
- if the image cannot be readprivate static java.awt.image.BufferedImage from1Bit(PDImage pdImage, java.awt.Rectangle clipped, int subsampling, int width, int height) throws java.io.IOException
java.io.IOException
private static java.awt.image.BufferedImage from8bit(PDImage pdImage, java.awt.image.WritableRaster raster, java.awt.Rectangle clipped, int subsampling, int width, int height) throws java.io.IOException
java.io.IOException
private static java.awt.image.BufferedImage fromAny(PDImage pdImage, java.awt.image.WritableRaster raster, COSArray colorKey, java.awt.Rectangle clipped, int subsampling, int width, int height) throws java.io.IOException
java.io.IOException
private static java.awt.image.BufferedImage applyColorKeyMask(java.awt.image.BufferedImage image, java.awt.image.BufferedImage mask)
private static float[] getDecodeArray(PDImage pdImage) throws java.io.IOException
java.io.IOException