public abstract class RGBImageFilter extends ImageFilter
class RedBlueSwapFilter extends RGBImageFilter {
public RedBlueSwapFilter() {
// The filter's operation does not depend on the
// pixel's location, so IndexColorModels can be
// filtered directly.
canFilterIndexColorModel = true;
}
public int filterRGB(int x, int y, int rgb) {
return ((rgb & 0xff00ff00)
| ((rgb & 0xff0000) >> 16)
| ((rgb & 0xff) << 16));
}
}
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
canFilterIndexColorModel
这个布尔值指示是否将颜色过滤的filterrgb方法来代替像素indexcolormodel对象的颜色表项的像素滤波可接受。
|
protected ColorModel |
newmodel
这
ColorModel取代
origmodel当用户调用
substituteColorModel。
|
protected ColorModel |
origmodel
|
consumerCOMPLETESCANLINES, IMAGEABORTED, IMAGEERROR, RANDOMPIXELORDER, SINGLEFRAME, SINGLEFRAMEDONE, SINGLEPASS, STATICIMAGEDONE, TOPDOWNLEFTRIGHT| Constructor and Description |
|---|
RGBImageFilter() |
| Modifier and Type | Method and Description |
|---|---|
IndexColorModel |
filterIndexColorModel(IndexColorModel icm)
滤波器的一个indexcolormodel对象运行在其颜色表的每一项通过rgbimagefilter子类必须提供filterrgb功能。
|
abstract int |
filterRGB(int x, int y, int rgb)
子类必须指定一个将单输入像素的RGB色彩模型在默认为单输出像素的方法。
|
void |
filterRGBPixels(int x, int y, int w, int h, int[] pixels, int off, int scansize)
在默认的RGB色彩模型过滤器的像素缓冲区通过逐一通过filterrgb方法。
|
void |
setColorModel(ColorModel model)
如果要为indexcolormodel和子类具有设置canfilterindexcolormodel标志为true,我们用过滤版的彩色模型的地方,原来要对象出现在SetPixels方法。
|
void |
setPixels(int x, int y, int w, int h, ColorModel model, byte[] pixels, int off, int scansize)
如果要对象是同一个,已被转换,然后通过像素要通过与转换。
|
void |
setPixels(int x, int y, int w, int h, ColorModel model, int[] pixels, int off, int scansize)
如果要对象是同一个,已被转换,然后通过像素要通过与转换,否则将整数像素的RGB色彩模型的缓冲区,通过转换缓冲区的filterrgbpixels方法要转换一个一个。
|
void |
substituteColorModel(ColorModel oldcm, ColorModel newcm)
要注册两物体替代。
|
clone, getFilterInstance, imageComplete, resendTopDownLeftRight, setDimensions, setHints, setPropertiesprotected ColorModel origmodel
protected ColorModel newmodel
ColorModel取代
origmodel当用户调用
substituteColorModel。
protected boolean canFilterIndexColorModel
public void setColorModel(ColorModel model)
注:此方法用于被其像素被过滤的Image的ImageProducer。开发人员使用这个类来过滤图像中的像素应该避免直接调用这个方法,因为该操作可能会干扰滤波操作。
setColorModel 接口
ImageConsumer
setColorModel 方法重写,继承类
ImageFilter
model -指定
ColorModel
ImageConsumer,
ColorModel.getRGBdefault()
public void substituteColorModel(ColorModel oldcm, ColorModel newcm)
oldcm -要被替换的飞行物体
newcm -要对象来代替对飞oldcm
public IndexColorModel filterIndexColorModel(IndexColorModel icm)
icm - indexcolormodel对象进行过滤
NullPointerException -如果
icm是空的
public void filterRGBPixels(int x,
int y,
int w,
int h,
int[] pixels,
int off,
int scansize)
x的像素区域左上角的x坐标
y的像素区域的左上角的Y坐标
w -像素区域的宽度
h -像素区域的高度
pixels -像素阵列
off -偏移到
pixels阵列
scansize -从一行的像素距离下一个数组中
ColorModel.getRGBdefault(),
filterRGB(int, int, int)
public void setPixels(int x,
int y,
int w,
int h,
ColorModel model,
byte[] pixels,
int off,
int scansize)
注:此方法用于被其像素被过滤的Image的ImageProducer。开发人员使用这个类来过滤图像中的像素应该避免直接调用这个方法,因为该操作可能会干扰滤波操作。
setPixels 接口
ImageConsumer
setPixels 方法重写,继承类
ImageFilter
x的x坐标的像素区域的左上角是集
y的像素区域的左上角要设置的Y坐标
w -像素区域的宽度
h -像素区域的高度
model -指定
ColorModel
pixels -像素阵列
pixels阵列
off -
scansize -从一行像素的距离在
pixels阵下
ColorModel.getRGBdefault(),
filterRGBPixels(int, int, int, int, int[], int, int)
public void setPixels(int x,
int y,
int w,
int h,
ColorModel model,
int[] pixels,
int off,
int scansize)
注:此方法用于被其像素被过滤的Image的ImageProducer。开发人员使用这个类来过滤图像中的像素应该避免直接调用这个方法,因为该操作可能会干扰滤波操作。
setPixels 接口
ImageConsumer
setPixels 方法重写,继承类
ImageFilter
x的x坐标的像素区域的左上角是集
y的像素区域的左上角要设置的Y坐标
w -像素区域的宽度
h -像素区域的高度
model -指定
ColorModel
pixels -像素阵列
off -偏移到
pixels阵列
scansize -从一行像素的距离在
pixels阵下
ColorModel.getRGBdefault(),
filterRGBPixels(int, int, int, int, int[], int, int)
public abstract int filterRGB(int x,
int y,
int rgb)
x -像素的x坐标
y -像素点的Y坐标
rgb -在默认的RGB颜色模型的整数像素表示
ColorModel.getRGBdefault(),
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, 2014, Oracle and/or its affiliates. All rights reserved.