get gray values with magick++
Posted: 2006-04-10T13:48:31-07:00
Hello,
I have read a gray pgm-file into the Image object. Can anyone please supply me with an example of how to put the gray values into a vector<int> for example!
is it going to be someting like this:
vector<int> vec;
for( x=0; x<width; x++)
for( y=0; y<height; y++)
vec.push_back( image.get(x,y) )
put get returns a PixelPacket, and how do I get the gray value from that?
many thanks
J
I have read a gray pgm-file into the Image object. Can anyone please supply me with an example of how to put the gray values into a vector<int> for example!
is it going to be someting like this:
vector<int> vec;
for( x=0; x<width; x++)
for( y=0; y<height; y++)
vec.push_back( image.get(x,y) )
put get returns a PixelPacket, and how do I get the gray value from that?
many thanks
J