sub_arctic.output
Class mask_filter

java.lang.Object
  |
  +--java.awt.image.ImageFilter
        |
        +--java.awt.image.RGBImageFilter
              |
              +--sub_arctic.output.mask_filter

public class mask_filter
extends java.awt.image.RGBImageFilter

An RGBImageFilter for building images from an intensity mask and a color.

See Also:
RGBImageFilter, loaded_image.image_from_intensity_map(sub_arctic.output.loaded_image, java.awt.Color, int)

Field Summary
protected  double target_h
          H of HSV representation of target.
protected  double target_s
          S of HSV representation of target.
protected  double target_v
          V of HSV representation of target.
protected  int tmp_b
          This is temporary holding place for the B value when we are doing a conversion from HSV to RGB.
protected  int tmp_g
          This is temporary holding place for the G value when we are doing a conversion from HSV to RGB.
protected  int tmp_r
          This is temporary holding place for the R value when we are doing a conversion from HSV to RGB.
protected  int transp_color
          Store the intensity we are using for transparent.
 
Fields inherited from class java.awt.image.RGBImageFilter
canFilterIndexColorModel, newmodel, origmodel
 
Fields inherited from class java.awt.image.ImageFilter
consumer
 
Constructor Summary
mask_filter(java.awt.Color c, int transp_intensity)
           
 
Method Summary
 int filterRGB(int x, int y, int rgb)
          This function gets called for each pixel.
protected  void new_color(double v)
          Convert our HSV representation into a color with a different v value.
protected  void to_hsv(java.awt.Color c)
          Convert an RGB value to RGB.
 
Methods inherited from class java.awt.image.RGBImageFilter
filterIndexColorModel, filterRGBPixels, setColorModel, setPixels, setPixels, substituteColorModel
 
Methods inherited from class java.awt.image.ImageFilter
clone, getFilterInstance, imageComplete, resendTopDownLeftRight, setDimensions, setHints, setProperties
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

target_h

protected double target_h
H of HSV representation of target. Range is [0,360) and -1.0 if H is undefined.

target_s

protected double target_s
S of HSV representation of target. Range is [0,1)

target_v

protected double target_v
V of HSV representation of target. Range is [0,1)

tmp_r

protected int tmp_r
This is temporary holding place for the R value when we are doing a conversion from HSV to RGB.

tmp_g

protected int tmp_g
This is temporary holding place for the G value when we are doing a conversion from HSV to RGB.

tmp_b

protected int tmp_b
This is temporary holding place for the B value when we are doing a conversion from HSV to RGB.

transp_color

protected int transp_color
Store the intensity we are using for transparent.
Constructor Detail

mask_filter

public mask_filter(java.awt.Color c,
                   int transp_intensity)
Method Detail

to_hsv

protected void to_hsv(java.awt.Color c)
Convert an RGB value to RGB. This is section 13.3.4 of Foley & Van Dam.

new_color

protected void new_color(double v)
Convert our HSV representation into a color with a different v value.
Parameters:
double - v the new v value

filterRGB

public int filterRGB(int x,
                     int y,
                     int rgb)
This function gets called for each pixel.
Parameters:
int - x the x coord of the pixel (not used)
int - y the y coord of the pixel (not used)
int - rgb the rgb value (plus the alpha channel)
Returns:
int the new value
Overrides:
filterRGB in class java.awt.image.RGBImageFilter