jdk/src/java.desktop/share/native/liblcms/cmspack.c
author prr
Tue, 26 Jul 2016 11:50:19 -0700
changeset 40152 35cbab101a76
parent 30491 ea1c291ee28f
permissions -rw-r--r--
8162488: JDK should be updated to use LittleCMS 2.8 Reviewed-by: serb, psadhukhan
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2394
diff changeset
     6
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2394
diff changeset
     8
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2394
diff changeset
    20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2394
diff changeset
    21
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2394
diff changeset
    22
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
// This file is available under and governed by the GNU General Public
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
// License version 2 only, as published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
// However, the following notice accompanied the original version of this
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
// file:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
//
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    30
//---------------------------------------------------------------------------------
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    31
//
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    32
//  Little Color Management System
40152
35cbab101a76 8162488: JDK should be updated to use LittleCMS 2.8
prr
parents: 30491
diff changeset
    33
//  Copyright (c) 1998-2016 Marti Maria Saguer
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
//
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
// Permission is hereby granted, free of charge, to any person obtaining
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
// a copy of this software and associated documentation files (the "Software"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
// to deal in the Software without restriction, including without limitation
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
// and/or sell copies of the Software, and to permit persons to whom the Software
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
// is furnished to do so, subject to the following conditions:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
//
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
// The above copyright notice and this permission notice shall be included in
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
// all copies or substantial portions of the Software.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
//
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
// THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    52
//
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    53
//---------------------------------------------------------------------------------
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    54
//
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    55
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    56
#include "lcms2_internal.h"
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    57
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    58
// This module handles all formats supported by lcms. There are two flavors, 16 bits and
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    59
// floating point. Floating point is supported only in a subset, those formats holding
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
    60
// cmsFloat32Number (4 bytes per component) and double (marked as 0 bytes per component
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
    61
