I'll try to summarize what I'd like to achieve:
A continuous live effect where each displayed line have a delay equal to its position. That means the first line of the image has no delay, the second line has one frame delay, the 500th line has 500 frames delay. I tried to illustrate that with the following: (the rocket is rotating)

I imagine the left part as a large image/frame 'fifo' or rotating buffer, and the process is executed for each new frame from the camera, in order to have a continuous animation.
I manage to create this behavior with Processing as I'm more comfortable with Java. The following code work at ~20 fps with an image size of 300^3 pixels:
Code: Select all
img = new PImage[video_size];
imgDest = createImage(video_size, video_size, RGB);
for (int j = 0; j < img.length; j++) {
img[j] = createImage(video_size, video_size, RGB);
}
// [...]
void draw() {
// If the camera is sending new data, capture that data
if (video.available()) {
video.read();
img[imgIndex%video_size].copy(video, 0,0,video_size,video_size,0,0,video_size,video_size);
for(int i=0; i<video_size; i++){
imgDest.copy(img[(imgIndex + i)%video_size], 0, i, video_size, 1, 0, i, video_size, 1);
}
imgIndex++;
}
image(imgDest, 0, 0, video_size, video_size);
}
I dug a bit in the raspistill code, and the following is where I would like to have advice:
I saw in RaspiTexUtil.c in
Code: Select all
int raspitexutil_do_update_texture(EGLDisplay display, EGLenum target,
EGLClientBuffer mm_buf, GLuint *texture, EGLImageKHR *egl_image)
To compute the displayed image, I imagine I could draw the complete stack of image/texture and select only the right pixel line using a shader. This part as well is completely new for me. I'm starting learning the basics of GL drawing, but in the meantime if someone has advice to compute the image (by extracting every lines from an images buffer), in an efficient way, I would appreciate a lot.
It was a lengthy post, thanks for reading!