diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 18:28:45 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 18:28:45 -0800 |
commit | d5193d9394c5e58176d7bcdf50ef017f8a3b9e1e (patch) | |
tree | 4b825dc642cb6eb9a060e54bf8d69288fbee4904 /awt/org/apache/harmony/awt/gl/color/ICC_ProfileHelper.java | |
parent | 43aa2b1cbf7a03e248e10f4d0fec0463257cd52d (diff) | |
download | frameworks_native-d5193d9394c5e58176d7bcdf50ef017f8a3b9e1e.zip frameworks_native-d5193d9394c5e58176d7bcdf50ef017f8a3b9e1e.tar.gz frameworks_native-d5193d9394c5e58176d7bcdf50ef017f8a3b9e1e.tar.bz2 |
auto import from //depot/cupcake/@135843
Diffstat (limited to 'awt/org/apache/harmony/awt/gl/color/ICC_ProfileHelper.java')
-rw-r--r-- | awt/org/apache/harmony/awt/gl/color/ICC_ProfileHelper.java | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/awt/org/apache/harmony/awt/gl/color/ICC_ProfileHelper.java b/awt/org/apache/harmony/awt/gl/color/ICC_ProfileHelper.java deleted file mode 100644 index 2f7e519..0000000 --- a/awt/org/apache/harmony/awt/gl/color/ICC_ProfileHelper.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @author Oleg V. Khaschansky - * @version $Revision$ - */ -package org.apache.harmony.awt.gl.color; - -import java.awt.color.ICC_Profile; - -/** - * Includes utility methods for reading ICC profile data. - * Created to provide public access to ICC_Profile methods - * for classes outside of java.awt.color - */ -public class ICC_ProfileHelper { - /** - * Utility method. - * Gets integer value from the byte array - * @param byteArray - byte array - * @param idx - byte offset - * @return integer value - */ - public static int getIntFromByteArray(byte[] byteArray, int idx) { - return (byteArray[idx] & 0xFF)| - ((byteArray[idx+1] & 0xFF) << 8) | - ((byteArray[idx+2] & 0xFF) << 16)| - ((byteArray[idx+3] & 0xFF) << 24); - } - - /** - * Utility method. - * Gets big endian integer value from the byte array - * @param byteArray - byte array - * @param idx - byte offset - * @return integer value - */ - public static int getBigEndianFromByteArray(byte[] byteArray, int idx) { - return ((byteArray[idx] & 0xFF) << 24) | - ((byteArray[idx+1] & 0xFF) << 16) | - ((byteArray[idx+2] & 0xFF) << 8) | - ( byteArray[idx+3] & 0xFF); - } - - /** - * Utility method. - * Gets short value from the byte array - * @param byteArray - byte array - * @param idx - byte offset - * @return short value - */ - public static short getShortFromByteArray(byte[] byteArray, int idx) { - return (short) ((byteArray[idx] & 0xFF) | - ((byteArray[idx+1] & 0xFF) << 8)); - } - - /** - * Used in ICC_Transform class to check the rendering intent of the profile - * @param profile - ICC profile - * @return rendering intent - */ - public static int getRenderingIntent(ICC_Profile profile) { - return getIntFromByteArray( - profile.getData(ICC_Profile.icSigHead), // pf header - ICC_Profile.icHdrRenderingIntent - ); - } -} |