private RenderingIntent getRenderingIntent(ICC_Profile profile) throws IOException { byte[] hdr = profile.getData(ICC_Profile.icSigHead); int value = hdr[ICC_Profile.icHdrRenderingIntent]; return RenderingIntent.fromICCValue(value); }
/** * Creates a new ICC-based color space. * @param p the color profile * @param intent the overriding rendering intent (use {@link RenderingIntent#AUTO} * to preserve the profile's) * @param profileName the color profile name * @param profileURI the source URI of the color profile */ public ICCColorSpaceWithIntent(ICC_Profile p, RenderingIntent intent, String profileName, String profileURI) { super(p); this.intent = intent; /** * Apply the requested intent into the profile */ if (intent != RenderingIntent.AUTO) { byte[] hdr = p.getData(ICC_Profile.icSigHead); hdr[ICC_Profile.icHdrRenderingIntent] = (byte)intent.getIntegerValue(); } this.profileName = profileName; this.profileURI = profileURI; }