On 03/01/2014 at 03:45, xxxxxxxx wrote:
Yes, that is what I thought.
I use GetColorMode.
orgImage->Init(fname, -1, nullptr);
Int32 colorMode = orgImage->GetColorMode(); //The image colormode
Int32 bw = orgImage->GetBw(); //The image width
Int32 bh = orgImage->GetBh(); //The image height
Here also a translation from the Int32 colormode to a String with the colormode description
Perhaps someone might find it useful (it saves typing in).
String modeToString(Int32 colorMode)
{
switch (colorMode)
{
case COLORMODE_ILLEGAL:
return "Illegal";
case COLORMODE_ALPHA:
return "Only 8-bit alpha channel.";
case COLORMODE_GRAY:
return "8-bit grayscale channel.";
case COLORMODE_AGRAY:
return "8-bit grayscale channel with 8-bit alpha.";
case COLORMODE_RGB:
return "8-bit RGB channels.";
case COLORMODE_ARGB:
return "8-bit RGB channels with 8-bit alpha.";
case COLORMODE_CMYK:
return "8-bit CMYK channel.";
case COLORMODE_ACMYK:
return "8-bit CMYK channel with 8-bit alpha.";
case COLORMODE_MASK:
return "8-bit grayscale map as mask.";
case COLORMODE_AMASK:
return "8-bit grayscale map as mask with 8-bit alpha.";
case COLORMODE_ILLEGALw:
return "Illegal.";
case COLORMODE_GRAYw:
return "16-bit grayscale channel.";
case COLORMODE_AGRAYw:
return "16-bit grayscale channel with 16-bit alpha.";
case COLORMODE_RGBw:
return "16-bit RGB channels.";
case COLORMODE_ARGBw:
return "16-bit RGB channels with 16-bit alpha.";
case COLORMODE_MASKw:
return "16-bit grayscale map as mask.";
case COLORMODE_ILLEGALf:
return "Illegal.";
case COLORMODE_GRAYf:
return "Floating point grayscale channel.";
case COLORMODE_AGRAYf:
return "Floating point grayscale channel with floating point alpha.";
case COLORMODE_RGBf:
return "Floating point RGB channels.";
case COLORMODE_ARGBf:
return "Floating point RGB channels with floating point alpha.";
case COLORMODE_MASKf:
return "Floating point grayscale map as mask.";
default:
return "Unknown Colormode: " + String::IntToString(colorMode);
}
}// end String modeToString(Int32 colorMode)