Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.

Commit

Permalink
8262497: Delete unused utility methods in ICC_Profile class
Browse files Browse the repository at this point in the history
Reviewed-by: azvegint, pbansal, trebari, kizune
  • Loading branch information
mrserb committed Mar 1, 2021
1 parent 4c9adce commit 682e120
Showing 1 changed file with 2 additions and 53 deletions.
55 changes: 2 additions & 53 deletions src/java.desktop/share/classes/java/awt/color/ICC_Profile.java
Expand Up @@ -1188,41 +1188,6 @@ public void setData(int tagSignature, byte[] tagData) {
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
Expand Down Expand Up @@ -1544,34 +1509,18 @@ static int iccCStoJCS(int theColorSpaceSig) {
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
Expand Down

0 comments on commit 682e120

Please sign in to comment.