|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.jagrlib.DefaultProperty
cz.cuni.jagrlib.Piece
cz.cuni.jagrlib.DefaultImageFunction
public abstract class DefaultImageFunction
Default implementation of ImageFunction
.
Field Summary | |
---|---|
protected double[] |
background
Background color. |
protected double |
time
Actual time. |
protected double |
xMax
Image function sampling bounds - horizontal maximum. |
protected double |
xMin
Image function sampling bounds - horizontal minimum. |
protected double |
yMax
Image function sampling bounds - vertical maximum. |
protected double |
yMin
Image function sampling bounds - vertical minimum. |
Fields inherited from class cz.cuni.jagrlib.Piece |
---|
channels, info, pl, plugs, reg, TEMPLATE_TYPE, userBreak |
Fields inherited from interface cz.cuni.jagrlib.iface.ImageFunction |
---|
BACKGROUND_COLOR |
Fields inherited from interface cz.cuni.jagrlib.iface.Property |
---|
LOGGING, STATISTICS, TEXT_DESCRIPTION |
Constructor Summary | |
---|---|
DefaultImageFunction()
|
Method Summary | |
---|---|
double[] |
getBounds(double[] pre)
Returns actual bounds for [x,y] (2D coordinates). |
long |
getSample(double x,
double y,
double[] color)
Computes one image sample. |
long |
getSample(double x,
double y,
int order,
int total,
double[] color)
Computes one image sample. |
double |
getTime()
Returns the actual time value for the object (used in animations). |
double[] |
getTimeInterval(double[] pre)
Retrieve the valid bounds for time variable. |
void |
setBounds(double Xmin,
double Xmax,
double Ymin,
double Ymax)
Sets bounds (scaling factors) for the image function (e.g. 2D mapping). |
void |
setTime(double time)
Sets the actual time value for the object (used in animations). |
Methods inherited from class cz.cuni.jagrlib.Piece |
---|
className, connect, findPlug, findPlug, getInfo, getInterface, getInterface, getPlug, getReg, init, isCompatible, isCompatible, isConnected, logError, logWarning, myInterface, newInputPlug, newOptOutputPlug, newOutputPlug, newPlug, noTemplates, propBegin, propBounds, propDefault, propEnd, propEnum, propManipulator, propManipulator, setProgressListener, setRegStrings, setTemplate, setTemplateDynamic, stop |
Methods inherited from class cz.cuni.jagrlib.DefaultProperty |
---|
booleanProperty, booleanProperty, colorDoubleProperty, colorProperty, commit, doubleProperty, doubleProperty, doubleProperty, enumProperty, floatProperty, floatProperty, floatProperty, get, intProperty, intProperty, intProperty, longProperty, longProperty, longProperty, set, set, stringProperty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface cz.cuni.jagrlib.iface.Property |
---|
commit, get, set |
Field Detail |
---|
protected double[] background
protected double time
protected double xMin
protected double xMax
protected double yMin
protected double yMax
Constructor Detail |
---|
public DefaultImageFunction()
Method Detail |
---|
public double[] getTimeInterval(double[] pre)
getTimeInterval
in interface TimeDependent
pre
- Pre-allocated double[2]
array to hold the result (can be
null
).
result[0]
.. minimum time value, result[1]
.. maximum
time value.getTime()
,
setTime(double)
public double getTime()
getTime
in interface TimeDependent
setTime(double)
public void setTime(double time)
setTime
in interface TimeDependent
time
- New scene time (in seconds).getTime()
,
getTimeInterval(double[])
public void setBounds(double Xmin, double Xmax, double Ymin, double Ymax)
setBounds
in interface ImageFunction
Xmin
- Minimum X coordinate.Xmax
- Maximum X coordinate.Ymin
- Minimum Y coordinate.Ymax
- Maximum Y coordinate.getBounds(double[])
public double[] getBounds(double[] pre)
[x,y]
(2D coordinates).
getBounds
in interface ImageFunction
pre
- Pre-allocated (non-mandatory) double[4]
array to hold results:
pre[0]
.. Xmin, pre[1]
.. Xmax,
pre[2]
.. Ymin, pre[3]
.. Ymax.
setBounds(double, double, double, double)
,
TimeDependent.getTimeInterval(double[])
public long getSample(double x, double y, double[] color)
getSample
in interface ImageFunction
x
- X coordinate of the sample.y
- Y coordinate of the sample.color
- Pre-allocated array to hold result color vector (double[1]
for monochrome images, double[3]
for RGB images,
larger arrays can be used for more complex spectral sampling).
getSample(double,double,int,int,double[])
,
getBounds(double[])
public long getSample(double x, double y, int order, int total, double[] color)
getSample
in interface ImageFunction
x
- X coordinate of the sample.y
- Y coordinate of the sample.order
- Order of this sample inside the actual pixel.total
- Total number of samples in the actual pixel.color
- Pre-allocated array to hold result color vector (double[1]
for monochrome images, double[3]
for RGB images,
larger arrays can be used for more complex spectral sampling).
getSample(double,double,double[])
,
getBounds(double[])
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |