// the tags required by the two types.
// First look for the gray TRC tag. If the profile is indeed an input profile, and this
// tag exists, then the profile is a Monochrome Input profile
ICCCurveType grayTag = (ICCCurveType) tags.get(new Integer(kdwGrayTRCTag));
if (grayTag != null) {
return RestrictedICCProfile.createInstance (grayTag); }
// If it wasn't a Monochrome Input profile, look for the Red Colorant tag. If that
// tag is found and the profile is indeed an input profile, then this profile is
// a Three-Component Matrix-Based Input profile
ICCCurveType rTRCTag = (ICCCurveType) tags.get(new Integer(kdwRedTRCTag));
if (rTRCTag != null) {
ICCCurveType gTRCTag = (ICCCurveType) tags.get(new Integer(kdwGreenTRCTag));
ICCCurveType bTRCTag = (ICCCurveType) tags.get(new Integer(kdwBlueTRCTag));
ICCXYZType rColorantTag = (ICCXYZType) tags.get(new Integer(kdwRedColorantTag));
ICCXYZType gColorantTag = (ICCXYZType) tags.get(new Integer(kdwGreenColorantTag));
ICCXYZType bColorantTag = (ICCXYZType) tags.get(new Integer(kdwBlueColorantTag));
return RestrictedICCProfile.createInstance
(rTRCTag, gTRCTag, bTRCTag, rColorantTag, gColorantTag, bColorantTag); }