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

Q: How to set colors NON-LINEARLY from image to videograbber

$
0
0

@Buoyancist wrote:

Hi. I have a working project based on the meshfromcamera example. However I'd like set part of the colors of the camera stream so that part of the vidgrabber screen would constitute of these rectangle bits of a jpg file. I couldn't find a solution to this, every where I looked the vertex colors are set linearily, so that it sets one vertex after another. For example like this:

for (int i= 0); i<vidGrabber.getWidth()*vidGrabber.getHeight(); i+=1) {
  int x = mainMesh.getVertex(i).x;
  int y = mainMesh.getVertex(i).y;
  mainMesh.setColor(i, jpgFile.getColor(x,y));
 }

How could I do this by setting the vertex so that it would go only let's say 100 lines in X and then changes to Y so I could change rectangle areas of the vidgrabber stream. So basically how to set vertex colors in [x][y] style?

Thanks!

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles