net.wotonomy.ui.swing.components
Class TintedImageFilter

java.lang.Object
  extended by java.awt.image.ImageFilter
      extended by java.awt.image.RGBImageFilter
          extended by net.wotonomy.ui.swing.components.TintedImageFilter
All Implemented Interfaces:
java.awt.image.ImageConsumer, java.lang.Cloneable

public class TintedImageFilter
extends java.awt.image.RGBImageFilter

TintedImageFilter tints all gray pixels half-way towards the value passed into the constructor. This "tints" a mostly grayscale image. This has proven useful for tinting user interface decorative images towards one of the SystemColor constants to better mesh with a platform look and feel.

Version:
$Revision: 893 $
Author:
michael@mpowers.net, $Author: cgruber $

Field Summary
 
Fields inherited from class java.awt.image.RGBImageFilter
canFilterIndexColorModel, newmodel, origmodel
 
Fields inherited from class java.awt.image.ImageFilter
consumer
 
Fields inherited from interface java.awt.image.ImageConsumer
COMPLETESCANLINES, IMAGEABORTED, IMAGEERROR, RANDOMPIXELORDER, SINGLEFRAME, SINGLEFRAMEDONE, SINGLEPASS, STATICIMAGEDONE, TOPDOWNLEFTRIGHT
 
Constructor Summary
TintedImageFilter(java.awt.Color aColor)
           
 
Method Summary
 int filterRGB(int x, int y, int rgb)
           
protected  double getOffset(int colorValue)
          Calculates the offset used to modify color values.
 
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
 

Constructor Detail

TintedImageFilter

public TintedImageFilter(java.awt.Color aColor)
Method Detail

getOffset

protected double getOffset(int colorValue)
Calculates the offset used to modify color values. This method returns half the difference between the specified color level and 192.


filterRGB

public int filterRGB(int x,
                     int y,
                     int rgb)
Specified by:
filterRGB in class java.awt.image.RGBImageFilter


Copyright © 2006 null. All Rights Reserved.