FileDocCategorySizeDatePackage
ICC_ProfileHelper.javaAPI DocAndroid 1.5 API2851Wed May 06 22:41:54 BST 2009org.apache.harmony.awt.gl.color

ICC_ProfileHelper

public class ICC_ProfileHelper extends Object
Includes utility methods for reading ICC profile data. Created to provide public access to ICC_Profile methods for classes outside of java.awt.color

Fields Summary
Constructors Summary
Methods Summary
public static intgetBigEndianFromByteArray(byte[] byteArray, int idx)
Utility method. Gets big endian integer value from the byte array

param
byteArray - byte array
param
idx - byte offset
return
integer value

        return ((byteArray[idx] & 0xFF) << 24)   |
               ((byteArray[idx+1] & 0xFF) << 16) |
               ((byteArray[idx+2] & 0xFF) << 8)  |
               ( byteArray[idx+3] & 0xFF);
    
public static intgetIntFromByteArray(byte[] byteArray, int idx)
Utility method. Gets integer value from the byte array

param
byteArray - byte array
param
idx - byte offset
return
integer value

        return (byteArray[idx] & 0xFF)|
               ((byteArray[idx+1] & 0xFF) << 8) |
               ((byteArray[idx+2] & 0xFF) << 16)|
               ((byteArray[idx+3] & 0xFF) << 24);
    
public static intgetRenderingIntent(java.awt.color.ICC_Profile profile)
Used in ICC_Transform class to check the rendering intent of the profile

param
profile - ICC profile
return
rendering intent

        return getIntFromByteArray(
                profile.getData(ICC_Profile.icSigHead), // pf header
                ICC_Profile.icHdrRenderingIntent
            );
    
public static shortgetShortFromByteArray(byte[] byteArray, int idx)
Utility method. Gets short value from the byte array

param
byteArray - byte array
param
idx - byte offset
return
short value

        return (short) ((byteArray[idx] & 0xFF) |
                       ((byteArray[idx+1] & 0xFF) << 8));