public class GrayFilter extends RGBImageFilter
canFilterIndexColorModel, newmodel, origmodel
consumer
COMPLETESCANLINES, IMAGEABORTED, IMAGEERROR, RANDOMPIXELORDER, SINGLEFRAME, SINGLEFRAMEDONE, SINGLEPASS, STATICIMAGEDONE, TOPDOWNLEFTRIGHT
Constructor and Description |
---|
GrayFilter(boolean b,
int p)
Constructs a GrayFilter object that filters a color image to a
grayscale image.
|
Modifier and Type | Method and 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, substituteColorModel
clone, getFilterInstance, imageComplete, resendTopDownLeftRight, setDimensions, setHints, setProperties
public 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 RGBImageFilter
x
- 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, 2022, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.