Example Use: Rastest.java

	import java.applet.*;
	import java.awt.*;
	import Raster;
	
	public class Rastest extends Applet {
	    Raster raster;
	
	    public void init() {
	        String filename = getParameter("image");
	        raster = new Raster(getImage(getDocumentBase(), filename));
	    }
	
	    public void paint(Graphics g) {
	        Image output = raster.toImage(this);
	        g.drawImage(output, 0, 0, this);
	    }
	
	    public void update(Graphics g) {
	        paint(g);
	    }
	
	    public boolean mouseUp(Event e, int x, int y) {			// not Java 1.1
	        int s = raster.size();
	        for (int i = 0; i < s; i++) {
	            raster.pixel[i] ^= 0x00ffffff;
	        }
	        repaint();
	        return true;
	    }
	}
Lecture 2 Slide 24 6.837 Fall '98