GMU:Processing im Park/Josephine Jatzlau: Difference between revisions

From Medien Wiki
(Blanked the page)
 
(16 intermediate revisions by one other user not shown)
Line 1: Line 1:
==Josephine Jatzlau==


=== ''homework 1'' ===
[[File:Kolibri.gif]]
'''Kolibri'''
----
''here is my first homework
didn't manage it to upload the code
''
=== ''homework 2'' ===
[[File:Moon-collage.jpg]]
'''Moon'''
[[File:Moon-Collage2.jpg]]
'''Moon 2.0'''
----
=== ''homework 3'' ===
[[File:Grumpy.jpg]]
'''Grumpy Cat Fusion'''
----
=== ''Pixel Sorting'' ===
[[File:pxl-old.png |thumb|left|400px]]
=== ''Video Delay'' ===
[https://vimeo.com/152994562 BeeGees Video Delay]
//
import processing.video.*;
Movie myMovie;
int maxFrames;
int d = 4;
boolean recording = false;
ArrayList frames = new ArrayList();
void setup() {
  size(1280, 720);
  maxFrames = width / d;
 
  myMovie = new Movie(this, "NightFever.mp4");
  myMovie.loop();
 
  PImage img = createImage(width, height, RGB);
  frames.add(img);
}
void draw() {
  int n = frames.size();
 
  image(myMovie, 0, 0);
 
  // iterate over vertical strips
  for(int i = 0; i < n; i++) {
    // get snip from the frame
    PImage img = (PImage) frames.get(i);
    // x coordinate for the left side of the current strip
    int x1 = int(map(i, 0, n-1, 0, width/2 - 100));
    int y1 = int(map(i, 0, n-1, 0, height/2 - 100));
    int x2 = width - x1;
    int y2 = height - y1;
    int w = x2 - y1;
    int h = y2 - y1;
    PImage snip = img.get(x1, y1, w, h);
    // show strip on screen
    //tint(255, 50);
    image(snip, x1, y1);
}
if(recording) {
  saveFrame("frame/####.png");
    // recording feedback
    stroke(255, 0, 0);
    noFill();
    strokeWeight(5);
    rect(0, 0, width, height);
  }
}
void keyPressed() {
  recording = !recording;
}
// Called every time a new frame is available to read
void movieEvent(Movie m) {
  m.read();
 
  PImage img = myMovie.get();
  frames.add(img);
  if( frames.size() > maxFrames) {
    frames.remove(0);
  }
}

Latest revision as of 15:19, 8 April 2020