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

Variable Index

 o desc
 o regionMaxX
 o regionMaxY
 o regionMinX
 o regionMinY
 o useSourceRegion

Constructor Index

 o PicPipe()

Method Index

 o BNF(int)
Return BNF description of parameters for this object, when parsing language lang.
 o 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.
 o getDescription(PicPipeList)
Get the string describing what this picture is.
 o getParameters(int)
Return a parameter array if BNF(), parse(), and unparse() are to be automated, null otherwise.
 o init(PicPipeList)
Initialize this object, and possibly remove from linked list.
 o initialize(int)
Initialize, either partially or completely.
 o parse(Parser, int)
Create/initialize an object from a string describing it in language lang.
 o regionMaxX(PicPipeList)
Return max x coordinate of region this pipeline looks at
 o regionMaxY(PicPipeList)
Return max y coordinate of region this pipeline looks at
 o regionMinX(PicPipeList)
Return min x coordinate of region this pipeline looks at
 o regionMinY(PicPipeList)
Return min y coordinate of region this pipeline looks at
 o setDescription(String)
Set the string describing what this picture is.
 o setRegion(double, double, double, double)
Set the coordinates of the region this pipeline looks at
 o unparse(Unparser, int)
Output a description of this object and its state.

Variables

 o regionMinX
 protected double regionMinX
 o regionMaxX
 protected double regionMaxX
 o regionMinY
 protected double regionMinY
 o regionMaxY
 protected double regionMaxY
 o desc
 protected String desc
 o useSourceRegion
 protected boolean useSourceRegion

Constructors

 o PicPipe
 public PicPipe()

Methods

 o getParameters
 public Object[][] getParameters(int lang)
Return a parameter array if BNF(), parse(), and unparse() are to be automated, null otherwise.

See Also:
getParameters
 o 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.

 o 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(...).

 o 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
 o 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.

 o 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.

 o setDescription
 public void setDescription(String description)
Set the string describing what this picture is.

 o getDescription
 public String getDescription(PicPipeList source)
Get the string describing what this picture is.

 o setRegion
 public void setRegion(double minX,
                       double minY,
                       double maxX,
                       double maxY)
Set the coordinates of the region this pipeline looks at

 o regionMinX
 public double regionMinX(PicPipeList source)
Return min x coordinate of region this pipeline looks at

 o regionMaxX
 public double regionMaxX(PicPipeList source)
Return max x coordinate of region this pipeline looks at

 o regionMinY
 public double regionMinY(PicPipeList source)
Return min y coordinate of region this pipeline looks at

 o regionMaxY
 public double regionMaxY(PicPipeList source)
Return max y coordinate of region this pipeline looks at

 o initialize
 public void initialize(int level)
Initialize, either partially or completely.

See Also:
initialize

All Packages  Class Hierarchy  This Package  Previous  Next  Index