Page 1 of 1

how get quantum depth information

Posted: 2011-02-10T03:26:09-07:00
by ctyszkiewicz
Hello

What function form Image Magick c++ API allows to get the information of number of bytes per color of the image.
I thought that GetImageInfo() is designed for this purpose, however it "initializes image_info to default values". How get the true value eg. read the image header.

Best regards

Cuma

Re: how get quantum depth information

Posted: 2011-02-10T07:48:21-07:00
by magick
The Magick++ API call to return the image depth is modulusDepth():
  • cout << image.modulusDepth() << endl;

Re: how get quantum depth information

Posted: 2011-02-10T09:58:05-07:00
by ctyszkiewicz
magick wrote:The Magick++ API call to return the image depth is modulusDepth():
  • cout << image.modulusDepth() << endl;
In this case on my box the compilator says:
cimmg.cpp:391: error: ‘struct _Image’ has no member named ‘modulusDepth’

Maybe I have older version of Image Magick where Image is not a class. Thank to this error after few trials finally I have find the solution:

(*image).depth

Thanks for help

Cuma