Processing.js

LinearImage

This code was updated from the Java source to work with Processing.js asynchronous image loading.

Click and drag mouse up and down to control the signal. Press and hold any key to watch the scanning.

Original Processing.org Example: LinearImage

// All Examples Written by Casey Reas and Ben Fry
// unless otherwise stated.
PImage a;
boolean onetime = true;
int[] aPixels = new int[200*200];
int direction = 1;

float signal;

void setup() 
{
  size(33, 33);
  stroke(255);
  a = loadImage("data/cait.jpg", null, function(){
    for(int i=0; i