src/share/native/sun/java2d/cmm/lcms/LCMS.c

Print this page




  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 #include <stdio.h>
  27 #include <stdlib.h>
  28 #include <memory.h>
  29 #include "sun_java2d_cmm_lcms_LCMS.h"
  30 #include "jni_util.h"
  31 #include "Trace.h"
  32 #include "Disposer.h"
  33 #include "lcms2.h"
  34 #include "jlong.h"
  35 
  36 
  37 #define ALIGNLONG(x) (((x)+3) & ~(3))         // Aligns to DWORD boundary
  38 
  39 #ifdef USE_BIG_ENDIAN
  40 #define AdjustEndianess32(a)
  41 #else
  42 
  43 static
  44 void AdjustEndianess32(cmsUInt8Number *pByte)
  45 {
  46     cmsUInt8Number temp1;
  47     cmsUInt8Number temp2;
  48 
  49     temp1 = *pByte++;
  50     temp2 = *pByte++;
  51     *(pByte-1) = *pByte;
  52     *pByte++ = temp2;
  53     *(pByte-3) = *pByte;




  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 #include <stdio.h>
  27 #include <stdlib.h>
  28 #include <memory.h>
  29 #include "sun_java2d_cmm_lcms_LCMS.h"
  30 #include "jni_util.h"
  31 #include "Trace.h"
  32 #include "Disposer.h"
  33 #include <lcms2.h>
  34 #include "jlong.h"
  35 
  36 
  37 #define ALIGNLONG(x) (((x)+3) & ~(3))         // Aligns to DWORD boundary
  38 
  39 #ifdef USE_BIG_ENDIAN
  40 #define AdjustEndianess32(a)
  41 #else
  42 
  43 static
  44 void AdjustEndianess32(cmsUInt8Number *pByte)
  45 {
  46     cmsUInt8Number temp1;
  47     cmsUInt8Number temp2;
  48 
  49     temp1 = *pByte++;
  50     temp2 = *pByte++;
  51     *(pByte-1) = *pByte;
  52     *pByte++ = temp2;
  53     *(pByte-3) = *pByte;