8262497: Delete unused utility methods in ICC_Profile class

Reviewed-by: azvegint, pbansal, trebari, kizune
This commit is contained in:
Sergey Bylokhov 2021-03-01 19:31:05 +00:00
parent 4c9adce20d
commit 682e120235

View File

@ -1188,41 +1188,6 @@ public class ICC_Profile implements Serializable {
CMSManager.getModule().setTagData(cmmProfile, tagSignature, tagData);
}
/**
* Sets the rendering intent of the profile. This is used to select the
* proper transform from a profile that has multiple transforms.
*/
void setRenderingIntent(int renderingIntent) {
byte[] theHeader = getData(icSigHead);/* getData will activate deferred
profiles if necessary */
intToBigEndian (renderingIntent, theHeader, icHdrRenderingIntent);
/* set the rendering intent */
setData (icSigHead, theHeader);
}
/**
* Returns the rendering intent of the profile. This is used to select the
* proper transform from a profile that has multiple transforms. It is
* typically set in a source profile to select a transform from an output
* profile.
*/
int getRenderingIntent() {
byte[] theHeader = getData(icSigHead);/* getData will activate deferred
profiles if necessary */
int renderingIntent = intFromBigEndian(theHeader, icHdrRenderingIntent);
/* set the rendering intent */
/* 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 (0xffff & renderingIntent);
}
/**
* Returns the number of color components in the "input" color space of this
* profile. For example if the color space type of this profile is
@ -1544,34 +1509,18 @@ public class ICC_Profile implements Serializable {
return theColorSpace;
}
static int intFromBigEndian(byte[] array, int index) {
private static int intFromBigEndian(byte[] array, int index) {
return (((array[index] & 0xff) << 24) |
((array[index+1] & 0xff) << 16) |
((array[index+2] & 0xff) << 8) |
(array[index+3] & 0xff));
}
static void intToBigEndian(int value, byte[] array, int index) {
array[index] = (byte) (value >> 24);
array[index+1] = (byte) (value >> 16);
array[index+2] = (byte) (value >> 8);
array[index+3] = (byte) (value);
}
static short shortFromBigEndian(byte[] array, int index) {
private static short shortFromBigEndian(byte[] array, int index) {
return (short) (((array[index] & 0xff) << 8) |
(array[index+1] & 0xff));
}
static void shortToBigEndian(short value, byte[] array, int index) {
array[index] = (byte) (value >> 8);
array[index+1] = (byte) (value);
}
/**
* {@code fileName} may be an absolute or a relative file specification.
* Relative file names are looked for in several places: first, relative to