switch (profileID) { case ColorSpace.CS_sRGB: case ColorSpace.CS_LINEAR_RGB: case ColorSpace.CS_CIEXYZ: return 3; case ColorSpace.CS_GRAY: return 1; case ColorSpace.CS_PYCC: default: throw new UnsupportedOperationException("profile not implemented"); }
int[] lookup = { ColorSpace.TYPE_RGB, 3, ColorSpace.TYPE_CMY, 3, ColorSpace.TYPE_CMYK, 4, ColorSpace.TYPE_GRAY, 1, ColorSpace.TYPE_YCbCr, 3, ColorSpace.TYPE_XYZ, 3, ColorSpace.TYPE_Lab, 3, ColorSpace.TYPE_HSV, 3, ColorSpace.TYPE_2CLR, 2, ColorSpace.TYPE_Luv, 3, ColorSpace.TYPE_Yxy, 3, ColorSpace.TYPE_HLS, 3, ColorSpace.TYPE_3CLR, 3, ColorSpace.TYPE_4CLR, 4, ColorSpace.TYPE_5CLR, 5, ColorSpace.TYPE_6CLR, 6, ColorSpace.TYPE_7CLR, 7, ColorSpace.TYPE_8CLR, 8, ColorSpace.TYPE_9CLR, 9, ColorSpace.TYPE_ACLR, 10, ColorSpace.TYPE_BCLR, 11, ColorSpace.TYPE_CCLR, 12, ColorSpace.TYPE_DCLR, 13, ColorSpace.TYPE_ECLR, 14, ColorSpace.TYPE_FCLR, 15 }; for (int i = 0; i < lookup.length; i += 2) if (header.getColorSpace() == lookup[i]) return lookup[i + 1]; return 3;
  public int getNumComponents()  {    switch (profileID)      {      case ColorSpace.CS_sRGB:      case ColorSpace.CS_LINEAR_RGB:      case ColorSpace.CS_CIEXYZ:	return 3;      case ColorSpace.CS_GRAY:	return 1;      case ColorSpace.CS_PYCC: // have no clue about this one      default:	throw new UnsupportedOperationException("profile not implemented");      }  }