// as special case)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
// ---------------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
// This macro return words stored as big endian
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    67
#define CHANGE_ENDIAN(w)    (cmsUInt16Number) ((cmsUInt16Number) ((w)<<8)|((w)>>8))
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
// These macros handles reversing (negative)
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    70
#define REVERSE_FLAVOR_8(x)     ((cmsUInt8Number) (0xff-(x)))
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    71
#define REVERSE_FLAVOR_16(x)    ((cmsUInt16Number)(0xffff-(x)))
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    72
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    73
// * 0xffff / 0xff00 = (255 * 257) / (255 * 256) = 257 / 256
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    74
cmsINLINE cmsUInt16Number FomLabV2ToLabV4(cmsUInt16Number x)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    75
{
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
    76
    int a = (x << 8 | x) >> 8;  // * 257 / 256
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    77
    if ( a > 0xffff) return 0xffff;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    78
    return (cmsUInt16Number) a;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    79
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    80
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    81
// * 0xf00 / 0xffff = * 256 / 257
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    82
cmsINLINE cmsUInt16Number FomLabV4ToLabV2(cmsUInt16Number x)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    83
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    84
    return (cmsUInt16Number) (((x << 8) + 0x80) / 257);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    85
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    86
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    87
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    88
typedef struct {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    89
    cmsUInt32Number Type;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    90
    cmsUInt32Number Mask;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
    91
    cmsFormatter16  Frm;
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    92
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    93
} cmsFormatters16;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    94
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    95
typedef struct {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    96
    cmsUInt32Number    Type;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    97
    cmsUInt32Number    Mask;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
    98
    cmsFormatterFloat  Frm;
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
    99
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   100
} cmsFormattersFloat;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   101
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   102
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   103
#define ANYSPACE        COLORSPACE_SH(31)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   104
#define ANYCHANNELS     CHANNELS_SH(15)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   105
#define ANYEXTRA        EXTRA_SH(7)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   106
#define ANYPLANAR       PLANAR_SH(1)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   107
#define ANYENDIAN       ENDIAN16_SH(1)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   108
#define ANYSWAP         DOSWAP_SH(1)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   109
#define ANYSWAPFIRST    SWAPFIRST_SH(1)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   110
#define ANYFLAVOR       FLAVOR_SH(1)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   111
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
40152
35cbab101a76 8162488: JDK should be updated to use LittleCMS 2.8
prr
parents: 30491
diff changeset
   113
// Suppress waning about info never being used
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
#ifdef _MSC_VER
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
#pragma warning(disable : 4100)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   119
// Unpacking routines (16 bits) ----------------------------------------------------------------------------------------
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   120
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   121
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   122
// Does almost everything but is slow
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   123
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   124
cmsUInt8Number* UnrollChunkyBytes(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   125
                                  register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   126
                                  register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   127
                                  register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   128
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   129
    int nChan      = T_CHANNELS(info -> InputFormat);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   130
    int DoSwap     = T_DOSWAP(info ->InputFormat);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   131
    int Reverse    = T_FLAVOR(info ->InputFormat);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   132
    int SwapFirst  = T_SWAPFIRST(info -> InputFormat);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   133
    int Extra      = T_EXTRA(info -> InputFormat);
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   134
    int ExtraFirst = DoSwap ^ SwapFirst;
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   135
    cmsUInt16Number v;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   136
    int i;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   137
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   138
    if (ExtraFirst) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   139
        accum += Extra;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   140
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   141
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   142
    for (i=0; i < nChan; i++) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   143
        int index = DoSwap ? (nChan - i - 1) : i;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   144
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   145
        v = FROM_8_TO_16(*accum);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   146
        v = Reverse ? REVERSE_FLAVOR_16(v) : v;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   147
        wIn[index] = v;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   148
        accum++;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   149
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   150
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   151
    if (!ExtraFirst) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   152
        accum += Extra;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   153
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   154
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   155
    if (Extra == 0 && SwapFirst) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   156
        cmsUInt16Number tmp = wIn[0];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   157
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   158
        memmove(&wIn[0], &wIn[1], (nChan-1) * sizeof(cmsUInt16Number));
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   159
        wIn[nChan-1] = tmp;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   160
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   161
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   162
    return accum;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   163
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   164
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   165
    cmsUNUSED_PARAMETER(Stride);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   166
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   167
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   168
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   169
// Extra channels are just ignored because come in the next planes
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   170
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   171
cmsUInt8Number* UnrollPlanarBytes(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   172
                                  register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   173
                                  register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   174
                                  register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   175
{
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   176
    int nChan     = T_CHANNELS(info -> InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   177
    int DoSwap    = T_DOSWAP(info ->InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   178
    int SwapFirst = T_SWAPFIRST(info ->InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   179
    int Reverse   = T_FLAVOR(info ->InputFormat);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   180
    int i;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   181
    cmsUInt8Number* Init = accum;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   182
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   183
    if (DoSwap ^ SwapFirst) {
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   184
        accum += T_EXTRA(info -> InputFormat) * Stride;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   185
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   186
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   187
    for (i=0; i < nChan; i++) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   188
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   189
        int index = DoSwap ? (nChan - i - 1) : i;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   190
        cmsUInt16Number v = FROM_8_TO_16(*accum);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   191
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   192
        wIn[index] = Reverse ? REVERSE_FLAVOR_16(v) : v;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   193
        accum += Stride;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   194
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   195
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   196
    return (Init + 1);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   197
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   198
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   199
// Special cases, provided for performance
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   200
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   201
cmsUInt8Number* Unroll4Bytes(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   202
                             register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   203
                             register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   204
                             register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   205
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   206
    wIn[0] = FROM_8_TO_16(*accum); accum++; // C
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   207
    wIn[1] = FROM_8_TO_16(*accum); accum++; // M
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   208
    wIn[2] = FROM_8_TO_16(*accum); accum++; // Y
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   209
    wIn[3] = FROM_8_TO_16(*accum); accum++; // K
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   210
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   211
    return accum;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   212
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   213
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   214
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   215
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   216
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   217
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   218
cmsUInt8Number* Unroll4BytesReverse(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   219
                                    register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   220
                                    register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   221
                                    register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   222
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   223
    wIn[0] = FROM_8_TO_16(REVERSE_FLAVOR_8(*accum)); accum++; // C
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   224
    wIn[1] = FROM_8_TO_16(REVERSE_FLAVOR_8(*accum)); accum++; // M
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   225
    wIn[2] = FROM_8_TO_16(REVERSE_FLAVOR_8(*accum)); accum++; // Y
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   226
    wIn[3] = FROM_8_TO_16(REVERSE_FLAVOR_8(*accum)); accum++; // K
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   227
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   228
    return accum;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   229
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   230
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   231
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   232
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   233
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   234
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   235
cmsUInt8Number* Unroll4BytesSwapFirst(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   236
                                      register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   237
                                      register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   238
                                      register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   239
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   240
    wIn[3] = FROM_8_TO_16(*accum); accum++; // K
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   241
    wIn[0] = FROM_8_TO_16(*accum); accum++; // C
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   242
    wIn[1] = FROM_8_TO_16(*accum); accum++; // M
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   243
    wIn[2] = FROM_8_TO_16(*accum); accum++; // Y
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   244
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   245
    return accum;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   246
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   247
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   248
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   249
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   250
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   251
// KYMC
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   252
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   253
cmsUInt8Number* Unroll4BytesSwap(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   254
                                 register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   255
                                 register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   256
                                 register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   257
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   258
    wIn[3] = FROM_8_TO_16(*accum); accum++;  // K
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   259
    wIn[2] = FROM_8_TO_16(*accum); accum++;  // Y
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   260
    wIn[1] = FROM_8_TO_16(*accum); accum++;  // M
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   261
    wIn[0] = FROM_8_TO_16(*accum); accum++;  // C
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   262
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   263
    return accum;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   264
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   265
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   266
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   267
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   268
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   269
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   270
cmsUInt8Number* Unroll4BytesSwapSwapFirst(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   271
                                          register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   272
                                          register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   273
                                          register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   274
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   275
    wIn[2] = FROM_8_TO_16(*accum); accum++;  // K
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   276
    wIn[1] = FROM_8_TO_16(*accum); accum++;  // Y
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   277
    wIn[0] = FROM_8_TO_16(*accum); accum++;  // M
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   278
    wIn[3] = FROM_8_TO_16(*accum); accum++;  // C
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   279
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   280
    return accum;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   281
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   282
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   283
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   284
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   285
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   286
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   287
cmsUInt8Number* Unroll3Bytes(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   288
                             register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   289
                             register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   290
                             register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   291
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   292
    wIn[0] = FROM_8_TO_16(*accum); accum++;     // R
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   293
    wIn[1] = FROM_8_TO_16(*accum); accum++;     // G
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   294
    wIn[2] = FROM_8_TO_16(*accum); accum++;     // B
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   295
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   296
    return accum;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   297
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   298
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   299
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   300
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   301
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   302
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   303
cmsUInt8Number* Unroll3BytesSkip1Swap(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   304
                                      register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   305
                                      register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   306
                                      register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   307
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   308
    accum++; // A
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   309
    wIn[2] = FROM_8_TO_16(*accum); accum++; // B
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   310
    wIn[1] = FROM_8_TO_16(*accum); accum++; // G
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   311
    wIn[0] = FROM_8_TO_16(*accum); accum++; // R
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   312
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   313
    return accum;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   314
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   315
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   316
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   317
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   318
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   319
static
23906
8f7f9cb6fe11 8029750: Enhance LCMS color processing
prr
parents: 14300
diff changeset
   320
cmsUInt8Number* Unroll3BytesSkip1SwapSwapFirst(register _cmsTRANSFORM* info,
8f7f9cb6fe11 8029750: Enhance LCMS color processing
prr
parents: 14300
diff changeset
   321
                                              register cmsUInt16Number wIn[],
8f7f9cb6fe11 8029750: Enhance LCMS color processing
prr
parents: 14300
diff changeset
   322
                                              register cmsUInt8Number* accum,
8f7f9cb6fe11 8029750: Enhance LCMS color processing
prr
parents: 14300
diff changeset
   323
                                              register cmsUInt32Number Stride)
8f7f9cb6fe11 8029750: Enhance LCMS color processing
prr
parents: 14300
diff changeset
   324
{
8f7f9cb6fe11 8029750: Enhance LCMS color processing
prr
parents: 14300
diff changeset
   325
    wIn[2] = FROM_8_TO_16(*accum); accum++; // B
8f7f9cb6fe11 8029750: Enhance LCMS color processing
prr
parents: 14300
diff changeset
   326
    wIn[1] = FROM_8_TO_16(*accum); accum++; // G
8f7f9cb6fe11 8029750: Enhance LCMS color processing
prr
parents: 14300
diff changeset
   327
    wIn[0] = FROM_8_TO_16(*accum); accum++; // R
8f7f9cb6fe11 8029750: Enhance LCMS color processing
prr
parents: 14300
diff changeset
   328
    accum++; // A
8f7f9cb6fe11 8029750: Enhance LCMS color processing
prr
parents: 14300
diff changeset
   329
8f7f9cb6fe11 8029750: Enhance LCMS color processing
prr
parents: 14300
diff changeset
   330
    return accum;
8f7f9cb6fe11 8029750: Enhance LCMS color processing
prr
parents: 14300
diff changeset
   331
8f7f9cb6fe11 8029750: Enhance LCMS color processing
prr
parents: 14300
diff changeset
   332
    cmsUNUSED_PARAMETER(info);
8f7f9cb6fe11 8029750: Enhance LCMS color processing
prr
parents: 14300
diff changeset
   333
    cmsUNUSED_PARAMETER(Stride);
8f7f9cb6fe11 8029750: Enhance LCMS color processing
prr
parents: 14300
diff changeset
   334
}
8f7f9cb6fe11 8029750: Enhance LCMS color processing
prr
parents: 14300
diff changeset
   335
8f7f9cb6fe11 8029750: Enhance LCMS color processing
prr
parents: 14300
diff changeset
   336
static
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   337
cmsUInt8Number* Unroll3BytesSkip1SwapFirst(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   338
                                           register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   339
                                           register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   340
                                           register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   341
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   342
    accum++; // A
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   343
    wIn[0] = FROM_8_TO_16(*accum); accum++; // R
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   344
    wIn[1] = FROM_8_TO_16(*accum); accum++; // G
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   345
    wIn[2] = FROM_8_TO_16(*accum); accum++; // B
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   346
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   347
    return accum;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   348
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   349
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   350
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   351
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   352
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   353
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   354
// BRG
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   355
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   356
cmsUInt8Number* Unroll3BytesSwap(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   357
                                 register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   358
                                 register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   359
                                 register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   360
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   361
    wIn[2] = FROM_8_TO_16(*accum); accum++;     // B
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   362
    wIn[1] = FROM_8_TO_16(*accum); accum++;     // G
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   363
    wIn[0] = FROM_8_TO_16(*accum); accum++;     // R
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   364
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   365
    return accum;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   366
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   367
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   368
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   369
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   370
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   371
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   372
cmsUInt8Number* UnrollLabV2_8(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   373
                              register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   374
                              register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   375
                              register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   376
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   377
    wIn[0] = FomLabV2ToLabV4(FROM_8_TO_16(*accum)); accum++;     // L
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   378
    wIn[1] = FomLabV2ToLabV4(FROM_8_TO_16(*accum)); accum++;     // a
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   379
    wIn[2] = FomLabV2ToLabV4(FROM_8_TO_16(*accum)); accum++;     // b
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   380
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   381
    return accum;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   382
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   383
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   384
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   385
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   386
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   387
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   388
cmsUInt8Number* UnrollALabV2_8(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   389
                               register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   390
                               register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   391
                               register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   392
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   393
    accum++;  // A
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   394
    wIn[0] = FomLabV2ToLabV4(FROM_8_TO_16(*accum)); accum++;     // L
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   395
    wIn[1] = FomLabV2ToLabV4(FROM_8_TO_16(*accum)); accum++;     // a
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   396
    wIn[2] = FomLabV2ToLabV4(FROM_8_TO_16(*accum)); accum++;     // b
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   397
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   398
    return accum;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   399
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   400
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   401
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   402
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   403
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   404
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   405
cmsUInt8Number* UnrollLabV2_16(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   406
                               register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   407
                               register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   408
                               register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   409
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   410
    wIn[0] = FomLabV2ToLabV4(*(cmsUInt16Number*) accum); accum += 2;     // L
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   411
    wIn[1] = FomLabV2ToLabV4(*(cmsUInt16Number*) accum); accum += 2;     // a
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   412
    wIn[2] = FomLabV2ToLabV4(*(cmsUInt16Number*) accum); accum += 2;     // b
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   413
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   414
    return accum;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   415
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   416
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   417
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   418
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   419
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   420
// for duplex
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   421
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   422
cmsUInt8Number* Unroll2Bytes(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   423
                                     register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   424
                                     register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   425
                                     register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   426
{
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   427
    wIn[0] = FROM_8_TO_16(*accum); accum++;     // ch1
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   428
    wIn[1] = FROM_8_TO_16(*accum); accum++;     // ch2
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   429
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   430
    return accum;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   431
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   432
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   433
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   434
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   435
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   436
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   437
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   438
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   439
// Monochrome duplicates L into RGB for null-transforms
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   440
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   441
cmsUInt8Number* Unroll1Byte(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   442
                            register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   443
                            register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   444
                            register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   445
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   446
    wIn[0] = wIn[1] = wIn[2] = FROM_8_TO_16(*accum); accum++;     // L
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   447
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   448
    return accum;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   449
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   450
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   451
    cmsUNUSED_PARAMETER(Stride);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   452
}
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   453
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   454
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   455
static
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   456
cmsUInt8Number* Unroll1ByteSkip1(register _cmsTRANSFORM* info,
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   457
                                 register cmsUInt16Number wIn[],
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   458
                                 register cmsUInt8Number* accum,
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   459
                                 register cmsUInt32Number Stride)
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   460
{
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   461
    wIn[0] = wIn[1] = wIn[2] = FROM_8_TO_16(*accum); accum++;     // L
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   462
    accum += 1;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   463
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   464
    return accum;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   465
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   466
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   467
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   468
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   469
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   470
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   471
cmsUInt8Number* Unroll1ByteSkip2(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   472
                                 register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   473
                                 register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   474
                                 register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   475
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   476
    wIn[0] = wIn[1] = wIn[2] = FROM_8_TO_16(*accum); accum++;     // L
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   477
    accum += 2;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   478
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   479
    return accum;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   480
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   481
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   482
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   483
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   484
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   485
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   486
cmsUInt8Number* Unroll1ByteReversed(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   487
                                    register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   488
                                    register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   489
                                    register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   490
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   491
    wIn[0] = wIn[1] = wIn[2] = REVERSE_FLAVOR_16(FROM_8_TO_16(*accum)); accum++;     // L
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   492
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   493
    return accum;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   494
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   495
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   496
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   497
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   498
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   499
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   500
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   501
cmsUInt8Number* UnrollAnyWords(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   502
                               register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   503
                               register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   504
                               register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   505
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   506
    int nChan       = T_CHANNELS(info -> InputFormat);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   507
    int SwapEndian  = T_ENDIAN16(info -> InputFormat);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   508
    int DoSwap      = T_DOSWAP(info ->InputFormat);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   509
    int Reverse     = T_FLAVOR(info ->InputFormat);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   510
    int SwapFirst   = T_SWAPFIRST(info -> InputFormat);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   511
    int Extra       = T_EXTRA(info -> InputFormat);
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   512
    int ExtraFirst  = DoSwap ^ SwapFirst;
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   513
    int i;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   514
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   515
    if (ExtraFirst) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   516
        accum += Extra * sizeof(cmsUInt16Number);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   517
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   518
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   519
    for (i=0; i < nChan; i++) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   520
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   521
        int index = DoSwap ? (nChan - i - 1) : i;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   522
        cmsUInt16Number v = *(cmsUInt16Number*) accum;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   523
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   524
        if (SwapEndian)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   525
            v = CHANGE_ENDIAN(v);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   526
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   527
        wIn[index] = Reverse ? REVERSE_FLAVOR_16(v) : v;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   528
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   529
        accum += sizeof(cmsUInt16Number);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   530
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   531
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   532
    if (!ExtraFirst) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   533
        accum += Extra * sizeof(cmsUInt16Number);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   534
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   535
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   536
    if (Extra == 0 && SwapFirst) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   537
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   538
        cmsUInt16Number tmp = wIn[0];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   539
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   540
        memmove(&wIn[0], &wIn[1], (nChan-1) * sizeof(cmsUInt16Number));
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   541
        wIn[nChan-1] = tmp;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   542
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   543
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   544
    return accum;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   545
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   546
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   547
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   548
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   549
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   550
cmsUInt8Number* UnrollPlanarWords(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   551
                                  register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   552
                                  register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   553
                                  register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   554
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   555
    int nChan = T_CHANNELS(info -> InputFormat);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   556
    int DoSwap= T_DOSWAP(info ->InputFormat);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   557
    int Reverse= T_FLAVOR(info ->InputFormat);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   558
    int SwapEndian = T_ENDIAN16(info -> InputFormat);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   559
    int i;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   560
    cmsUInt8Number* Init = accum;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   561
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   562
    if (DoSwap) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   563
        accum += T_EXTRA(info -> InputFormat) * Stride * sizeof(cmsUInt16Number);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   564
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   565
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   566
    for (i=0; i < nChan; i++) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   567
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   568
        int index = DoSwap ? (nChan - i - 1) : i;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   569
        cmsUInt16Number v = *(cmsUInt16Number*) accum;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   570
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   571
        if (SwapEndian)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   572
            v = CHANGE_ENDIAN(v);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   573
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   574
        wIn[index] = Reverse ? REVERSE_FLAVOR_16(v) : v;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   575
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   576
        accum +=  Stride * sizeof(cmsUInt16Number);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   577
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   578
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   579
    return (Init + sizeof(cmsUInt16Number));
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   580
}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
static
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   584
cmsUInt8Number* Unroll4Words(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   585
                             register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   586
                             register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   587
                             register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   588
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   589
    wIn[0] = *(cmsUInt16Number*) accum; accum+= 2; // C
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   590
    wIn[1] = *(cmsUInt16Number*) accum; accum+= 2; // M
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   591
    wIn[2] = *(cmsUInt16Number*) accum; accum+= 2; // Y
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   592
    wIn[3] = *(cmsUInt16Number*) accum; accum+= 2; // K
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   593
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   594
    return accum;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   595
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   596
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   597
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   598
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   599
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   600
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   601
cmsUInt8Number* Unroll4WordsReverse(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   602
                                    register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   603
                                    register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   604
                                    register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   605
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   606
    wIn[0] = REVERSE_FLAVOR_16(*(cmsUInt16Number*) accum); accum+= 2; // C
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   607
    wIn[1] = REVERSE_FLAVOR_16(*(cmsUInt16Number*) accum); accum+= 2; // M
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   608
    wIn[2] = REVERSE_FLAVOR_16(*(cmsUInt16Number*) accum); accum+= 2; // Y
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   609
    wIn[3] = REVERSE_FLAVOR_16(*(cmsUInt16Number*) accum); accum+= 2; // K
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   610
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   611
    return accum;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   612
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   613
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   614
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   615
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   616
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   617
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   618
cmsUInt8Number* Unroll4WordsSwapFirst(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   619
                                      register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   620
                                      register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   621
                                      register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   622
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   623
    wIn[3] = *(cmsUInt16Number*) accum; accum+= 2; // K
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   624
    wIn[0] = *(cmsUInt16Number*) accum; accum+= 2; // C
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   625
    wIn[1] = *(cmsUInt16Number*) accum; accum+= 2; // M
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   626
    wIn[2] = *(cmsUInt16Number*) accum; accum+= 2; // Y
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   627
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   628
    return accum;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   629
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   630
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   631
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   632
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   633
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   634
// KYMC
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   635
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   636
cmsUInt8Number* Unroll4WordsSwap(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   637
                                 register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   638
                                 register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   639
                                 register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   640
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   641
    wIn[3] = *(cmsUInt16Number*) accum; accum+= 2; // K
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   642
    wIn[2] = *(cmsUInt16Number*) accum; accum+= 2; // Y
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   643
    wIn[1] = *(cmsUInt16Number*) accum; accum+= 2; // M
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   644
    wIn[0] = *(cmsUInt16Number*) accum; accum+= 2; // C
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   645
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   646
    return accum;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   647
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   648
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   649
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   650
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   651
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   652
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   653
cmsUInt8Number* Unroll4WordsSwapSwapFirst(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   654
                                          register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   655
                                          register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   656
                                          register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   657
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   658
    wIn[2] = *(cmsUInt16Number*) accum; accum+= 2; // K
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   659
    wIn[1] = *(cmsUInt16Number*) accum; accum+= 2; // Y
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   660
    wIn[0] = *(cmsUInt16Number*) accum; accum+= 2; // M
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   661
    wIn[3] = *(cmsUInt16Number*) accum; accum+= 2; // C
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   662
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   663
    return accum;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   664
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   665
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   666
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   667
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   668
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   669
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   670
cmsUInt8Number* Unroll3Words(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   671
                             register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   672
                             register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   673
                             register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   674
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   675
    wIn[0] = *(cmsUInt16Number*) accum; accum+= 2;  // C R
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   676
    wIn[1] = *(cmsUInt16Number*) accum; accum+= 2;  // M G
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   677
    wIn[2] = *(cmsUInt16Number*) accum; accum+= 2;  // Y B
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   678
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   679
    return accum;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   680
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   681
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   682
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   683
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   684
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   685
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   686
cmsUInt8Number* Unroll3WordsSwap(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   687
                                 register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   688
                                 register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   689
                                 register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   690
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   691
    wIn[2] = *(cmsUInt16Number*) accum; accum+= 2;  // C R
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   692
    wIn[1] = *(cmsUInt16Number*) accum; accum+= 2;  // M G
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   693
    wIn[0] = *(cmsUInt16Number*) accum; accum+= 2;  // Y B
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   694
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   695
    return accum;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   696
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   697
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   698
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   699
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   700
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   701
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   702
cmsUInt8Number* Unroll3WordsSkip1Swap(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   703
                                      register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   704
                                      register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   705
                                      register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   706
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   707
    accum += 2; // A
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   708
    wIn[2] = *(cmsUInt16Number*) accum; accum += 2; // R
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   709
    wIn[1] = *(cmsUInt16Number*) accum; accum += 2; // G
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   710
    wIn[0] = *(cmsUInt16Number*) accum; accum += 2; // B
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   711
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   712
    return accum;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   713
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   714
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   715
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   716
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   717
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   718
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   719
cmsUInt8Number* Unroll3WordsSkip1SwapFirst(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   720
                                           register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   721
                                           register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   722
                                           register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   723
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   724
    accum += 2; // A
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   725
    wIn[0] = *(cmsUInt16Number*) accum; accum += 2; // R
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   726
    wIn[1] = *(cmsUInt16Number*) accum; accum += 2; // G
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   727
    wIn[2] = *(cmsUInt16Number*) accum; accum += 2; // B
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   728
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   729
    return accum;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   730
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   731
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   732
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   733
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   734
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   735
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   736
cmsUInt8Number* Unroll1Word(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   737
                            register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   738
                            register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   739
                            register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   740
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   741
    wIn[0] = wIn[1] = wIn[2] = *(cmsUInt16Number*) accum; accum+= 2;   // L
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   742
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   743
    return accum;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   744
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   745
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   746
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   747
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   748
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   749
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   750
cmsUInt8Number* Unroll1WordReversed(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   751
                                    register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   752
                                    register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   753
                                    register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   754
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   755
    wIn[0] = wIn[1] = wIn[2] = REVERSE_FLAVOR_16(*(cmsUInt16Number*) accum); accum+= 2;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   756
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   757
    return accum;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   758
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   759
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   760
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   761
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   762
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   763
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   764
cmsUInt8Number* Unroll1WordSkip3(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   765
                                 register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   766
                                 register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   767
                                 register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   768
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   769
    wIn[0] = wIn[1] = wIn[2] = *(cmsUInt16Number*) accum;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   770
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   771
    accum += 8;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   772
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   773
    return accum;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   774
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   775
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   776
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   777
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   778
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   779
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   780
cmsUInt8Number* Unroll2Words(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   781
                                     register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   782
                                     register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   783
                                     register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   784
{
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   785
    wIn[0] = *(cmsUInt16Number*) accum; accum += 2;    // ch1
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   786
    wIn[1] = *(cmsUInt16Number*) accum; accum += 2;    // ch2
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   787
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   788
    return accum;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   789
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   790
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   791
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   792
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   793
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   794
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   795
// This is a conversion of Lab double to 16 bits
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   796
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   797
cmsUInt8Number* UnrollLabDoubleTo16(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   798
                                    register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   799
                                    register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   800
                                    register cmsUInt32Number  Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   801
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   802
    if (T_PLANAR(info -> InputFormat)) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   803
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   804
        cmsFloat64Number* Pt = (cmsFloat64Number*) accum;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   805
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   806
        cmsCIELab Lab;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   807
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   808
        Lab.L = Pt[0];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   809
        Lab.a = Pt[Stride];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   810
        Lab.b = Pt[Stride*2];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   811
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   812
        cmsFloat2LabEncoded(wIn, &Lab);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   813
        return accum + sizeof(cmsFloat64Number);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   814
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   815
    else {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   816
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   817
        cmsFloat2LabEncoded(wIn, (cmsCIELab*) accum);
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   818
        accum += sizeof(cmsCIELab) + T_EXTRA(info ->InputFormat) * sizeof(cmsFloat64Number);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   819
        return accum;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   820
    }
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   821
}
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   822
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   823
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   824
// This is a conversion of Lab float to 16 bits
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   825
static
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   826
cmsUInt8Number* UnrollLabFloatTo16(register _cmsTRANSFORM* info,
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   827
                                    register cmsUInt16Number wIn[],
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   828
                                    register cmsUInt8Number* accum,
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   829
                                    register cmsUInt32Number  Stride)
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   830
{
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   831
    cmsCIELab Lab;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   832
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   833
    if (T_PLANAR(info -> InputFormat)) {
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   834
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   835
        cmsFloat32Number* Pt = (cmsFloat32Number*) accum;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   836
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   837
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   838
        Lab.L = Pt[0];
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   839
        Lab.a = Pt[Stride];
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   840
        Lab.b = Pt[Stride*2];
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   841
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   842
        cmsFloat2LabEncoded(wIn, &Lab);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   843
        return accum + sizeof(cmsFloat32Number);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   844
    }
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   845
    else {
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   846
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   847
        Lab.L = ((cmsFloat32Number*) accum)[0];
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   848
        Lab.a = ((cmsFloat32Number*) accum)[1];
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   849
        Lab.b = ((cmsFloat32Number*) accum)[2];
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   850
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   851
        cmsFloat2LabEncoded(wIn, &Lab);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   852
        accum += (3 + T_EXTRA(info ->InputFormat)) * sizeof(cmsFloat32Number);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   853
        return accum;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   854
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   855
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   856
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   857
// This is a conversion of XYZ double to 16 bits
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   858
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   859
cmsUInt8Number* UnrollXYZDoubleTo16(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   860
                                    register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   861
                                    register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   862
                                    register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   863
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   864
    if (T_PLANAR(info -> InputFormat)) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   865
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   866
        cmsFloat64Number* Pt = (cmsFloat64Number*) accum;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   867
        cmsCIEXYZ XYZ;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   868
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   869
        XYZ.X = Pt[0];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   870
        XYZ.Y = Pt[Stride];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   871
        XYZ.Z = Pt[Stride*2];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   872
        cmsFloat2XYZEncoded(wIn, &XYZ);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   873
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   874
        return accum + sizeof(cmsFloat64Number);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   875
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   876
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   877
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   878
    else {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   879
        cmsFloat2XYZEncoded(wIn, (cmsCIEXYZ*) accum);
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   880
        accum += sizeof(cmsCIEXYZ) + T_EXTRA(info ->InputFormat) * sizeof(cmsFloat64Number);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   881
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   882
        return accum;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   883
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   884
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   885
26609
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   886
// This is a conversion of XYZ float to 16 bits
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   887
static
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   888
cmsUInt8Number* UnrollXYZFloatTo16(register _cmsTRANSFORM* info,
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   889
                                   register cmsUInt16Number wIn[],
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   890
                                   register cmsUInt8Number* accum,
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   891
                                   register cmsUInt32Number Stride)
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   892
{
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   893
    if (T_PLANAR(info -> InputFormat)) {
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   894
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   895
        cmsFloat32Number* Pt = (cmsFloat32Number*) accum;
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   896
        cmsCIEXYZ XYZ;
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   897
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   898
        XYZ.X = Pt[0];
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   899
        XYZ.Y = Pt[Stride];
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   900
        XYZ.Z = Pt[Stride*2];
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   901
        cmsFloat2XYZEncoded(wIn, &XYZ);
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   902
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   903
        return accum + sizeof(cmsFloat32Number);
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   904
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   905
    }
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   906
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   907
    else {
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   908
        cmsFloat32Number* Pt = (cmsFloat32Number*) accum;
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   909
        cmsCIEXYZ XYZ;
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   910
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   911
        XYZ.X = Pt[0];
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   912
        XYZ.Y = Pt[1];
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   913
        XYZ.Z = Pt[2];
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   914
        cmsFloat2XYZEncoded(wIn, &XYZ);
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   915
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   916
        accum += 3 * sizeof(cmsFloat32Number) + T_EXTRA(info ->InputFormat) * sizeof(cmsFloat32Number);
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   917
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   918
        return accum;
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   919
    }
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   920
}
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
   921
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   922
// Check if space is marked as ink
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   923
cmsINLINE cmsBool IsInkSpace(cmsUInt32Number Type)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   924
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   925
    switch (T_COLORSPACE(Type)) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   926
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   927
     case PT_CMY:
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   928
     case PT_CMYK:
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   929
     case PT_MCH5:
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   930
     case PT_MCH6:
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   931
     case PT_MCH7:
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   932
     case PT_MCH8:
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   933
     case PT_MCH9:
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   934
     case PT_MCH10:
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   935
     case PT_MCH11:
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   936
     case PT_MCH12:
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   937
     case PT_MCH13:
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   938
     case PT_MCH14:
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   939
     case PT_MCH15: return TRUE;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   940
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   941
     default: return FALSE;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   942
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   943
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   944
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   945
// Inks does come in percentage, remaining cases are between 0..1.0, again to 16 bits
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   946
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   947
cmsUInt8Number* UnrollDoubleTo16(register _cmsTRANSFORM* info,
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   948
                                register cmsUInt16Number wIn[],
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   949
                                register cmsUInt8Number* accum,
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   950
                                register cmsUInt32Number Stride)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   951
{
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   952
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   953
    int nChan      = T_CHANNELS(info -> InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   954
    int DoSwap     = T_DOSWAP(info ->InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   955
    int Reverse    = T_FLAVOR(info ->InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   956
    int SwapFirst  = T_SWAPFIRST(info -> InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   957
    int Extra      = T_EXTRA(info -> InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   958
    int ExtraFirst = DoSwap ^ SwapFirst;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   959
    int Planar     = T_PLANAR(info -> InputFormat);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   960
    cmsFloat64Number v;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   961
    cmsUInt16Number  vi;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   962
    int i, start = 0;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   963
   cmsFloat64Number maximum = IsInkSpace(info ->InputFormat) ? 655.35 : 65535.0;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   964
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   965
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   966
    if (ExtraFirst)
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   967
            start = Extra;
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   968
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   969
    for (i=0; i < nChan; i++) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   970
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   971
        int index = DoSwap ? (nChan - i - 1) : i;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   972
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   973
        if (Planar)
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   974
            v = (cmsFloat32Number) ((cmsFloat64Number*) accum)[(i + start) * Stride];
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   975
        else
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   976
            v = (cmsFloat32Number) ((cmsFloat64Number*) accum)[i + start];
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   977
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   978
        vi = _cmsQuickSaturateWord(v * maximum);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   979
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   980
        if (Reverse)
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   981
            vi = REVERSE_FLAVOR_16(vi);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   982
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   983
        wIn[index] = vi;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   984
    }
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   985
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   986
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   987
    if (Extra == 0 && SwapFirst) {
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   988
        cmsUInt16Number tmp = wIn[0];
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   989
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   990
        memmove(&wIn[0], &wIn[1], (nChan-1) * sizeof(cmsUInt16Number));
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   991
        wIn[nChan-1] = tmp;
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   992
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   993
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   994
    if (T_PLANAR(info -> InputFormat))
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   995
        return accum + sizeof(cmsFloat64Number);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   996
    else
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
   997
        return accum + (nChan + Extra) * sizeof(cmsFloat64Number);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   998
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
   999
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1000
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1001
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1002
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1003
cmsUInt8Number* UnrollFloatTo16(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1004
                                register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1005
                                register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1006
                                register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1007
{
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1008
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1009
    int nChan      = T_CHANNELS(info -> InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1010
    int DoSwap     = T_DOSWAP(info ->InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1011
    int Reverse    = T_FLAVOR(info ->InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1012
    int SwapFirst  = T_SWAPFIRST(info -> InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1013
    int Extra      = T_EXTRA(info -> InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1014
    int ExtraFirst = DoSwap ^ SwapFirst;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1015
    int Planar     = T_PLANAR(info -> InputFormat);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1016
    cmsFloat32Number v;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1017
    cmsUInt16Number  vi;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1018
    int i, start = 0;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1019
   cmsFloat64Number maximum = IsInkSpace(info ->InputFormat) ? 655.35 : 65535.0;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1020
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1021
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1022
    if (ExtraFirst)
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1023
            start = Extra;
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1024
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1025
    for (i=0; i < nChan; i++) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1026
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1027
        int index = DoSwap ? (nChan - i - 1) : i;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1028
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1029
        if (Planar)
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1030
            v = (cmsFloat32Number) ((cmsFloat32Number*) accum)[(i + start) * Stride];
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1031
        else
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1032
            v = (cmsFloat32Number) ((cmsFloat32Number*) accum)[i + start];
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1033
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1034
        vi = _cmsQuickSaturateWord(v * maximum);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1035
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1036
        if (Reverse)
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1037
            vi = REVERSE_FLAVOR_16(vi);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1038
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1039
        wIn[index] = vi;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1040
    }
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1041
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1042
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1043
    if (Extra == 0 && SwapFirst) {
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1044
        cmsUInt16Number tmp = wIn[0];
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1045
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1046
        memmove(&wIn[0], &wIn[1], (nChan-1) * sizeof(cmsUInt16Number));
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1047
        wIn[nChan-1] = tmp;
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1048
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1049
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1050
    if (T_PLANAR(info -> InputFormat))
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1051
        return accum + sizeof(cmsFloat32Number);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1052
    else
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1053
        return accum + (nChan + Extra) * sizeof(cmsFloat32Number);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1054
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1055
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1056
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1057
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1058
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1059
// For 1 channel, we need to duplicate data (it comes in 0..1.0 range)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1060
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1061
cmsUInt8Number* UnrollDouble1Chan(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1062
                                  register cmsUInt16Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1063
                                  register cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1064
                                  register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1065
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1066
    cmsFloat64Number* Inks = (cmsFloat64Number*) accum;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1067
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1068
    wIn[0] = wIn[1] = wIn[2] = _cmsQuickSaturateWord(Inks[0] * 65535.0);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1069
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1070
    return accum + sizeof(cmsFloat64Number);
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1071
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1072
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1073
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1074
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1075
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1076
//-------------------------------------------------------------------------------------------------------------------
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1077
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1078
// For anything going from cmsFloat32Number
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1079
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1080
cmsUInt8Number* UnrollFloatsToFloat(_cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1081
                                    cmsFloat32Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1082
                                    cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1083
                                    cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1084
{
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1085
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1086
    int nChan      = T_CHANNELS(info -> InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1087
    int DoSwap     = T_DOSWAP(info ->InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1088
    int Reverse    = T_FLAVOR(info ->InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1089
    int SwapFirst  = T_SWAPFIRST(info -> InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1090
    int Extra      = T_EXTRA(info -> InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1091
    int ExtraFirst = DoSwap ^ SwapFirst;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1092
    int Planar     = T_PLANAR(info -> InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1093
    cmsFloat32Number v;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1094
    int i, start = 0;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1095
    cmsFloat32Number maximum = IsInkSpace(info ->InputFormat) ? 100.0F : 1.0F;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1096
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1097
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1098
    if (ExtraFirst)
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1099
            start = Extra;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1100
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1101
    for (i=0; i < nChan; i++) {
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1102
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1103
        int index = DoSwap ? (nChan - i - 1) : i;
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1104
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1105
        if (Planar)
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1106
            v = (cmsFloat32Number) ((cmsFloat32Number*) accum)[(i + start) * Stride];
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1107
        else
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1108
            v = (cmsFloat32Number) ((cmsFloat32Number*) accum)[i + start];
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1109
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1110
        v /= maximum;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1111
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1112
        wIn[index] = Reverse ? 1 - v : v;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1113
    }
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1114
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1115
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1116
    if (Extra == 0 && SwapFirst) {
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1117
        cmsFloat32Number tmp = wIn[0];
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1118
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1119
        memmove(&wIn[0], &wIn[1], (nChan-1) * sizeof(cmsFloat32Number));
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1120
        wIn[nChan-1] = tmp;
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1121
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1122
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1123
    if (T_PLANAR(info -> InputFormat))
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1124
        return accum + sizeof(cmsFloat32Number);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1125
    else
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1126
        return accum + (nChan + Extra) * sizeof(cmsFloat32Number);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1127
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1128
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1129
// For anything going from double
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1130
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1131
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1132
cmsUInt8Number* UnrollDoublesToFloat(_cmsTRANSFORM* info,
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1133
                                    cmsFloat32Number wIn[],
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1134
                                    cmsUInt8Number* accum,
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1135
                                    cmsUInt32Number Stride)
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1136
{
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1137
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1138
    int nChan      = T_CHANNELS(info -> InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1139
    int DoSwap     = T_DOSWAP(info ->InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1140
    int Reverse    = T_FLAVOR(info ->InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1141
    int SwapFirst  = T_SWAPFIRST(info -> InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1142
    int Extra      = T_EXTRA(info -> InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1143
    int ExtraFirst = DoSwap ^ SwapFirst;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1144
    int Planar     = T_PLANAR(info -> InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1145
    cmsFloat64Number v;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1146
    int i, start = 0;
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1147
    cmsFloat64Number maximum = IsInkSpace(info ->InputFormat) ? 100.0 : 1.0;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1148
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1149
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1150
    if (ExtraFirst)
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1151
            start = Extra;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1152
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1153
    for (i=0; i < nChan; i++) {
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1154
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1155
        int index = DoSwap ? (nChan - i - 1) : i;
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1156
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1157
        if (Planar)
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1158
            v = (cmsFloat64Number) ((cmsFloat64Number*) accum)[(i + start)  * Stride];
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1159
        else
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1160
            v = (cmsFloat64Number) ((cmsFloat64Number*) accum)[i + start];
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1161
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1162
        v /= maximum;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1163
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1164
        wIn[index] = (cmsFloat32Number) (Reverse ? 1.0 - v : v);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1165
    }
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1166
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1167
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1168
    if (Extra == 0 && SwapFirst) {
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1169
        cmsFloat32Number tmp = wIn[0];
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1170
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1171
        memmove(&wIn[0], &wIn[1], (nChan-1) * sizeof(cmsFloat32Number));
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1172
        wIn[nChan-1] = tmp;
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1173
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1174
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1175
    if (T_PLANAR(info -> InputFormat))
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1176
        return accum + sizeof(cmsFloat64Number);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1177
    else
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1178
        return accum + (nChan + Extra) * sizeof(cmsFloat64Number);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1179
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1180
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1181
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1182
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1183
// From Lab double to cmsFloat32Number
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1184
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1185
cmsUInt8Number* UnrollLabDoubleToFloat(_cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1186
                                       cmsFloat32Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1187
                                       cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1188
                                       cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1189
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1190
    cmsFloat64Number* Pt = (cmsFloat64Number*) accum;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1191
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1192
    if (T_PLANAR(info -> InputFormat)) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1193
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1194
        wIn[0] = (cmsFloat32Number) (Pt[0] / 100.0);                            // from 0..100 to 0..1
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1195
        wIn[1] = (cmsFloat32Number) ((Pt[Stride] + 128) / 255.0);    // form -128..+127 to 0..1
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1196
        wIn[2] = (cmsFloat32Number) ((Pt[Stride*2] + 128) / 255.0);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1197
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1198
        return accum + sizeof(cmsFloat64Number);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1199
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1200
    else {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1201
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1202
        wIn[0] = (cmsFloat32Number) (Pt[0] / 100.0);            // from 0..100 to 0..1
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1203
        wIn[1] = (cmsFloat32Number) ((Pt[1] + 128) / 255.0);    // form -128..+127 to 0..1
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1204
        wIn[2] = (cmsFloat32Number) ((Pt[2] + 128) / 255.0);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1205
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1206
        accum += sizeof(cmsFloat64Number)*(3 + T_EXTRA(info ->InputFormat));
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1207
        return accum;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1208
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1209
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1210
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1211
// From Lab double to cmsFloat32Number
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1212
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1213
cmsUInt8Number* UnrollLabFloatToFloat(_cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1214
                                      cmsFloat32Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1215
                                      cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1216
                                      cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1217
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1218
    cmsFloat32Number* Pt = (cmsFloat32Number*) accum;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1219
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1220
    if (T_PLANAR(info -> InputFormat)) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1221
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1222
        wIn[0] = (cmsFloat32Number) (Pt[0] / 100.0);                 // from 0..100 to 0..1
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1223
        wIn[1] = (cmsFloat32Number) ((Pt[Stride] + 128) / 255.0);    // form -128..+127 to 0..1
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1224
        wIn[2] = (cmsFloat32Number) ((Pt[Stride*2] + 128) / 255.0);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1225
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1226
        return accum + sizeof(cmsFloat32Number);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1227
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1228
    else {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1229
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1230
        wIn[0] = (cmsFloat32Number) (Pt[0] / 100.0);            // from 0..100 to 0..1
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1231
        wIn[1] = (cmsFloat32Number) ((Pt[1] + 128) / 255.0);    // form -128..+127 to 0..1
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1232
        wIn[2] = (cmsFloat32Number) ((Pt[2] + 128) / 255.0);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1233
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1234
        accum += sizeof(cmsFloat32Number)*(3 + T_EXTRA(info ->InputFormat));
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1235
        return accum;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1236
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1237
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1238
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1239
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1240
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1241
// 1.15 fixed point, that means maximum value is MAX_ENCODEABLE_XYZ (0xFFFF)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1242
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1243
cmsUInt8Number* UnrollXYZDoubleToFloat(_cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1244
                                       cmsFloat32Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1245
                                       cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1246
                                       cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1247
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1248
    cmsFloat64Number* Pt = (cmsFloat64Number*) accum;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1249
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1250
    if (T_PLANAR(info -> InputFormat)) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1251
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1252
        wIn[0] = (cmsFloat32Number) (Pt[0] / MAX_ENCODEABLE_XYZ);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1253
        wIn[1] = (cmsFloat32Number) (Pt[Stride] / MAX_ENCODEABLE_XYZ);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1254
        wIn[2] = (cmsFloat32Number) (Pt[Stride*2] / MAX_ENCODEABLE_XYZ);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1255
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1256
        return accum + sizeof(cmsFloat64Number);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1257
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1258
    else {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1259
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1260
        wIn[0] = (cmsFloat32Number) (Pt[0] / MAX_ENCODEABLE_XYZ);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1261
        wIn[1] = (cmsFloat32Number) (Pt[1] / MAX_ENCODEABLE_XYZ);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1262
        wIn[2] = (cmsFloat32Number) (Pt[2] / MAX_ENCODEABLE_XYZ);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1263
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1264
        accum += sizeof(cmsFloat64Number)*(3 + T_EXTRA(info ->InputFormat));
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1265
        return accum;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1266
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1267
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1268
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1269
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1270
cmsUInt8Number* UnrollXYZFloatToFloat(_cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1271
                                      cmsFloat32Number wIn[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1272
                                      cmsUInt8Number* accum,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1273
                                      cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1274
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1275
    cmsFloat32Number* Pt = (cmsFloat32Number*) accum;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1276
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1277
    if (T_PLANAR(info -> InputFormat)) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1278
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1279
        wIn[0] = (cmsFloat32Number) (Pt[0] / MAX_ENCODEABLE_XYZ);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1280
        wIn[1] = (cmsFloat32Number) (Pt[Stride] / MAX_ENCODEABLE_XYZ);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1281
        wIn[2] = (cmsFloat32Number) (Pt[Stride*2] / MAX_ENCODEABLE_XYZ);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1282
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1283
        return accum + sizeof(cmsFloat32Number);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1284
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1285
    else {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1286
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1287
        wIn[0] = (cmsFloat32Number) (Pt[0] / MAX_ENCODEABLE_XYZ);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1288
        wIn[1] = (cmsFloat32Number) (Pt[1] / MAX_ENCODEABLE_XYZ);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1289
        wIn[2] = (cmsFloat32Number) (Pt[2] / MAX_ENCODEABLE_XYZ);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1290
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1291
        accum += sizeof(cmsFloat32Number)*(3 + T_EXTRA(info ->InputFormat));
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1292
        return accum;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1293
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1294
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1295
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1296
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1297
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1298
// Packing routines -----------------------------------------------------------------------------------------------------------
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1299
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1300
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1301
// Generic chunky for byte
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1302
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1303
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1304
cmsUInt8Number* PackAnyBytes(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1305
                             register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1306
                             register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1307
                             register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1308
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1309
    int nChan      = T_CHANNELS(info -> OutputFormat);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1310
    int DoSwap     = T_DOSWAP(info ->OutputFormat);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1311
    int Reverse    = T_FLAVOR(info ->OutputFormat);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1312
    int Extra      = T_EXTRA(info -> OutputFormat);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1313
    int SwapFirst  = T_SWAPFIRST(info -> OutputFormat);
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1314
    int ExtraFirst = DoSwap ^ SwapFirst;
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1315
    cmsUInt8Number* swap1;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1316
    cmsUInt8Number v = 0;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1317
    int i;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1318
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1319
    swap1 = output;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1320
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1321
    if (ExtraFirst) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1322
        output += Extra;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1323
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1324
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1325
    for (i=0; i < nChan; i++) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1326
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1327
        int index = DoSwap ? (nChan - i - 1) : i;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1328
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1329
        v = FROM_16_TO_8(wOut[index]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1330
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1331
        if (Reverse)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1332
            v = REVERSE_FLAVOR_8(v);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1333
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1334
        *output++ = v;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1335
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1336
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1337
    if (!ExtraFirst) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1338
        output += Extra;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1339
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1340
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1341
    if (Extra == 0 && SwapFirst) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1342
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1343
        memmove(swap1 + 1, swap1, nChan-1);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1344
        *swap1 = v;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1345
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1346
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1347
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1348
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1349
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1350
    cmsUNUSED_PARAMETER(Stride);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1351
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1352
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1353
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1354
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1355
static
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1356
cmsUInt8Number* PackAnyWords(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1357
                             register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1358
                             register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1359
                             register cmsUInt32Number Stride)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1360
{
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1361
    int nChan      = T_CHANNELS(info -> OutputFormat);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1362
    int SwapEndian = T_ENDIAN16(info -> InputFormat);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1363
    int DoSwap     = T_DOSWAP(info ->OutputFormat);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1364
    int Reverse    = T_FLAVOR(info ->OutputFormat);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1365
    int Extra      = T_EXTRA(info -> OutputFormat);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1366
    int SwapFirst  = T_SWAPFIRST(info -> OutputFormat);
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1367
    int ExtraFirst = DoSwap ^ SwapFirst;
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1368
    cmsUInt16Number* swap1;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1369
    cmsUInt16Number v = 0;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1370
    int i;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1371
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1372
    swap1 = (cmsUInt16Number*) output;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1373
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1374
    if (ExtraFirst) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1375
        output += Extra * sizeof(cmsUInt16Number);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1376
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1377
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1378
    for (i=0; i < nChan; i++) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1379
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1380
        int index = DoSwap ? (nChan - i - 1) : i;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1381
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1382
        v = wOut[index];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1383
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1384
        if (SwapEndian)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1385
            v = CHANGE_ENDIAN(v);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1386
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1387
        if (Reverse)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1388
            v = REVERSE_FLAVOR_16(v);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1389
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1390
        *(cmsUInt16Number*) output = v;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1391
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1392
        output += sizeof(cmsUInt16Number);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1393
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1394
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1395
    if (!ExtraFirst) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1396
        output += Extra * sizeof(cmsUInt16Number);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1397
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1398
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1399
    if (Extra == 0 && SwapFirst) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1400
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1401
        memmove(swap1 + 1, swap1, (nChan-1)* sizeof(cmsUInt16Number));
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1402
        *swap1 = v;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1403
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1404
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1405
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1406
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1407
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1408
    cmsUNUSED_PARAMETER(Stride);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1409
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1410
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1411
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1412
static
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1413
cmsUInt8Number* PackPlanarBytes(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1414
                                register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1415
                                register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1416
                                register cmsUInt32Number Stride)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1417
{
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1418
    int nChan     = T_CHANNELS(info -> OutputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1419
    int DoSwap    = T_DOSWAP(info ->OutputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1420
    int SwapFirst = T_SWAPFIRST(info ->OutputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1421
    int Reverse   = T_FLAVOR(info ->OutputFormat);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1422
    int i;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1423
    cmsUInt8Number* Init = output;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1424
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1425
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1426
    if (DoSwap ^ SwapFirst) {
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1427
        output += T_EXTRA(info -> OutputFormat) * Stride;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1428
    }
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1429
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1430
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1431
    for (i=0; i < nChan; i++) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1432
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1433
        int index = DoSwap ? (nChan - i - 1) : i;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1434
        cmsUInt8Number v = FROM_16_TO_8(wOut[index]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1435
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1436
        *(cmsUInt8Number*)  output = (cmsUInt8Number) (Reverse ? REVERSE_FLAVOR_8(v) : v);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1437
        output += Stride;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1438
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1439
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1440
    return (Init + 1);
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1441
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1442
    cmsUNUSED_PARAMETER(Stride);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1443
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1444
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1445
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1446
static
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1447
cmsUInt8Number* PackPlanarWords(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1448
                                register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1449
                                register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1450
                                register cmsUInt32Number Stride)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1451
{
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1452
    int nChan = T_CHANNELS(info -> OutputFormat);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1453
    int DoSwap = T_DOSWAP(info ->OutputFormat);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1454
    int Reverse= T_FLAVOR(info ->OutputFormat);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1455
    int SwapEndian = T_ENDIAN16(info -> OutputFormat);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1456
    int i;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1457
    cmsUInt8Number* Init = output;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1458
    cmsUInt16Number v;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1459
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1460
    if (DoSwap) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1461
        output += T_EXTRA(info -> OutputFormat) * Stride * sizeof(cmsUInt16Number);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1462
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1463
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1464
    for (i=0; i < nChan; i++) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1465
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1466
        int index = DoSwap ? (nChan - i - 1) : i;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1467
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1468
        v = wOut[index];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1469
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1470
        if (SwapEndian)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1471
            v = CHANGE_ENDIAN(v);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1472
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1473
        if (Reverse)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1474
            v =  REVERSE_FLAVOR_16(v);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1475
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1476
        *(cmsUInt16Number*) output = v;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1477
        output += (Stride * sizeof(cmsUInt16Number));
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1478
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1479
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1480
    return (Init + sizeof(cmsUInt16Number));
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1481
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1483
// CMYKcm (unrolled for speed)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1484
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1485
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1486
cmsUInt8Number* Pack6Bytes(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1487
                           register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1488
                           register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1489
                           register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1490
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1491
    *output++ = FROM_16_TO_8(wOut[0]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1492
    *output++ = FROM_16_TO_8(wOut[1]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1493
    *output++ = FROM_16_TO_8(wOut[2]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1494
    *output++ = FROM_16_TO_8(wOut[3]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1495
    *output++ = FROM_16_TO_8(wOut[4]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1496
    *output++ = FROM_16_TO_8(wOut[5]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1497
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1498
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1499
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1500
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1501
    cmsUNUSED_PARAMETER(Stride);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1502
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1503
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1504
// KCMYcm
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1505
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1506
static
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1507
cmsUInt8Number* Pack6BytesSwap(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1508
                               register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1509
                               register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1510
                               register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1511
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1512
    *output++ = FROM_16_TO_8(wOut[5]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1513
    *output++ = FROM_16_TO_8(wOut[4]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1514
    *output++ = FROM_16_TO_8(wOut[3]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1515
    *output++ = FROM_16_TO_8(wOut[2]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1516
    *output++ = FROM_16_TO_8(wOut[1]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1517
    *output++ = FROM_16_TO_8(wOut[0]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1518
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1519
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1520
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1521
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1522
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1523
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1524
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1525
// CMYKcm
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1526
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1527
cmsUInt8Number* Pack6Words(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1528
                           register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1529
                           register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1530
                           register cmsUInt32Number Stride)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1531
{
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1532
    *(cmsUInt16Number*) output = wOut[0];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1533
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1534
    *(cmsUInt16Number*) output = wOut[1];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1535
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1536
    *(cmsUInt16Number*) output = wOut[2];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1537
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1538
    *(cmsUInt16Number*) output = wOut[3];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1539
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1540
    *(cmsUInt16Number*) output = wOut[4];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1541
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1542
    *(cmsUInt16Number*) output = wOut[5];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1543
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1544
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1545
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1546
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1547
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1548
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1549
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1550
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1551
// KCMYcm
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1552
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1553
cmsUInt8Number* Pack6WordsSwap(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1554
                               register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1555
                               register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1556
                               register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1557
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1558
    *(cmsUInt16Number*) output = wOut[5];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1559
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1560
    *(cmsUInt16Number*) output = wOut[4];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1561
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1562
    *(cmsUInt16Number*) output = wOut[3];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1563
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1564
    *(cmsUInt16Number*) output = wOut[2];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1565
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1566
    *(cmsUInt16Number*) output = wOut[1];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1567
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1568
    *(cmsUInt16Number*) output = wOut[0];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1569
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1570
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1571
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1572
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1573
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1574
    cmsUNUSED_PARAMETER(Stride);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1575
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1576
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1577
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1578
static
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1579
cmsUInt8Number* Pack4Bytes(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1580
                           register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1581
                           register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1582
                           register cmsUInt32Number Stride)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1583
{
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1584
    *output++ = FROM_16_TO_8(wOut[0]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1585
    *output++ = FROM_16_TO_8(wOut[1]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1586
    *output++ = FROM_16_TO_8(wOut[2]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1587
    *output++ = FROM_16_TO_8(wOut[3]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1588
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1589
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1590
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1591
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1592
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1593
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1594
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1595
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1596
cmsUInt8Number* Pack4BytesReverse(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1597
                                  register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1598
                                  register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1599
                                  register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1600
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1601
    *output++ = REVERSE_FLAVOR_8(FROM_16_TO_8(wOut[0]));
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1602
    *output++ = REVERSE_FLAVOR_8(FROM_16_TO_8(wOut[1]));
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1603
    *output++ = REVERSE_FLAVOR_8(FROM_16_TO_8(wOut[2]));
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1604
    *output++ = REVERSE_FLAVOR_8(FROM_16_TO_8(wOut[3]));
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1605
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1606
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1607
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1608
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1609
    cmsUNUSED_PARAMETER(Stride);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1610
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1611
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1612
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1613
static
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1614
cmsUInt8Number* Pack4BytesSwapFirst(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1615
                                    register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1616
                                    register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1617
                                    register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1618
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1619
    *output++ = FROM_16_TO_8(wOut[3]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1620
    *output++ = FROM_16_TO_8(wOut[0]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1621
    *output++ = FROM_16_TO_8(wOut[1]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1622
    *output++ = FROM_16_TO_8(wOut[2]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1623
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1624
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1625
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1626
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1627
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1628
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1629
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1630
// ABGR
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1631
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1632
cmsUInt8Number* Pack4BytesSwap(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1633
                               register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1634
                               register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1635
                               register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1636
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1637
    *output++ = FROM_16_TO_8(wOut[3]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1638
    *output++ = FROM_16_TO_8(wOut[2]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1639
    *output++ = FROM_16_TO_8(wOut[1]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1640
    *output++ = FROM_16_TO_8(wOut[0]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1641
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1642
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1643
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1644
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1645
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1646
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1647
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1648
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1649
cmsUInt8Number* Pack4BytesSwapSwapFirst(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1650
                                        register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1651
                                        register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1652
                                        register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1653
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1654
    *output++ = FROM_16_TO_8(wOut[2]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1655
    *output++ = FROM_16_TO_8(wOut[1]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1656
    *output++ = FROM_16_TO_8(wOut[0]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1657
    *output++ = FROM_16_TO_8(wOut[3]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1658
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1659
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1660
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1661
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1662
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1663
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1664
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1665
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1666
cmsUInt8Number* Pack4Words(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1667
                           register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1668
                           register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1669
                           register cmsUInt32Number Stride)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1670
{
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1671
    *(cmsUInt16Number*) output = wOut[0];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1672
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1673
    *(cmsUInt16Number*) output = wOut[1];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1674
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1675
    *(cmsUInt16Number*) output = wOut[2];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1676
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1677
    *(cmsUInt16Number*) output = wOut[3];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1678
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1679
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1680
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1681
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1682
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1683
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1684
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1685
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1686
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1687
cmsUInt8Number* Pack4WordsReverse(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1688
                                  register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1689
                                  register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1690
                                  register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1691
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1692
    *(cmsUInt16Number*) output = REVERSE_FLAVOR_16(wOut[0]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1693
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1694
    *(cmsUInt16Number*) output = REVERSE_FLAVOR_16(wOut[1]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1695
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1696
    *(cmsUInt16Number*) output = REVERSE_FLAVOR_16(wOut[2]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1697
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1698
    *(cmsUInt16Number*) output = REVERSE_FLAVOR_16(wOut[3]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1699
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1700
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1701
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1702
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1703
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1704
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1705
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1706
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1707
// ABGR
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1708
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1709
cmsUInt8Number* Pack4WordsSwap(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1710
                               register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1711
                               register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1712
                               register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1713
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1714
    *(cmsUInt16Number*) output = wOut[3];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1715
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1716
    *(cmsUInt16Number*) output = wOut[2];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1717
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1718
    *(cmsUInt16Number*) output = wOut[1];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1719
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1720
    *(cmsUInt16Number*) output = wOut[0];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1721
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1722
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1723
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1724
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1725
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1726
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1727
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1728
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1729
// CMYK
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1730
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1731
cmsUInt8Number* Pack4WordsBigEndian(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1732
                                    register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1733
                                    register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1734
                                    register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1735
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1736
    *(cmsUInt16Number*) output = CHANGE_ENDIAN(wOut[0]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1737
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1738
    *(cmsUInt16Number*) output = CHANGE_ENDIAN(wOut[1]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1739
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1740
    *(cmsUInt16Number*) output = CHANGE_ENDIAN(wOut[2]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1741
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1742
    *(cmsUInt16Number*) output = CHANGE_ENDIAN(wOut[3]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1743
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1744
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1745
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1746
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1747
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1748
    cmsUNUSED_PARAMETER(Stride);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1749
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1750
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1751
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1752
static
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1753
cmsUInt8Number* PackLabV2_8(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1754
                            register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1755
                            register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1756
                            register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1757
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1758
    *output++ = FROM_16_TO_8(FomLabV4ToLabV2(wOut[0]));
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1759
    *output++ = FROM_16_TO_8(FomLabV4ToLabV2(wOut[1]));
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1760
    *output++ = FROM_16_TO_8(FomLabV4ToLabV2(wOut[2]));
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1761
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1762
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1763
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1764
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1765
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1766
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1767
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1768
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1769
cmsUInt8Number* PackALabV2_8(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1770
                             register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1771
                             register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1772
                             register cmsUInt32Number Stride)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1773
{
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1774
    output++;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1775
    *output++ = FROM_16_TO_8(FomLabV4ToLabV2(wOut[0]));
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1776
    *output++ = FROM_16_TO_8(FomLabV4ToLabV2(wOut[1]));
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1777
    *output++ = FROM_16_TO_8(FomLabV4ToLabV2(wOut[2]));
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1778
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1779
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1780
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1781
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1782
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1783
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1784
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1785
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1786
cmsUInt8Number* PackLabV2_16(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1787
                             register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1788
                             register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1789
                             register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1790
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1791
    *(cmsUInt16Number*) output = FomLabV4ToLabV2(wOut[0]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1792
    output += 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1793
    *(cmsUInt16Number*) output = FomLabV4ToLabV2(wOut[1]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1794
    output += 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1795
    *(cmsUInt16Number*) output = FomLabV4ToLabV2(wOut[2]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1796
    output += 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1797
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1798
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1799
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1800
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1801
    cmsUNUSED_PARAMETER(Stride);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1802
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1803
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1804
static
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1805
cmsUInt8Number* Pack3Bytes(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1806
                           register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1807
                           register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1808
                           register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1809
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1810
    *output++ = FROM_16_TO_8(wOut[0]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1811
    *output++ = FROM_16_TO_8(wOut[1]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1812
    *output++ = FROM_16_TO_8(wOut[2]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1813
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1814
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1815
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1816
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1817
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1818
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1819
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1820
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1821
cmsUInt8Number* Pack3BytesOptimized(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1822
                                    register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1823
                                    register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1824
                                    register cmsUInt32Number Stride)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1825
{
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1826
    *output++ = (wOut[0] & 0xFF);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1827
    *output++ = (wOut[1] & 0xFF);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1828
    *output++ = (wOut[2] & 0xFF);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1829
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1830
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1831
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1832
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1833
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1834
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1835
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1836
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1837
cmsUInt8Number* Pack3BytesSwap(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1838
                               register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1839
                               register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1840
                               register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1841
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1842
    *output++ = FROM_16_TO_8(wOut[2]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1843
    *output++ = FROM_16_TO_8(wOut[1]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1844
    *output++ = FROM_16_TO_8(wOut[0]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1845
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1846
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1847
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1848
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1849
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1850
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1851
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1852
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1853
cmsUInt8Number* Pack3BytesSwapOptimized(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1854
                                        register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1855
                                        register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1856
                                        register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1857
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1858
    *output++ = (wOut[2] & 0xFF);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1859
    *output++ = (wOut[1] & 0xFF);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1860
    *output++ = (wOut[0] & 0xFF);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1861
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1862
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1863
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1864
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1865
    cmsUNUSED_PARAMETER(Stride);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1866
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1867
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1868
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1869
static
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1870
cmsUInt8Number* Pack3Words(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1871
                           register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1872
                           register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1873
                           register cmsUInt32Number Stride)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1874
{
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1875
    *(cmsUInt16Number*) output = wOut[0];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1876
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1877
    *(cmsUInt16Number*) output = wOut[1];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1878
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1879
    *(cmsUInt16Number*) output = wOut[2];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1880
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1881
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1882
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1883
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1884
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1885
    cmsUNUSED_PARAMETER(Stride);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1886
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1887
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1888
static
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1889
cmsUInt8Number* Pack3WordsSwap(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1890
                               register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1891
                               register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1892
                               register cmsUInt32Number Stride)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1893
{
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1894
    *(cmsUInt16Number*) output = wOut[2];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1895
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1896
    *(cmsUInt16Number*) output = wOut[1];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1897
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1898
    *(cmsUInt16Number*) output = wOut[0];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1899
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1900
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1901
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1902
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1903
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1904
    cmsUNUSED_PARAMETER(Stride);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1905
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1906
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1907
static
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1908
cmsUInt8Number* Pack3WordsBigEndian(register _cmsTRANSFORM* info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1909
                                    register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1910
                                    register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1911
                                    register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1912
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1913
    *(cmsUInt16Number*) output = CHANGE_ENDIAN(wOut[0]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1914
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1915
    *(cmsUInt16Number*) output = CHANGE_ENDIAN(wOut[1]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1916
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1917
    *(cmsUInt16Number*) output = CHANGE_ENDIAN(wOut[2]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1918
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1919
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1920
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1921
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1922
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1923
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1924
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1925
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1926
static
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1927
cmsUInt8Number* Pack3BytesAndSkip1(register _cmsTRANSFORM* info,
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1928
                                   register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1929
                                   register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1930
                                   register cmsUInt32Number Stride)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1931
{
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1932
    *output++ = FROM_16_TO_8(wOut[0]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1933
    *output++ = FROM_16_TO_8(wOut[1]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1934
    *output++ = FROM_16_TO_8(wOut[2]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1935
    output++;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1936
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1937
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1938
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1939
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1940
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1941
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1942
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1943
static
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1944
cmsUInt8Number* Pack3BytesAndSkip1Optimized(register _cmsTRANSFORM* info,
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1945
                                            register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1946
                                            register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1947
                                            register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1948
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1949
    *output++ = (wOut[0] & 0xFF);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1950
    *output++ = (wOut[1] & 0xFF);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1951
    *output++ = (wOut[2] & 0xFF);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1952
    output++;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1953
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1954
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1955
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1956
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1957
    cmsUNUSED_PARAMETER(Stride);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1958
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1959
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1960
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1961
static
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1962
cmsUInt8Number* Pack3BytesAndSkip1SwapFirst(register _cmsTRANSFORM* info,
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1963
                                            register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1964
                                            register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1965
                                            register cmsUInt32Number Stride)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1966
{
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1967
    output++;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1968
    *output++ = FROM_16_TO_8(wOut[0]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1969
    *output++ = FROM_16_TO_8(wOut[1]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1970
    *output++ = FROM_16_TO_8(wOut[2]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1971
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1972
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1973
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1974
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1975
    cmsUNUSED_PARAMETER(Stride);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1976
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1977
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1978
static
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1979
cmsUInt8Number* Pack3BytesAndSkip1SwapFirstOptimized(register _cmsTRANSFORM* info,
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1980
                                                     register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1981
                                                     register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1982
                                                     register cmsUInt32Number Stride)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1983
{
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1984
    output++;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1985
    *output++ = (wOut[0] & 0xFF);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1986
    *output++ = (wOut[1] & 0xFF);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1987
    *output++ = (wOut[2] & 0xFF);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1988
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1989
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1990
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1991
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1992
    cmsUNUSED_PARAMETER(Stride);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1993
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1994
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1995
static
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  1996
cmsUInt8Number* Pack3BytesAndSkip1Swap(register _cmsTRANSFORM* info,
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1997
                                       register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1998
                                       register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  1999
                                       register cmsUInt32Number Stride)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2000
{
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2001
    output++;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2002
    *output++ = FROM_16_TO_8(wOut[2]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2003
    *output++ = FROM_16_TO_8(wOut[1]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2004
    *output++ = FROM_16_TO_8(wOut[0]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2005
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2006
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2007
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2008
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2009
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2010
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2011
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2012
static
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2013
cmsUInt8Number* Pack3BytesAndSkip1SwapOptimized(register _cmsTRANSFORM* info,
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2014
                                                register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2015
                                                register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2016
                                                register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2017
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2018
    output++;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2019
    *output++ = (wOut[2] & 0xFF);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2020
    *output++ = (wOut[1] & 0xFF);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2021
    *output++ = (wOut[0] & 0xFF);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2022
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2023
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2024
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2025
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2026
    cmsUNUSED_PARAMETER(Stride);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2027
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2028
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2029
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2030
static
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2031
cmsUInt8Number* Pack3BytesAndSkip1SwapSwapFirst(register _cmsTRANSFORM* info,
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2032
                                                register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2033
                                                register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2034
                                                register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2035
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2036
    *output++ = FROM_16_TO_8(wOut[2]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2037
    *output++ = FROM_16_TO_8(wOut[1]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2038
    *output++ = FROM_16_TO_8(wOut[0]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2039
    output++;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2040
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2041
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2042
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2043
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2044
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2045
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2046
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2047
static
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2048
cmsUInt8Number* Pack3BytesAndSkip1SwapSwapFirstOptimized(register _cmsTRANSFORM* info,
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2049
                                                         register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2050
                                                         register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2051
                                                         register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2052
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2053
    *output++ = (wOut[2] & 0xFF);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2054
    *output++ = (wOut[1] & 0xFF);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2055
    *output++ = (wOut[0] & 0xFF);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2056
    output++;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2057
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2058
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2059
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2060
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2061
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2062
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2063
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2064
static
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2065
cmsUInt8Number* Pack3WordsAndSkip1(register _cmsTRANSFORM* info,
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2066
                                   register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2067
                                   register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2068
                                   register cmsUInt32Number Stride)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2069
{
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2070
    *(cmsUInt16Number*) output = wOut[0];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2071
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2072
    *(cmsUInt16Number*) output = wOut[1];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2073
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2074
    *(cmsUInt16Number*) output = wOut[2];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2075
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2076
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2077
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2078
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2079
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2080
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2081
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2082
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2083
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2084
static
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2085
cmsUInt8Number* Pack3WordsAndSkip1Swap(register _cmsTRANSFORM* info,
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2086
                                       register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2087
                                       register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2088
                                       register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2089
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2090
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2091
    *(cmsUInt16Number*) output = wOut[2];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2092
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2093
    *(cmsUInt16Number*) output = wOut[1];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2094
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2095
    *(cmsUInt16Number*) output = wOut[0];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2096
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2097
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2098
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2099
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2100
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2101
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2102
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2103
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2104
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2105
static
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2106
cmsUInt8Number* Pack3WordsAndSkip1SwapFirst(register _cmsTRANSFORM* info,
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2107
                                            register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2108
                                            register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2109
                                            register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2110
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2111
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2112
    *(cmsUInt16Number*) output = wOut[0];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2113
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2114
    *(cmsUInt16Number*) output = wOut[1];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2115
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2116
    *(cmsUInt16Number*) output = wOut[2];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2117
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2118
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2119
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2120
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2121
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2122
    cmsUNUSED_PARAMETER(Stride);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2123
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2124
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2125
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2126
static
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2127
cmsUInt8Number* Pack3WordsAndSkip1SwapSwapFirst(register _cmsTRANSFORM* info,
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2128
                                                register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2129
                                                register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2130
                                                register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2131
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2132
    *(cmsUInt16Number*) output = wOut[2];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2133
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2134
    *(cmsUInt16Number*) output = wOut[1];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2135
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2136
    *(cmsUInt16Number*) output = wOut[0];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2137
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2138
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2139
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2140
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2141
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2142
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2143
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2144
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2145
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2146
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2147
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2148
static
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2149
cmsUInt8Number* Pack1Byte(register _cmsTRANSFORM* info,
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2150
                          register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2151
                          register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2152
                          register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2153
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2154
    *output++ = FROM_16_TO_8(wOut[0]);
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2155
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2156
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2157
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2158
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2159
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2160
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2161
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2162
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2163
static
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2164
cmsUInt8Number* Pack1ByteReversed(register _cmsTRANSFORM* info,
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2165
                                  register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2166
                                  register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2167
                                  register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2168
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2169
    *output++ = FROM_16_TO_8(REVERSE_FLAVOR_16(wOut[0]));
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2170
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2171
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2172
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2173
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2174
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2175
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2176
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2177
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2178
static
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2179
cmsUInt8Number* Pack1ByteSkip1(register _cmsTRANSFORM* info,
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2180
                               register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2181
                               register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2182
                               register cmsUInt32Number Stride)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2183
{
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2184
    *output++ = FROM_16_TO_8(wOut[0]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2185
    output++;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2186
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2187
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2188
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2189
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2190
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2191
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2192
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2193
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2194
static
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2195
cmsUInt8Number* Pack1ByteSkip1SwapFirst(register _cmsTRANSFORM* info,
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2196
                                        register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2197
                                        register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2198
                                        register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2199
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2200
    output++;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2201
    *output++ = FROM_16_TO_8(wOut[0]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2202
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2203
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2204
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2205
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2206
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2207
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2208
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2209
static
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2210
cmsUInt8Number* Pack1Word(register _cmsTRANSFORM* info,
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2211
                          register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2212
                          register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2213
                          register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2214
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2215
    *(cmsUInt16Number*) output = wOut[0];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2216
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2217
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2218
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2219
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2220
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2221
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2222
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2223
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2224
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2225
static
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2226
cmsUInt8Number* Pack1WordReversed(register _cmsTRANSFORM* info,
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2227
                                  register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2228
                                  register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2229
                                  register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2230
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2231
    *(cmsUInt16Number*) output = REVERSE_FLAVOR_16(wOut[0]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2232
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2233
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2234
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2235
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2236
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2237
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2238
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2239
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2240
static
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2241
cmsUInt8Number* Pack1WordBigEndian(register _cmsTRANSFORM* info,
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2242
                                   register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2243
                                   register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2244
                                   register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2245
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2246
    *(cmsUInt16Number*) output = CHANGE_ENDIAN(wOut[0]);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2247
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2248
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2249
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2250
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2251
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2252
    cmsUNUSED_PARAMETER(Stride);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2253
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2254
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2255
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2256
static
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2257
cmsUInt8Number* Pack1WordSkip1(register _cmsTRANSFORM* info,
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2258
                               register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2259
                               register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2260
                               register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2261
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2262
    *(cmsUInt16Number*) output = wOut[0];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2263
    output+= 4;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2264
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2265
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2266
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2267
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2268
    cmsUNUSED_PARAMETER(Stride);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2269
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2270
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2271
static
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2272
cmsUInt8Number* Pack1WordSkip1SwapFirst(register _cmsTRANSFORM* info,
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2273
                                        register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2274
                                        register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2275
                                        register cmsUInt32Number Stride)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2276
{
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2277
    output += 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2278
    *(cmsUInt16Number*) output = wOut[0];
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2279
    output+= 2;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2280
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2281
    return output;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2282
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2283
    cmsUNUSED_PARAMETER(info);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2284
    cmsUNUSED_PARAMETER(Stride);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2285
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2286
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2287
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2288
// Unencoded Float values -- don't try optimize speed
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2289
static
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2290
cmsUInt8Number* PackLabDoubleFrom16(register _cmsTRANSFORM* info,
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2291
                                    register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2292
                                    register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2293
                                    register cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2294
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2295
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2296
    if (T_PLANAR(info -> OutputFormat)) {
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2297
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2298
        cmsCIELab  Lab;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2299
        cmsFloat64Number* Out = (cmsFloat64Number*) output;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2300
        cmsLabEncoded2Float(&Lab, wOut);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2301
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2302
        Out[0]        = Lab.L;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2303
        Out[Stride]   = Lab.a;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2304
        Out[Stride*2] = Lab.b;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2305
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2306
        return output + sizeof(cmsFloat64Number);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2307
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2308
    else {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2309
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2310
        cmsLabEncoded2Float((cmsCIELab*) output, wOut);
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2311
        return output + (sizeof(cmsCIELab) + T_EXTRA(info ->OutputFormat) * sizeof(cmsFloat64Number));
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2312
    }
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2313
}
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2314
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2315
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2316
static
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2317
cmsUInt8Number* PackLabFloatFrom16(register _cmsTRANSFORM* info,
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2318
                                    register cmsUInt16Number wOut[],
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2319
                                    register cmsUInt8Number* output,
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2320
                                    register cmsUInt32Number Stride)
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2321
{
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2322
    cmsCIELab  Lab;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2323
    cmsLabEncoded2Float(&Lab, wOut);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2324
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2325
    if (T_PLANAR(info -> OutputFormat)) {
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2326
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2327
        cmsFloat32Number* Out = (cmsFloat32Number*) output;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2328
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2329
        Out[0]        = (cmsFloat32Number)Lab.L;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2330
        Out[Stride]   = (cmsFloat32Number)Lab.a;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2331
        Out[Stride*2] = (cmsFloat32Number)Lab.b;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2332
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2333
        return output + sizeof(cmsFloat32Number);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2334
    }
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2335
    else {
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2336
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2337
       ((cmsFloat32Number*) output)[0] = (cmsFloat32Number) Lab.L;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2338
       ((cmsFloat32Number*) output)[1] = (cmsFloat32Number) Lab.a;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2339
       ((cmsFloat32Number*) output)[2] = (cmsFloat32Number) Lab.b;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2340
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2341
        return output + (3 + T_EXTRA(info ->OutputFormat)) * sizeof(cmsFloat32Number);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2342
    }
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2343
}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2344
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2345
static
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2346
cmsUInt8Number* PackXYZDoubleFrom16(register _cmsTRANSFORM* Info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2347
                                    register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2348
                                    register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2349
                                    register cmsUInt32Number Stride)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2350
{
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2351
    if (T_PLANAR(Info -> OutputFormat)) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2352
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2353
        cmsCIEXYZ XYZ;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2354
        cmsFloat64Number* Out = (cmsFloat64Number*) output;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2355
        cmsXYZEncoded2Float(&XYZ, wOut);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2356
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2357
        Out[0]        = XYZ.X;
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2358
        Out[Stride]   = XYZ.Y;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2359
        Out[Stride*2] = XYZ.Z;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2360
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2361
        return output + sizeof(cmsFloat64Number);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2362
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2363
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2364
    else {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2365
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2366
        cmsXYZEncoded2Float((cmsCIEXYZ*) output, wOut);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2367
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2368
        return output + (sizeof(cmsCIEXYZ) + T_EXTRA(Info ->OutputFormat) * sizeof(cmsFloat64Number));
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2369
    }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2370
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2371
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2372
static
26609
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2373
cmsUInt8Number* PackXYZFloatFrom16(register _cmsTRANSFORM* Info,
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2374
                                   register cmsUInt16Number wOut[],
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2375
                                   register cmsUInt8Number* output,
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2376
                                   register cmsUInt32Number Stride)
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2377
{
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2378
    if (T_PLANAR(Info -> OutputFormat)) {
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2379
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2380
        cmsCIEXYZ XYZ;
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2381
        cmsFloat32Number* Out = (cmsFloat32Number*) output;
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2382
        cmsXYZEncoded2Float(&XYZ, wOut);
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2383
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2384
        Out[0]        = (cmsFloat32Number) XYZ.X;
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2385
        Out[Stride]   = (cmsFloat32Number) XYZ.Y;
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2386
        Out[Stride*2] = (cmsFloat32Number) XYZ.Z;
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2387
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2388
        return output + sizeof(cmsFloat32Number);
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2389
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2390
    }
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2391
    else {
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2392
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2393
        cmsCIEXYZ XYZ;
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2394
        cmsFloat32Number* Out = (cmsFloat32Number*) output;
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2395
        cmsXYZEncoded2Float(&XYZ, wOut);
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2396
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2397
        Out[0] = (cmsFloat32Number) XYZ.X;
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2398
        Out[1] = (cmsFloat32Number) XYZ.Y;
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2399
        Out[2] = (cmsFloat32Number) XYZ.Z;
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2400
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2401
        return output + (3 * sizeof(cmsFloat32Number) + T_EXTRA(Info ->OutputFormat) * sizeof(cmsFloat32Number));
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2402
    }
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2403
}
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2404
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2405
static
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2406
cmsUInt8Number* PackDoubleFrom16(register _cmsTRANSFORM* info,
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2407
                                register cmsUInt16Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2408
                                register cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2409
                                register cmsUInt32Number Stride)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2410
{
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2411
    int nChan      = T_CHANNELS(info -> OutputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2412
    int DoSwap     = T_DOSWAP(info ->OutputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2413
    int Reverse    = T_FLAVOR(info ->OutputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2414
    int Extra      = T_EXTRA(info -> OutputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2415
    int SwapFirst  = T_SWAPFIRST(info -> OutputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2416
    int Planar     = T_PLANAR(info -> OutputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2417
    int ExtraFirst = DoSwap ^ SwapFirst;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2418
    cmsFloat64Number maximum = IsInkSpace(info ->OutputFormat) ? 655.35 : 65535.0;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2419
    cmsFloat64Number v = 0;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2420
    cmsFloat64Number* swap1 = (cmsFloat64Number*) output;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2421
    int i, start = 0;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2422
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2423
    if (ExtraFirst)
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2424
        start = Extra;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2425
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2426
    for (i=0; i < nChan; i++) {
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2427
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2428
        int index = DoSwap ? (nChan - i - 1) : i;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2429
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2430
        v = (cmsFloat64Number) wOut[index] / maximum;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2431
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2432
        if (Reverse)
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2433
            v = maximum - v;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2434
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2435
        if (Planar)
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2436
            ((cmsFloat64Number*) output)[(i + start)  * Stride]= v;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2437
        else
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2438
            ((cmsFloat64Number*) output)[i + start] = v;
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2439
    }
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2440
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2441
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2442
    if (Extra == 0 && SwapFirst) {
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2443
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2444
         memmove(swap1 + 1, swap1, (nChan-1)* sizeof(cmsFloat64Number));
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2445
        *swap1 = v;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2446
    }
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2447
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2448
    if (T_PLANAR(info -> OutputFormat))
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2449
        return output + sizeof(cmsFloat64Number);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2450
    else
30491
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2451
        return output + (nChan + Extra) * sizeof(cmsFloat64Number);
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2452
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2453
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2454
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2455
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2456
static
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2457
cmsUInt8Number* PackFloatFrom16(register _cmsTRANSFORM* info,
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2458
                                register cmsUInt16Number wOut[],
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2459
                                register cmsUInt8Number* output,
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2460
                                register cmsUInt32Number Stride)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2461
{
30491
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2462
       int nChan = T_CHANNELS(info->OutputFormat);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2463
       int DoSwap = T_DOSWAP(info->OutputFormat);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2464
       int Reverse = T_FLAVOR(info->OutputFormat);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2465
       int Extra = T_EXTRA(info->OutputFormat);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2466
       int SwapFirst = T_SWAPFIRST(info->OutputFormat);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2467
       int Planar = T_PLANAR(info->OutputFormat);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2468
       int ExtraFirst = DoSwap ^ SwapFirst;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2469
       cmsFloat64Number maximum = IsInkSpace(info->OutputFormat) ? 655.35 : 65535.0;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2470
       cmsFloat64Number v = 0;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2471
       cmsFloat32Number* swap1 = (cmsFloat32Number*)output;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2472
       int i, start = 0;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2473
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2474
       if (ExtraFirst)
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2475
              start = Extra;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2476
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2477
       for (i = 0; i < nChan; i++) {
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2478
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2479
              int index = DoSwap ? (nChan - i - 1) : i;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2480
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2481
              v = (cmsFloat64Number)wOut[index] / maximum;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2482
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2483
              if (Reverse)
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2484
                     v = maximum - v;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2485
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2486
              if (Planar)
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2487
                     ((cmsFloat32Number*)output)[(i + start) * Stride] = (cmsFloat32Number)v;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2488
              else
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2489
                     ((cmsFloat32Number*)output)[i + start] = (cmsFloat32Number)v;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2490
       }
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2491
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2492
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2493
       if (Extra == 0 && SwapFirst) {
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2494
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2495
              memmove(swap1 + 1, swap1, (nChan - 1)* sizeof(cmsFloat32Number));
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2496
              *swap1 = (cmsFloat32Number)v;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2497
       }
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2498
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2499
       if (T_PLANAR(info->OutputFormat))
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2500
              return output + sizeof(cmsFloat32Number);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2501
       else
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2502
              return output + (nChan + Extra) * sizeof(cmsFloat32Number);
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2503
}
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2504
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2505
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2506
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2507
// --------------------------------------------------------------------------------------------------------
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2508
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2509
static
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2510
cmsUInt8Number* PackFloatsFromFloat(_cmsTRANSFORM* info,
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2511
                                    cmsFloat32Number wOut[],
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2512
                                    cmsUInt8Number* output,
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2513
                                    cmsUInt32Number Stride)
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2514
{
30491
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2515
       int nChan = T_CHANNELS(info->OutputFormat);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2516
       int DoSwap = T_DOSWAP(info->OutputFormat);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2517
       int Reverse = T_FLAVOR(info->OutputFormat);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2518
       int Extra = T_EXTRA(info->OutputFormat);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2519
       int SwapFirst = T_SWAPFIRST(info->OutputFormat);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2520
       int Planar = T_PLANAR(info->OutputFormat);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2521
       int ExtraFirst = DoSwap ^ SwapFirst;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2522
       cmsFloat64Number maximum = IsInkSpace(info->OutputFormat) ? 100.0 : 1.0;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2523
       cmsFloat32Number* swap1 = (cmsFloat32Number*)output;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2524
       cmsFloat64Number v = 0;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2525
       int i, start = 0;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2526
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2527
       if (ExtraFirst)
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2528
              start = Extra;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2529
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2530
       for (i = 0; i < nChan; i++) {
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2531
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2532
              int index = DoSwap ? (nChan - i - 1) : i;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2533
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2534
              v = wOut[index] * maximum;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2535
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2536
              if (Reverse)
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2537
                     v = maximum - v;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2538
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2539
              if (Planar)
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2540
                     ((cmsFloat32Number*)output)[(i + start)* Stride] = (cmsFloat32Number)v;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2541
              else
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2542
                     ((cmsFloat32Number*)output)[i + start] = (cmsFloat32Number)v;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2543
       }
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2544
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2545
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2546
       if (Extra == 0 && SwapFirst) {
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2547
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2548
              memmove(swap1 + 1, swap1, (nChan - 1)* sizeof(cmsFloat32Number));
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2549
              *swap1 = (cmsFloat32Number)v;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2550
       }
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2551
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2552
       if (T_PLANAR(info->OutputFormat))
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2553
              return output + sizeof(cmsFloat32Number);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2554
       else
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2555
              return output + (nChan + Extra) * sizeof(cmsFloat32Number);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2556
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2557
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2558
static
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2559
cmsUInt8Number* PackDoublesFromFloat(_cmsTRANSFORM* info,
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2560
                                    cmsFloat32Number wOut[],
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2561
                                    cmsUInt8Number* output,
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2562
                                    cmsUInt32Number Stride)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2563
{
30491
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2564
       int nChan = T_CHANNELS(info->OutputFormat);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2565
       int DoSwap = T_DOSWAP(info->OutputFormat);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2566
       int Reverse = T_FLAVOR(info->OutputFormat);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2567
       int Extra = T_EXTRA(info->OutputFormat);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2568
       int SwapFirst = T_SWAPFIRST(info->OutputFormat);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2569
       int Planar = T_PLANAR(info->OutputFormat);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2570
       int ExtraFirst = DoSwap ^ SwapFirst;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2571
       cmsFloat64Number maximum = IsInkSpace(info->OutputFormat) ? 100.0 : 1.0;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2572
       cmsFloat64Number v = 0;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2573
       cmsFloat64Number* swap1 = (cmsFloat64Number*)output;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2574
       int i, start = 0;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2575
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2576
       if (ExtraFirst)
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2577
              start = Extra;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2578
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2579
       for (i = 0; i < nChan; i++) {
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2580
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2581
              int index = DoSwap ? (nChan - i - 1) : i;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2582
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2583
              v = wOut[index] * maximum;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2584
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2585
              if (Reverse)
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2586
                     v = maximum - v;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2587
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2588
              if (Planar)
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2589
                     ((cmsFloat64Number*)output)[(i + start) * Stride] = v;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2590
              else
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2591
                     ((cmsFloat64Number*)output)[i + start] = v;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2592
       }
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2593
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2594
       if (Extra == 0 && SwapFirst) {
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2595
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2596
              memmove(swap1 + 1, swap1, (nChan - 1)* sizeof(cmsFloat64Number));
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2597
              *swap1 = v;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2598
       }
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2599
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2600
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2601
       if (T_PLANAR(info->OutputFormat))
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2602
              return output + sizeof(cmsFloat64Number);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2603
       else
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2604
              return output + (nChan + Extra) * sizeof(cmsFloat64Number);
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2605
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2606
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2607
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2608
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2609
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2610
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2611
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2612
static
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2613
cmsUInt8Number* PackLabFloatFromFloat(_cmsTRANSFORM* Info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2614
                                      cmsFloat32Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2615
                                      cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2616
                                      cmsUInt32Number Stride)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2617
{
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2618
    cmsFloat32Number* Out = (cmsFloat32Number*) output;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2619
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2620
    if (T_PLANAR(Info -> OutputFormat)) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2621
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2622
        Out[0]        = (cmsFloat32Number) (wOut[0] * 100.0);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2623
        Out[Stride]   = (cmsFloat32Number) (wOut[1] * 255.0 - 128.0);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2624
        Out[Stride*2] = (cmsFloat32Number) (wOut[2] * 255.0 - 128.0);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2625
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2626
        return output + sizeof(cmsFloat32Number);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2627
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2628
    else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2629
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2630
        Out[0] = (cmsFloat32Number) (wOut[0] * 100.0);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2631
        Out[1] = (cmsFloat32Number) (wOut[1] * 255.0 - 128.0);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2632
        Out[2] = (cmsFloat32Number) (wOut[2] * 255.0 - 128.0);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2633
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2634
        return output + (sizeof(cmsFloat32Number)*3 + T_EXTRA(Info ->OutputFormat) * sizeof(cmsFloat32Number));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2635
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2636
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2637
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2638
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2639
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2640
static
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2641
cmsUInt8Number* PackLabDoubleFromFloat(_cmsTRANSFORM* Info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2642
                                       cmsFloat32Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2643
                                       cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2644
                                       cmsUInt32Number Stride)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2645
{
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2646
    cmsFloat64Number* Out = (cmsFloat64Number*) output;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2647
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2648
    if (T_PLANAR(Info -> OutputFormat)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2649
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2650
        Out[0]        = (cmsFloat64Number) (wOut[0] * 100.0);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2651
        Out[Stride]   = (cmsFloat64Number) (wOut[1] * 255.0 - 128.0);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2652
        Out[Stride*2] = (cmsFloat64Number) (wOut[2] * 255.0 - 128.0);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2653
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2654
        return output + sizeof(cmsFloat64Number);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2655
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2656
    else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2657
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2658
        Out[0] = (cmsFloat64Number) (wOut[0] * 100.0);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2659
        Out[1] = (cmsFloat64Number) (wOut[1] * 255.0 - 128.0);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2660
        Out[2] = (cmsFloat64Number) (wOut[2] * 255.0 - 128.0);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2661
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2662
        return output + (sizeof(cmsFloat64Number)*3 + T_EXTRA(Info ->OutputFormat) * sizeof(cmsFloat64Number));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2663
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2664
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2665
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2666
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2667
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2668
// From 0..1 range to 0..MAX_ENCODEABLE_XYZ
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2669
static
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2670
cmsUInt8Number* PackXYZFloatFromFloat(_cmsTRANSFORM* Info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2671
                                      cmsFloat32Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2672
                                      cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2673
                                      cmsUInt32Number Stride)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2674
{
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2675
    cmsFloat32Number* Out = (cmsFloat32Number*) output;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2676
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2677
    if (T_PLANAR(Info -> OutputFormat)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2678
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2679
        Out[0]        = (cmsFloat32Number) (wOut[0] * MAX_ENCODEABLE_XYZ);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2680
        Out[Stride]   = (cmsFloat32Number) (wOut[1] * MAX_ENCODEABLE_XYZ);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2681
        Out[Stride*2] = (cmsFloat32Number) (wOut[2] * MAX_ENCODEABLE_XYZ);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2682
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2683
        return output + sizeof(cmsFloat32Number);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2684
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2685
    else {
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2686
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2687
        Out[0] = (cmsFloat32Number) (wOut[0] * MAX_ENCODEABLE_XYZ);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2688
        Out[1] = (cmsFloat32Number) (wOut[1] * MAX_ENCODEABLE_XYZ);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2689
        Out[2] = (cmsFloat32Number) (wOut[2] * MAX_ENCODEABLE_XYZ);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2690
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2691
        return output + (sizeof(cmsFloat32Number)*3 + T_EXTRA(Info ->OutputFormat) * sizeof(cmsFloat32Number));
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2692
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2693
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2694
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2695
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2696
// Same, but convert to double
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2697
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2698
cmsUInt8Number* PackXYZDoubleFromFloat(_cmsTRANSFORM* Info,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2699
                                       cmsFloat32Number wOut[],
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2700
                                       cmsUInt8Number* output,
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2701
                                       cmsUInt32Number Stride)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2702
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2703
    cmsFloat64Number* Out = (cmsFloat64Number*) output;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2704
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2705
    if (T_PLANAR(Info -> OutputFormat)) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2706
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2707
        Out[0]        = (cmsFloat64Number) (wOut[0] * MAX_ENCODEABLE_XYZ);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2708
        Out[Stride]   = (cmsFloat64Number) (wOut[1] * MAX_ENCODEABLE_XYZ);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2709
        Out[Stride*2] = (cmsFloat64Number) (wOut[2] * MAX_ENCODEABLE_XYZ);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2710
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2711
        return output + sizeof(cmsFloat64Number);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2712
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2713
    else {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2714
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2715
        Out[0] = (cmsFloat64Number) (wOut[0] * MAX_ENCODEABLE_XYZ);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2716
        Out[1] = (cmsFloat64Number) (wOut[1] * MAX_ENCODEABLE_XYZ);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2717
        Out[2] = (cmsFloat64Number) (wOut[2] * MAX_ENCODEABLE_XYZ);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2718
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2719
        return output + (sizeof(cmsFloat64Number)*3 + T_EXTRA(Info ->OutputFormat) * sizeof(cmsFloat64Number));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2720
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2721
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2722
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2723
90ce3da70b43 Initial load
duke
parents:
diff changeset
  2724
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2725
// ----------------------------------------------------------------------------------------------------------------
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2726
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2727
#ifndef CMS_NO_HALF_SUPPORT
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2728
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2729
// Decodes an stream of half floats to wIn[] described by input format
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2730
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2731
static
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2732
cmsUInt8Number* UnrollHalfTo16(register _cmsTRANSFORM* info,
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2733
                                register cmsUInt16Number wIn[],
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2734
                                register cmsUInt8Number* accum,
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2735
                                register cmsUInt32Number Stride)
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2736
{
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2737
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2738
    int nChan      = T_CHANNELS(info -> InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2739
    int DoSwap     = T_DOSWAP(info ->InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2740
    int Reverse    = T_FLAVOR(info ->InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2741
    int SwapFirst  = T_SWAPFIRST(info -> InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2742
    int Extra      = T_EXTRA(info -> InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2743
    int ExtraFirst = DoSwap ^ SwapFirst;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2744
    int Planar     = T_PLANAR(info -> InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2745
    cmsFloat32Number v;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2746
    int i, start = 0;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2747
    cmsFloat32Number maximum = IsInkSpace(info ->InputFormat) ? 655.35F : 65535.0F;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2748
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2749
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2750
    if (ExtraFirst)
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2751
            start = Extra;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2752
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2753
    for (i=0; i < nChan; i++) {
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2754
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2755
        int index = DoSwap ? (nChan - i - 1) : i;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2756
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2757
        if (Planar)
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2758
            v = _cmsHalf2Float ( ((cmsUInt16Number*) accum)[(i + start) * Stride] );
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2759
        else
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2760
            v = _cmsHalf2Float ( ((cmsUInt16Number*) accum)[i + start] ) ;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2761
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2762
        if (Reverse) v = maximum - v;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2763
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2764
        wIn[index] = _cmsQuickSaturateWord(v * maximum);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2765
    }
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2766
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2767
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2768
    if (Extra == 0 && SwapFirst) {
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2769
        cmsUInt16Number tmp = wIn[0];
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2770
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2771
        memmove(&wIn[0], &wIn[1], (nChan-1) * sizeof(cmsUInt16Number));
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2772
        wIn[nChan-1] = tmp;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2773
    }
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2774
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2775
    if (T_PLANAR(info -> InputFormat))
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2776
        return accum + sizeof(cmsUInt16Number);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2777
    else
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2778
        return accum + (nChan + Extra) * sizeof(cmsUInt16Number);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2779
}
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2780
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2781
// Decodes an stream of half floats to wIn[] described by input format
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2782
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2783
static
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2784
cmsUInt8Number* UnrollHalfToFloat(_cmsTRANSFORM* info,
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2785
                                    cmsFloat32Number wIn[],
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2786
                                    cmsUInt8Number* accum,
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2787
                                    cmsUInt32Number Stride)
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2788
{
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2789
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2790
    int nChan      = T_CHANNELS(info -> InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2791
    int DoSwap     = T_DOSWAP(info ->InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2792
    int Reverse    = T_FLAVOR(info ->InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2793
    int SwapFirst  = T_SWAPFIRST(info -> InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2794
    int Extra      = T_EXTRA(info -> InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2795
    int ExtraFirst = DoSwap ^ SwapFirst;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2796
    int Planar     = T_PLANAR(info -> InputFormat);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2797
    cmsFloat32Number v;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2798
    int i, start = 0;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2799
    cmsFloat32Number maximum = IsInkSpace(info ->InputFormat) ? 100.0F : 1.0F;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2800
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2801
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2802
    if (ExtraFirst)
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2803
            start = Extra;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2804
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2805
    for (i=0; i < nChan; i++) {
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2806
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2807
        int index = DoSwap ? (nChan - i - 1) : i;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2808
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2809
        if (Planar)
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2810
            v =  _cmsHalf2Float ( ((cmsUInt16Number*) accum)[(i + start) * Stride] );
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2811
        else
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2812
            v =  _cmsHalf2Float ( ((cmsUInt16Number*) accum)[i + start] ) ;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2813
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2814
        v /= maximum;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2815
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2816
        wIn[index] = Reverse ? 1 - v : v;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2817
    }
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2818
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2819
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2820
    if (Extra == 0 && SwapFirst) {
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2821
        cmsFloat32Number tmp = wIn[0];
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2822
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2823
        memmove(&wIn[0], &wIn[1], (nChan-1) * sizeof(cmsFloat32Number));
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2824
        wIn[nChan-1] = tmp;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2825
    }
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2826
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2827
    if (T_PLANAR(info -> InputFormat))
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2828
        return accum + sizeof(cmsUInt16Number);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2829
    else
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2830
        return accum + (nChan + Extra) * sizeof(cmsUInt16Number);
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2831
}
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2832
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2833
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2834
static
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2835
cmsUInt8Number* PackHalfFrom16(register _cmsTRANSFORM* info,
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2836
                                register cmsUInt16Number wOut[],
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2837
                                register cmsUInt8Number* output,
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2838
                                register cmsUInt32Number Stride)
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2839
{
30491
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2840
       int nChan = T_CHANNELS(info->OutputFormat);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2841
       int DoSwap = T_DOSWAP(info->OutputFormat);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2842
       int Reverse = T_FLAVOR(info->OutputFormat);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2843
       int Extra = T_EXTRA(info->OutputFormat);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2844
       int SwapFirst = T_SWAPFIRST(info->OutputFormat);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2845
       int Planar = T_PLANAR(info->OutputFormat);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2846
       int ExtraFirst = DoSwap ^ SwapFirst;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2847
       cmsFloat32Number maximum = IsInkSpace(info->OutputFormat) ? 655.35F : 65535.0F;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2848
       cmsFloat32Number v = 0;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2849
       cmsUInt16Number* swap1 = (cmsUInt16Number*)output;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2850
       int i, start = 0;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2851
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2852
       if (ExtraFirst)
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2853
              start = Extra;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2854
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2855
       for (i = 0; i < nChan; i++) {
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2856
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2857
              int index = DoSwap ? (nChan - i - 1) : i;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2858
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2859
              v = (cmsFloat32Number)wOut[index] / maximum;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2860
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2861
              if (Reverse)
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2862
                     v = maximum - v;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2863
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2864
              if (Planar)
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2865
                     ((cmsUInt16Number*)output)[(i + start) * Stride] = _cmsFloat2Half(v);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2866
              else
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2867
                     ((cmsUInt16Number*)output)[i + start] = _cmsFloat2Half(v);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2868
       }
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2869
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2870
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2871
       if (Extra == 0 && SwapFirst) {
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2872
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2873
              memmove(swap1 + 1, swap1, (nChan - 1)* sizeof(cmsUInt16Number));
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2874
              *swap1 = _cmsFloat2Half(v);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2875
       }
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2876
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2877
       if (T_PLANAR(info->OutputFormat))
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2878
              return output + sizeof(cmsUInt16Number);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2879
       else
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2880
              return output + (nChan + Extra) * sizeof(cmsUInt16Number);
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2881
}
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2882
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2883
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2884
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2885
static
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2886
cmsUInt8Number* PackHalfFromFloat(_cmsTRANSFORM* info,
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2887
                                    cmsFloat32Number wOut[],
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2888
                                    cmsUInt8Number* output,
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2889
                                    cmsUInt32Number Stride)
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2890
{
30491
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2891
       int nChan = T_CHANNELS(info->OutputFormat);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2892
       int DoSwap = T_DOSWAP(info->OutputFormat);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2893
       int Reverse = T_FLAVOR(info->OutputFormat);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2894
       int Extra = T_EXTRA(info->OutputFormat);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2895
       int SwapFirst = T_SWAPFIRST(info->OutputFormat);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2896
       int Planar = T_PLANAR(info->OutputFormat);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2897
       int ExtraFirst = DoSwap ^ SwapFirst;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2898
       cmsFloat32Number maximum = IsInkSpace(info->OutputFormat) ? 100.0F : 1.0F;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2899
       cmsUInt16Number* swap1 = (cmsUInt16Number*)output;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2900
       cmsFloat32Number v = 0;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2901
       int i, start = 0;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2902
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2903
       if (ExtraFirst)
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2904
              start = Extra;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2905
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2906
       for (i = 0; i < nChan; i++) {
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2907
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2908
              int index = DoSwap ? (nChan - i - 1) : i;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2909
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2910
              v = wOut[index] * maximum;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2911
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2912
              if (Reverse)
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2913
                     v = maximum - v;
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2914
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2915
              if (Planar)
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2916
                     ((cmsUInt16Number*)output)[(i + start)* Stride] = _cmsFloat2Half(v);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2917
              else
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2918
                     ((cmsUInt16Number*)output)[i + start] = _cmsFloat2Half(v);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2919
       }
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2920
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2921
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2922
       if (Extra == 0 && SwapFirst) {
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2923
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2924
              memmove(swap1 + 1, swap1, (nChan - 1)* sizeof(cmsUInt16Number));
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2925
              *swap1 = (cmsUInt16Number)_cmsFloat2Half(v);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2926
       }
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2927
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2928
       if (T_PLANAR(info->OutputFormat))
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2929
              return output + sizeof(cmsUInt16Number);
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2930
       else
ea1c291ee28f 8078331: Upgrade JDK to use LittleCMS 2.7
prr
parents: 26609
diff changeset
  2931
              return output + (nChan + Extra)* sizeof(cmsUInt16Number);
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2932
}
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2933
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2934
#endif
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2935
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2936
// ----------------------------------------------------------------------------------------------------------------
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2937
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2938
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2939
static cmsFormatters16 InputFormatters16[] = {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2940
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2941
    //    Type                                          Mask                  Function
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2942
    //  ----------------------------   ------------------------------------  ----------------------------
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2943
    { TYPE_Lab_DBL,                                 ANYPLANAR|ANYEXTRA,   UnrollLabDoubleTo16},
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2944
    { TYPE_XYZ_DBL,                                 ANYPLANAR|ANYEXTRA,   UnrollXYZDoubleTo16},
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2945
    { TYPE_Lab_FLT,                                 ANYPLANAR|ANYEXTRA,   UnrollLabFloatTo16},
26609
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  2946
    { TYPE_XYZ_FLT,                                 ANYPLANAR|ANYEXTRA,   UnrollXYZFloatTo16},
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2947
    { TYPE_GRAY_DBL,                                                 0,   UnrollDouble1Chan},
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2948
    { FLOAT_SH(1)|BYTES_SH(0), ANYCHANNELS|ANYPLANAR|ANYSWAPFIRST|ANYFLAVOR|
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2949
                                             ANYSWAP|ANYEXTRA|ANYSPACE,   UnrollDoubleTo16},
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2950
    { FLOAT_SH(1)|BYTES_SH(4), ANYCHANNELS|ANYPLANAR|ANYSWAPFIRST|ANYFLAVOR|
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2951
                                             ANYSWAP|ANYEXTRA|ANYSPACE,   UnrollFloatTo16},
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2952
#ifndef CMS_NO_HALF_SUPPORT
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2953
    { FLOAT_SH(1)|BYTES_SH(2), ANYCHANNELS|ANYPLANAR|ANYSWAPFIRST|ANYFLAVOR|
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2954
                                            ANYEXTRA|ANYSWAP|ANYSPACE,   UnrollHalfTo16},
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2955
#endif
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2956
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2957
    { CHANNELS_SH(1)|BYTES_SH(1),                              ANYSPACE,  Unroll1Byte},
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2958
    { CHANNELS_SH(1)|BYTES_SH(1)|EXTRA_SH(1),                  ANYSPACE,  Unroll1ByteSkip1},
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2959
    { CHANNELS_SH(1)|BYTES_SH(1)|EXTRA_SH(2),                  ANYSPACE,  Unroll1ByteSkip2},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2960
    { CHANNELS_SH(1)|BYTES_SH(1)|FLAVOR_SH(1),                 ANYSPACE,  Unroll1ByteReversed},
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2961
    { COLORSPACE_SH(PT_MCH2)|CHANNELS_SH(2)|BYTES_SH(1),              0,  Unroll2Bytes},
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2962
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2963
    { TYPE_LabV2_8,                                                   0,  UnrollLabV2_8 },
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2964
    { TYPE_ALabV2_8,                                                  0,  UnrollALabV2_8 },
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2965
    { TYPE_LabV2_16,                                                  0,  UnrollLabV2_16 },
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2966
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2967
    { CHANNELS_SH(3)|BYTES_SH(1),                              ANYSPACE,  Unroll3Bytes},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2968
    { CHANNELS_SH(3)|BYTES_SH(1)|DOSWAP_SH(1),                 ANYSPACE,  Unroll3BytesSwap},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2969
    { CHANNELS_SH(3)|EXTRA_SH(1)|BYTES_SH(1)|DOSWAP_SH(1),     ANYSPACE,  Unroll3BytesSkip1Swap},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2970
    { CHANNELS_SH(3)|EXTRA_SH(1)|BYTES_SH(1)|SWAPFIRST_SH(1),  ANYSPACE,  Unroll3BytesSkip1SwapFirst},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2971
23906
8f7f9cb6fe11 8029750: Enhance LCMS color processing
prr
parents: 14300
diff changeset
  2972
    { CHANNELS_SH(3)|EXTRA_SH(1)|BYTES_SH(1)|DOSWAP_SH(1)|SWAPFIRST_SH(1),
8f7f9cb6fe11 8029750: Enhance LCMS color processing
prr
parents: 14300
diff changeset
  2973
                                                               ANYSPACE,  Unroll3BytesSkip1SwapSwapFirst},
8f7f9cb6fe11 8029750: Enhance LCMS color processing
prr
parents: 14300
diff changeset
  2974
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2975
    { CHANNELS_SH(4)|BYTES_SH(1),                              ANYSPACE,  Unroll4Bytes},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2976
    { CHANNELS_SH(4)|BYTES_SH(1)|FLAVOR_SH(1),                 ANYSPACE,  Unroll4BytesReverse},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2977
    { CHANNELS_SH(4)|BYTES_SH(1)|SWAPFIRST_SH(1),              ANYSPACE,  Unroll4BytesSwapFirst},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2978
    { CHANNELS_SH(4)|BYTES_SH(1)|DOSWAP_SH(1),                 ANYSPACE,  Unroll4BytesSwap},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2979
    { CHANNELS_SH(4)|BYTES_SH(1)|DOSWAP_SH(1)|SWAPFIRST_SH(1), ANYSPACE,  Unroll4BytesSwapSwapFirst},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2980
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2981
    { BYTES_SH(1)|PLANAR_SH(1), ANYFLAVOR|ANYSWAPFIRST|
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2982
                                   ANYSWAP|ANYEXTRA|ANYCHANNELS|ANYSPACE, UnrollPlanarBytes},
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2983
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2984
    { BYTES_SH(1),    ANYFLAVOR|ANYSWAPFIRST|ANYSWAP|
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  2985
                                           ANYEXTRA|ANYCHANNELS|ANYSPACE, UnrollChunkyBytes},
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2986
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2987
    { CHANNELS_SH(1)|BYTES_SH(2),                              ANYSPACE,  Unroll1Word},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2988
    { CHANNELS_SH(1)|BYTES_SH(2)|FLAVOR_SH(1),                 ANYSPACE,  Unroll1WordReversed},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2989
    { CHANNELS_SH(1)|BYTES_SH(2)|EXTRA_SH(3),                  ANYSPACE,  Unroll1WordSkip3},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2990
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2991
    { CHANNELS_SH(2)|BYTES_SH(2),                              ANYSPACE,  Unroll2Words},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2992
    { CHANNELS_SH(3)|BYTES_SH(2),                              ANYSPACE,  Unroll3Words},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2993
    { CHANNELS_SH(4)|BYTES_SH(2),                              ANYSPACE,  Unroll4Words},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2994
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2995
    { CHANNELS_SH(3)|BYTES_SH(2)|DOSWAP_SH(1),                 ANYSPACE,  Unroll3WordsSwap},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2996
    { CHANNELS_SH(3)|BYTES_SH(2)|EXTRA_SH(1)|SWAPFIRST_SH(1),  ANYSPACE,  Unroll3WordsSkip1SwapFirst},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2997
    { CHANNELS_SH(3)|BYTES_SH(2)|EXTRA_SH(1)|DOSWAP_SH(1),     ANYSPACE,  Unroll3WordsSkip1Swap},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2998
    { CHANNELS_SH(4)|BYTES_SH(2)|FLAVOR_SH(1),                 ANYSPACE,  Unroll4WordsReverse},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  2999
    { CHANNELS_SH(4)|BYTES_SH(2)|SWAPFIRST_SH(1),              ANYSPACE,  Unroll4WordsSwapFirst},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3000
    { CHANNELS_SH(4)|BYTES_SH(2)|DOSWAP_SH(1),                 ANYSPACE,  Unroll4WordsSwap},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3001
    { CHANNELS_SH(4)|BYTES_SH(2)|DOSWAP_SH(1)|SWAPFIRST_SH(1), ANYSPACE,  Unroll4WordsSwapSwapFirst},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3002
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3003
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3004
    { BYTES_SH(2)|PLANAR_SH(1),  ANYFLAVOR|ANYSWAP|ANYENDIAN|ANYEXTRA|ANYCHANNELS|ANYSPACE,  UnrollPlanarWords},
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3005
    { BYTES_SH(2),  ANYFLAVOR|ANYSWAPFIRST|ANYSWAP|ANYENDIAN|ANYEXTRA|ANYCHANNELS|ANYSPACE,  UnrollAnyWords},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3006
};
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3007
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3008
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3009
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3010
static cmsFormattersFloat InputFormattersFloat[] = {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3011
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3012
    //    Type                                          Mask                  Function
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3013
    //  ----------------------------   ------------------------------------  ----------------------------
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3014
    {     TYPE_Lab_DBL,                                ANYPLANAR|ANYEXTRA,   UnrollLabDoubleToFloat},
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3015
    {     TYPE_Lab_FLT,                                ANYPLANAR|ANYEXTRA,   UnrollLabFloatToFloat},
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3016
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3017
    {     TYPE_XYZ_DBL,                                ANYPLANAR|ANYEXTRA,   UnrollXYZDoubleToFloat},
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3018
    {     TYPE_XYZ_FLT,                                ANYPLANAR|ANYEXTRA,   UnrollXYZFloatToFloat},
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3019
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3020
    {     FLOAT_SH(1)|BYTES_SH(4), ANYPLANAR|ANYSWAPFIRST|ANYSWAP|ANYEXTRA|
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3021
                                                      ANYCHANNELS|ANYSPACE,  UnrollFloatsToFloat},
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3022
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3023
    {     FLOAT_SH(1)|BYTES_SH(0), ANYPLANAR|ANYSWAPFIRST|ANYSWAP|ANYEXTRA|
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3024
                                                        ANYCHANNELS|ANYSPACE,  UnrollDoublesToFloat},
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3025
#ifndef CMS_NO_HALF_SUPPORT
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3026
    {     FLOAT_SH(1)|BYTES_SH(2), ANYPLANAR|ANYSWAPFIRST|ANYSWAP|ANYEXTRA|
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3027
                                                        ANYCHANNELS|ANYSPACE,  UnrollHalfToFloat},
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3028
#endif
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3029
};
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3030
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3031
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3032
// Bit fields set to one in the mask are not compared
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3033
static
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3034
cmsFormatter _cmsGetStockInputFormatter(cmsUInt32Number dwInput, cmsUInt32Number dwFlags)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3035
{
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3036
    cmsUInt32Number i;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3037
    cmsFormatter fr;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3038
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3039
    switch (dwFlags) {
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3040
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3041
    case CMS_PACK_FLAGS_16BITS: {
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3042
        for (i=0; i < sizeof(InputFormatters16) / sizeof(cmsFormatters16); i++) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3043
            cmsFormatters16* f = InputFormatters16 + i;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3044
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3045
            if ((dwInput & ~f ->Mask) == f ->Type) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3046
                fr.Fmt16 = f ->Frm;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3047
                return fr;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3048
            }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3049
        }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3050
    }
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3051
    break;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3052
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3053
    case CMS_PACK_FLAGS_FLOAT: {
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3054
        for (i=0; i < sizeof(InputFormattersFloat) / sizeof(cmsFormattersFloat); i++) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3055
            cmsFormattersFloat* f = InputFormattersFloat + i;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3056
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3057
            if ((dwInput & ~f ->Mask) == f ->Type) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3058
                fr.FmtFloat = f ->Frm;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3059
                return fr;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3060
            }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3061
        }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3062
    }
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3063
    break;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3064
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3065
    default:;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3066
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3067
    }
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3068
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3069
    fr.Fmt16 = NULL;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3070
    return fr;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3071
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3072
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3073
static cmsFormatters16 OutputFormatters16[] = {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3074
    //    Type                                          Mask                  Function
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3075
    //  ----------------------------   ------------------------------------  ----------------------------
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3076
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3077
    { TYPE_Lab_DBL,                                      ANYPLANAR|ANYEXTRA,  PackLabDoubleFrom16},
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3078
    { TYPE_XYZ_DBL,                                      ANYPLANAR|ANYEXTRA,  PackXYZDoubleFrom16},
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3079
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3080
    { TYPE_Lab_FLT,                                      ANYPLANAR|ANYEXTRA,  PackLabFloatFrom16},
26609
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3081
    { TYPE_XYZ_FLT,                                      ANYPLANAR|ANYEXTRA,  PackXYZFloatFrom16},
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3082
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3083
    { FLOAT_SH(1)|BYTES_SH(0),      ANYFLAVOR|ANYSWAPFIRST|ANYSWAP|
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3084
                                    ANYCHANNELS|ANYPLANAR|ANYEXTRA|ANYSPACE,  PackDoubleFrom16},
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3085
    { FLOAT_SH(1)|BYTES_SH(4),      ANYFLAVOR|ANYSWAPFIRST|ANYSWAP|
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3086
                                    ANYCHANNELS|ANYPLANAR|ANYEXTRA|ANYSPACE,  PackFloatFrom16},
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3087
#ifndef CMS_NO_HALF_SUPPORT
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3088
    { FLOAT_SH(1)|BYTES_SH(2),      ANYFLAVOR|ANYSWAPFIRST|ANYSWAP|
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3089
                                    ANYCHANNELS|ANYPLANAR|ANYEXTRA|ANYSPACE,  PackHalfFrom16},
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3090
#endif
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3091
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3092
    { CHANNELS_SH(1)|BYTES_SH(1),                                  ANYSPACE,  Pack1Byte},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3093
    { CHANNELS_SH(1)|BYTES_SH(1)|EXTRA_SH(1),                      ANYSPACE,  Pack1ByteSkip1},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3094
    { CHANNELS_SH(1)|BYTES_SH(1)|EXTRA_SH(1)|SWAPFIRST_SH(1),      ANYSPACE,  Pack1ByteSkip1SwapFirst},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3095
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3096
    { CHANNELS_SH(1)|BYTES_SH(1)|FLAVOR_SH(1),                     ANYSPACE,  Pack1ByteReversed},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3097
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3098
    { TYPE_LabV2_8,                                                       0,  PackLabV2_8 },
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3099
    { TYPE_ALabV2_8,                                                      0,  PackALabV2_8 },
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3100
    { TYPE_LabV2_16,                                                      0,  PackLabV2_16 },
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3101
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3102
    { CHANNELS_SH(3)|BYTES_SH(1)|OPTIMIZED_SH(1),                  ANYSPACE,  Pack3BytesOptimized},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3103
    { CHANNELS_SH(3)|BYTES_SH(1)|EXTRA_SH(1)|OPTIMIZED_SH(1),      ANYSPACE,  Pack3BytesAndSkip1Optimized},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3104
    { CHANNELS_SH(3)|BYTES_SH(1)|EXTRA_SH(1)|SWAPFIRST_SH(1)|OPTIMIZED_SH(1),
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3105
                                                                   ANYSPACE,  Pack3BytesAndSkip1SwapFirstOptimized},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3106
    { CHANNELS_SH(3)|BYTES_SH(1)|EXTRA_SH(1)|DOSWAP_SH(1)|SWAPFIRST_SH(1)|OPTIMIZED_SH(1),
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3107
                                                                   ANYSPACE,  Pack3BytesAndSkip1SwapSwapFirstOptimized},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3108
    { CHANNELS_SH(3)|BYTES_SH(1)|DOSWAP_SH(1)|EXTRA_SH(1)|OPTIMIZED_SH(1),
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3109
                                                                   ANYSPACE,  Pack3BytesAndSkip1SwapOptimized},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3110
    { CHANNELS_SH(3)|BYTES_SH(1)|DOSWAP_SH(1)|OPTIMIZED_SH(1),     ANYSPACE,  Pack3BytesSwapOptimized},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3111
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3112
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3113
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3114
    { CHANNELS_SH(3)|BYTES_SH(1),                                  ANYSPACE,  Pack3Bytes},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3115
    { CHANNELS_SH(3)|BYTES_SH(1)|EXTRA_SH(1),                      ANYSPACE,  Pack3BytesAndSkip1},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3116
    { CHANNELS_SH(3)|BYTES_SH(1)|EXTRA_SH(1)|SWAPFIRST_SH(1),      ANYSPACE,  Pack3BytesAndSkip1SwapFirst},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3117
    { CHANNELS_SH(3)|BYTES_SH(1)|EXTRA_SH(1)|DOSWAP_SH(1)|SWAPFIRST_SH(1),
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3118
                                                                   ANYSPACE,  Pack3BytesAndSkip1SwapSwapFirst},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3119
    { CHANNELS_SH(3)|BYTES_SH(1)|DOSWAP_SH(1)|EXTRA_SH(1),         ANYSPACE,  Pack3BytesAndSkip1Swap},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3120
    { CHANNELS_SH(3)|BYTES_SH(1)|DOSWAP_SH(1),                     ANYSPACE,  Pack3BytesSwap},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3121
    { CHANNELS_SH(6)|BYTES_SH(1),                                  ANYSPACE,  Pack6Bytes},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3122
    { CHANNELS_SH(6)|BYTES_SH(1)|DOSWAP_SH(1),                     ANYSPACE,  Pack6BytesSwap},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3123
    { CHANNELS_SH(4)|BYTES_SH(1),                                  ANYSPACE,  Pack4Bytes},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3124
    { CHANNELS_SH(4)|BYTES_SH(1)|FLAVOR_SH(1),                     ANYSPACE,  Pack4BytesReverse},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3125
    { CHANNELS_SH(4)|BYTES_SH(1)|SWAPFIRST_SH(1),                  ANYSPACE,  Pack4BytesSwapFirst},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3126
    { CHANNELS_SH(4)|BYTES_SH(1)|DOSWAP_SH(1),                     ANYSPACE,  Pack4BytesSwap},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3127
    { CHANNELS_SH(4)|BYTES_SH(1)|DOSWAP_SH(1)|SWAPFIRST_SH(1),     ANYSPACE,  Pack4BytesSwapSwapFirst},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3128
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3129
    { BYTES_SH(1),                 ANYFLAVOR|ANYSWAPFIRST|ANYSWAP|ANYEXTRA|ANYCHANNELS|ANYSPACE, PackAnyBytes},
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3130
    { BYTES_SH(1)|PLANAR_SH(1),    ANYFLAVOR|ANYSWAPFIRST|ANYSWAP|ANYEXTRA|ANYCHANNELS|ANYSPACE, PackPlanarBytes},
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3131
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3132
    { CHANNELS_SH(1)|BYTES_SH(2),                                  ANYSPACE,  Pack1Word},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3133
    { CHANNELS_SH(1)|BYTES_SH(2)|EXTRA_SH(1),                      ANYSPACE,  Pack1WordSkip1},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3134
    { CHANNELS_SH(1)|BYTES_SH(2)|EXTRA_SH(1)|SWAPFIRST_SH(1),      ANYSPACE,  Pack1WordSkip1SwapFirst},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3135
    { CHANNELS_SH(1)|BYTES_SH(2)|FLAVOR_SH(1),                     ANYSPACE,  Pack1WordReversed},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3136
    { CHANNELS_SH(1)|BYTES_SH(2)|ENDIAN16_SH(1),                   ANYSPACE,  Pack1WordBigEndian},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3137
    { CHANNELS_SH(3)|BYTES_SH(2),                                  ANYSPACE,  Pack3Words},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3138
    { CHANNELS_SH(3)|BYTES_SH(2)|DOSWAP_SH(1),                     ANYSPACE,  Pack3WordsSwap},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3139
    { CHANNELS_SH(3)|BYTES_SH(2)|ENDIAN16_SH(1),                   ANYSPACE,  Pack3WordsBigEndian},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3140
    { CHANNELS_SH(3)|BYTES_SH(2)|EXTRA_SH(1),                      ANYSPACE,  Pack3WordsAndSkip1},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3141
    { CHANNELS_SH(3)|BYTES_SH(2)|EXTRA_SH(1)|DOSWAP_SH(1),         ANYSPACE,  Pack3WordsAndSkip1Swap},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3142
    { CHANNELS_SH(3)|BYTES_SH(2)|EXTRA_SH(1)|SWAPFIRST_SH(1),      ANYSPACE,  Pack3WordsAndSkip1SwapFirst},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3143
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3144
    { CHANNELS_SH(3)|BYTES_SH(2)|EXTRA_SH(1)|DOSWAP_SH(1)|SWAPFIRST_SH(1),
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3145
                                                                   ANYSPACE,  Pack3WordsAndSkip1SwapSwapFirst},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3146
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3147
    { CHANNELS_SH(4)|BYTES_SH(2),                                  ANYSPACE,  Pack4Words},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3148
    { CHANNELS_SH(4)|BYTES_SH(2)|FLAVOR_SH(1),                     ANYSPACE,  Pack4WordsReverse},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3149
    { CHANNELS_SH(4)|BYTES_SH(2)|DOSWAP_SH(1),                     ANYSPACE,  Pack4WordsSwap},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3150
    { CHANNELS_SH(4)|BYTES_SH(2)|ENDIAN16_SH(1),                   ANYSPACE,  Pack4WordsBigEndian},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3151
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3152
    { CHANNELS_SH(6)|BYTES_SH(2),                                  ANYSPACE,  Pack6Words},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3153
    { CHANNELS_SH(6)|BYTES_SH(2)|DOSWAP_SH(1),                     ANYSPACE,  Pack6WordsSwap},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3154
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3155
    { BYTES_SH(2)|PLANAR_SH(1),     ANYFLAVOR|ANYENDIAN|ANYSWAP|ANYEXTRA|ANYCHANNELS|ANYSPACE, PackPlanarWords},
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3156
    { BYTES_SH(2),                  ANYFLAVOR|ANYSWAPFIRST|ANYSWAP|ANYENDIAN|ANYEXTRA|ANYCHANNELS|ANYSPACE, PackAnyWords}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3157
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3158
};
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3159
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3160
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3161
static cmsFormattersFloat OutputFormattersFloat[] = {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3162
    //    Type                                          Mask                                 Function
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3163
    //  ----------------------------   ---------------------------------------------------  ----------------------------
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3164
    {     TYPE_Lab_FLT,                                                ANYPLANAR|ANYEXTRA,   PackLabFloatFromFloat},
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3165
    {     TYPE_XYZ_FLT,                                                ANYPLANAR|ANYEXTRA,   PackXYZFloatFromFloat},
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3166
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3167
    {     TYPE_Lab_DBL,                                                ANYPLANAR|ANYEXTRA,   PackLabDoubleFromFloat},
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3168
    {     TYPE_XYZ_DBL,                                                ANYPLANAR|ANYEXTRA,   PackXYZDoubleFromFloat},
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3169
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3170
    {     FLOAT_SH(1)|BYTES_SH(4), ANYPLANAR|
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3171
                             ANYFLAVOR|ANYSWAPFIRST|ANYSWAP|ANYEXTRA|ANYCHANNELS|ANYSPACE,   PackFloatsFromFloat },
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3172
    {     FLOAT_SH(1)|BYTES_SH(0), ANYPLANAR|
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3173
                             ANYFLAVOR|ANYSWAPFIRST|ANYSWAP|ANYEXTRA|ANYCHANNELS|ANYSPACE,   PackDoublesFromFloat },
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3174
#ifndef CMS_NO_HALF_SUPPORT
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3175
    {     FLOAT_SH(1)|BYTES_SH(2),
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3176
                             ANYFLAVOR|ANYSWAPFIRST|ANYSWAP|ANYEXTRA|ANYCHANNELS|ANYSPACE,   PackHalfFromFloat },
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3177
#endif
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3178
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3179
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3180
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3181
};
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3182
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3183
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3184
// Bit fields set to one in the mask are not compared
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3185
static
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3186
cmsFormatter _cmsGetStockOutputFormatter(cmsUInt32Number dwInput, cmsUInt32Number dwFlags)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3187
{
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3188
    cmsUInt32Number i;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3189
    cmsFormatter fr;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3190
40152
35cbab101a76 8162488: JDK should be updated to use LittleCMS 2.8
prr
parents: 30491
diff changeset
  3191
    // Optimization is only a hint
35cbab101a76 8162488: JDK should be updated to use LittleCMS 2.8
prr
parents: 30491
diff changeset
  3192
    dwInput &= ~OPTIMIZED_SH(1);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3193
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3194
    switch (dwFlags)
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3195
    {
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3196
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3197
     case CMS_PACK_FLAGS_16BITS: {
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3198
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3199
        for (i=0; i < sizeof(OutputFormatters16) / sizeof(cmsFormatters16); i++) {
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3200
            cmsFormatters16* f = OutputFormatters16 + i;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3201
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3202
            if ((dwInput & ~f ->Mask) == f ->Type) {
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3203
                fr.Fmt16 = f ->Frm;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3204
                return fr;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3205
            }
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3206
        }
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3207
        }
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3208
        break;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3209
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3210
    case CMS_PACK_FLAGS_FLOAT: {
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3211
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3212
        for (i=0; i < sizeof(OutputFormattersFloat) / sizeof(cmsFormattersFloat); i++) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3213
            cmsFormattersFloat* f = OutputFormattersFloat + i;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3214
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3215
            if ((dwInput & ~f ->Mask) == f ->Type) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3216
                fr.FmtFloat = f ->Frm;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3217
                return fr;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3218
            }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3219
        }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3220
        }
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3221
        break;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3222
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3223
    default:;
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3224
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3225
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3226
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3227
    fr.Fmt16 = NULL;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3228
    return fr;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3229
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3230
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3231
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3232
typedef struct _cms_formatters_factory_list {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3233
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3234
    cmsFormatterFactory Factory;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3235
    struct _cms_formatters_factory_list *Next;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3236
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3237
} cmsFormattersFactoryList;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3238
26609
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3239
_cmsFormattersPluginChunkType _cmsFormattersPluginChunk = { NULL };
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3240
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3241
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3242
// Duplicates the zone of memory used by the plug-in in the new context
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3243
static
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3244
void DupFormatterFactoryList(struct _cmsContext_struct* ctx,
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3245
                                               const struct _cmsContext_struct* src)
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3246
{
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3247
   _cmsFormattersPluginChunkType newHead = { NULL };
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3248
   cmsFormattersFactoryList*  entry;
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3249
   cmsFormattersFactoryList*  Anterior = NULL;
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3250
   _cmsFormattersPluginChunkType* head = (_cmsFormattersPluginChunkType*) src->chunks[FormattersPlugin];
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3251
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3252
     _cmsAssert(head != NULL);
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3253
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3254
   // Walk the list copying all nodes
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3255
   for (entry = head->FactoryList;
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3256
       entry != NULL;
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3257
       entry = entry ->Next) {
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3258
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3259
           cmsFormattersFactoryList *newEntry = ( cmsFormattersFactoryList *) _cmsSubAllocDup(ctx ->MemPool, entry, sizeof(cmsFormattersFactoryList));
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3260
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3261
           if (newEntry == NULL)
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3262
               return;
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3263
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3264
           // We want to keep the linked list order, so this is a little bit tricky
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3265
           newEntry -> Next = NULL;
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3266
           if (Anterior)
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3267
               Anterior -> Next = newEntry;
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3268
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3269
           Anterior = newEntry;
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3270
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3271
           if (newHead.FactoryList == NULL)
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3272
               newHead.FactoryList = newEntry;
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3273
   }
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3274
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3275
   ctx ->chunks[FormattersPlugin] = _cmsSubAllocDup(ctx->MemPool, &newHead, sizeof(_cmsFormattersPluginChunkType));
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3276
}
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3277
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3278
// The interpolation plug-in memory chunk allocator/dup
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3279
void _cmsAllocFormattersPluginChunk(struct _cmsContext_struct* ctx,
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3280
                                    const struct _cmsContext_struct* src)
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3281
{
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3282
      _cmsAssert(ctx != NULL);
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3283
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3284
     if (src != NULL) {
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3285
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3286
         // Duplicate the LIST
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3287
         DupFormatterFactoryList(ctx, src);
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3288
     }
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3289
     else {
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3290
          static _cmsFormattersPluginChunkType FormattersPluginChunk = { NULL };
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3291
          ctx ->chunks[FormattersPlugin] = _cmsSubAllocDup(ctx ->MemPool, &FormattersPluginChunk, sizeof(_cmsFormattersPluginChunkType));
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3292
     }
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3293
}
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3294
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3295
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3296
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3297
// Formatters management
26609
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3298
cmsBool  _cmsRegisterFormattersPlugin(cmsContext ContextID, cmsPluginBase* Data)
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3299
{
26609
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3300
    _cmsFormattersPluginChunkType* ctx = ( _cmsFormattersPluginChunkType*) _cmsContextGetClientChunk(ContextID, FormattersPlugin);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3301
    cmsPluginFormatters* Plugin = (cmsPluginFormatters*) Data;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3302
    cmsFormattersFactoryList* fl ;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3303
26609
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3304
    // Reset to built-in defaults
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3305
    if (Data == NULL) {
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3306
26609
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3307
          ctx ->FactoryList = NULL;
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3308
          return TRUE;
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3309
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3310
26609
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3311
    fl = (cmsFormattersFactoryList*) _cmsPluginMalloc(ContextID, sizeof(cmsFormattersFactoryList));
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3312
    if (fl == NULL) return FALSE;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3313
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3314
    fl ->Factory    = Plugin ->FormattersFactory;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3315
26609
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3316
    fl ->Next = ctx -> FactoryList;
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3317
    ctx ->FactoryList = fl;
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3318
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3319
    return TRUE;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3320
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3321
26609
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3322
cmsFormatter _cmsGetFormatter(cmsContext ContextID,
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3323
                             cmsUInt32Number Type,         // Specific type, i.e. TYPE_RGB_8
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3324
                             cmsFormatterDirection Dir,
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3325
                             cmsUInt32Number dwFlags)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3326
{
26609
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3327
    _cmsFormattersPluginChunkType* ctx = ( _cmsFormattersPluginChunkType*) _cmsContextGetClientChunk(ContextID, FormattersPlugin);
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3328
    cmsFormattersFactoryList* f;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3329
26609
de18f570018c 8056122: Upgrade JDK to use LittleCMS 2.6
prr
parents: 25859
diff changeset
  3330
    for (f =ctx->FactoryList; f != NULL; f = f ->Next) {
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3331
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3332
        cmsFormatter fn = f ->Factory(Type, Dir, dwFlags);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3333
        if (fn.Fmt16 != NULL) return fn;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3334
    }
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3335
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3336
    // Revert to default
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3337
    if (Dir == cmsFormatterInput)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3338
        return _cmsGetStockInputFormatter(Type, dwFlags);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3339
    else
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3340
        return _cmsGetStockOutputFormatter(Type, dwFlags);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3341
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3342
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3343
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3344
// Return whatever given formatter refers to float values
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3345
cmsBool  _cmsFormatterIsFloat(cmsUInt32Number Type)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3346
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3347
    return T_FLOAT(Type) ? TRUE : FALSE;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  3348
}
6482
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3349
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3350
// Return whatever given formatter refers to 8 bits
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3351
cmsBool  _cmsFormatterIs8bit(cmsUInt32Number Type)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3352
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3353
    int Bytes = T_BYTES(Type);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3354
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3355
    return (Bytes == 1);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3356
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3357
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3358
// Build a suitable formatter for the colorspace of this profile
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3359
cmsUInt32Number CMSEXPORT cmsFormatterForColorspaceOfProfile(cmsHPROFILE hProfile, cmsUInt32Number nBytes, cmsBool lIsFloat)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3360
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3361
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3362
    cmsColorSpaceSignature ColorSpace      = cmsGetColorSpace(hProfile);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3363
    cmsUInt32Number        ColorSpaceBits  = _cmsLCMScolorSpace(ColorSpace);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3364
    cmsUInt32Number        nOutputChans    = cmsChannelsOf(ColorSpace);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3365
    cmsUInt32Number        Float           = lIsFloat ? 1 : 0;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3366
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3367
    // Create a fake formatter for result
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3368
    return FLOAT_SH(Float) | COLORSPACE_SH(ColorSpaceBits) | BYTES_SH(nBytes) | CHANNELS_SH(nOutputChans);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3369
}
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3370
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3371
// Build a suitable formatter for the colorspace of this profile
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3372
cmsUInt32Number CMSEXPORT cmsFormatterForPCSOfProfile(cmsHPROFILE hProfile, cmsUInt32Number nBytes, cmsBool lIsFloat)
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3373
{
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3374
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3375
    cmsColorSpaceSignature ColorSpace      = cmsGetPCS(hProfile);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3376
    int                    ColorSpaceBits  = _cmsLCMScolorSpace(ColorSpace);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3377
    cmsUInt32Number        nOutputChans    = cmsChannelsOf(ColorSpace);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3378
    cmsUInt32Number        Float           = lIsFloat ? 1 : 0;
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3379
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3380
    // Create a fake formatter for result
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3381
    return FLOAT_SH(Float) | COLORSPACE_SH(ColorSpaceBits) | BYTES_SH(nBytes) | CHANNELS_SH(nOutputChans);
0f6a4442b29e 6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents: 5506
diff changeset
  3382
}
14300
117dc9b98a7b 7053526: Upgrade JDK 8 to use Little CMS 2.4
bae
parents: 6482
diff changeset
  3383