FileDocCategorySizeDatePackage
ColorPanCycle.javaAPI DocExample727Fri Jun 07 02:54:24 BST 1996None

ColorPanCycle

public class ColorPanCycle extends Object implements FrameARGBData

Fields Summary
int
frame
int
width
int
height
private int[]
pixels
Constructors Summary
ColorPanCycle(int w, int h)


	       
		width = w;
		height = h;
		pixels = new int [ width * height ];
		nextFrame();
	
Methods Summary
public synchronized int[]getPixels()

		return pixels;
	
public synchronized voidnextFrame()

		int index = 0;
		for (int y = 0; y < height; y++) {
			for (int x = 0; x < width; x++) {
				int red = (y * 255) / (height - 1);
				int green = (x * 255) / (width - 1);
				int blue = (frame * 10) & 0xff;
				pixels[index++] = 
					(255 << 24) | (red << 16) | (green << 8) | blue;
			}
		}
		frame++;
	
public java.awt.Dimensionsize()

		return new Dimension ( width, height );