nebkat
nebkat

Reputation: 8553

PNG++ Read Pixel Color Values

How do I read the pixel color values in a png with png++? I dont see any way of reading values in the documentation. I need to get all the values rgba seperately and append them to a char array.

Upvotes: 2

Views: 4140

Answers (2)

Kleist
Kleist

Reputation: 7995

I've never used png++, but from reading the documentation on pixel I think you can access a pixel (X,Y) of png::image<T> image with image[Y][X] and then access the red, green and blue values by accessing image[Y][X].red, etc.

Upvotes: 2

alex
alex

Reputation: 935

can't add a comment, so here goes :)

Actually, you should want image[Y][X] since first [] gets you to Y-th row, and then to the X-th column in that row.

Btw, I'm the author of PNG++. Feel free to ask more specific questions on the mailing list or at my private email, or here, if you like. :)

Upvotes: 7

Related Questions