/// <summary> /// Returns the RenderingIntent from the specified ICC Profile. /// </summary> private int GetRenderingIntent(ICC_Profile profile) { sbyte[] header = profile.GetData(ICC_Profile.IcSigHead); int index = ICC_Profile.IcHdrRenderingIntent; /* According to ICC spec, only the least-significant 16 bits shall be * used to encode the rendering intent. The most significant 16 bits * shall be set to zero. Thus, we are ignoring two most significant * bytes here. * * See http://www.color.org/ICC1v42_2006-05.pdf, section 7.2.15. */ return(((header[index + 2] & 0xff) << 8) | (header[index + 3] & 0xff)); }