Packagecom.threerings.display
Classpublic class FilterUtil

Useful utility methods that wouldn't be needed if the flash API were not so retarded.



Public Methods
 MethodDefined by
  
addFilter(disp:DisplayObject, filter:BitmapFilter):void
[static] Add the specified filter to the DisplayObject.
FilterUtil
  
createHueShift(hue:int):ColorMatrixFilter
[static] Create a filter that, if applied to a DisplayObject, will shift the hue of that object by the given value.
FilterUtil
  
equals(f1:BitmapFilter, f2:BitmapFilter):Boolean
[static] Are the two filters equals?
FilterUtil
  
removeFilter(disp:DisplayObject, filter:BitmapFilter):void
[static] Remove the specified filter from the DisplayObject.
FilterUtil
  
shiftHueBy(original:ColorMatrixFilter, hueShift:int):ColorMatrixFilter
[static] Shift the color matrix filter by the given amount.
FilterUtil
Protected Methods
 MethodDefined by
  
checkArgs(disp:DisplayObject, filter:BitmapFilter):void
[static]
FilterUtil
Method detail
addFilter()method
public static function addFilter(disp:DisplayObject, filter:BitmapFilter):void

Add the specified filter to the DisplayObject.

Parameters
disp:DisplayObject
 
filter:BitmapFilter
checkArgs()method 
protected static function checkArgs(disp:DisplayObject, filter:BitmapFilter):voidParameters
disp:DisplayObject
 
filter:BitmapFilter
createHueShift()method 
public static function createHueShift(hue:int):ColorMatrixFilter

Create a filter that, if applied to a DisplayObject, will shift the hue of that object by the given value.

Parameters
hue:int — a value, in degrees, between -180 and 180.

Returns
ColorMatrixFilter
equals()method 
public static function equals(f1:BitmapFilter, f2:BitmapFilter):Boolean

Are the two filters equals?

Parameters
f1:BitmapFilter
 
f2:BitmapFilter

Returns
Boolean
removeFilter()method 
public static function removeFilter(disp:DisplayObject, filter:BitmapFilter):void

Remove the specified filter from the DisplayObject. Note that the filter set in the DisplayObject is a clone, so the values of the specified filter are used to find a match.

Parameters
disp:DisplayObject
 
filter:BitmapFilter
shiftHueBy()method 
public static function shiftHueBy(original:ColorMatrixFilter, hueShift:int):ColorMatrixFilter

Shift the color matrix filter by the given amount. This is adapted from the code found at http://www.kirupa.com/forum/showthread.php?t=230706

Parameters
original:ColorMatrixFilter — a value, in degrees, between -180 and 180.
 
hueShift:int

Returns
ColorMatrixFilter