visual.statik.sampled
Class GrayExceptOp

java.lang.Object
  extended by visual.statik.sampled.IdentityOp
      extended by visual.statik.sampled.GrayExceptOp
All Implemented Interfaces:
java.awt.image.BufferedImageOp

public class GrayExceptOp
extends IdentityOp

A BufferedImageOp that returns a gray-scale version with one color (in a particular area) left unchanged

See Also:
"The Design and Implementation of Multimedia Software © 2011"

Constructor Summary
GrayExceptOp(int r, int g, int b)
          Explicit Value Constructor
GrayExceptOp(int r, int g, int b, Metric metric)
          Explicit Value Constructor
 
Method Summary
 java.awt.image.BufferedImage filter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dest)
          Perform the filtering operation
 void setMetric(Metric metric)
          Set the Metric to use to calculate the distance between two colors
 
Methods inherited from class visual.statik.sampled.IdentityOp
createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GrayExceptOp

public GrayExceptOp(int r,
                    int g,
                    int b)
Explicit Value Constructor

Parameters:
r - The red component of the color to leave
g - The green component of the color to leave
b - The blue component of the color to leave

GrayExceptOp

public GrayExceptOp(int r,
                    int g,
                    int b,
                    Metric metric)
Explicit Value Constructor

Parameters:
r - The red component of the color to leave
g - The green component of the color to leave
b - The blue component of the color to leave
metric - The Metric to use to determine if two colors are similar
Method Detail

filter

public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage src,
                                           java.awt.image.BufferedImage dest)
Perform the filtering operation

Specified by:
filter in interface java.awt.image.BufferedImageOp
Overrides:
filter in class IdentityOp
Parameters:
src - The source image
dest - An empty image in which to srote the result (or null)

setMetric

public void setMetric(Metric metric)
Set the Metric to use to calculate the distance between two colors

Parameters:
metric - The Metric to use


Design and Implementation of Multimedia Software, Jones and Bartlett Publishers