private RestrictedICCProfile getICCProfile(CSJ2K.Color.ColorSpace csm)
{
switch (ncomps)
{
case 1:
icc = ICCMonochromeInputProfile.createInstance(csm);
ricc = icc.parse();
if (ricc.Type != RestrictedICCProfile.kMonochromeInput)
throw new System.ArgumentException("wrong ICCProfile type" + " for image");
break;
case 3:
icc = ICCMatrixBasedInputProfile.createInstance(csm);
ricc = icc.parse();
if (ricc.Type != RestrictedICCProfile.kThreeCompInput)
throw new System.ArgumentException("wrong ICCProfile type" + " for image");
break;
default:
throw new System.ArgumentException("illegal number of " + "components (" + ncomps + ") in image");
}
return ricc;
}