|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttoxi.math.ScaleMap
public class ScaleMap
This class maps values from one interval into another. By default the mapping
is using linear projection, but can be changed by using alternative
InterpolateStrategy
implementations to achieve a
non-regular mapping.
Constructor Summary | |
---|---|
ScaleMap(double minIn,
double maxIn,
double minOut,
double maxOut)
Creates a new instance to map values between the 2 number ranges specified. |
Method Summary | |
---|---|
double |
getClippedValueFor(double val)
Computes mapped value in the target interval and ensures the input value is clipped to source interval. |
double |
getInputMedian()
|
DoubleRange |
getInputRange()
|
double |
getMappedMedian()
|
double |
getMappedValueFor(double val)
Computes mapped value in the target interval. |
double |
getOutputMedian()
|
DoubleRange |
getOutputRange()
|
void |
setInputRange(double min,
double max)
Sets new minimum & maximum values for the input range |
void |
setMapFunction(InterpolateStrategy func)
Overrides the mapping function used for the scale conversion. |
void |
setOutputRange(double min,
double max)
Sets new minimum & maximum values for the output/target range |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ScaleMap(double minIn, double maxIn, double minOut, double maxOut)
minIn
- maxIn
- minOut
- maxOut
- Method Detail |
---|
public double getClippedValueFor(double val)
val
-
public double getInputMedian()
public DoubleRange getInputRange()
public double getMappedMedian()
getOutputMedian()
.public double getMappedValueFor(double val)
val
-
public double getOutputMedian()
public DoubleRange getOutputRange()
public void setInputRange(double min, double max)
min
- max
- public void setMapFunction(InterpolateStrategy func)
func
- interpolate strategy implementationpublic void setOutputRange(double min, double max)
min
- new min output valuemax
- new max output value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |