Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

Can't figure out changing from B&W to color in slitscanner

$
0
0

@doleyl1 wrote:

I’m trying to take a sample row of pixels from the top of my video monitor and repeating the sample coming up from the bottom of a separate display screen. When I started the project and it was sampling a vertical row of pixels and repeating the sample left to right, the colors were there. As soon as I switched from vertical to horizontal, the colors on the display went to black and white.

I started with the code from this website to create a basic slitscanner: https://www.instructables.com/id/Experiments-with-slit-scan-photography/

Here is the part of my code that I think the issue may be in:
void ofApp::movePixelsInImage(ofImage * image) {
unsigned char * pixels = image->getPixels().getData(); //equivalent to (image).getPixels();
for (int col=0; colgetWidth()-1; col++) { //Was X
for (int row=0; rowgetHeight(); row++) { //Was y
int position = row
(image->getWidth()3)+col3;
int nextPosition = position+camWidth*3;
pixels[position] = pixels[nextPosition];
pixels[position+1] = pixels[nextPosition+1];
pixels[position+2] = pixels[nextPosition+2];
}
}
image->update();
}

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles