January 16, 2014
int redBuffer;
int blueBuffer;
int greenBuffer;
PImage display;
color pixel;
int iterationCount;
void setup(){
iterationCount=0;
redBuffer = int(random(pow(2,32)));
greenBuffer = int(random(pow(2,32)));
blueBuffer = int(random(pow(2,32)));
display =...

int redBuffer;

int blueBuffer;

int greenBuffer;

PImage display;

color pixel;

int iterationCount;

void setup(){

  iterationCount=0;

  redBuffer = int(random(pow(2,32)));

  greenBuffer =  int(random(pow(2,32)));

  blueBuffer =  int(random(pow(2,32)));

  display = createImage(100,100,RGB);

  frameRate(15);

  size(display.width,display.height); 

}

void draw(){

  generatePixels();

  image(display,0,0);

  //display.save(“frameOutput_”+nf(iterationCount,4)+“.png”);

  if (iterationCount < 0){

    exit();

  }

  iterationCount++;

}

void generatePixels(){

  for (int i=0; i<display.pixels.length;i++){

  redBuffer=shift(redBuffer, 26, 2);

  greenBuffer=shift(greenBuffer, 27, 26);

  blueBuffer=shift(blueBuffer, 9, 31);

  pixel = color(int(byte(redBuffer)),int(byte(greenBuffer)),int(byte(blueBuffer)));

  display.pixels[i]=pixel;

  }

  display.updatePixels();

}

int shift(int input, int tapPos1, int tapPos2){

  int register = input << 1 ^ ((input >> tapPos1 & 1) ^ (input >> tapPos2 & 1));

  return register;

}

  1. katrinuddstromer-blog reblogged this from yearoftheglitch
  2. 666inful reblogged this from yearoftheglitch
  3. quietwastelandstudent reblogged this from yearoftheglitch
  4. felixlefix reblogged this from yearoftheglitch
  5. shortcutss reblogged this from yearoftheglitch
  6. adoenoughdone reblogged this from yearoftheglitch
  7. kikuzu reblogged this from himatbshiz-blog
  8. himatbshiz-blog reblogged this from shortcutss
  9. alpha-bravo-charlie-delta reblogged this from yearoftheglitch
  10. arevariousdoourart reblogged this from yearoftheglitch
  11. northern-place reblogged this from yearoftheglitch
  12. ufkngpplmkmesick reblogged this from yearoftheglitch
  13. m-f-luderofficial reblogged this from yearoftheglitch
  14. 2xaa reblogged this from yearoftheglitch
  15. captainamericachopsticks reblogged this from newyorkartdepartment
  16. jwolfspotted-blog reblogged this from newyorkartdepartment
  17. sometemos reblogged this from newyorkartdepartment
  18. longnightsbrokenlights reblogged this from yearoftheglitch
  19. yearoftheglitch posted this