All Packages Class Hierarchy This Package Previous Next Index
Class picture.FadeIn
java.lang.Object
|
+----picture.FadeIn
- public class FadeIn
- extends Object
Make a picture fade in by drawing big squares, then smaller ones.
A separate thread does the drawing, and a copy of the screen is kept in
memory so that the screen can be redrawn quickly. Also, an
additional copy is kept as a byte array, so that the 24-bit
image can be examined for antialiasing, or written to a file easily.
Two PicPipeSources are given to this program. The first is used to
color every pixel, then the second, if not null, is used to color
only those pixels that differ greatly from at least one of the 8 neighbors
in at least one of the 3 color components. This allows adaptive
antialiasing if the first pass does just jitter, and the second
averages multiple rays per pixel.
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.01, 25 July 96
- Author:
- Leemon Baird
-
bHeight
-
-
color
-
-
height
-
-
maxX
-
-
maxY
-
-
minX
-
-
minY
-
-
newBarHeight
-
-
newC
-
-
newG
-
-
newGHeight
-
-
newGWidth
-
-
newJob
-
-
newMaxX
-
-
newMaxY
-
-
newMinX
-
-
newMinY
-
-
newSource1
-
-
newSource2
-
-
newX
-
-
newY
-
-
offscrC
-
-
offscrG
-
-
offscrImg
-
-
onscrG
-
-
source1
-
-
source2
-
-
stopDrawingException
-
-
stopJob
-
-
width
-
-
x0
-
-
y0
-
-
FadeIn()
-
-
drawServer()
- do an infinite loop that executes drawing jobs
-
isFar(int, int, int, int)
- Is pixel (x1,y1) a very different color than pixel (x2,y2)?
-
paint(Graphics, ImageObserver)
- Instantly paint the screen from an offscreen buffer
-
redraw(PicPipeList, boolean)
- Draw the whole picture with either dots or squares.
-
setGraphics(Graphics)
- set the drawing to be going to g instead of its current destination
-
shouldAntialias(int, int)
- Should pixel (x,y) be antialiased because its color is currently
very different from at least one of its neighbors?
-
start(Graphics, Component, double, double, double, double, int, int, int, int, int, PicPipeList, PicPipeList)
- Start a new thread that causes the picture to fade in on the screen.
-
stop()
- Interrupt the current drawing job, and force a wait for start()
onscrG
protected Graphics onscrG
offscrImg
protected Image offscrImg
offscrG
protected Graphics offscrG
offscrC
protected byte offscrC[][][]
x0
protected int x0
y0
protected int y0
width
protected int width
height
protected int height
bHeight
protected int bHeight
minX
protected double minX
maxX
protected double maxX
minY
protected double minY
maxY
protected double maxY
source1
protected PicPipeList source1
source2
protected PicPipeList source2
color
protected Colors color
stopDrawingException
protected StopDrawingException stopDrawingException
newJob
protected boolean newJob
stopJob
protected boolean stopJob
newG
protected Graphics newG
newC
protected Component newC
newMinX
protected double newMinX
newMaxX
protected double newMaxX
newMinY
protected double newMinY
newMaxY
protected double newMaxY
newX
protected int newX
newY
protected int newY
newGWidth
protected int newGWidth
newGHeight
protected int newGHeight
newBarHeight
protected int newBarHeight
newSource1
protected PicPipeList newSource1
newSource2
protected PicPipeList newSource2
FadeIn
public FadeIn()
stop
public synchronized void stop()
- Interrupt the current drawing job, and force a wait for start()
start
public synchronized void start(Graphics g,
Component c,
double minX,
double maxX,
double minY,
double maxY,
int x,
int y,
int gWidth,
int gHeight,
int barHeight,
PicPipeList sourcePass1,
PicPipeList sourcePass2)
- Start a new thread that causes the picture to fade in on the screen.
Each pixel is drawn first, then a second pass does antialiasing.
Stops the previously-running thread, if any.
paint
public synchronized void paint(Graphics g,
ImageObserver c)
- Instantly paint the screen from an offscreen buffer
setGraphics
public void setGraphics(Graphics g)
- set the drawing to be going to g instead of its current destination
redraw
public synchronized void redraw(PicPipeList source,
boolean dots) throws StopDrawingException
- Draw the whole picture with either dots or squares.
If dots==true, then it draws dots and a white status bar.
otherwise it draws squares and a black status bar.
- Throws: StopDrawingException
- if the drawing is interrupted
shouldAntialias
protected final boolean shouldAntialias(int x,
int y)
- Should pixel (x,y) be antialiased because its color is currently
very different from at least one of its neighbors?
isFar
protected final boolean isFar(int x1,
int y1,
int x2,
int y2)
- Is pixel (x1,y1) a very different color than pixel (x2,y2)?
drawServer
public synchronized void drawServer()
- do an infinite loop that executes drawing jobs
All Packages Class Hierarchy This Package Previous Next Index