/* くり貫き ImageFilter Ver 0.20 */ /* */ /* */ /* by Atsushi 98/4/28 */ package net.antun.lib.awt.image; import java.awt.Color; import java.awt.image.RGBImageFilter; public class GougeImageFilter extends RGBImageFilter { /* --- Field --- */ private Color color; private int rangeR,rangeG,rangeB; /* --- Constructor --- */ public GougeImageFilter(Color color) { this.color=color; canFilterIndexColorModel=true; } /* --- フィルタリング --- */ public int filterRGB(int x,int y,int rgb) { return (((rgb & 0x00ffffff)==color.getRGB()) ? 0 : rgb); } /* --- 文字列化 --- */ public String toString() { return getClass().getName()+"[r="+color.getRed()+ ",g="+color.getGreen()+ ",b="+color.getBlue()+"]"; } }