We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
modify slit scan program (Read 1888 times)
modify slit scan program
Apr 26th, 2005, 3:00pm
 
as a absolute beginer i want to modify a existing program for processingALPHA, found at

http://www.flong.com/writings/lists/list_slit_scan_img/jenkins_slit_camera.pde

to use instead of a live video a videofile. Tried with BVideo, but doesn't work yet.


BVideo vid;
int vid_width     = 320;
int vid_height    = 240;
int vid_fetch_loc = vid_width/2;
int window_width    = 800;
int window_height   = video_height;
int sample_width    = 1;

int draw_position   = window_width - sample_width;  // iterator
boolean b_newFrame  = false; // fresh-frame flag

//--------------------------------------------
void setup(){
 size(window_width, window_height);
 loadVideo("MyFile.mov");
 background(0);
}

//--------------------------------------------
void videoEvent() {
 b_newFrame = true;
}

//--------------------------------------------
void loop() {
 if (b_newFrame) {
   replicate(video,
    vid_fetch_loc,   0, vid_fetch_loc+sample_width, vid_height,
    draw_position + 0, 0, draw_position + sample_width, vid_height);
   
   draw_position -= sample_width;
   if (draw_position < 0) {
     draw_position = window_width - sample_width;
   }
   b_newFrame = false;
 }
}



Can someone help me?

-piille-
Re: modify slit scan program
Reply #1 - Apr 26th, 2005, 4:00pm
 
Video stuff has changed quite a bit, and BVideo doesn't exist any more.

The reference for the new functions is here:
http://processing.org/reference/libraries/video/
Page Index Toggle Pages: 1