public class GrayFilter extends RGBImageFilter
canFilterIndexColorModel, newmodel, origmodelconsumerCOMPLETESCANLINES, IMAGEABORTED, IMAGEERROR, RANDOMPIXELORDER, SINGLEFRAME, SINGLEFRAMEDONE, SINGLEPASS, STATICIMAGEDONE, TOPDOWNLEFTRIGHT| Constructor | Description |
|---|---|
GrayFilter(boolean b,
int p) |
Constructs a GrayFilter object that filters a color image to a
grayscale image.
|
| Modifier and Type | Method | Description |
|---|---|---|
static Image |
createDisabledImage(Image i) |
Creates a disabled image
|
int |
filterRGB(int x,
int y,
int rgb) |
Overrides
RGBImageFilter.filterRGB. |
filterIndexColorModel, filterRGBPixels, setColorModel, setPixels, setPixels, substituteColorModelclone, getFilterInstance, imageComplete, resendTopDownLeftRight, setDimensions, setHints, setPropertiespublic GrayFilter(boolean b,
int p)
b - a boolean -- true if the pixels should be brightenedp - an int in the range 0..100 that determines the percentage
of gray, where 100 is the darkest gray, and 0 is the lightestpublic int filterRGB(int x,
int y,
int rgb)
RGBImageFilter.filterRGB.filterRGB in class RGBImageFilterx - the X coordinate of the pixely - the Y coordinate of the pixelrgb - the integer pixel representation in the default RGB
color modelColorModel.getRGBdefault(),
RGBImageFilter.filterRGBPixels(int, int, int, int, int[], int, int) Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.