PulpCore

pulpcore.image.filter
Class HSBAdjust

java.lang.Object
  extended by pulpcore.image.filter.Filter
      extended by pulpcore.image.filter.HSBAdjust

public final class HSBAdjust
extends Filter

A HSB adjust filter. This filter uses 3 parameters : hue, saturation, brightness. Each parameter indicates the offset of hue, brightness and saturation to apply to the filtered image. Each of this value can move from -255 to 255. Higher values will be clamped. The alpha channel of the original image is not affected by the filter.

Author:
Florent Dupont

Field Summary
 Int brightness
          Brightness.
 Int hue
          Hue.
 Int saturation
          Saturation.
 
Constructor Summary
HSBAdjust()
          Creates the HSBAdjust filter with the default values (0).
HSBAdjust(int hue, int saturation, int brightness)
          Creates the filters with specific values.
 
Method Summary
 Filter copy()
          Creates a copy of the Filter for another Sprite to use.
protected  void filter(CoreImage src, CoreImage dst)
          Performs this filter on the input image onto the specified output image.
 void update(int elapsedTime)
          Updates the filter.
 
Methods inherited from class pulpcore.image.filter.Filter
filter, getHeight, getInput, getOutput, getWidth, getX, getY, isDirty, isOpaque, setDirty, setInput
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hue

public final Int hue
Hue. Indicates the hue offset this filter will apply to the image. Values from -255 to 255.


saturation

public final Int saturation
Saturation. Indicates the saturation offset this filter will apply to the image. Values from -255 to 255.


brightness

public final Int brightness
Brightness. Indicates the brightness offset this filter will apply to the image. Values from -255 to 255.

Constructor Detail

HSBAdjust

public HSBAdjust()
Creates the HSBAdjust filter with the default values (0).


HSBAdjust

public HSBAdjust(int hue,
                 int saturation,
                 int brightness)
Creates the filters with specific values.

Parameters:
hue - hue offset to apply to the image.
saturation - saturation offset to apply to the image.
brightness - brightness offset to apply to the image.
Method Detail

copy

public Filter copy()
Description copied from class: Filter
Creates a copy of the Filter for another Sprite to use. The input filter is also copied. The properties of the copy, if any, will be bound to the original filter's properties.

This method is used by the Sprite class. Most apps will not need to call this method.

Subclasses should bind all properties of the cloned object using bindWithInverse(). For example, for the HSBAdjust filter:

        public Filter copy() {
            HSBAdjust copy = new HSBAdjust();
            copy.hue.bindWithInverse(hue);
            copy.brightness.bindWithInverse(brightness);
            copy.saturation.bindWithInverse(saturation);
            return copy;
        }
        

Specified by:
copy in class Filter

update

public void update(int elapsedTime)
Description copied from class: Filter
Updates the filter. The default method does nothing.

Overrides:
update in class Filter

filter

protected void filter(CoreImage src,
                      CoreImage dst)
Description copied from class: Filter
Performs this filter on the input image onto the specified output image.

This method is called from Filter.getOutput() if Filter.isDirty() returns true. The output image will be the same dimensions as (Filter.getWidth() x Filter.getHeight(). Implementors must ensure that every pixel in output is drawn.

Specified by:
filter in class Filter

PulpCore

Copyright © 2007-2009 Interactive Pulp, LLC.