|
fop 2.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.fop.util.bitmap.BitmapImageUtil
public final class BitmapImageUtil
Utility method for dealing with bitmap images.
Method Summary | |
---|---|
static int |
convertToGray(int rgb)
Convert an RGB color value to a grayscale from 0 to 100. |
static int |
convertToGray(int r,
int g,
int b)
Convert an RGB color value to a grayscale from 0 to 100. |
static java.awt.image.BufferedImage |
convertToGrayscale(java.awt.image.RenderedImage img,
java.awt.Dimension targetDimension)
Converts an image to a grayscale (8 bits) image. |
static java.awt.image.BufferedImage |
convertToMonochrome(java.awt.image.RenderedImage img,
java.awt.Dimension targetDimension)
Converts an image to a monochrome 1-bit image. |
static java.awt.image.RenderedImage |
convertToMonochrome(java.awt.image.RenderedImage img,
java.awt.Dimension targetDimension,
float quality)
Converts an image to a monochrome 1-bit image. |
static java.awt.image.BufferedImage |
convertTosRGB(java.awt.image.RenderedImage img,
java.awt.Dimension targetDimension)
Converts an image to sRGB. |
static MonochromeBitmapConverter |
createDefaultMonochromeBitmapConverter()
|
static int |
getColorIndexSize(java.awt.image.RenderedImage img)
Returns the size of the color index if the given image has one. |
static boolean |
isGrayscaleImage(java.awt.image.RenderedImage img)
Indicates whether an image is a grayscale image. |
static boolean |
isMonochromeImage(java.awt.image.RenderedImage img)
Indicates whether an image is a monochrome (1 bit black and white) image. |
static boolean |
isZeroBlack(java.awt.image.RenderedImage img)
Indicates whether a zero bit indicates a black/dark pixel for a monochrome image. |
static java.awt.image.BufferedImage |
toBufferedImage(java.awt.image.RenderedImage img)
Returns a BufferedImage based on the given RenderedImage. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean isMonochromeImage(java.awt.image.RenderedImage img)
img
- the image
public static boolean isZeroBlack(java.awt.image.RenderedImage img)
img
- the image (must be 1 bit monochrome)
public static int convertToGray(int r, int g, int b)
r
- the red componentg
- the green componentb
- the blue component
public static int convertToGray(int rgb)
rgb
- the RGB value
public static int getColorIndexSize(java.awt.image.RenderedImage img)
img
- the image
public static boolean isGrayscaleImage(java.awt.image.RenderedImage img)
img
- the image
public static java.awt.image.BufferedImage convertTosRGB(java.awt.image.RenderedImage img, java.awt.Dimension targetDimension)
img
- the image to be convertedtargetDimension
- the new target dimensions or null if no scaling is necessary
public static java.awt.image.BufferedImage convertToGrayscale(java.awt.image.RenderedImage img, java.awt.Dimension targetDimension)
img
- the image to be convertedtargetDimension
- the new target dimensions or null if no scaling is necessary
public static java.awt.image.BufferedImage convertToMonochrome(java.awt.image.RenderedImage img, java.awt.Dimension targetDimension)
img
- the image to be convertedtargetDimension
- the new target dimensions or null if no scaling is necessary
public static java.awt.image.RenderedImage convertToMonochrome(java.awt.image.RenderedImage img, java.awt.Dimension targetDimension, float quality)
img
- the image to be convertedtargetDimension
- the new target dimensions or null if no scaling is necessaryquality
- Defines the desired quality level for the conversion.
Valid values: a value between 0.0f (fastest) and 1.0f (best)
public static java.awt.image.BufferedImage toBufferedImage(java.awt.image.RenderedImage img)
img
- the original image
public static MonochromeBitmapConverter createDefaultMonochromeBitmapConverter()
|
fop 2.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |