All Packages Class Hierarchy This Package Previous Next Index
Class picture.PicPipe
java.lang.Object
|
+----picture.PicPipe
- public abstract class PicPipe
- extends Object
- implements Parsable
PicPipe objects are connected together for drawing pictures.
Each one calls the next on the pipeline to get a number or color,
and returns a modified number or color.
Each PicPipe has a method called get() that,
given an (x,y,z,t) coordinate, returns
the color associated with that location (a PicColor).
So it calls its source, then returns the value or color for
location (x,y,z,t). x,y,z,t are doubles representing a point in
the region being drawn (usually (-1..1,-1..1,-1..1,0..1)).
The size of a pixel (dx,dy,dz,dt) is also passed in to allow
antialiasing, edge detection, etc. t is the time of the current frame
in an animation, and dt is the time between the current and next frame.
This code is (c) 1996 Leemon Baird
<leemon@cs.cmu.edu>,
http://www.cs.cmu.edu/~baird
The source and object code may be redistributed freely.
If the code is modified, please state so in the comments.
- Version:
- 1.0, 26 April 96
- Author:
- Leemon Baird
- See Also:
- Colors, PicPipeList
-
desc
-
-
regionMaxX
-
-
regionMaxY
-
-
regionMinX
-
-
regionMinY
-
-
useSourceRegion
-
-
PicPipe()
-
-
BNF(int)
- Return BNF description of parameters for this object, when parsing language lang.
-
get(PicPipeList, Colors, double, double, double, double, double, double, double, double)
- Passing in an object color, change its contents to return a pixel's color.
-
getDescription(PicPipeList)
- Get the string describing what this picture is.
-
getParameters(int)
- Return a parameter array if BNF(), parse(), and unparse() are to be automated, null otherwise.
-
init(PicPipeList)
- Initialize this object, and possibly remove from linked list.
-
initialize(int)
- Initialize, either partially or completely.
-
parse(Parser, int)
- Create/initialize an object from a string describing it in language lang.
-
regionMaxX(PicPipeList)
- Return max x coordinate of region this pipeline looks at
-
regionMaxY(PicPipeList)
- Return max y coordinate of region this pipeline looks at
-
regionMinX(PicPipeList)
- Return min x coordinate of region this pipeline looks at
-
regionMinY(PicPipeList)
- Return min y coordinate of region this pipeline looks at
-
setDescription(String)
- Set the string describing what this picture is.
-
setRegion(double, double, double, double)
- Set the coordinates of the region this pipeline looks at
-
unparse(Unparser, int)
- Output a description of this object and its state.
regionMinX
protected double regionMinX
regionMaxX
protected double regionMaxX
regionMinY
protected double regionMinY
regionMaxY
protected double regionMaxY
desc
protected String desc
useSourceRegion
protected boolean useSourceRegion
PicPipe
public PicPipe()
getParameters
public Object[][] getParameters(int lang)
- Return a parameter array if BNF(), parse(), and unparse() are to be automated, null otherwise.
- See Also:
- getParameters
BNF
public abstract String BNF(int lang)
- Return BNF description of parameters for this object, when parsing language lang.
It should use single quotes around literal strings, * for zero or more,
+ for one or more, [ ] for optional, ( ) for grouping, and should
end with a comment describing it that starts with a dot.
unparse
public abstract void unparse(Unparser u,
int lang)
- Output a description of this object and its state.
If emitName, then output the name of the class first. Create
it so that it can be parsed with the parse command, when it
is parsing with language lang. Output is emitted by calling
u.emit(...).
parse
public abstract Object parse(Parser p,
int lang) throws ParserException
- Create/initialize an object from a string describing it in language lang.
- Throws: ParserException
- parser didn't find the required token
get
public void get(PicPipeList source,
Colors color,
double x,
double y,
double z,
double t,
double dx,
double dy,
double dz,
double dt)
- Passing in an object color, change its contents to return a pixel's color.
This PicPipe may call it's source PicPipe one or more times
first, then modify the values it receives before returning.
If not overridden, the PicPipe does nothing.
init
public PicPipeList init(PicPipeList picPipeList)
- Initialize this object, and possibly remove from linked list.
This object is given a list containing itself and is sources.
It can call its sources and set them up, then remove itself
from the linked list if desired. This method does nothing by
default, and usually will not be implemented in most classes.
setDescription
public void setDescription(String description)
- Set the string describing what this picture is.
getDescription
public String getDescription(PicPipeList source)
- Get the string describing what this picture is.
setRegion
public void setRegion(double minX,
double minY,
double maxX,
double maxY)
- Set the coordinates of the region this pipeline looks at
regionMinX
public double regionMinX(PicPipeList source)
- Return min x coordinate of region this pipeline looks at
regionMaxX
public double regionMaxX(PicPipeList source)
- Return max x coordinate of region this pipeline looks at
regionMinY
public double regionMinY(PicPipeList source)
- Return min y coordinate of region this pipeline looks at
regionMaxY
public double regionMaxY(PicPipeList source)
- Return max y coordinate of region this pipeline looks at
initialize
public void initialize(int level)
- Initialize, either partially or completely.
- See Also:
- initialize
All Packages Class Hierarchy This Package Previous Next Index