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

Variable Index

 o bHeight
 o color
 o height
 o maxX
 o maxY
 o minX
 o minY
 o newBarHeight
 o newC
 o newG
 o newGHeight
 o newGWidth
 o newJob
 o newMaxX
 o newMaxY
 o newMinX
 o newMinY
 o newSource1
 o newSource2
 o newX
 o newY
 o offscrC
 o offscrG
 o offscrImg
 o onscrG
 o source1
 o source2
 o stopDrawingException
 o stopJob
 o width
 o x0
 o y0

Constructor Index

 o FadeIn()

Method Index

 o drawServer()
do an infinite loop that executes drawing jobs
 o isFar(int, int, int, int)
Is pixel (x1,y1) a very different color than pixel (x2,y2)?
 o paint(Graphics, ImageObserver)
Instantly paint the screen from an offscreen buffer
 o redraw(PicPipeList, boolean)
Draw the whole picture with either dots or squares.
 o setGraphics(Graphics)
set the drawing to be going to g instead of its current destination
 o shouldAntialias(int, int)
Should pixel (x,y) be antialiased because its color is currently very different from at least one of its neighbors?
 o 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.
 o stop()
Interrupt the current drawing job, and force a wait for start()

Variables

 o onscrG
 protected Graphics onscrG
 o offscrImg
 protected Image offscrImg
 o offscrG
 protected Graphics offscrG
 o offscrC
 protected byte offscrC[][][]
 o x0
 protected int x0
 o y0
 protected int y0
 o width
 protected int width
 o height
 protected int height
 o bHeight
 protected int bHeight
 o minX
 protected double minX
 o maxX
 protected double maxX
 o minY
 protected double minY
 o maxY
 protected double maxY
 o source1
 protected PicPipeList source1
 o source2
 protected PicPipeList source2
 o color
 protected Colors color
 o stopDrawingException
 protected StopDrawingException stopDrawingException
 o newJob
 protected boolean newJob
 o stopJob
 protected boolean stopJob
 o newG
 protected Graphics newG
 o newC
 protected Component newC
 o newMinX
 protected double newMinX
 o newMaxX
 protected double newMaxX
 o newMinY
 protected double newMinY
 o newMaxY
 protected double newMaxY
 o newX
 protected int newX
 o newY
 protected int newY
 o newGWidth
 protected int newGWidth
 o newGHeight
 protected int newGHeight
 o newBarHeight
 protected int newBarHeight
 o newSource1
 protected PicPipeList newSource1
 o newSource2
 protected PicPipeList newSource2

Constructors

 o FadeIn
 public FadeIn()

Methods

 o stop
 public synchronized void stop()
Interrupt the current drawing job, and force a wait for start()

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

 o paint
 public synchronized void paint(Graphics g,
                                ImageObserver c)
Instantly paint the screen from an offscreen buffer

 o setGraphics
 public void setGraphics(Graphics g)
set the drawing to be going to g instead of its current destination

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

 o 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)?

 o drawServer
 public synchronized void drawServer()
do an infinite loop that executes drawing jobs


All Packages  Class Hierarchy  This Package  Previous  Next  Index