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

[ error ] ofPixels: format doesn't support channels

$
0
0

@Cici wrote:

SOLVED
Hello,

I am copying color information from an image into an ofMesh by first converting it to ofPixels and then accessing the color information. In order to do that I wrote the following code (this is a simplified version):

ofPixels curvePixels;
curvePixels.setImageType(OF_IMAGE_COLOR);
curvePixels = anImage.getPixels();

ofColor color = curvePixels.getColor(x, y);

            aMesh.addVertex(pixel);
            aMesh.addColor(color);

This code works. It does exactly what I want. But it throws the following error messages, every time when I call .getColor:

[ error ] ofPixels: format doesn't support channels
[warning] returning color not supported yet for UNKOWN format

Can anybody tell me how I can prevent those errors?
Thanks!
Marko
=================
As I only noticed after I sent this post, I solved my mistake unknowingly while I copied the code to this post.
I had originally defined the variable color as ofFloatColor. However, it has to be ofColor, because this is what ofPixel::getColor() returns.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles