com.meltingice.caman.filters
Class Curves

java.lang.Object
  extended by com.meltingice.caman.CamanFilter
      extended by com.meltingice.caman.filters.Curves

public class Curves
extends CamanFilter

Curves implementation loosely based off of Photoshop's similarly named feature. Curves in CamanJ use Bezier curves to convert an input color X into an output color Y based on the Bezier curve. First param is the channels you wish to apply the curve to. This is simply a string with r, g, and or b in it. The rest of the params are the start, control 1, control 2, and end points in x/y pairs. Params: (String, int x 8)

Version:
1.0
Author:
Ryan LeFevre

Constructor Summary
Curves()
           
 
Method Summary
 void precomputeParams()
          Allows the filter to precompute any required values before CamanFilter.process(int[]) is executed.
 int[] process(int[] rgb)
          Processes the given pixel and returns the updated values.
 
Methods inherited from class com.meltingice.caman.CamanFilter
getKernel, getParamDouble, getParamInt, set, set, type
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Curves

public Curves()
Method Detail

precomputeParams

public void precomputeParams()
                      throws InvalidArgumentsException
Description copied from class: CamanFilter
Allows the filter to precompute any required values before CamanFilter.process(int[]) is executed. This helps with speed so that arguments don't have to be recomputed for every pixel.

Overrides:
precomputeParams in class CamanFilter
Throws:
InvalidArgumentsException

process

public int[] process(int[] rgb)
Description copied from class: CamanFilter
Processes the given pixel and returns the updated values.

Overrides:
process in class CamanFilter
Parameters:
rgb - The current pixel's color values rgb[0] => red, rgb[1] => green, rgb[2] => blue
Returns:
The updated RGB color values