com.twelvemonkeys.image
Class GrayFilter
java.lang.Object
java.awt.image.ImageFilter
java.awt.image.RGBImageFilter
com.twelvemonkeys.image.GrayFilter
- All Implemented Interfaces:
- ImageConsumer, Cloneable
public class GrayFilter
- extends RGBImageFilter
This class can convert a color image to grayscale.
Uses ITU standard conversion: (222 * Red + 707 * Green + 71 * Blue) / 1000.
- Version:
- $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/image/GrayFilter.java#1 $
- Author:
- Harald Kuhr, last modified by $Author: haku $
|
Constructor Summary |
GrayFilter()
Constructs a GrayFilter using ITU color-conversion. |
GrayFilter(float pLow,
float pHigh)
Constructs a GrayFilter using ITU color-conversion, and a dynamic range between
pLow and pHigh. |
GrayFilter(int pLow,
int pHigh)
Constructs a GrayFilter using ITU color-conversion, and a dynamic
range between pLow and pHigh. |
|
Method Summary |
int |
filterRGB(int pX,
int pY,
int pARGB)
Filters one pixel using ITU color-conversion. |
GrayFilter
public GrayFilter()
- Constructs a GrayFilter using ITU color-conversion.
GrayFilter
public GrayFilter(float pLow,
float pHigh)
- Constructs a GrayFilter using ITU color-conversion, and a dynamic range between
pLow and pHigh.
- Parameters:
pLow - float in the range 0..1pHigh - float in the range 0..1 and >= pLow
GrayFilter
public GrayFilter(int pLow,
int pHigh)
- Constructs a GrayFilter using ITU color-conversion, and a dynamic
range between pLow and pHigh.
- Parameters:
pLow - integer in the range 0..255pHigh - inteeger in the range 0..255 and >= pLow
filterRGB
public int filterRGB(int pX,
int pY,
int pARGB)
- Filters one pixel using ITU color-conversion.
- Specified by:
filterRGB in class RGBImageFilter
- Parameters:
pX - xpY - ypARGB - pixel value in default color space
- Returns:
- the filtered pixel value in the default color space
Copyright © 2015. All Rights Reserved.