Class Clamp
- java.lang.Object
-
- picasso.parser.language.ExpressionTreeNode
-
- picasso.parser.language.expressions.UnaryFunction
-
- picasso.parser.language.expressions.Clamp
-
- All Implemented Interfaces:
EvaluatableExpression
public class Clamp extends UnaryFunction
Represents the clamp function in the Picasso language. Clamps color values to the range [-1, 1].
-
-
Field Summary
-
Fields inherited from class picasso.parser.language.ExpressionTreeNode
gelementsToValue
-
-
Constructor Summary
Constructors Constructor Description Clamp(ExpressionTreeNode param)Create a clamp expression tree that applies clamp() to the given parameter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RGBColorevaluate(double x, double y)Evaluates this expression at (x, y) by clamping each RGB component to [-1, 1].-
Methods inherited from class picasso.parser.language.expressions.UnaryFunction
equals, toString
-
-
-
-
Constructor Detail
-
Clamp
public Clamp(ExpressionTreeNode param)
Create a clamp expression tree that applies clamp() to the given parameter.- Parameters:
param- the expression whose values we will clamp
-
-
Method Detail
-
evaluate
public RGBColor evaluate(double x, double y)
Evaluates this expression at (x, y) by clamping each RGB component to [-1, 1].- Specified by:
evaluatein interfaceEvaluatableExpression- Specified by:
evaluatein classExpressionTreeNode- Parameters:
x- the value of xy- the value of y- Returns:
- the result of evaluating the expression for the given values of x and y
-
-