Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
06bdbf91
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
06bdbf91
编写于
12月 07, 2017
作者:
P
prr
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8183032: Upgrade to LittleCMS 2.9
Reviewed-by: serb, psadhukhan, mschoene, rhalade
上级
6774b980
变更
30
展开全部
显示空白变更内容
内联
并排
Showing
30 changed file
with
1595 addition
and
1054 deletion
+1595
-1054
src/share/native/sun/java2d/cmm/lcms/LCMS.c
src/share/native/sun/java2d/cmm/lcms/LCMS.c
+3
-3
src/share/native/sun/java2d/cmm/lcms/cmsalpha.c
src/share/native/sun/java2d/cmm/lcms/cmsalpha.c
+74
-33
src/share/native/sun/java2d/cmm/lcms/cmscam02.c
src/share/native/sun/java2d/cmm/lcms/cmscam02.c
+1
-1
src/share/native/sun/java2d/cmm/lcms/cmscgats.c
src/share/native/sun/java2d/cmm/lcms/cmscgats.c
+150
-145
src/share/native/sun/java2d/cmm/lcms/cmscnvrt.c
src/share/native/sun/java2d/cmm/lcms/cmscnvrt.c
+8
-7
src/share/native/sun/java2d/cmm/lcms/cmserr.c
src/share/native/sun/java2d/cmm/lcms/cmserr.c
+6
-4
src/share/native/sun/java2d/cmm/lcms/cmsgamma.c
src/share/native/sun/java2d/cmm/lcms/cmsgamma.c
+308
-150
src/share/native/sun/java2d/cmm/lcms/cmsgmt.c
src/share/native/sun/java2d/cmm/lcms/cmsgmt.c
+2
-2
src/share/native/sun/java2d/cmm/lcms/cmshalf.c
src/share/native/sun/java2d/cmm/lcms/cmshalf.c
+3
-3
src/share/native/sun/java2d/cmm/lcms/cmsintrp.c
src/share/native/sun/java2d/cmm/lcms/cmsintrp.c
+35
-27
src/share/native/sun/java2d/cmm/lcms/cmsio0.c
src/share/native/sun/java2d/cmm/lcms/cmsio0.c
+42
-29
src/share/native/sun/java2d/cmm/lcms/cmsio1.c
src/share/native/sun/java2d/cmm/lcms/cmsio1.c
+19
-19
src/share/native/sun/java2d/cmm/lcms/cmslut.c
src/share/native/sun/java2d/cmm/lcms/cmslut.c
+80
-49
src/share/native/sun/java2d/cmm/lcms/cmsmd5.c
src/share/native/sun/java2d/cmm/lcms/cmsmd5.c
+1
-1
src/share/native/sun/java2d/cmm/lcms/cmsmtrx.c
src/share/native/sun/java2d/cmm/lcms/cmsmtrx.c
+1
-1
src/share/native/sun/java2d/cmm/lcms/cmsnamed.c
src/share/native/sun/java2d/cmm/lcms/cmsnamed.c
+24
-25
src/share/native/sun/java2d/cmm/lcms/cmsopt.c
src/share/native/sun/java2d/cmm/lcms/cmsopt.c
+102
-74
src/share/native/sun/java2d/cmm/lcms/cmspack.c
src/share/native/sun/java2d/cmm/lcms/cmspack.c
+309
-230
src/share/native/sun/java2d/cmm/lcms/cmspcs.c
src/share/native/sun/java2d/cmm/lcms/cmspcs.c
+5
-5
src/share/native/sun/java2d/cmm/lcms/cmsplugin.c
src/share/native/sun/java2d/cmm/lcms/cmsplugin.c
+57
-15
src/share/native/sun/java2d/cmm/lcms/cmsps2.c
src/share/native/sun/java2d/cmm/lcms/cmsps2.c
+31
-32
src/share/native/sun/java2d/cmm/lcms/cmssamp.c
src/share/native/sun/java2d/cmm/lcms/cmssamp.c
+1
-1
src/share/native/sun/java2d/cmm/lcms/cmssm.c
src/share/native/sun/java2d/cmm/lcms/cmssm.c
+1
-1
src/share/native/sun/java2d/cmm/lcms/cmstypes.c
src/share/native/sun/java2d/cmm/lcms/cmstypes.c
+143
-88
src/share/native/sun/java2d/cmm/lcms/cmsvirt.c
src/share/native/sun/java2d/cmm/lcms/cmsvirt.c
+32
-24
src/share/native/sun/java2d/cmm/lcms/cmswtpnt.c
src/share/native/sun/java2d/cmm/lcms/cmswtpnt.c
+3
-4
src/share/native/sun/java2d/cmm/lcms/cmsxform.c
src/share/native/sun/java2d/cmm/lcms/cmsxform.c
+22
-11
src/share/native/sun/java2d/cmm/lcms/lcms2.h
src/share/native/sun/java2d/cmm/lcms/lcms2.h
+38
-30
src/share/native/sun/java2d/cmm/lcms/lcms2_internal.h
src/share/native/sun/java2d/cmm/lcms/lcms2_internal.h
+91
-37
src/share/native/sun/java2d/cmm/lcms/lcms2_plugin.h
src/share/native/sun/java2d/cmm/lcms/lcms2_plugin.h
+3
-3
未找到文件。
src/share/native/sun/java2d/cmm/lcms/LCMS.c
浏览文件 @
06bdbf91
...
...
@@ -391,12 +391,12 @@ JNIEXPORT jbyteArray JNICALL Java_sun_java2d_cmm_lcms_LCMS_getTagNative
{
lcmsProfile_p
sProf
=
(
lcmsProfile_p
)
jlong_to_ptr
(
id
);
TagSignature_t
sig
;
cmsInt32Number
tagSize
;
cms
U
Int32Number
tagSize
;
jbyte
*
dataArray
=
NULL
;
jbyteArray
data
=
NULL
;
jint
bufSize
;
cmsUInt32Number
bufSize
;
sig
.
j
=
tagSig
;
...
...
@@ -839,7 +839,7 @@ static cmsHPROFILE _writeCookedTag(const cmsHPROFILE pfTarget,
for
(
i
=
0
;
i
<
tagCount
;
i
++
)
{
cmsBool
isTagReady
=
FALSE
;
const
cmsTagSignature
s
=
cmsGetTagSignature
(
pfTarget
,
i
);
const
cmsInt32Number
tagSize
=
cmsReadRawTag
(
pfTarget
,
s
,
NULL
,
0
);
const
cms
U
Int32Number
tagSize
=
cmsReadRawTag
(
pfTarget
,
s
,
NULL
,
0
);
if
(
s
==
sig
)
{
// skip the user supplied tag
...
...
src/share/native/sun/java2d/cmm/lcms/cmsalpha.c
浏览文件 @
06bdbf91
...
...
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-201
6
Marti Maria Saguer
// Copyright (c) 1998-201
7
Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
...
...
@@ -55,7 +55,6 @@
#include "lcms2_internal.h"
// Alpha copy ------------------------------------------------------------------------------------------------------------------
// Floor to byte, taking care of saturation
...
...
@@ -71,9 +70,9 @@ cmsINLINE cmsUInt8Number _cmsQuickSaturateByte(cmsFloat64Number d)
// Return the size in bytes of a given formatter
static
int
trueBytesSize
(
cmsUInt32Number
Format
)
cmsUInt32Number
trueBytesSize
(
cmsUInt32Number
Format
)
{
int
fmt_bytes
=
T_BYTES
(
Format
);
cmsUInt32Number
fmt_bytes
=
T_BYTES
(
Format
);
// For double, the T_BYTES field returns zero
if
(
fmt_bytes
==
0
)
...
...
@@ -119,8 +118,13 @@ void from8toDBL(void* dst, const void* src)
static
void
from8toHLF
(
void
*
dst
,
const
void
*
src
)
{
#ifndef CMS_NO_HALF_SUPPORT
cmsFloat32Number
n
=
(
*
(
cmsUInt8Number
*
)
src
)
/
255
.
0
f
;
*
(
cmsUInt16Number
*
)
dst
=
_cmsFloat2Half
(
n
);
#else
cmsUNUSED_PARAMETER
(
dst
);
cmsUNUSED_PARAMETER
(
src
);
#endif
}
// From 16
...
...
@@ -151,8 +155,13 @@ void from16toDBL(void* dst, const void* src)
static
void
from16toHLF
(
void
*
dst
,
const
void
*
src
)
{
#ifndef CMS_NO_HALF_SUPPORT
cmsFloat32Number
n
=
(
*
(
cmsUInt16Number
*
)
src
)
/
65535
.
0
f
;
*
(
cmsUInt16Number
*
)
dst
=
_cmsFloat2Half
(
n
);
#else
cmsUNUSED_PARAMETER
(
dst
);
cmsUNUSED_PARAMETER
(
src
);
#endif
}
// From Float
...
...
@@ -187,8 +196,13 @@ void fromFLTtoDBL(void* dst, const void* src)
static
void
fromFLTtoHLF
(
void
*
dst
,
const
void
*
src
)
{
#ifndef CMS_NO_HALF_SUPPORT
cmsFloat32Number
n
=
*
(
cmsFloat32Number
*
)
src
;
*
(
cmsUInt16Number
*
)
dst
=
_cmsFloat2Half
(
n
);
#else
cmsUNUSED_PARAMETER
(
dst
);
cmsUNUSED_PARAMETER
(
src
);
#endif
}
...
...
@@ -197,27 +211,48 @@ void fromFLTtoHLF(void* dst, const void* src)
static
void
fromHLFto8
(
void
*
dst
,
const
void
*
src
)
{
#ifndef CMS_NO_HALF_SUPPORT
cmsFloat32Number
n
=
_cmsHalf2Float
(
*
(
cmsUInt16Number
*
)
src
);
*
(
cmsUInt8Number
*
)
dst
=
_cmsQuickSaturateByte
(
n
*
255
.
0
f
);
#else
cmsUNUSED_PARAMETER
(
dst
);
cmsUNUSED_PARAMETER
(
src
);
#endif
}
static
void
fromHLFto16
(
void
*
dst
,
const
void
*
src
)
{
#ifndef CMS_NO_HALF_SUPPORT
cmsFloat32Number
n
=
_cmsHalf2Float
(
*
(
cmsUInt16Number
*
)
src
);
*
(
cmsUInt16Number
*
)
dst
=
_cmsQuickSaturateWord
(
n
*
65535
.
0
f
);
#else
cmsUNUSED_PARAMETER
(
dst
);
cmsUNUSED_PARAMETER
(
src
);
#endif
}
static
void
fromHLFtoFLT
(
void
*
dst
,
const
void
*
src
)
{
#ifndef CMS_NO_HALF_SUPPORT
*
(
cmsFloat32Number
*
)
dst
=
_cmsHalf2Float
(
*
(
cmsUInt16Number
*
)
src
);
#else
cmsUNUSED_PARAMETER
(
dst
);
cmsUNUSED_PARAMETER
(
src
);
#endif
}
static
void
fromHLFtoDBL
(
void
*
dst
,
const
void
*
src
)
{
#ifndef CMS_NO_HALF_SUPPORT
*
(
cmsFloat64Number
*
)
dst
=
(
cmsFloat64Number
)
_cmsHalf2Float
(
*
(
cmsUInt16Number
*
)
src
);
#else
cmsUNUSED_PARAMETER
(
dst
);
cmsUNUSED_PARAMETER
(
src
);
#endif
}
// From double
...
...
@@ -245,8 +280,13 @@ void fromDBLtoFLT(void* dst, const void* src)
static
void
fromDBLtoHLF
(
void
*
dst
,
const
void
*
src
)
{
#ifndef CMS_NO_HALF_SUPPORT
cmsFloat32Number
n
=
(
cmsFloat32Number
)
*
(
cmsFloat64Number
*
)
src
;
*
(
cmsUInt16Number
*
)
dst
=
_cmsFloat2Half
(
n
);
#else
cmsUNUSED_PARAMETER
(
dst
);
cmsUNUSED_PARAMETER
(
src
);
#endif
}
static
...
...
@@ -260,12 +300,14 @@ void copy64(void* dst, const void* src)
static
int
FormatterPos
(
cmsUInt32Number
frm
)
{
int
b
=
T_BYTES
(
frm
);
cmsUInt32Number
b
=
T_BYTES
(
frm
);
if
(
b
==
0
&&
T_FLOAT
(
frm
))
return
4
;
// DBL
#ifndef CMS_NO_HALF_SUPPORT
if
(
b
==
2
&&
T_FLOAT
(
frm
))
return
2
;
// HLF
#endif
if
(
b
==
4
&&
T_FLOAT
(
frm
))
return
3
;
// FLT
if
(
b
==
2
&&
!
T_FLOAT
(
frm
))
...
...
@@ -274,7 +316,6 @@ int FormatterPos(cmsUInt32Number frm)
return
0
;
// 8
return
-
1
;
// not recognized
}
// Obtains a alpha-to-alpha funmction formatter
...
...
@@ -310,12 +351,12 @@ void ComputeIncrementsForChunky(cmsUInt32Number Format,
cmsUInt32Number
ComponentPointerIncrements
[])
{
cmsUInt32Number
channels
[
cmsMAXCHANNELS
];
int
extra
=
T_EXTRA
(
Format
);
int
nchannels
=
T_CHANNELS
(
Format
);
int
total_chans
=
nchannels
+
extra
;
int
i
;
int
channelSize
=
trueBytesSize
(
Format
);
int
pixelSize
=
channelSize
*
total_chans
;
cmsUInt32Number
extra
=
T_EXTRA
(
Format
);
cmsUInt32Number
nchannels
=
T_CHANNELS
(
Format
);
cmsUInt32Number
total_chans
=
nchannels
+
extra
;
cmsUInt32Number
i
;
cmsUInt32Number
channelSize
=
trueBytesSize
(
Format
);
cmsUInt32Number
pixelSize
=
channelSize
*
total_chans
;
// Sanity check
if
(
total_chans
<=
0
||
total_chans
>=
cmsMAXCHANNELS
)
...
...
@@ -368,11 +409,11 @@ void ComputeIncrementsForPlanar(cmsUInt32Number Format,
cmsUInt32Number
ComponentPointerIncrements
[])
{
cmsUInt32Number
channels
[
cmsMAXCHANNELS
];
int
extra
=
T_EXTRA
(
Format
);
int
nchannels
=
T_CHANNELS
(
Format
);
int
total_chans
=
nchannels
+
extra
;
int
i
;
int
channelSize
=
trueBytesSize
(
Format
);
cmsUInt32Number
extra
=
T_EXTRA
(
Format
);
cmsUInt32Number
nchannels
=
T_CHANNELS
(
Format
);
cmsUInt32Number
total_chans
=
nchannels
+
extra
;
cmsUInt32Number
i
;
cmsUInt32Number
channelSize
=
trueBytesSize
(
Format
);
// Sanity check
if
(
total_chans
<=
0
||
total_chans
>=
cmsMAXCHANNELS
)
...
...
src/share/native/sun/java2d/cmm/lcms/cmscam02.c
浏览文件 @
06bdbf91
...
...
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-201
6
Marti Maria Saguer
// Copyright (c) 1998-201
7
Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
...
...
src/share/native/sun/java2d/cmm/lcms/cmscgats.c
浏览文件 @
06bdbf91
...
...
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-201
6
Marti Maria Saguer
// Copyright (c) 1998-201
7
Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
...
...
@@ -179,8 +179,9 @@ typedef struct {
SYMBOL
sy
;
// Current symbol
int
ch
;
// Current character
int
inum
;
// integer value
cmsInt32Number
inum
;
// integer value
cmsFloat64Number
dnum
;
// real value
char
id
[
MAXID
];
// identifier
char
str
[
MAXSTR
];
// string
...
...
@@ -189,10 +190,10 @@ typedef struct {
KEYVALUE
*
ValidSampleID
;
char
*
Source
;
// Points to loc. being parsed
int
lineno
;
// line counter for error reporting
cmsInt32Number
lineno
;
// line counter for error reporting
FILECTX
*
FileStack
[
MAXINCLUDE
];
// Stack of files being parsed
int
IncludeSP
;
// Include Stack Pointer
cmsInt32Number
IncludeSP
;
// Include Stack Pointer
char
*
MemoryBlock
;
// The stream if holded in memory
...
...
@@ -287,7 +288,6 @@ static PROPERTY PredefinedProperties[] = {
// measurement. Allowed values are black, white, or {"na".
{
"CHISQ_DOF"
,
WRITE_STRINGIFY
},
// Degrees of freedom associated with the Chi squared statistic
// below properties are new in recent specs:
{
"MEASUREMENT_GEOMETRY"
,
WRITE_STRINGIFY
},
// The type of measurement, either reflection or transmission, should be indicated
...
...
@@ -564,13 +564,13 @@ cmsFloat64Number xpow10(int n)
// Reads a Real number, tries to follow from integer number
static
void
ReadReal
(
cmsIT8
*
it8
,
int
inum
)
void
ReadReal
(
cmsIT8
*
it8
,
cmsInt32Number
inum
)
{
it8
->
dnum
=
(
cmsFloat64Number
)
inum
;
it8
->
dnum
=
(
cmsFloat64Number
)
inum
;
while
(
isdigit
(
it8
->
ch
))
{
it8
->
dnum
=
it8
->
dnum
*
10
.
0
+
(
it8
->
ch
-
'0'
);
it8
->
dnum
=
(
cmsFloat64Number
)
it8
->
dnum
*
10
.
0
+
(
cmsFloat64Number
)
(
it8
->
ch
-
'0'
);
NextCh
(
it8
);
}
...
...
@@ -583,7 +583,7 @@ void ReadReal(cmsIT8* it8, int inum)
while
(
isdigit
(
it8
->
ch
))
{
frac
=
frac
*
10
.
0
+
(
it8
->
ch
-
'0'
);
frac
=
frac
*
10
.
0
+
(
cmsFloat64Number
)(
it8
->
ch
-
'0'
);
prec
++
;
NextCh
(
it8
);
}
...
...
@@ -594,8 +594,8 @@ void ReadReal(cmsIT8* it8, int inum)
// Exponent, example 34.00E+20
if
(
toupper
(
it8
->
ch
)
==
'E'
)
{
int
e
;
int
sgn
;
cmsInt32Number
e
;
cmsInt32Number
sgn
;
NextCh
(
it8
);
sgn
=
1
;
...
...
@@ -613,14 +613,16 @@ void ReadReal(cmsIT8* it8, int inum)
e
=
0
;
while
(
isdigit
(
it8
->
ch
))
{
if
((
cmsFloat64Number
)
e
*
10L
<
INT_MAX
)
e
=
e
*
10
+
(
it8
->
ch
-
'0'
);
cmsInt32Number
digit
=
(
it8
->
ch
-
'0'
);
if
((
cmsFloat64Number
)
e
*
10
.
0
+
(
cmsFloat64Number
)
digit
<
(
cmsFloat64Number
)
+
2147483647
.
0
)
e
=
e
*
10
+
digit
;
NextCh
(
it8
);
}
e
=
sgn
*
e
;
it8
->
dnum
=
it8
->
dnum
*
xpow10
(
e
);
it8
->
dnum
=
it8
->
dnum
*
xpow10
(
e
);
}
}
...
...
@@ -643,7 +645,7 @@ cmsFloat64Number ParseFloatNumber(const char *Buffer)
}
while
(
*
Buffer
&&
isdigit
((
int
)
*
Buffer
))
{
while
(
*
Buffer
&&
isdigit
((
int
)
*
Buffer
))
{
dnum
=
dnum
*
10
.
0
+
(
*
Buffer
-
'0'
);
if
(
*
Buffer
)
Buffer
++
;
...
...
@@ -652,11 +654,11 @@ cmsFloat64Number ParseFloatNumber(const char *Buffer)
if
(
*
Buffer
==
'.'
)
{
cmsFloat64Number
frac
=
0
.
0
;
// fraction
int
prec
=
0
;
// precis
s
ion
int
prec
=
0
;
// precision
if
(
*
Buffer
)
Buffer
++
;
while
(
*
Buffer
&&
isdigit
((
int
)
*
Buffer
))
{
while
(
*
Buffer
&&
isdigit
((
int
)
*
Buffer
))
{
frac
=
frac
*
10
.
0
+
(
*
Buffer
-
'0'
);
prec
++
;
...
...
@@ -688,10 +690,12 @@ cmsFloat64Number ParseFloatNumber(const char *Buffer)
}
e
=
0
;
while
(
*
Buffer
&&
isdigit
((
int
)
*
Buffer
))
{
while
(
*
Buffer
&&
isdigit
((
int
)
*
Buffer
))
{
if
((
cmsFloat64Number
)
e
*
10L
<
INT_MAX
)
e
=
e
*
10
+
(
*
Buffer
-
'0'
);
cmsInt32Number
digit
=
(
*
Buffer
-
'0'
);
if
((
cmsFloat64Number
)
e
*
10
.
0
+
digit
<
(
cmsFloat64Number
)
+
2147483647
.
0
)
e
=
e
*
10
+
digit
;
if
(
*
Buffer
)
Buffer
++
;
}
...
...
@@ -766,7 +770,7 @@ void InSymbol(cmsIT8* it8)
if
(
it8
->
ch
>=
'A'
&&
it8
->
ch
<=
'F'
)
j
=
it8
->
ch
-
'A'
+
10
;
else
j
=
it8
->
ch
-
'0'
;
if
((
long
)
it8
->
inum
*
16L
>
(
long
)
INT_MAX
)
if
((
cmsFloat64Number
)
it8
->
inum
*
16
.
0
+
(
cmsFloat64Number
)
j
>
(
cmsFloat64Number
)
+
2147483647
.
0
)
{
SynError
(
it8
,
"Invalid hexadecimal number"
);
return
;
...
...
@@ -787,7 +791,7 @@ void InSymbol(cmsIT8* it8)
{
j
=
it8
->
ch
-
'0'
;
if
((
long
)
it8
->
inum
*
2L
>
(
long
)
INT_MAX
)
if
((
cmsFloat64Number
)
it8
->
inum
*
2
.
0
+
j
>
(
cmsFloat64Number
)
+
2147483647
.
0
)
{
SynError
(
it8
,
"Invalid binary number"
);
return
;
...
...
@@ -803,14 +807,16 @@ void InSymbol(cmsIT8* it8)
while
(
isdigit
(
it8
->
ch
))
{
if
((
long
)
it8
->
inum
*
10L
>
(
long
)
INT_MAX
)
{
cmsInt32Number
digit
=
(
it8
->
ch
-
'0'
);
if
((
cmsFloat64Number
)
it8
->
inum
*
10
.
0
+
(
cmsFloat64Number
)
digit
>
(
cmsFloat64Number
)
+
2147483647
.
0
)
{
ReadReal
(
it8
,
it8
->
inum
);
it8
->
sy
=
SDNUM
;
it8
->
dnum
*=
sign
;
return
;
}
it8
->
inum
=
it8
->
inum
*
10
+
(
it8
->
ch
-
'0'
)
;
it8
->
inum
=
it8
->
inum
*
10
+
digit
;
NextCh
(
it8
);
}
...
...
@@ -1515,7 +1521,7 @@ cmsBool SetDataFormat(cmsIT8* it8, int n, const char *label)
cmsBool
CMSEXPORT
cmsIT8SetDataFormat
(
cmsHANDLE
h
,
int
n
,
const
char
*
Sample
)
{
cmsIT8
*
it8
=
(
cmsIT8
*
)
h
;
cmsIT8
*
it8
=
(
cmsIT8
*
)
h
;
return
SetDataFormat
(
it8
,
n
,
Sample
);
}
...
...
@@ -1973,10 +1979,10 @@ cmsBool HeaderSection(cmsIT8* it8)
case
SIDENT
:
strncpy
(
VarName
,
it8
->
id
,
MAXID
-
1
);
VarName
[
MAXID
-
1
]
=
0
;
strncpy
(
VarName
,
it8
->
id
,
MAXID
-
1
);
VarName
[
MAXID
-
1
]
=
0
;
if
(
!
IsAvailableOnList
(
it8
->
ValidKeywords
,
VarName
,
NULL
,
&
Key
))
{
if
(
!
IsAvailableOnList
(
it8
->
ValidKeywords
,
VarName
,
NULL
,
&
Key
))
{
#ifdef CMS_STRICT_CGATS
return
SynError
(
it8
,
"Undefined keyword '%s'"
,
VarName
);
...
...
@@ -1987,9 +1993,9 @@ cmsBool HeaderSection(cmsIT8* it8)
}
InSymbol
(
it8
);
if
(
!
GetVal
(
it8
,
Buffer
,
MAXSTR
-
1
,
"Property data expected"
))
return
FALSE
;
if
(
!
GetVal
(
it8
,
Buffer
,
MAXSTR
-
1
,
"Property data expected"
))
return
FALSE
;
if
(
Key
->
WriteAs
!=
WRITE_PAIR
)
{
if
(
Key
->
WriteAs
!=
WRITE_PAIR
)
{
AddToList
(
it8
,
&
GetTable
(
it8
)
->
HeaderList
,
VarName
,
NULL
,
Buffer
,
(
it8
->
sy
==
SSTRING
)
?
WRITE_STRINGIFY
:
WRITE_UNCOOKED
);
}
...
...
@@ -2005,28 +2011,28 @@ cmsBool HeaderSection(cmsIT8* it8)
char
*
Value
,
*
temp
;
// identify token pair boundary
Nextkey
=
(
char
*
)
strchr
(
Subkey
,
';'
);
if
(
Nextkey
)
Nextkey
=
(
char
*
)
strchr
(
Subkey
,
';'
);
if
(
Nextkey
)
*
Nextkey
++
=
'\0'
;
// for each pair, split the subkey and the value
Value
=
(
char
*
)
strrchr
(
Subkey
,
','
);
if
(
Value
==
NULL
)
Value
=
(
char
*
)
strrchr
(
Subkey
,
','
);
if
(
Value
==
NULL
)
return
SynError
(
it8
,
"Invalid value for property '%s'."
,
VarName
);
// gobble the spaces before the coma, and the coma itself
temp
=
Value
++
;
do
*
temp
--
=
'\0'
;
while
(
temp
>=
Subkey
&&
*
temp
==
' '
);
do
*
temp
--
=
'\0'
;
while
(
temp
>=
Subkey
&&
*
temp
==
' '
);
// gobble any space at the right
temp
=
Value
+
strlen
(
Value
)
-
1
;
while
(
*
temp
==
' '
)
*
temp
--
=
'\0'
;
while
(
*
temp
==
' '
)
*
temp
--
=
'\0'
;
// trim the strings from the left
Subkey
+=
strspn
(
Subkey
,
" "
);
Value
+=
strspn
(
Value
,
" "
);
if
(
Subkey
[
0
]
==
0
||
Value
[
0
]
==
0
)
if
(
Subkey
[
0
]
==
0
||
Value
[
0
]
==
0
)
return
SynError
(
it8
,
"Invalid value for property '%s'."
,
VarName
);
AddToList
(
it8
,
&
GetTable
(
it8
)
->
HeaderList
,
VarName
,
Subkey
,
Value
,
WRITE_PAIR
);
}
...
...
@@ -2062,7 +2068,6 @@ void ReadType(cmsIT8* it8, char* SheetTypePtr)
while
(
it8
->
ch
!=
'\r'
&&
it8
->
ch
!=
'\n'
&&
it8
->
ch
!=
'\t'
&&
it8
->
ch
!=
0
)
{
*
SheetTypePtr
++=
(
char
)
it8
->
ch
;
if
(
cnt
++
<
MAXSTR
)
*
SheetTypePtr
++=
(
char
)
it8
->
ch
;
NextCh
(
it8
);
...
...
@@ -2257,10 +2262,10 @@ void CookPointers(cmsIT8* it8)
// that should be something like some printable characters plus a \n
// returns 0 if this is not like a CGATS, or an integer otherwise. This integer is the number of words in first line?
static
int
IsMyBlock
(
const
cmsUInt8Number
*
Buffer
,
int
n
)
int
IsMyBlock
(
const
cmsUInt8Number
*
Buffer
,
cmsUInt32Number
n
)
{
int
words
=
1
,
space
=
0
,
quot
=
0
;
int
i
;
cmsUInt32Number
i
;
if
(
n
<
10
)
return
0
;
// Too small
...
...
@@ -2748,7 +2753,7 @@ int CMSEXPORT cmsIT8SetTableByLabel(cmsHANDLE hIT8, const char* cSet, const char
{
const
char
*
cLabelFld
;
char
Type
[
256
],
Label
[
256
];
int
nTable
;
cmsUInt32Number
nTable
;
_cmsAssert
(
hIT8
!=
NULL
);
...
...
@@ -2761,7 +2766,7 @@ int CMSEXPORT cmsIT8SetTableByLabel(cmsHANDLE hIT8, const char* cSet, const char
cLabelFld
=
cmsIT8GetData
(
hIT8
,
cSet
,
cField
);
if
(
!
cLabelFld
)
return
-
1
;
if
(
sscanf
(
cLabelFld
,
"%255s %
d
%255s"
,
Label
,
&
nTable
,
Type
)
!=
3
)
if
(
sscanf
(
cLabelFld
,
"%255s %
u
%255s"
,
Label
,
&
nTable
,
Type
)
!=
3
)
return
-
1
;
if
(
ExpectedType
!=
NULL
&&
*
ExpectedType
==
0
)
...
...
src/share/native/sun/java2d/cmm/lcms/cmscnvrt.c
浏览文件 @
06bdbf91
...
...
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-201
6
Marti Maria Saguer
// Copyright (c) 1998-201
7
Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
...
...
@@ -392,7 +392,8 @@ cmsBool IsEmptyLayer(cmsMAT3* m, cmsVEC3* off)
// Compute the conversion layer
static
cmsBool
ComputeConversion
(
int
i
,
cmsHPROFILE
hProfiles
[],
cmsBool
ComputeConversion
(
cmsUInt32Number
i
,
cmsHPROFILE
hProfiles
[],
cmsUInt32Number
Intent
,
cmsBool
BPC
,
cmsFloat64Number
AdaptationState
,
...
...
@@ -708,7 +709,7 @@ cmsPipeline* CMSEXPORT _cmsDefaultICCintents(cmsContext ContextID,
// Translate black-preserving intents to ICC ones
static
int
TranslateNonICCIntents
(
int
Intent
)
cmsUInt32Number
TranslateNonICCIntents
(
cmsUInt32Number
Intent
)
{
switch
(
Intent
)
{
case
INTENT_PRESERVE_K_ONLY_PERCEPTUAL
:
...
...
src/share/native/sun/java2d/cmm/lcms/cmserr.c
浏览文件 @
06bdbf91
...
...
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-201
6
Marti Maria Saguer
// Copyright (c) 1998-201
7
Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
...
...
@@ -83,9 +83,11 @@ long int CMSEXPORT cmsfilelength(FILE* f)
long
int
p
,
n
;
p
=
ftell
(
f
);
// register current file position
if
(
p
==
-
1L
)
return
-
1L
;
if
(
fseek
(
f
,
0
,
SEEK_END
)
!=
0
)
{
return
-
1
;
return
-
1
L
;
}
n
=
ftell
(
f
);
...
...
@@ -115,7 +117,7 @@ cmsBool _cmsRegisterMemHandlerPlugin(cmsContext ContextID, cmsPluginBase* Plug
// *********************************************************************************
// This is the default memory allocation function. It does a very coarse
// check of amout of memory, just to prevent exploits
// check of amou
n
t of memory, just to prevent exploits
static
void
*
_cmsMallocDefaultFn
(
cmsContext
ContextID
,
cmsUInt32Number
size
)
{
...
...
@@ -222,7 +224,7 @@ void _cmsAllocMemPluginChunk(struct _cmsContext_struct* ctx, const struct _cmsCo
}
else
{
// To reset it, we use the default allocators, which cannot be overriden
// To reset it, we use the default allocators, which cannot be overrid
d
en
ctx
->
chunks
[
MemPlugin
]
=
&
ctx
->
DefaultMemoryManager
;
}
}
...
...
src/share/native/sun/java2d/cmm/lcms/cmsgamma.c
浏览文件 @
06bdbf91
此差异已折叠。
点击以展开。
src/share/native/sun/java2d/cmm/lcms/cmsgmt.c
浏览文件 @
06bdbf91
...
...
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-201
6
Marti Maria Saguer
// Copyright (c) 1998-201
7
Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
...
...
@@ -326,7 +326,7 @@ cmsPipeline* _cmsCreateGamutCheckPipeline(cmsContext ContextID,
cmsStage
*
CLUT
;
cmsUInt32Number
dwFormat
;
GAMUTCHAIN
Chain
;
int
nChannels
,
nGridpoints
;
cmsUInt32Number
nChannels
,
nGridpoints
;
cmsColorSpaceSignature
ColorSpace
;
cmsUInt32Number
i
;
cmsHPROFILE
ProfileList
[
256
];
...
...
src/share/native/sun/java2d/cmm/lcms/cmshalf.c
浏览文件 @
06bdbf91
...
...
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-201
6
Marti Maria Saguer
// Copyright (c) 1998-201
7
Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
...
...
@@ -532,7 +532,7 @@ static cmsUInt8Number Shift[512] = {
0x18
,
0x18
,
0x18
,
0x18
,
0x0d
};
cmsFloat32Number
_cmsHalf2Float
(
cmsUInt16Number
h
)
cmsFloat32Number
CMSEXPORT
_cmsHalf2Float
(
cmsUInt16Number
h
)
{
union
{
cmsFloat32Number
flt
;
...
...
@@ -545,7 +545,7 @@ cmsFloat32Number _cmsHalf2Float(cmsUInt16Number h)
return
out
.
flt
;
}
cmsUInt16Number
_cmsFloat2Half
(
cmsFloat32Number
flt
)
cmsUInt16Number
CMSEXPORT
_cmsFloat2Half
(
cmsFloat32Number
flt
)
{
union
{
cmsFloat32Number
flt
;
...
...
src/share/native/sun/java2d/cmm/lcms/cmsintrp.c
浏览文件 @
06bdbf91
...
...
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-201
6
Marti Maria Saguer
// Copyright (c) 1998-201
7
Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
...
...
@@ -58,6 +58,13 @@
// This module incorporates several interpolation routines, for 1 to 8 channels on input and
// up to 65535 channels on output. The user may change those by using the interpolation plug-in
// Some people may want to compile as C++ with all warnings on, in this case make compiler silent
#ifdef _MSC_VER
# if (_MSC_VER >= 1400)
# pragma warning( disable : 4365 )
# endif
#endif
// Interpolation routines by default
static
cmsInterpFunction
DefaultInterpolatorsFactory
(
cmsUInt32Number
nInputChannels
,
cmsUInt32Number
nOutputChannels
,
cmsUInt32Number
dwFlags
);
...
...
@@ -131,12 +138,12 @@ cmsBool _cmsSetInterpolationRoutine(cmsContext ContextID, cmsInterpParams* p)
// This function precalculates as many parameters as possible to speed up the interpolation.
cmsInterpParams
*
_cmsComputeInterpParamsEx
(
cmsContext
ContextID
,
const
cmsUInt32Number
nSamples
[],
int
InputChan
,
int
OutputChan
,
cmsUInt32Number
InputChan
,
cmsUInt32Number
OutputChan
,
const
void
*
Table
,
cmsUInt32Number
dwFlags
)
{
cmsInterpParams
*
p
;
int
i
;
cmsUInt32Number
i
;
// Check for maximum inputs
if
(
InputChan
>
MAX_INPUT_DIMENSIONS
)
{
...
...
@@ -180,7 +187,8 @@ cmsInterpParams* _cmsComputeInterpParamsEx(cmsContext ContextID,
// This one is a wrapper on the anterior, but assuming all directions have same number of nodes
cmsInterpParams
*
_cmsComputeInterpParams
(
cmsContext
ContextID
,
int
nSamples
,
int
InputChan
,
int
OutputChan
,
const
void
*
Table
,
cmsUInt32Number
dwFlags
)
cmsInterpParams
*
CMSEXPORT
_cmsComputeInterpParams
(
cmsContext
ContextID
,
cmsUInt32Number
nSamples
,
cmsUInt32Number
InputChan
,
cmsUInt32Number
OutputChan
,
const
void
*
Table
,
cmsUInt32Number
dwFlags
)
{
int
i
;
cmsUInt32Number
Samples
[
MAX_INPUT_DIMENSIONS
];
...
...
@@ -195,7 +203,7 @@ cmsInterpParams* _cmsComputeInterpParams(cmsContext ContextID, int nSamples, int
// Free all associated memory
void
_cmsFreeInterpParams
(
cmsInterpParams
*
p
)
void
CMSEXPORT
_cmsFreeInterpParams
(
cmsInterpParams
*
p
)
{
if
(
p
!=
NULL
)
_cmsFree
(
p
->
ContextID
,
p
);
}
...
...
@@ -244,7 +252,7 @@ void LinLerp1D(register const cmsUInt16Number Value[],
// To prevent out of bounds indexing
cmsINLINE
cmsFloat32Number
fclamp
(
cmsFloat32Number
v
)
{
return
v
<
0
.
0
f
||
v
!=
v
?
0
.
0
f
:
(
v
>
1
.
0
f
?
1
.
0
f
:
v
);
return
((
v
<
1.0e-9
f
)
||
isnan
(
v
))
?
0
.
0
f
:
(
v
>
1
.
0
f
?
1
.
0
f
:
v
);
}
// Floating-point version of 1D interpolation
...
...
@@ -381,10 +389,10 @@ void BilinearInterpFloat(const cmsFloat32Number Input[],
y0
=
(
int
)
_cmsQuickFloor
(
py
);
fy
=
py
-
(
cmsFloat32Number
)
y0
;
X0
=
p
->
opta
[
1
]
*
x0
;
X1
=
X0
+
(
Input
[
0
]
>=
1
.
0
?
0
:
p
->
opta
[
1
]);
X1
=
X0
+
(
fclamp
(
Input
[
0
])
>=
1
.
0
?
0
:
p
->
opta
[
1
]);
Y0
=
p
->
opta
[
0
]
*
y0
;
Y1
=
Y0
+
(
Input
[
1
]
>=
1
.
0
?
0
:
p
->
opta
[
0
]);
Y1
=
Y0
+
(
fclamp
(
Input
[
1
])
>=
1
.
0
?
0
:
p
->
opta
[
0
]);
for
(
OutChan
=
0
;
OutChan
<
TotalOut
;
OutChan
++
)
{
...
...
@@ -493,18 +501,18 @@ void TrilinearInterpFloat(const cmsFloat32Number Input[],
py
=
fclamp
(
Input
[
1
])
*
p
->
Domain
[
1
];
pz
=
fclamp
(
Input
[
2
])
*
p
->
Domain
[
2
];
x0
=
(
int
)
_cmsQuickFloor
(
px
);
fx
=
px
-
(
cmsFloat32Number
)
x0
;
y0
=
(
int
)
_cmsQuickF
loor
(
py
);
fy
=
py
-
(
cmsFloat32Number
)
y0
;
z0
=
(
int
)
_cmsQuickF
loor
(
pz
);
fz
=
pz
-
(
cmsFloat32Number
)
z0
;
x0
=
(
int
)
floor
(
px
);
fx
=
px
-
(
cmsFloat32Number
)
x0
;
// We need full floor funcionality here
y0
=
(
int
)
f
loor
(
py
);
fy
=
py
-
(
cmsFloat32Number
)
y0
;
z0
=
(
int
)
f
loor
(
pz
);
fz
=
pz
-
(
cmsFloat32Number
)
z0
;
X0
=
p
->
opta
[
2
]
*
x0
;
X1
=
X0
+
(
Input
[
0
]
>=
1
.
0
?
0
:
p
->
opta
[
2
]);
X1
=
X0
+
(
fclamp
(
Input
[
0
])
>=
1
.
0
?
0
:
p
->
opta
[
2
]);
Y0
=
p
->
opta
[
1
]
*
y0
;
Y1
=
Y0
+
(
Input
[
1
]
>=
1
.
0
?
0
:
p
->
opta
[
1
]);
Y1
=
Y0
+
(
fclamp
(
Input
[
1
])
>=
1
.
0
?
0
:
p
->
opta
[
1
]);
Z0
=
p
->
opta
[
0
]
*
z0
;
Z1
=
Z0
+
(
Input
[
2
]
>=
1
.
0
?
0
:
p
->
opta
[
0
]);
Z1
=
Z0
+
(
fclamp
(
Input
[
2
])
>=
1
.
0
?
0
:
p
->
opta
[
0
]);
for
(
OutChan
=
0
;
OutChan
<
TotalOut
;
OutChan
++
)
{
...
...
@@ -637,19 +645,19 @@ void TetrahedralInterpFloat(const cmsFloat32Number Input[],
py
=
fclamp
(
Input
[
1
])
*
p
->
Domain
[
1
];
pz
=
fclamp
(
Input
[
2
])
*
p
->
Domain
[
2
];
x0
=
(
int
)
_cmsQuickFloor
(
px
);
rx
=
(
px
-
(
cmsFloat32Number
)
x0
);
y0
=
(
int
)
_cmsQuickF
loor
(
py
);
ry
=
(
py
-
(
cmsFloat32Number
)
y0
);
z0
=
(
int
)
_cmsQuickF
loor
(
pz
);
rz
=
(
pz
-
(
cmsFloat32Number
)
z0
);
x0
=
(
int
)
floor
(
px
);
rx
=
(
px
-
(
cmsFloat32Number
)
x0
);
// We need full floor functionality here
y0
=
(
int
)
f
loor
(
py
);
ry
=
(
py
-
(
cmsFloat32Number
)
y0
);
z0
=
(
int
)
f
loor
(
pz
);
rz
=
(
pz
-
(
cmsFloat32Number
)
z0
);
X0
=
p
->
opta
[
2
]
*
x0
;
X1
=
X0
+
(
Input
[
0
]
>=
1
.
0
?
0
:
p
->
opta
[
2
]);
X1
=
X0
+
(
fclamp
(
Input
[
0
])
>=
1
.
0
?
0
:
p
->
opta
[
2
]);
Y0
=
p
->
opta
[
1
]
*
y0
;
Y1
=
Y0
+
(
Input
[
1
]
>=
1
.
0
?
0
:
p
->
opta
[
1
]);
Y1
=
Y0
+
(
fclamp
(
Input
[
1
])
>=
1
.
0
?
0
:
p
->
opta
[
1
]);
Z0
=
p
->
opta
[
0
]
*
z0
;
Z1
=
Z0
+
(
Input
[
2
]
>=
1
.
0
?
0
:
p
->
opta
[
0
]);
Z1
=
Z0
+
(
fclamp
(
Input
[
2
])
>=
1
.
0
?
0
:
p
->
opta
[
0
]);
for
(
OutChan
=
0
;
OutChan
<
TotalOut
;
OutChan
++
)
{
...
...
@@ -958,7 +966,7 @@ void Eval4Inputs(register const cmsUInt16Number Input[],
Rest
=
c1
*
rx
+
c2
*
ry
+
c3
*
rz
;
Tmp1
[
OutChan
]
=
(
cmsUInt16Number
)
(
c0
+
ROUND_FIXED_TO_INT
(
_cmsToFixedDomain
(
Rest
)));
Tmp1
[
OutChan
]
=
(
cmsUInt16Number
)
(
c0
+
ROUND_FIXED_TO_INT
(
_cmsToFixedDomain
(
Rest
)));
}
...
...
@@ -1057,7 +1065,7 @@ void Eval4InputsFloat(const cmsFloat32Number Input[],
rest
=
pk
-
(
cmsFloat32Number
)
k0
;
K0
=
p
->
opta
[
3
]
*
k0
;
K1
=
K0
+
(
Input
[
0
]
>=
1
.
0
?
0
:
p
->
opta
[
3
]);
K1
=
K0
+
(
fclamp
(
Input
[
0
])
>=
1
.
0
?
0
:
p
->
opta
[
3
]);
p1
=
*
p
;
memmove
(
&
p1
.
Domain
[
0
],
&
p
->
Domain
[
1
],
3
*
sizeof
(
cmsUInt32Number
));
...
...
@@ -1144,7 +1152,7 @@ void Eval5InputsFloat(const cmsFloat32Number Input[],
rest
=
pk
-
(
cmsFloat32Number
)
k0
;
K0
=
p
->
opta
[
4
]
*
k0
;
K1
=
K0
+
(
Input
[
0
]
>=
1
.
0
?
0
:
p
->
opta
[
4
]);
K1
=
K0
+
(
fclamp
(
Input
[
0
])
>=
1
.
0
?
0
:
p
->
opta
[
4
]);
p1
=
*
p
;
memmove
(
&
p1
.
Domain
[
0
],
&
p
->
Domain
[
1
],
4
*
sizeof
(
cmsUInt32Number
));
...
...
@@ -1231,7 +1239,7 @@ void Eval6InputsFloat(const cmsFloat32Number Input[],
rest
=
pk
-
(
cmsFloat32Number
)
k0
;
K0
=
p
->
opta
[
5
]
*
k0
;
K1
=
K0
+
(
Input
[
0
]
>=
1
.
0
?
0
:
p
->
opta
[
5
]);
K1
=
K0
+
(
fclamp
(
Input
[
0
])
>=
1
.
0
?
0
:
p
->
opta
[
5
]);
p1
=
*
p
;
memmove
(
&
p1
.
Domain
[
0
],
&
p
->
Domain
[
1
],
5
*
sizeof
(
cmsUInt32Number
));
...
...
@@ -1316,7 +1324,7 @@ void Eval7InputsFloat(const cmsFloat32Number Input[],
rest
=
pk
-
(
cmsFloat32Number
)
k0
;
K0
=
p
->
opta
[
6
]
*
k0
;
K1
=
K0
+
(
Input
[
0
]
>=
1
.
0
?
0
:
p
->
opta
[
6
]);
K1
=
K0
+
(
fclamp
(
Input
[
0
])
>=
1
.
0
?
0
:
p
->
opta
[
6
]);
p1
=
*
p
;
memmove
(
&
p1
.
Domain
[
0
],
&
p
->
Domain
[
1
],
6
*
sizeof
(
cmsUInt32Number
));
...
...
@@ -1401,7 +1409,7 @@ void Eval8InputsFloat(const cmsFloat32Number Input[],
rest
=
pk
-
(
cmsFloat32Number
)
k0
;
K0
=
p
->
opta
[
7
]
*
k0
;
K1
=
K0
+
(
Input
[
0
]
>=
1
.
0
?
0
:
p
->
opta
[
7
]);
K1
=
K0
+
(
fclamp
(
Input
[
0
])
>=
1
.
0
?
0
:
p
->
opta
[
7
]);
p1
=
*
p
;
memmove
(
&
p1
.
Domain
[
0
],
&
p
->
Domain
[
1
],
7
*
sizeof
(
cmsUInt32Number
));
...
...
src/share/native/sun/java2d/cmm/lcms/cmsio0.c
浏览文件 @
06bdbf91
...
...
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-201
6
Marti Maria Saguer
// Copyright (c) 1998-201
7
Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
...
...
@@ -366,11 +366,17 @@ cmsBool FileSeek(cmsIOHANDLER* iohandler, cmsUInt32Number offset)
return
TRUE
;
}
// Returns file pointer position
// Returns file pointer position
or 0 on error, which is also a valid position.
static
cmsUInt32Number
FileTell
(
cmsIOHANDLER
*
iohandler
)
{
return
(
cmsUInt32Number
)
ftell
((
FILE
*
)
iohandler
->
stream
);
long
t
=
ftell
((
FILE
*
)
iohandler
->
stream
);
if
(
t
==
-
1L
)
{
cmsSignalError
(
iohandler
->
ContextID
,
cmsERROR_FILE
,
"Tell error; probably corrupted file"
);
return
0
;
}
return
(
cmsUInt32Number
)
t
;
}
// Writes data to stream, also keeps used space for further reference. Returns TRUE on success, FALSE on error
...
...
@@ -380,7 +386,7 @@ cmsBool FileWrite(cmsIOHANDLER* iohandler, cmsUInt32Number size, const void* Bu
if
(
size
==
0
)
return
TRUE
;
// We allow to write 0 bytes, but nothing is written
iohandler
->
UsedSpace
+=
size
;
return
(
fwrite
(
Buffer
,
size
,
1
,
(
FILE
*
)
iohandler
->
stream
)
==
1
);
return
(
fwrite
(
Buffer
,
size
,
1
,
(
FILE
*
)
iohandler
->
stream
)
==
1
);
}
// Closes the file
...
...
@@ -548,7 +554,7 @@ cmsInt32Number CMSEXPORT cmsGetTagCount(cmsHPROFILE hProfile)
_cmsICCPROFILE
*
Icc
=
(
_cmsICCPROFILE
*
)
hProfile
;
if
(
Icc
==
NULL
)
return
-
1
;
return
Icc
->
TagCount
;
return
(
cmsInt32Number
)
Icc
->
TagCount
;
}
// Return the tag signature of a given tag number
...
...
@@ -566,9 +572,9 @@ cmsTagSignature CMSEXPORT cmsGetTagSignature(cmsHPROFILE hProfile, cmsUInt32Numb
static
int
SearchOneTag
(
_cmsICCPROFILE
*
Profile
,
cmsTagSignature
sig
)
{
cmsUInt32Number
i
;
int
i
;
for
(
i
=
0
;
i
<
Profile
->
TagCount
;
i
++
)
{
for
(
i
=
0
;
i
<
(
int
)
Profile
->
TagCount
;
i
++
)
{
if
(
sig
==
Profile
->
TagNames
[
i
])
return
i
;
...
...
@@ -662,7 +668,7 @@ cmsBool _cmsNewTag(_cmsICCPROFILE* Icc, cmsTagSignature sig, int* NewPos)
return
FALSE
;
}
*
NewPos
=
Icc
->
TagCount
;
*
NewPos
=
(
int
)
Icc
->
TagCount
;
Icc
->
TagCount
++
;
}
...
...
@@ -693,10 +699,10 @@ cmsUInt32Number _validatedVersion(cmsUInt32Number DWord)
cmsUInt8Number
temp2
;
if
(
*
pByte
>
0x09
)
*
pByte
=
(
cmsUInt8Number
)
0x09
;
temp1
=
*
(
pByte
+
1
)
&
0xf0
;
temp2
=
*
(
pByte
+
1
)
&
0x0f
;
if
(
temp1
>
0x90
)
temp1
=
0x90
;
if
(
temp2
>
0x09
)
temp2
=
0x09
;
temp1
=
(
cmsUInt8Number
)
(
*
(
pByte
+
1
)
&
0xf0
)
;
temp2
=
(
cmsUInt8Number
)
(
*
(
pByte
+
1
)
&
0x0f
)
;
if
(
temp1
>
0x90
U
)
temp1
=
0x90U
;
if
(
temp2
>
0x09
U
)
temp2
=
0x09U
;
*
(
pByte
+
1
)
=
(
cmsUInt8Number
)(
temp1
|
temp2
);
*
(
pByte
+
2
)
=
(
cmsUInt8Number
)
0
;
*
(
pByte
+
3
)
=
(
cmsUInt8Number
)
0
;
...
...
@@ -804,7 +810,7 @@ cmsBool _cmsWriteHeader(_cmsICCPROFILE* Icc, cmsUInt32Number UsedSpace)
cmsICCHeader
Header
;
cmsUInt32Number
i
;
cmsTagEntry
Tag
;
cms
Int32Number
Count
=
0
;
cms
UInt32Number
Count
;
Header
.
size
=
_cmsAdjustEndianess32
(
UsedSpace
);
Header
.
cmmId
=
_cmsAdjustEndianess32
(
lcmsSignature
);
...
...
@@ -835,9 +841,9 @@ cmsBool _cmsWriteHeader(_cmsICCPROFILE* Icc, cmsUInt32Number UsedSpace)
Header
.
renderingIntent
=
_cmsAdjustEndianess32
(
Icc
->
RenderingIntent
);
// Illuminant is always D50
Header
.
illuminant
.
X
=
_cmsAdjustEndianess32
(
_cmsDoubleTo15Fixed16
(
cmsD50_XYZ
()
->
X
));
Header
.
illuminant
.
Y
=
_cmsAdjustEndianess32
(
_cmsDoubleTo15Fixed16
(
cmsD50_XYZ
()
->
Y
));
Header
.
illuminant
.
Z
=
_cmsAdjustEndianess32
(
_cmsDoubleTo15Fixed16
(
cmsD50_XYZ
()
->
Z
));
Header
.
illuminant
.
X
=
(
cmsS15Fixed16Number
)
_cmsAdjustEndianess32
((
cmsUInt32Number
)
_cmsDoubleTo15Fixed16
(
cmsD50_XYZ
()
->
X
));
Header
.
illuminant
.
Y
=
(
cmsS15Fixed16Number
)
_cmsAdjustEndianess32
((
cmsUInt32Number
)
_cmsDoubleTo15Fixed16
(
cmsD50_XYZ
()
->
Y
));
Header
.
illuminant
.
Z
=
(
cmsS15Fixed16Number
)
_cmsAdjustEndianess32
((
cmsUInt32Number
)
_cmsDoubleTo15Fixed16
(
cmsD50_XYZ
()
->
Z
));
// Created by LittleCMS (that's me!)
Header
.
creator
=
_cmsAdjustEndianess32
(
lcmsSignature
);
...
...
@@ -853,6 +859,7 @@ cmsBool _cmsWriteHeader(_cmsICCPROFILE* Icc, cmsUInt32Number UsedSpace)
// Saves Tag directory
// Get true count
Count
=
0
;
for
(
i
=
0
;
i
<
Icc
->
TagCount
;
i
++
)
{
if
(
Icc
->
TagNames
[
i
]
!=
(
cmsTagSignature
)
0
)
Count
++
;
...
...
@@ -865,9 +872,9 @@ cmsBool _cmsWriteHeader(_cmsICCPROFILE* Icc, cmsUInt32Number UsedSpace)
if
(
Icc
->
TagNames
[
i
]
==
(
cmsTagSignature
)
0
)
continue
;
// It is just a placeholder
Tag
.
sig
=
(
cmsTagSignature
)
_cmsAdjustEndianess32
((
cmsInt32Number
)
Icc
->
TagNames
[
i
]);
Tag
.
offset
=
_cmsAdjustEndianess32
((
cmsInt32Number
)
Icc
->
TagOffsets
[
i
]);
Tag
.
size
=
_cmsAdjustEndianess32
((
cmsInt32Number
)
Icc
->
TagSizes
[
i
]);
Tag
.
sig
=
(
cmsTagSignature
)
_cmsAdjustEndianess32
((
cms
U
Int32Number
)
Icc
->
TagNames
[
i
]);
Tag
.
offset
=
_cmsAdjustEndianess32
((
cms
U
Int32Number
)
Icc
->
TagOffsets
[
i
]);
Tag
.
size
=
_cmsAdjustEndianess32
((
cms
U
Int32Number
)
Icc
->
TagSizes
[
i
]);
if
(
!
Icc
->
IOhandler
->
Write
(
Icc
->
IOhandler
,
sizeof
(
cmsTagEntry
),
&
Tag
))
return
FALSE
;
}
...
...
@@ -1176,7 +1183,7 @@ cmsHPROFILE CMSEXPORT cmsOpenProfileFromMemTHR(cmsContext ContextID, const void*
NewIcc
=
(
_cmsICCPROFILE
*
)
hEmpty
;
// Ok, in this case const void* is casted to void* just because open IO handler
// shares read and writ
t
ing modes. Don't abuse this feature!
// shares read and writing modes. Don't abuse this feature!
NewIcc
->
IOhandler
=
cmsOpenIOhandlerFromMem
(
ContextID
,
(
void
*
)
MemPtr
,
dwSize
,
"r"
);
if
(
NewIcc
->
IOhandler
==
NULL
)
goto
Error
;
...
...
@@ -1466,7 +1473,7 @@ cmsBool CMSEXPORT cmsCloseProfile(cmsHPROFILE hProfile)
// Was open in write mode?
if
(
Icc
->
IsWrite
)
{
Icc
->
IsWrite
=
FALSE
;
// Assure no further writ
t
ing
Icc
->
IsWrite
=
FALSE
;
// Assure no further writing
rc
&=
cmsSaveProfileToFile
(
hProfile
,
Icc
->
IOhandler
->
PhysicalFile
);
}
...
...
@@ -1543,11 +1550,15 @@ void* CMSEXPORT cmsReadTag(cmsHPROFILE hProfile, cmsTagSignature sig)
// If the element is already in memory, return the pointer
if
(
Icc
->
TagPtrs
[
n
])
{
if
(
Icc
->
TagTypeHandlers
[
n
]
==
NULL
)
goto
Error
;
BaseType
=
Icc
->
TagTypeHandlers
[
n
]
->
Signature
;
if
(
Icc
->
TagTypeHandlers
[
n
]
==
NULL
)
goto
Error
;
// Sanity check
BaseType
=
Icc
->
TagTypeHandlers
[
n
]
->
Signature
;
if
(
BaseType
==
0
)
goto
Error
;
TagDescriptor
=
_cmsGetTagDescriptor
(
Icc
->
ContextID
,
sig
);
TagDescriptor
=
_cmsGetTagDescriptor
(
Icc
->
ContextID
,
sig
);
if
(
TagDescriptor
==
NULL
)
goto
Error
;
if
(
!
IsTypeSupported
(
TagDescriptor
,
BaseType
))
goto
Error
;
if
(
Icc
->
TagSaveAsRaw
[
n
])
goto
Error
;
// We don't support read raw tags as cooked
...
...
@@ -1560,6 +1571,8 @@ void* CMSEXPORT cmsReadTag(cmsHPROFILE hProfile, cmsTagSignature sig)
Offset
=
Icc
->
TagOffsets
[
n
];
TagSize
=
Icc
->
TagSizes
[
n
];
if
(
TagSize
<
8
)
goto
Error
;
// Seek to its location
if
(
!
io
->
Seek
(
io
,
Offset
))
goto
Error
;
...
...
@@ -1772,7 +1785,7 @@ Error:
// raw data written does not exactly correspond with the raw data proposed to cmsWriteRaw data, but this approach allows
// to write a tag as raw data and the read it as handled.
cmsInt32Number
CMSEXPORT
cmsReadRawTag
(
cmsHPROFILE
hProfile
,
cmsTagSignature
sig
,
void
*
data
,
cmsUInt32Number
BufferSize
)
cms
U
Int32Number
CMSEXPORT
cmsReadRawTag
(
cmsHPROFILE
hProfile
,
cmsTagSignature
sig
,
void
*
data
,
cmsUInt32Number
BufferSize
)
{
_cmsICCPROFILE
*
Icc
=
(
_cmsICCPROFILE
*
)
hProfile
;
void
*
Object
;
...
...
@@ -1890,7 +1903,7 @@ Error:
}
// Similar to the anterior. This function allows to write directly to the ICC profile any data, without
// checking anything. As a rule, mixing Raw with cooked doesn't work, so writ
t
ing a tag as raw and then reading
// checking anything. As a rule, mixing Raw with cooked doesn't work, so writing a tag as raw and then reading
// it as cooked without serializing does result into an error. If that is what you want, you will need to dump
// the profile to memry or disk and then reopen it.
cmsBool
CMSEXPORT
cmsWriteRawTag
(
cmsHPROFILE
hProfile
,
cmsTagSignature
sig
,
const
void
*
data
,
cmsUInt32Number
Size
)
...
...
src/share/native/sun/java2d/cmm/lcms/cmsio1.c
浏览文件 @
06bdbf91
...
...
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-201
6
Marti Maria Saguer
// Copyright (c) 1998-201
7
Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
...
...
@@ -335,8 +335,8 @@ Error:
// Read and create a BRAND NEW MPE LUT from a given profile. All stuff dependent of version, etc
// is adjusted here in order to create a LUT that takes care of all those details.
// We add intent =
-1
as a way to read matrix shaper always, no matter of other LUT
cmsPipeline
*
_cmsReadInputLUT
(
cmsHPROFILE
hProfile
,
int
Intent
)
// We add intent =
0xffffffff
as a way to read matrix shaper always, no matter of other LUT
cmsPipeline
*
CMSEXPORT
_cmsReadInputLUT
(
cmsHPROFILE
hProfile
,
cmsUInt32Number
Intent
)
{
cmsTagTypeSignature
OriginalType
;
cmsTagSignature
tag16
;
...
...
@@ -366,8 +366,8 @@ cmsPipeline* _cmsReadInputLUT(cmsHPROFILE hProfile, int Intent)
}
// This is an attempt to reuse this function to retrieve the matrix-shaper as pipeline no
// matter other LUT are present and have precedence. Intent =
-1 means just this
.
if
(
Intent
>=
INTENT_PERCEPTUAL
&&
Intent
<=
INTENT_ABSOLUTE_COLORIMETRIC
)
{
// matter other LUT are present and have precedence. Intent =
0xffffffff can be used for that
.
if
(
Intent
<=
INTENT_ABSOLUTE_COLORIMETRIC
)
{
tag16
=
Device2PCS16
[
Intent
];
tagFloat
=
Device2PCSFloat
[
Intent
];
...
...
@@ -611,7 +611,7 @@ Error:
}
// Create an output MPE LUT from agiven profile. Version mismatches are handled here
cmsPipeline
*
_cmsReadOutputLUT
(
cmsHPROFILE
hProfile
,
int
Intent
)
cmsPipeline
*
CMSEXPORT
_cmsReadOutputLUT
(
cmsHPROFILE
hProfile
,
cmsUInt32Number
Intent
)
{
cmsTagTypeSignature
OriginalType
;
cmsTagSignature
tag16
;
...
...
@@ -619,7 +619,7 @@ cmsPipeline* _cmsReadOutputLUT(cmsHPROFILE hProfile, int Intent)
cmsContext
ContextID
=
cmsGetProfileContextID
(
hProfile
);
if
(
Intent
>=
INTENT_PERCEPTUAL
&&
Intent
<=
INTENT_ABSOLUTE_COLORIMETRIC
)
{
if
(
Intent
<=
INTENT_ABSOLUTE_COLORIMETRIC
)
{
tag16
=
PCS2Device16
[
Intent
];
tagFloat
=
PCS2DeviceFloat
[
Intent
];
...
...
@@ -696,7 +696,7 @@ static
cmsPipeline
*
_cmsReadFloatDevicelinkTag
(
cmsHPROFILE
hProfile
,
cmsTagSignature
tagFloat
)
{
cmsContext
ContextID
=
cmsGetProfileContextID
(
hProfile
);
cmsPipeline
*
Lut
=
cmsPipelineDup
((
cmsPipeline
*
)
cmsReadTag
(
hProfile
,
tagFloat
));
cmsPipeline
*
Lut
=
cmsPipelineDup
((
cmsPipeline
*
)
cmsReadTag
(
hProfile
,
tagFloat
));
cmsColorSpaceSignature
PCS
=
cmsGetPCS
(
hProfile
);
cmsColorSpaceSignature
spc
=
cmsGetColorSpace
(
hProfile
);
...
...
@@ -734,7 +734,7 @@ Error:
// This one includes abstract profiles as well. Matrix-shaper cannot be obtained on that device class. The
// tag name here may default to AToB0
cmsPipeline
*
_cmsReadDevicelinkLUT
(
cmsHPROFILE
hProfile
,
int
Intent
)
cmsPipeline
*
CMSEXPORT
_cmsReadDevicelinkLUT
(
cmsHPROFILE
hProfile
,
cmsUInt32Number
Intent
)
{
cmsPipeline
*
Lut
;
cmsTagTypeSignature
OriginalType
;
...
...
@@ -743,7 +743,7 @@ cmsPipeline* _cmsReadDevicelinkLUT(cmsHPROFILE hProfile, int Intent)
cmsContext
ContextID
=
cmsGetProfileContextID
(
hProfile
);
if
(
Intent
<
INTENT_PERCEPTUAL
||
Intent
>
INTENT_ABSOLUTE_COLORIMETRIC
)
if
(
Intent
>
INTENT_ABSOLUTE_COLORIMETRIC
)
return
NULL
;
tag16
=
Device2PCS16
[
Intent
];
...
...
src/share/native/sun/java2d/cmm/lcms/cmslut.c
浏览文件 @
06bdbf91
...
...
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-201
6
Marti Maria Saguer
// Copyright (c) 1998-201
7
Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
...
...
@@ -153,8 +153,8 @@ cmsBool CMSEXPORT cmsPipelineCheckAndRetreiveStages(const cmsPipeline* Lut, cms
mpe
=
Lut
->
Elements
;
for
(
i
=
0
;
i
<
n
;
i
++
)
{
// Get asked type
Type
=
(
cmsStageSignature
)
va_arg
(
args
,
cmsStageSignature
);
// Get asked type
. cmsStageSignature is promoted to int by compiler
Type
=
(
cmsStageSignature
)
va_arg
(
args
,
int
);
if
(
mpe
->
Type
!=
Type
)
{
va_end
(
args
);
// Mismatch. We are done.
...
...
@@ -321,7 +321,7 @@ cmsStage* CMSEXPORT cmsStageAllocToneCurves(cmsContext ContextID, cmsUInt32Numbe
// Create a bunch of identity curves
cmsStage
*
_cmsStageAllocIdentityCurves
(
cmsContext
ContextID
,
int
nChannels
)
cmsStage
*
CMSEXPORT
_cmsStageAllocIdentityCurves
(
cmsContext
ContextID
,
cmsUInt32Number
nChannels
)
{
cmsStage
*
mpe
=
cmsStageAllocToneCurves
(
ContextID
,
nChannels
,
NULL
);
...
...
@@ -443,13 +443,13 @@ cmsStage* CMSEXPORT cmsStageAllocMatrix(cmsContext ContextID, cmsUInt32Number R
if
(
Offset
!=
NULL
)
{
NewElem
->
Offset
=
(
cmsFloat64Number
*
)
_cmsCalloc
(
ContextID
,
Col
s
,
sizeof
(
cmsFloat64Number
));
NewElem
->
Offset
=
(
cmsFloat64Number
*
)
_cmsCalloc
(
ContextID
,
Row
s
,
sizeof
(
cmsFloat64Number
));
if
(
NewElem
->
Offset
==
NULL
)
{
MatrixElemTypeFree
(
NewMPE
);
return
NULL
;
}
for
(
i
=
0
;
i
<
Col
s
;
i
++
)
{
for
(
i
=
0
;
i
<
Row
s
;
i
++
)
{
NewElem
->
Offset
[
i
]
=
Offset
[
i
];
}
...
...
@@ -741,7 +741,7 @@ int IdentitySampler(register const cmsUInt16Number In[], register cmsUInt16Numbe
}
// Creates an MPE that just copies input to output
cmsStage
*
_cmsStageAllocIdentityCLut
(
cmsContext
ContextID
,
int
nChan
)
cmsStage
*
CMSEXPORT
_cmsStageAllocIdentityCLut
(
cmsContext
ContextID
,
cmsUInt32Number
nChan
)
{
cmsUInt32Number
Dimensions
[
MAX_INPUT_DIMENSIONS
];
cmsStage
*
mpe
;
...
...
@@ -765,7 +765,7 @@ cmsStage* _cmsStageAllocIdentityCLut(cmsContext ContextID, int nChan)
// Quantize a value 0 <= i < MaxSamples to 0..0xffff
cmsUInt16Number
_cmsQuantizeVal
(
cmsFloat64Number
i
,
int
MaxSamples
)
cmsUInt16Number
CMSEXPORT
_cmsQuantizeVal
(
cmsFloat64Number
i
,
cmsUInt32Number
MaxSamples
)
{
cmsFloat64Number
x
;
...
...
@@ -778,8 +778,9 @@ cmsUInt16Number _cmsQuantizeVal(cmsFloat64Number i, int MaxSamples)
// function on knots. returns TRUE if all ok, FALSE otherwise.
cmsBool
CMSEXPORT
cmsStageSampleCLut16bit
(
cmsStage
*
mpe
,
cmsSAMPLER16
Sampler
,
void
*
Cargo
,
cmsUInt32Number
dwFlags
)
{
int
i
,
t
,
nTotalPoints
,
index
,
rest
;
int
nInputs
,
nOutputs
;
int
i
,
t
,
index
,
rest
;
cmsUInt32Number
nTotalPoints
;
cmsUInt32Number
nInputs
,
nOutputs
;
cmsUInt32Number
*
nSamples
;
cmsUInt16Number
In
[
MAX_INPUT_DIMENSIONS
+
1
],
Out
[
MAX_STAGE_CHANNELS
];
_cmsStageCLutData
*
clut
;
...
...
@@ -799,14 +800,17 @@ cmsBool CMSEXPORT cmsStageSampleCLut16bit(cmsStage* mpe, cmsSAMPLER16 Sampler, v
if
(
nInputs
>
MAX_INPUT_DIMENSIONS
)
return
FALSE
;
if
(
nOutputs
>=
MAX_STAGE_CHANNELS
)
return
FALSE
;
memset
(
In
,
0
,
sizeof
(
In
));
memset
(
Out
,
0
,
sizeof
(
Out
));
nTotalPoints
=
CubeSize
(
nSamples
,
nInputs
);
if
(
nTotalPoints
==
0
)
return
FALSE
;
index
=
0
;
for
(
i
=
0
;
i
<
nTotalPoints
;
i
++
)
{
for
(
i
=
0
;
i
<
(
int
)
nTotalPoints
;
i
++
)
{
rest
=
i
;
for
(
t
=
nInputs
-
1
;
t
>=
0
;
--
t
)
{
for
(
t
=
(
int
)
nInputs
-
1
;
t
>=
0
;
--
t
)
{
cmsUInt32Number
Colorant
=
rest
%
nSamples
[
t
];
...
...
@@ -816,7 +820,7 @@ cmsBool CMSEXPORT cmsStageSampleCLut16bit(cmsStage* mpe, cmsSAMPLER16 Sampler, v
}
if
(
clut
->
Tab
.
T
!=
NULL
)
{
for
(
t
=
0
;
t
<
nOutputs
;
t
++
)
for
(
t
=
0
;
t
<
(
int
)
nOutputs
;
t
++
)
Out
[
t
]
=
clut
->
Tab
.
T
[
index
+
t
];
}
...
...
@@ -826,7 +830,7 @@ cmsBool CMSEXPORT cmsStageSampleCLut16bit(cmsStage* mpe, cmsSAMPLER16 Sampler, v
if
(
!
(
dwFlags
&
SAMPLER_INSPECT
))
{
if
(
clut
->
Tab
.
T
!=
NULL
)
{
for
(
t
=
0
;
t
<
nOutputs
;
t
++
)
for
(
t
=
0
;
t
<
(
int
)
nOutputs
;
t
++
)
clut
->
Tab
.
T
[
index
+
t
]
=
Out
[
t
];
}
}
...
...
@@ -837,11 +841,12 @@ cmsBool CMSEXPORT cmsStageSampleCLut16bit(cmsStage* mpe, cmsSAMPLER16 Sampler, v
return
TRUE
;
}
// Same as anterior, but for floting point
// Same as anterior, but for flo
a
ting point
cmsBool
CMSEXPORT
cmsStageSampleCLutFloat
(
cmsStage
*
mpe
,
cmsSAMPLERFLOAT
Sampler
,
void
*
Cargo
,
cmsUInt32Number
dwFlags
)
{
int
i
,
t
,
nTotalPoints
,
index
,
rest
;
int
nInputs
,
nOutputs
;
int
i
,
t
,
index
,
rest
;
cmsUInt32Number
nTotalPoints
;
cmsUInt32Number
nInputs
,
nOutputs
;
cmsUInt32Number
*
nSamples
;
cmsFloat32Number
In
[
MAX_INPUT_DIMENSIONS
+
1
],
Out
[
MAX_STAGE_CHANNELS
];
_cmsStageCLutData
*
clut
=
(
_cmsStageCLutData
*
)
mpe
->
Data
;
...
...
@@ -859,10 +864,10 @@ cmsBool CMSEXPORT cmsStageSampleCLutFloat(cmsStage* mpe, cmsSAMPLERFLOAT Sampler
if
(
nTotalPoints
==
0
)
return
FALSE
;
index
=
0
;
for
(
i
=
0
;
i
<
nTotalPoints
;
i
++
)
{
for
(
i
=
0
;
i
<
(
int
)
nTotalPoints
;
i
++
)
{
rest
=
i
;
for
(
t
=
nInputs
-
1
;
t
>=
0
;
--
t
)
{
for
(
t
=
(
int
)
nInputs
-
1
;
t
>=
0
;
--
t
)
{
cmsUInt32Number
Colorant
=
rest
%
nSamples
[
t
];
...
...
@@ -872,7 +877,7 @@ cmsBool CMSEXPORT cmsStageSampleCLutFloat(cmsStage* mpe, cmsSAMPLERFLOAT Sampler
}
if
(
clut
->
Tab
.
TFloat
!=
NULL
)
{
for
(
t
=
0
;
t
<
nOutputs
;
t
++
)
for
(
t
=
0
;
t
<
(
int
)
nOutputs
;
t
++
)
Out
[
t
]
=
clut
->
Tab
.
TFloat
[
index
+
t
];
}
...
...
@@ -882,7 +887,7 @@ cmsBool CMSEXPORT cmsStageSampleCLutFloat(cmsStage* mpe, cmsSAMPLERFLOAT Sampler
if
(
!
(
dwFlags
&
SAMPLER_INSPECT
))
{
if
(
clut
->
Tab
.
TFloat
!=
NULL
)
{
for
(
t
=
0
;
t
<
nOutputs
;
t
++
)
for
(
t
=
0
;
t
<
(
int
)
nOutputs
;
t
++
)
clut
->
Tab
.
TFloat
[
index
+
t
]
=
Out
[
t
];
}
}
...
...
@@ -900,7 +905,8 @@ cmsBool CMSEXPORT cmsStageSampleCLutFloat(cmsStage* mpe, cmsSAMPLERFLOAT Sampler
cmsBool
CMSEXPORT
cmsSliceSpace16
(
cmsUInt32Number
nInputs
,
const
cmsUInt32Number
clutPoints
[],
cmsSAMPLER16
Sampler
,
void
*
Cargo
)
{
int
i
,
t
,
nTotalPoints
,
rest
;
int
i
,
t
,
rest
;
cmsUInt32Number
nTotalPoints
;
cmsUInt16Number
In
[
cmsMAXCHANNELS
];
if
(
nInputs
>=
cmsMAXCHANNELS
)
return
FALSE
;
...
...
@@ -908,10 +914,10 @@ cmsBool CMSEXPORT cmsSliceSpace16(cmsUInt32Number nInputs, const cmsUInt32Number
nTotalPoints
=
CubeSize
(
clutPoints
,
nInputs
);
if
(
nTotalPoints
==
0
)
return
FALSE
;
for
(
i
=
0
;
i
<
nTotalPoints
;
i
++
)
{
for
(
i
=
0
;
i
<
(
int
)
nTotalPoints
;
i
++
)
{
rest
=
i
;
for
(
t
=
nInputs
-
1
;
t
>=
0
;
--
t
)
{
for
(
t
=
(
int
)
nInputs
-
1
;
t
>=
0
;
--
t
)
{
cmsUInt32Number
Colorant
=
rest
%
clutPoints
[
t
];
...
...
@@ -930,7 +936,8 @@ cmsBool CMSEXPORT cmsSliceSpace16(cmsUInt32Number nInputs, const cmsUInt32Number
cmsInt32Number
CMSEXPORT
cmsSliceSpaceFloat
(
cmsUInt32Number
nInputs
,
const
cmsUInt32Number
clutPoints
[],
cmsSAMPLERFLOAT
Sampler
,
void
*
Cargo
)
{
int
i
,
t
,
nTotalPoints
,
rest
;
int
i
,
t
,
rest
;
cmsUInt32Number
nTotalPoints
;
cmsFloat32Number
In
[
cmsMAXCHANNELS
];
if
(
nInputs
>=
cmsMAXCHANNELS
)
return
FALSE
;
...
...
@@ -938,10 +945,10 @@ cmsInt32Number CMSEXPORT cmsSliceSpaceFloat(cmsUInt32Number nInputs, const cmsUI
nTotalPoints
=
CubeSize
(
clutPoints
,
nInputs
);
if
(
nTotalPoints
==
0
)
return
FALSE
;
for
(
i
=
0
;
i
<
nTotalPoints
;
i
++
)
{
for
(
i
=
0
;
i
<
(
int
)
nTotalPoints
;
i
++
)
{
rest
=
i
;
for
(
t
=
nInputs
-
1
;
t
>=
0
;
--
t
)
{
for
(
t
=
(
int
)
nInputs
-
1
;
t
>=
0
;
--
t
)
{
cmsUInt32Number
Colorant
=
rest
%
clutPoints
[
t
];
...
...
@@ -991,7 +998,7 @@ void EvaluateLab2XYZ(const cmsFloat32Number In[],
// No dup or free routines needed, as the structure has no pointers in it.
cmsStage
*
_cmsStageAllocLab2XYZ
(
cmsContext
ContextID
)
cmsStage
*
CMSEXPORT
_cmsStageAllocLab2XYZ
(
cmsContext
ContextID
)
{
return
_cmsStageAllocPlaceholder
(
ContextID
,
cmsSigLab2XYZElemType
,
3
,
3
,
EvaluateLab2XYZ
,
NULL
,
NULL
,
NULL
);
}
...
...
@@ -1021,7 +1028,7 @@ cmsStage* _cmsStageAllocLabV2ToV4curves(cmsContext ContextID)
return
NULL
;
}
// We need to map * (0xffff / 0xff00), thats same as (257 / 256)
// We need to map * (0xffff / 0xff00), that
'
s same as (257 / 256)
// So we can use 258-entry tables to do the trick (i / 257) * (255 * 257) * (257 / 256);
for
(
i
=
0
;
i
<
257
;
i
++
)
{
...
...
@@ -1042,7 +1049,7 @@ cmsStage* _cmsStageAllocLabV2ToV4curves(cmsContext ContextID)
// ********************************************************************************
// Matrix-based conversion, which is more accurate, but slower and cannot properly be saved in devicelink profiles
cmsStage
*
_cmsStageAllocLabV2ToV4
(
cmsContext
ContextID
)
cmsStage
*
CMSEXPORT
_cmsStageAllocLabV2ToV4
(
cmsContext
ContextID
)
{
static
const
cmsFloat64Number
V2ToV4
[]
=
{
65535
.
0
/
65280
.
0
,
0
,
0
,
0
,
65535
.
0
/
65280
.
0
,
0
,
...
...
@@ -1058,7 +1065,7 @@ cmsStage* _cmsStageAllocLabV2ToV4(cmsContext ContextID)
// Reverse direction
cmsStage
*
_cmsStageAllocLabV4ToV2
(
cmsContext
ContextID
)
cmsStage
*
CMSEXPORT
_cmsStageAllocLabV4ToV2
(
cmsContext
ContextID
)
{
static
const
cmsFloat64Number
V4ToV2
[]
=
{
65280
.
0
/
65535
.
0
,
0
,
0
,
0
,
65280
.
0
/
65535
.
0
,
0
,
...
...
@@ -1166,7 +1173,7 @@ void Clipper(const cmsFloat32Number In[], cmsFloat32Number Out[], const cmsStage
}
}
cmsStage
*
_cmsStageClipNegatives
(
cmsContext
ContextID
,
int
nChannels
)
cmsStage
*
_cmsStageClipNegatives
(
cmsContext
ContextID
,
cmsUInt32Number
nChannels
)
{
return
_cmsStageAllocPlaceholder
(
ContextID
,
cmsSigClipNegativesElemType
,
nChannels
,
nChannels
,
Clipper
,
NULL
,
NULL
,
NULL
);
...
...
@@ -1201,7 +1208,7 @@ void EvaluateXYZ2Lab(const cmsFloat32Number In[], cmsFloat32Number Out[], const
cmsUNUSED_PARAMETER
(
mpe
);
}
cmsStage
*
_cmsStageAllocXYZ2Lab
(
cmsContext
ContextID
)
cmsStage
*
CMSEXPORT
_cmsStageAllocXYZ2Lab
(
cmsContext
ContextID
)
{
return
_cmsStageAllocPlaceholder
(
ContextID
,
cmsSigXYZ2LabElemType
,
3
,
3
,
EvaluateXYZ2Lab
,
NULL
,
NULL
,
NULL
);
...
...
@@ -1300,23 +1307,42 @@ cmsStage* CMSEXPORT cmsStageDup(cmsStage* mpe)
// ***********************************************************************************************************
// This function sets up the channel count
static
void
BlessLUT
(
cmsPipeline
*
lut
)
cmsBool
BlessLUT
(
cmsPipeline
*
lut
)
{
// We can set the input/ouput channels only if we have elements.
// We can set the input/ou
t
put channels only if we have elements.
if
(
lut
->
Elements
!=
NULL
)
{
cmsStage
*
First
,
*
Last
;
cmsStage
*
prev
;
cmsStage
*
next
;
cmsStage
*
First
;
cmsStage
*
Last
;
First
=
cmsPipelineGetPtrToFirstStage
(
lut
);
Last
=
cmsPipelineGetPtrToLastStage
(
lut
);
if
(
First
!=
NULL
)
lut
->
InputChannels
=
First
->
InputChannels
;
if
(
Last
!=
NULL
)
lut
->
OutputChannels
=
Last
->
OutputChannels
;
if
(
First
==
NULL
||
Last
==
NULL
)
return
FALSE
;
lut
->
InputChannels
=
First
->
InputChannels
;
lut
->
OutputChannels
=
Last
->
OutputChannels
;
// Check chain consistency
prev
=
First
;
next
=
prev
->
Next
;
while
(
next
!=
NULL
)
{
if
(
next
->
InputChannels
!=
prev
->
OutputChannels
)
return
FALSE
;
next
=
next
->
Next
;
prev
=
prev
->
Next
;
}
}
return
TRUE
;
}
// Default to evaluate the LUT on 16 bit-basis. Precision is retained.
static
...
...
@@ -1368,21 +1394,18 @@ void _LUTevalFloat(register const cmsFloat32Number In[], register cmsFloat32Numb
}
// LUT Creation & Destruction
cmsPipeline
*
CMSEXPORT
cmsPipelineAlloc
(
cmsContext
ContextID
,
cmsUInt32Number
InputChannels
,
cmsUInt32Number
OutputChannels
)
{
cmsPipeline
*
NewLUT
;
// A value of zero in channels is allowed as placeholder
if
(
InputChannels
>=
cmsMAXCHANNELS
||
OutputChannels
>=
cmsMAXCHANNELS
)
return
NULL
;
NewLUT
=
(
cmsPipeline
*
)
_cmsMallocZero
(
ContextID
,
sizeof
(
cmsPipeline
));
if
(
NewLUT
==
NULL
)
return
NULL
;
NewLUT
->
InputChannels
=
InputChannels
;
NewLUT
->
OutputChannels
=
OutputChannels
;
...
...
@@ -1393,7 +1416,11 @@ cmsPipeline* CMSEXPORT cmsPipelineAlloc(cmsContext ContextID, cmsUInt32Number In
NewLUT
->
Data
=
NewLUT
;
NewLUT
->
ContextID
=
ContextID
;
BlessLUT
(
NewLUT
);
if
(
!
BlessLUT
(
NewLUT
))
{
_cmsFree
(
ContextID
,
NewLUT
);
return
NULL
;
}
return
NewLUT
;
}
...
...
@@ -1500,7 +1527,12 @@ cmsPipeline* CMSEXPORT cmsPipelineDup(const cmsPipeline* lut)
NewLUT
->
SaveAs8Bits
=
lut
->
SaveAs8Bits
;
BlessLUT
(
NewLUT
);
if
(
!
BlessLUT
(
NewLUT
))
{
_cmsFree
(
lut
->
ContextID
,
NewLUT
);
return
NULL
;
}
return
NewLUT
;
}
...
...
@@ -1537,8 +1569,7 @@ int CMSEXPORT cmsPipelineInsertStage(cmsPipeline* lut, cmsStageLoc loc, cmsStage
return
FALSE
;
}
BlessLUT
(
lut
);
return
TRUE
;
return
BlessLUT
(
lut
);
}
// Unlink an element and return the pointer to it
...
...
@@ -1593,6 +1624,7 @@ void CMSEXPORT cmsPipelineUnlinkStage(cmsPipeline* lut, cmsStageLoc loc, cmsStag
else
cmsStageFree
(
Unlinked
);
// May fail, but we ignore it
BlessLUT
(
lut
);
}
...
...
@@ -1619,8 +1651,7 @@ cmsBool CMSEXPORT cmsPipelineCat(cmsPipeline* l1, const cmsPipeline* l2)
return
FALSE
;
}
BlessLUT
(
l1
);
return
TRUE
;
return
BlessLUT
(
l1
);
}
...
...
src/share/native/sun/java2d/cmm/lcms/cmsmd5.c
浏览文件 @
06bdbf91
...
...
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-201
6
Marti Maria Saguer
// Copyright (c) 1998-201
7
Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
...
...
src/share/native/sun/java2d/cmm/lcms/cmsmtrx.c
浏览文件 @
06bdbf91
...
...
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-201
6
Marti Maria Saguer
// Copyright (c) 1998-201
7
Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
...
...
src/share/native/sun/java2d/cmm/lcms/cmsnamed.c
浏览文件 @
06bdbf91
...
...
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-201
6
Marti Maria Saguer
// Copyright (c) 1998-201
7
Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
...
...
@@ -156,7 +156,7 @@ int SearchMLUEntry(cmsMLU* mlu, cmsUInt16Number LanguageCode, cmsUInt16Number Co
for
(
i
=
0
;
i
<
mlu
->
UsedEntries
;
i
++
)
{
if
(
mlu
->
Entries
[
i
].
Country
==
CountryCode
&&
mlu
->
Entries
[
i
].
Language
==
LanguageCode
)
return
i
;
mlu
->
Entries
[
i
].
Language
==
LanguageCode
)
return
(
int
)
i
;
}
// Not found
...
...
@@ -207,31 +207,24 @@ cmsBool AddMLUBlock(cmsMLU* mlu, cmsUInt32Number size, const wchar_t *Block,
return
TRUE
;
}
// Convert from a 3-char code to a cmsUInt16Number. It is done inthis way because some
// Convert from a 3-char code to a cmsUInt16Number. It is done in
this way because some
// compilers don't properly align beginning of strings
static
cmsUInt16Number
strTo16
(
const
char
str
[
3
])
{
cmsUInt16Number
n
=
((
cmsUInt16Number
)
str
[
0
]
<<
8
)
|
str
[
1
];
const
cmsUInt8Number
*
ptr8
=
(
const
cmsUInt8Number
*
)
str
;
cmsUInt16Number
n
=
(
cmsUInt16Number
)(((
cmsUInt16Number
)
ptr8
[
0
]
<<
8
)
|
ptr8
[
1
]);
return
n
;
// Always big endian in this case
return
n
;
}
static
void
strFrom16
(
char
str
[
3
],
cmsUInt16Number
n
)
{
// Assiming this would be aligned
union
{
cmsUInt16Number
n
;
char
str
[
2
];
}
c
;
c
.
n
=
n
;
// Always big endian in this case
str
[
0
]
=
c
.
str
[
0
];
str
[
1
]
=
c
.
str
[
1
];
str
[
2
]
=
0
;
str
[
0
]
=
(
char
)(
n
>>
8
);
str
[
1
]
=
(
char
)
n
;
str
[
2
]
=
(
char
)
0
;
}
...
...
@@ -354,7 +347,7 @@ const wchar_t* _cmsMLUgetWide(const cmsMLU* mlu,
cmsUInt16Number
*
UsedLanguageCode
,
cmsUInt16Number
*
UsedCountryCode
)
{
cmsUInt32Number
i
;
cmsInt32Number
Best
=
-
1
;
int
Best
=
-
1
;
_cmsMLUentry
*
v
;
if
(
mlu
==
NULL
)
return
NULL
;
...
...
@@ -367,7 +360,7 @@ const wchar_t* _cmsMLUgetWide(const cmsMLU* mlu,
if
(
v
->
Language
==
LanguageCode
)
{
if
(
Best
==
-
1
)
Best
=
i
;
if
(
Best
==
-
1
)
Best
=
(
int
)
i
;
if
(
v
->
Country
==
CountryCode
)
{
...
...
@@ -633,10 +626,10 @@ cmsBool CMSEXPORT cmsAppendNamedColor(cmsNAMEDCOLORLIST* NamedColorList,
}
for
(
i
=
0
;
i
<
NamedColorList
->
ColorantCount
;
i
++
)
NamedColorList
->
List
[
NamedColorList
->
nColors
].
DeviceColorant
[
i
]
=
Colorant
==
NULL
?
0
:
Colorant
[
i
];
NamedColorList
->
List
[
NamedColorList
->
nColors
].
DeviceColorant
[
i
]
=
Colorant
==
NULL
?
(
cmsUInt16Number
)
0
:
Colorant
[
i
];
for
(
i
=
0
;
i
<
3
;
i
++
)
NamedColorList
->
List
[
NamedColorList
->
nColors
].
PCS
[
i
]
=
PCS
==
NULL
?
0
:
PCS
[
i
];
NamedColorList
->
List
[
NamedColorList
->
nColors
].
PCS
[
i
]
=
PCS
==
NULL
?
(
cmsUInt16Number
)
0
:
PCS
[
i
];
if
(
Name
!=
NULL
)
{
...
...
@@ -671,6 +664,7 @@ cmsBool CMSEXPORT cmsNamedColorInfo(const cmsNAMEDCOLORLIST* NamedColorList, cm
if
(
nColor
>=
cmsNamedColorCount
(
NamedColorList
))
return
FALSE
;
// strcpy instead of strncpy because many apps are using small buffers
if
(
Name
)
strcpy
(
Name
,
NamedColorList
->
List
[
nColor
].
Name
);
if
(
Prefix
)
strcpy
(
Prefix
,
NamedColorList
->
Prefix
);
if
(
Suffix
)
strcpy
(
Suffix
,
NamedColorList
->
Suffix
);
...
...
@@ -688,13 +682,14 @@ cmsBool CMSEXPORT cmsNamedColorInfo(const cmsNAMEDCOLORLIST* NamedColorList, cm
// Search for a given color name (no prefix or suffix)
cmsInt32Number
CMSEXPORT
cmsNamedColorIndex
(
const
cmsNAMEDCOLORLIST
*
NamedColorList
,
const
char
*
Name
)
{
int
i
,
n
;
cmsUInt32Number
i
;
cmsUInt32Number
n
;
if
(
NamedColorList
==
NULL
)
return
-
1
;
n
=
cmsNamedColorCount
(
NamedColorList
);
for
(
i
=
0
;
i
<
n
;
i
++
)
{
if
(
cmsstrcasecmp
(
Name
,
NamedColorList
->
List
[
i
].
Name
)
==
0
)
return
i
;
return
(
cmsInt32Number
)
i
;
}
return
-
1
;
...
...
@@ -723,7 +718,8 @@ void EvalNamedColorPCS(const cmsFloat32Number In[], cmsFloat32Number Out[], cons
cmsUInt16Number
index
=
(
cmsUInt16Number
)
_cmsQuickSaturateWord
(
In
[
0
]
*
65535
.
0
);
if
(
index
>=
NamedColorList
->
nColors
)
{
cmsSignalError
(
NamedColorList
->
ContextID
,
cmsERROR_RANGE
,
"Color %d out of range; ignored"
,
index
);
cmsSignalError
(
NamedColorList
->
ContextID
,
cmsERROR_RANGE
,
"Color %d out of range"
,
index
);
Out
[
0
]
=
Out
[
1
]
=
Out
[
2
]
=
0
.
0
f
;
}
else
{
...
...
@@ -742,7 +738,10 @@ void EvalNamedColor(const cmsFloat32Number In[], cmsFloat32Number Out[], const c
cmsUInt32Number
j
;
if
(
index
>=
NamedColorList
->
nColors
)
{
cmsSignalError
(
NamedColorList
->
ContextID
,
cmsERROR_RANGE
,
"Color %d out of range; ignored"
,
index
);
cmsSignalError
(
NamedColorList
->
ContextID
,
cmsERROR_RANGE
,
"Color %d out of range"
,
index
);
for
(
j
=
0
;
j
<
NamedColorList
->
ColorantCount
;
j
++
)
Out
[
j
]
=
0
.
0
f
;
}
else
{
for
(
j
=
0
;
j
<
NamedColorList
->
ColorantCount
;
j
++
)
...
...
@@ -752,7 +751,7 @@ void EvalNamedColor(const cmsFloat32Number In[], cmsFloat32Number Out[], const c
// Named color lookup element
cmsStage
*
_cmsStageAllocNamedColor
(
cmsNAMEDCOLORLIST
*
NamedColorList
,
cmsBool
UsePCS
)
cmsStage
*
CMSEXPORT
_cmsStageAllocNamedColor
(
cmsNAMEDCOLORLIST
*
NamedColorList
,
cmsBool
UsePCS
)
{
return
_cmsStageAllocPlaceholder
(
NamedColorList
->
ContextID
,
cmsSigNamedColorElemType
,
...
...
src/share/native/sun/java2d/cmm/lcms/cmsopt.c
浏览文件 @
06bdbf91
...
...
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-201
6
Marti Maria Saguer
// Copyright (c) 1998-201
7
Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
...
...
@@ -78,8 +78,8 @@ typedef struct {
cmsContext
ContextID
;
// Number of channels
int
nInputs
;
int
nOutputs
;
cmsUInt32Number
nInputs
;
cmsUInt32Number
nOutputs
;
_cmsInterpFn16
EvalCurveIn16
[
MAX_INPUT_DIMENSIONS
];
// The maximum number of input channels is known in advance
cmsInterpParams
*
ParamsCurveIn16
[
MAX_INPUT_DIMENSIONS
];
...
...
@@ -123,8 +123,8 @@ typedef struct {
cmsContext
ContextID
;
int
nCurves
;
// Number of curves
int
nElements
;
// Elements in curves
cmsUInt32Number
nCurves
;
// Number of curves
cmsUInt32Number
nElements
;
// Elements in curves
cmsUInt16Number
**
Curves
;
// Points to a dynamically allocated array
}
Curves16Data
;
...
...
@@ -245,7 +245,7 @@ cmsBool _MultiplyMatrix(cmsPipeline* Lut)
// Multiply both matrices to get the result
_cmsMAT3per
(
&
res
,
(
cmsMAT3
*
)
m2
->
Double
,
(
cmsMAT3
*
)
m1
->
Double
);
// Get the next in chain afer the matrices
// Get the next in chain af
t
er the matrices
chain
=
(
*
pt2
)
->
Next
;
// Remove both matrices
...
...
@@ -334,7 +334,7 @@ void PrelinEval16(register const cmsUInt16Number Input[],
Prelin16Data
*
p16
=
(
Prelin16Data
*
)
D
;
cmsUInt16Number
StageABC
[
MAX_INPUT_DIMENSIONS
];
cmsUInt16Number
StageDEF
[
cmsMAXCHANNELS
];
int
i
;
cmsUInt32Number
i
;
for
(
i
=
0
;
i
<
p16
->
nInputs
;
i
++
)
{
...
...
@@ -379,15 +379,15 @@ void* Prelin16dup(cmsContext ContextID, const void* ptr)
static
Prelin16Data
*
PrelinOpt16alloc
(
cmsContext
ContextID
,
const
cmsInterpParams
*
ColorMap
,
int
nInputs
,
cmsToneCurve
**
In
,
int
nOutputs
,
cmsToneCurve
**
Out
)
cmsUInt32Number
nInputs
,
cmsToneCurve
**
In
,
cmsUInt32Number
nOutputs
,
cmsToneCurve
**
Out
)
{
int
i
;
cmsUInt32Number
i
;
Prelin16Data
*
p16
=
(
Prelin16Data
*
)
_cmsMallocZero
(
ContextID
,
sizeof
(
Prelin16Data
));
if
(
p16
==
NULL
)
return
NULL
;
p16
->
nInputs
=
nInputs
;
p16
->
nOutputs
=
nOutputs
;
p16
->
nOutputs
=
nOutputs
;
for
(
i
=
0
;
i
<
nInputs
;
i
++
)
{
...
...
@@ -435,7 +435,7 @@ Prelin16Data* PrelinOpt16alloc(cmsContext ContextID,
// Sampler implemented by another LUT. This is a clean way to precalculate the devicelink 3D CLUT for
// almost any transform. We use floating point precision and then convert from floating point to 16 bits.
static
int
XFormSampler16
(
register
const
cmsUInt16Number
In
[],
register
cmsUInt16Number
Out
[],
register
void
*
Cargo
)
cmsInt32Number
XFormSampler16
(
register
const
cmsUInt16Number
In
[],
register
cmsUInt16Number
Out
[],
register
void
*
Cargo
)
{
cmsPipeline
*
Lut
=
(
cmsPipeline
*
)
Cargo
;
cmsFloat32Number
InFloat
[
cmsMAXCHANNELS
],
OutFloat
[
cmsMAXCHANNELS
];
...
...
@@ -482,7 +482,7 @@ cmsBool AllCurvesAreLinear(cmsStage* mpe)
// is to fix scum dot on broken profiles/transforms. Works on 1, 3 and 4 channels
static
cmsBool
PatchLUT
(
cmsStage
*
CLUT
,
cmsUInt16Number
At
[],
cmsUInt16Number
Value
[],
int
nChannelsOut
,
int
nChannelsIn
)
cmsUInt32Number
nChannelsOut
,
cmsUInt32Number
nChannelsIn
)
{
_cmsStageCLutData
*
Grid
=
(
_cmsStageCLutData
*
)
CLUT
->
Data
;
cmsInterpParams
*
p16
=
Grid
->
Params
;
...
...
@@ -512,10 +512,10 @@ cmsBool PatchLUT(cmsStage* CLUT, cmsUInt16Number At[], cmsUInt16Number Value[],
((
pz
-
z0
)
!=
0
)
||
((
pw
-
w0
)
!=
0
))
return
FALSE
;
// Not on exact node
index
=
p16
->
opta
[
3
]
*
x0
+
p16
->
opta
[
2
]
*
y0
+
p16
->
opta
[
1
]
*
z0
+
p16
->
opta
[
0
]
*
w0
;
index
=
(
int
)
p16
->
opta
[
3
]
*
x0
+
(
int
)
p16
->
opta
[
2
]
*
y0
+
(
int
)
p16
->
opta
[
1
]
*
z0
+
(
int
)
p16
->
opta
[
0
]
*
w0
;
}
else
if
(
nChannelsIn
==
3
)
{
...
...
@@ -532,9 +532,9 @@ cmsBool PatchLUT(cmsStage* CLUT, cmsUInt16Number At[], cmsUInt16Number Value[],
((
py
-
y0
)
!=
0
)
||
((
pz
-
z0
)
!=
0
))
return
FALSE
;
// Not on exact node
index
=
p16
->
opta
[
2
]
*
x0
+
p16
->
opta
[
1
]
*
y0
+
p16
->
opta
[
0
]
*
z0
;
index
=
(
int
)
p16
->
opta
[
2
]
*
x0
+
(
int
)
p16
->
opta
[
1
]
*
y0
+
(
int
)
p16
->
opta
[
0
]
*
z0
;
}
else
if
(
nChannelsIn
==
1
)
{
...
...
@@ -545,24 +545,24 @@ cmsBool PatchLUT(cmsStage* CLUT, cmsUInt16Number At[], cmsUInt16Number Value[],
if
(((
px
-
x0
)
!=
0
))
return
FALSE
;
// Not on exact node
index
=
p16
->
opta
[
0
]
*
x0
;
index
=
(
int
)
p16
->
opta
[
0
]
*
x0
;
}
else
{
cmsSignalError
(
CLUT
->
ContextID
,
cmsERROR_INTERNAL
,
"(internal) %d Channels are not supported on PatchLUT"
,
nChannelsIn
);
return
FALSE
;
}
for
(
i
=
0
;
i
<
nChannelsOut
;
i
++
)
Grid
->
Tab
.
T
[
index
+
i
]
=
Value
[
i
];
for
(
i
=
0
;
i
<
(
int
)
nChannelsOut
;
i
++
)
Grid
->
Tab
.
T
[
index
+
i
]
=
Value
[
i
];
return
TRUE
;
}
// Auxiliary, to see if two values are equal or very different
static
cmsBool
WhitesAreEqual
(
int
n
,
cmsUInt16Number
White1
[],
cmsUInt16Number
White2
[]
)
cmsBool
WhitesAreEqual
(
cmsUInt32Number
n
,
cmsUInt16Number
White1
[],
cmsUInt16Number
White2
[]
)
{
int
i
;
cmsUInt32Number
i
;
for
(
i
=
0
;
i
<
n
;
i
++
)
{
...
...
@@ -664,7 +664,7 @@ cmsBool OptimizeByResampling(cmsPipeline** Lut, cmsUInt32Number Intent, cmsUInt3
cmsStage
*
mpe
;
cmsStage
*
CLUT
;
cmsStage
*
KeepPreLin
=
NULL
,
*
KeepPostLin
=
NULL
;
int
nGridPoints
;
cmsUInt32Number
nGridPoints
;
cmsColorSpaceSignature
ColorSpace
,
OutputColorSpace
;
cmsStage
*
NewPreLin
=
NULL
;
cmsStage
*
NewPostLin
=
NULL
;
...
...
@@ -676,8 +676,13 @@ cmsBool OptimizeByResampling(cmsPipeline** Lut, cmsUInt32Number Intent, cmsUInt3
// This is a loosy optimization! does not apply in floating-point cases
if
(
_cmsFormatterIsFloat
(
*
InputFormat
)
||
_cmsFormatterIsFloat
(
*
OutputFormat
))
return
FALSE
;
ColorSpace
=
_cmsICCcolorSpace
(
T_COLORSPACE
(
*
InputFormat
));
OutputColorSpace
=
_cmsICCcolorSpace
(
T_COLORSPACE
(
*
OutputFormat
));
ColorSpace
=
_cmsICCcolorSpace
((
int
)
T_COLORSPACE
(
*
InputFormat
));
OutputColorSpace
=
_cmsICCcolorSpace
((
int
)
T_COLORSPACE
(
*
OutputFormat
));
// Color space must be specified
if
(
ColorSpace
==
(
cmsColorSpaceSignature
)
0
||
OutputColorSpace
==
(
cmsColorSpaceSignature
)
0
)
return
FALSE
;
nGridPoints
=
_cmsReasonableGridpointsByColorspace
(
ColorSpace
,
*
dwFlags
);
// For empty LUTs, 2 points are enough
...
...
@@ -715,7 +720,7 @@ cmsBool OptimizeByResampling(cmsPipeline** Lut, cmsUInt32Number Intent, cmsUInt3
goto
Error
;
// Remove prelinearization. Since we have duplicated the curve
// in destination LUT, the sampling shoud be applied after this stage.
// in destination LUT, the sampling shou
l
d be applied after this stage.
cmsPipelineUnlinkStage
(
Src
,
cmsAT_BEGIN
,
&
KeepPreLin
);
}
}
...
...
@@ -723,7 +728,7 @@ cmsBool OptimizeByResampling(cmsPipeline** Lut, cmsUInt32Number Intent, cmsUInt3
// Allocate the CLUT
CLUT
=
cmsStageAllocCLut16bit
(
Src
->
ContextID
,
nGridPoints
,
Src
->
InputChannels
,
Src
->
OutputChannels
,
NULL
);
if
(
CLUT
==
NULL
)
return
FALSE
;
if
(
CLUT
==
NULL
)
goto
Error
;
// Add the CLUT to the destination LUT
if
(
!
cmsPipelineInsertStage
(
Dest
,
cmsAT_END
,
CLUT
))
{
...
...
@@ -747,14 +752,14 @@ cmsBool OptimizeByResampling(cmsPipeline** Lut, cmsUInt32Number Intent, cmsUInt3
if
(
!
cmsPipelineInsertStage
(
Dest
,
cmsAT_END
,
NewPostLin
))
goto
Error
;
// In destination LUT, the sampling shoud be applied after this stage.
// In destination LUT, the sampling shou
l
d be applied after this stage.
cmsPipelineUnlinkStage
(
Src
,
cmsAT_END
,
&
KeepPostLin
);
}
}
}
// Now its time to do the sampling. We have to ignore pre/post linearization
// The source LUT w
h
ithout pre/post curves is passed as parameter.
// The source LUT without pre/post curves is passed as parameter.
if
(
!
cmsStageSampleCLut16bit
(
CLUT
,
XFormSampler16
,
(
void
*
)
Src
,
0
))
{
Error:
// Ops, something went wrong, Restore stages
...
...
@@ -834,7 +839,7 @@ void SlopeLimiting(cmsToneCurve* g)
{
int
BeginVal
,
EndVal
;
int
AtBegin
=
(
int
)
floor
((
cmsFloat64Number
)
g
->
nEntries
*
0
.
02
+
0
.
5
);
// Cutoff at 2%
int
AtEnd
=
g
->
nEntries
-
AtBegin
-
1
;
// And 98%
int
AtEnd
=
(
int
)
g
->
nEntries
-
AtBegin
-
1
;
// And 98%
cmsFloat64Number
Val
,
Slope
,
beta
;
int
i
;
...
...
@@ -895,9 +900,9 @@ Prelin8Data* PrelinOpt8alloc(cmsContext ContextID, const cmsInterpParams* p, cms
// Move to 0..1.0 in fixed domain
v1
=
_cmsToFixedDomain
(
Input
[
0
]
*
p
->
Domain
[
0
]
);
v2
=
_cmsToFixedDomain
(
Input
[
1
]
*
p
->
Domain
[
1
]
);
v3
=
_cmsToFixedDomain
(
Input
[
2
]
*
p
->
Domain
[
2
]
);
v1
=
_cmsToFixedDomain
(
(
int
)
(
Input
[
0
]
*
p
->
Domain
[
0
])
);
v2
=
_cmsToFixedDomain
(
(
int
)
(
Input
[
1
]
*
p
->
Domain
[
1
])
);
v3
=
_cmsToFixedDomain
(
(
int
)
(
Input
[
2
]
*
p
->
Domain
[
2
])
);
// Store the precalculated table of nodes
p8
->
X0
[
i
]
=
(
p
->
opta
[
2
]
*
FIXED_TO_INT
(
v1
));
...
...
@@ -945,24 +950,24 @@ void PrelinEval8(register const cmsUInt16Number Input[],
register
cmsS15Fixed16Number
X0
,
X1
,
Y0
,
Y1
,
Z0
,
Z1
;
Prelin8Data
*
p8
=
(
Prelin8Data
*
)
D
;
register
const
cmsInterpParams
*
p
=
p8
->
p
;
int
TotalOut
=
p
->
nOutputs
;
int
TotalOut
=
(
int
)
p
->
nOutputs
;
const
cmsUInt16Number
*
LutTable
=
(
const
cmsUInt16Number
*
)
p
->
Table
;
r
=
Input
[
0
]
>>
8
;
g
=
Input
[
1
]
>>
8
;
b
=
Input
[
2
]
>>
8
;
r
=
(
cmsUInt8Number
)
(
Input
[
0
]
>>
8
)
;
g
=
(
cmsUInt8Number
)
(
Input
[
1
]
>>
8
)
;
b
=
(
cmsUInt8Number
)
(
Input
[
2
]
>>
8
)
;
X0
=
X1
=
p8
->
X0
[
r
];
Y0
=
Y1
=
p8
->
Y0
[
g
];
Z0
=
Z1
=
p8
->
Z0
[
b
];
X0
=
X1
=
(
cmsS15Fixed16Number
)
p8
->
X0
[
r
];
Y0
=
Y1
=
(
cmsS15Fixed16Number
)
p8
->
Y0
[
g
];
Z0
=
Z1
=
(
cmsS15Fixed16Number
)
p8
->
Z0
[
b
];
rx
=
p8
->
rx
[
r
];
ry
=
p8
->
ry
[
g
];
rz
=
p8
->
rz
[
b
];
X1
=
X0
+
(
(
rx
==
0
)
?
0
:
p
->
opta
[
2
]);
Y1
=
Y0
+
(
(
ry
==
0
)
?
0
:
p
->
opta
[
1
]);
Z1
=
Z0
+
(
(
rz
==
0
)
?
0
:
p
->
opta
[
0
]);
X1
=
X0
+
(
cmsS15Fixed16Number
)((
rx
==
0
)
?
0
:
p
->
opta
[
2
]);
Y1
=
Y0
+
(
cmsS15Fixed16Number
)((
ry
==
0
)
?
0
:
p
->
opta
[
1
]);
Z1
=
Z0
+
(
cmsS15Fixed16Number
)((
rz
==
0
)
?
0
:
p
->
opta
[
0
]);
// These are the 6 Tetrahedral
...
...
@@ -1015,9 +1020,8 @@ void PrelinEval8(register const cmsUInt16Number Input[],
c1
=
c2
=
c3
=
0
;
}
Rest
=
c1
*
rx
+
c2
*
ry
+
c3
*
rz
+
0x8001
;
Output
[
OutChan
]
=
(
cmsUInt16Number
)
c0
+
((
Rest
+
(
Rest
>>
16
))
>>
16
);
Output
[
OutChan
]
=
(
cmsUInt16Number
)
(
c0
+
((
Rest
+
(
Rest
>>
16
))
>>
16
)
);
}
}
...
...
@@ -1029,8 +1033,8 @@ void PrelinEval8(register const cmsUInt16Number Input[],
static
cmsBool
IsDegenerated
(
const
cmsToneCurve
*
g
)
{
int
i
,
Zeros
=
0
,
Poles
=
0
;
int
nEntries
=
g
->
nEntries
;
cmsUInt32Number
i
,
Zeros
=
0
,
Poles
=
0
;
cmsUInt32Number
nEntries
=
g
->
nEntries
;
for
(
i
=
0
;
i
<
nEntries
;
i
++
)
{
...
...
@@ -1052,7 +1056,7 @@ static
cmsBool
OptimizeByComputingLinearization
(
cmsPipeline
**
Lut
,
cmsUInt32Number
Intent
,
cmsUInt32Number
*
InputFormat
,
cmsUInt32Number
*
OutputFormat
,
cmsUInt32Number
*
dwFlags
)
{
cmsPipeline
*
OriginalLut
;
int
nGridPoints
;
cmsUInt32Number
nGridPoints
;
cmsToneCurve
*
Trans
[
cmsMAXCHANNELS
],
*
TransReverse
[
cmsMAXCHANNELS
];
cmsUInt32Number
t
,
i
;
cmsFloat32Number
v
,
In
[
cmsMAXCHANNELS
],
Out
[
cmsMAXCHANNELS
];
...
...
@@ -1090,8 +1094,13 @@ cmsBool OptimizeByComputingLinearization(cmsPipeline** Lut, cmsUInt32Number Inte
if
(
cmsStageType
(
mpe
)
==
cmsSigNamedColorElemType
)
return
FALSE
;
}
ColorSpace
=
_cmsICCcolorSpace
(
T_COLORSPACE
(
*
InputFormat
));
OutputColorSpace
=
_cmsICCcolorSpace
(
T_COLORSPACE
(
*
OutputFormat
));
ColorSpace
=
_cmsICCcolorSpace
((
int
)
T_COLORSPACE
(
*
InputFormat
));
OutputColorSpace
=
_cmsICCcolorSpace
((
int
)
T_COLORSPACE
(
*
OutputFormat
));
// Color space must be specified
if
(
ColorSpace
==
(
cmsColorSpaceSignature
)
0
||
OutputColorSpace
==
(
cmsColorSpaceSignature
)
0
)
return
FALSE
;
nGridPoints
=
_cmsReasonableGridpointsByColorspace
(
ColorSpace
,
*
dwFlags
);
// Empty gamma containers
...
...
@@ -1212,7 +1221,10 @@ cmsBool OptimizeByComputingLinearization(cmsPipeline** Lut, cmsUInt32Number Inte
Prelin8Data
*
p8
=
PrelinOpt8alloc
(
OptimizedLUT
->
ContextID
,
OptimizedPrelinCLUT
->
Params
,
OptimizedPrelinCurves
);
if
(
p8
==
NULL
)
return
FALSE
;
if
(
p8
==
NULL
)
{
cmsPipelineFree
(
OptimizedLUT
);
return
FALSE
;
}
_cmsPipelineSetOptimizationParameters
(
OptimizedLUT
,
PrelinEval8
,
(
void
*
)
p8
,
Prelin8free
,
Prelin8dup
);
...
...
@@ -1222,7 +1234,10 @@ cmsBool OptimizeByComputingLinearization(cmsPipeline** Lut, cmsUInt32Number Inte
Prelin16Data
*
p16
=
PrelinOpt16alloc
(
OptimizedLUT
->
ContextID
,
OptimizedPrelinCLUT
->
Params
,
3
,
OptimizedPrelinCurves
,
3
,
NULL
);
if
(
p16
==
NULL
)
return
FALSE
;
if
(
p16
==
NULL
)
{
cmsPipelineFree
(
OptimizedLUT
);
return
FALSE
;
}
_cmsPipelineSetOptimizationParameters
(
OptimizedLUT
,
PrelinEval16
,
(
void
*
)
p16
,
PrelinOpt16free
,
Prelin16dup
);
...
...
@@ -1260,6 +1275,7 @@ Error:
return
FALSE
;
cmsUNUSED_PARAMETER
(
Intent
);
cmsUNUSED_PARAMETER
(
lIsLinear
);
}
...
...
@@ -1269,7 +1285,7 @@ static
void
CurvesFree
(
cmsContext
ContextID
,
void
*
ptr
)
{
Curves16Data
*
Data
=
(
Curves16Data
*
)
ptr
;
int
i
;
cmsUInt32Number
i
;
for
(
i
=
0
;
i
<
Data
->
nCurves
;
i
++
)
{
...
...
@@ -1284,7 +1300,7 @@ static
void
*
CurvesDup
(
cmsContext
ContextID
,
const
void
*
ptr
)
{
Curves16Data
*
Data
=
(
Curves16Data
*
)
_cmsDupMem
(
ContextID
,
ptr
,
sizeof
(
Curves16Data
));
int
i
;
cmsUInt32Number
i
;
if
(
Data
==
NULL
)
return
NULL
;
...
...
@@ -1299,9 +1315,9 @@ void* CurvesDup(cmsContext ContextID, const void* ptr)
// Precomputes tables for 8-bit on input devicelink.
static
Curves16Data
*
CurvesAlloc
(
cmsContext
ContextID
,
int
nCurves
,
int
nElements
,
cmsToneCurve
**
G
)
Curves16Data
*
CurvesAlloc
(
cmsContext
ContextID
,
cmsUInt32Number
nCurves
,
cmsUInt32Number
nElements
,
cmsToneCurve
**
G
)
{
int
i
,
j
;
cmsUInt32Number
i
,
j
;
Curves16Data
*
c16
;
c16
=
(
Curves16Data
*
)
_cmsMallocZero
(
ContextID
,
sizeof
(
Curves16Data
));
...
...
@@ -1311,7 +1327,10 @@ Curves16Data* CurvesAlloc(cmsContext ContextID, int nCurves, int nElements, cmsT
c16
->
nElements
=
nElements
;
c16
->
Curves
=
(
cmsUInt16Number
**
)
_cmsCalloc
(
ContextID
,
nCurves
,
sizeof
(
cmsUInt16Number
*
));
if
(
c16
->
Curves
==
NULL
)
return
NULL
;
if
(
c16
->
Curves
==
NULL
)
{
_cmsFree
(
ContextID
,
c16
);
return
NULL
;
}
for
(
i
=
0
;
i
<
nCurves
;
i
++
)
{
...
...
@@ -1327,7 +1346,7 @@ Curves16Data* CurvesAlloc(cmsContext ContextID, int nCurves, int nElements, cmsT
return
NULL
;
}
if
(
nElements
==
256
)
{
if
(
nElements
==
256
U
)
{
for
(
j
=
0
;
j
<
nElements
;
j
++
)
{
...
...
@@ -1351,8 +1370,8 @@ void FastEvaluateCurves8(register const cmsUInt16Number In[],
register
const
void
*
D
)
{
Curves16Data
*
Data
=
(
Curves16Data
*
)
D
;
cmsUInt8Number
x
;
int
i
;
int
x
;
cmsUInt32Number
i
;
for
(
i
=
0
;
i
<
Data
->
nCurves
;
i
++
)
{
...
...
@@ -1368,7 +1387,7 @@ void FastEvaluateCurves16(register const cmsUInt16Number In[],
register
const
void
*
D
)
{
Curves16Data
*
Data
=
(
Curves16Data
*
)
D
;
int
i
;
cmsUInt32Number
i
;
for
(
i
=
0
;
i
<
Data
->
nCurves
;
i
++
)
{
Out
[
i
]
=
Data
->
Curves
[
i
][
In
[
i
]];
...
...
@@ -1548,9 +1567,9 @@ void MatShaperEval16(register const cmsUInt16Number In[],
// In this case (and only in this case!) we can use this simplification since
// In[] is assured to come from a 8 bit number. (a << 8 | a)
ri
=
In
[
0
]
&
0xFF
;
gi
=
In
[
1
]
&
0xFF
;
bi
=
In
[
2
]
&
0xFF
;
ri
=
In
[
0
]
&
0xFF
U
;
gi
=
In
[
1
]
&
0xFF
U
;
bi
=
In
[
2
]
&
0xFF
U
;
// Across first shaper, which also converts to 1.14 fixed point
r
=
p
->
Shaper1R
[
ri
];
...
...
@@ -1563,9 +1582,9 @@ void MatShaperEval16(register const cmsUInt16Number In[],
l3
=
(
p
->
Mat
[
2
][
0
]
*
r
+
p
->
Mat
[
2
][
1
]
*
g
+
p
->
Mat
[
2
][
2
]
*
b
+
p
->
Off
[
2
]
+
0x2000
)
>>
14
;
// Now we have to clip to 0..1.0 range
ri
=
(
l1
<
0
)
?
0
:
((
l1
>
16384
)
?
16384
:
l1
);
gi
=
(
l2
<
0
)
?
0
:
((
l2
>
16384
)
?
16384
:
l2
);
bi
=
(
l3
<
0
)
?
0
:
((
l3
>
16384
)
?
16384
:
l3
);
ri
=
(
l1
<
0
)
?
0
:
((
l1
>
16384
)
?
16384
U
:
(
cmsUInt32Number
)
l1
);
gi
=
(
l2
<
0
)
?
0
:
((
l2
>
16384
)
?
16384
U
:
(
cmsUInt32Number
)
l2
);
bi
=
(
l3
<
0
)
?
0
:
((
l3
>
16384
)
?
16384
U
:
(
cmsUInt32Number
)
l3
);
// And across second shaper,
Out
[
0
]
=
p
->
Shaper2R
[
ri
];
...
...
@@ -1586,7 +1605,10 @@ void FillFirstShaper(cmsS1Fixed14Number* Table, cmsToneCurve* Curve)
R
=
(
cmsFloat32Number
)
(
i
/
255
.
0
);
y
=
cmsEvalToneCurveFloat
(
Curve
,
R
);
if
(
y
<
131072
.
0
)
Table
[
i
]
=
DOUBLE_TO_1FIXED14
(
y
);
else
Table
[
i
]
=
0x7fffffff
;
}
}
...
...
@@ -1602,6 +1624,12 @@ void FillSecondShaper(cmsUInt16Number* Table, cmsToneCurve* Curve, cmsBool Is8Bi
R
=
(
cmsFloat32Number
)
(
i
/
16384
.
0
);
Val
=
cmsEvalToneCurveFloat
(
Curve
,
R
);
// Val comes 0..1.0
if
(
Val
<
0
)
Val
=
0
;
if
(
Val
>
1
.
0
)
Val
=
1
.
0
;
if
(
Is8BitsOutput
)
{
// If 8 bits output, we can optimize further by computing the / 257 part.
...
...
@@ -1640,7 +1668,7 @@ cmsBool SetMatShaper(cmsPipeline* Dest, cmsToneCurve* Curve1[3], cmsMAT3* Mat, c
FillSecondShaper
(
p
->
Shaper2G
,
Curve2
[
1
],
Is8Bits
);
FillSecondShaper
(
p
->
Shaper2B
,
Curve2
[
2
],
Is8Bits
);
// Convert matrix to nFixed14. Note that those values may take more than 16 bits
as
// Convert matrix to nFixed14. Note that those values may take more than 16 bits
for
(
i
=
0
;
i
<
3
;
i
++
)
{
for
(
j
=
0
;
j
<
3
;
j
++
)
{
p
->
Mat
[
i
][
j
]
=
DOUBLE_TO_1FIXED14
(
Mat
->
v
[
i
].
n
[
j
]);
...
...
@@ -1902,7 +1930,7 @@ cmsBool _cmsRegisterOptimizationPlugin(cmsContext ContextID, cmsPluginBase* Dat
// The entry point for LUT optimization
cmsBool
_cmsOptimizePipeline
(
cmsContext
ContextID
,
cmsPipeline
**
PtrLut
,
int
Intent
,
cmsUInt32Number
Intent
,
cmsUInt32Number
*
InputFormat
,
cmsUInt32Number
*
OutputFormat
,
cmsUInt32Number
*
dwFlags
)
...
...
src/share/native/sun/java2d/cmm/lcms/cmspack.c
浏览文件 @
06bdbf91
此差异已折叠。
点击以展开。
src/share/native/sun/java2d/cmm/lcms/cmspcs.c
浏览文件 @
06bdbf91
...
...
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-201
6
Marti Maria Saguer
// Copyright (c) 1998-201
7
Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
...
...
@@ -685,9 +685,9 @@ cmsFloat64Number CMSEXPORT cmsCIE2000DeltaE(const cmsCIELab* Lab1, const cmsCIEL
// This function returns a number of gridpoints to be used as LUT table. It assumes same number
// of gripdpoints in all dimensions. Flags may override the choice.
int
_cmsReasonableGridpointsByColorspace
(
cmsColorSpaceSignature
Colorspace
,
cmsUInt32Number
dwFlags
)
cmsUInt32Number
_cmsReasonableGridpointsByColorspace
(
cmsColorSpaceSignature
Colorspace
,
cmsUInt32Number
dwFlags
)
{
int
nChannels
;
cmsUInt32Number
nChannels
;
// Already specified?
if
(
dwFlags
&
0x00FF0000
)
{
...
...
@@ -831,7 +831,7 @@ cmsColorSpaceSignature CMSEXPORT _cmsICCcolorSpace(int OurNotation)
case
PT_MCH14
:
return
cmsSigMCHEData
;
case
PT_MCH15
:
return
cmsSigMCHFData
;
default:
return
(
cmsColorSpaceSignature
)
(
-
1
)
;
default:
return
(
cmsColorSpaceSignature
)
0
;
}
}
...
...
@@ -898,7 +898,7 @@ int CMSEXPORT _cmsLCMScolorSpace(cmsColorSpaceSignature ProfileSpace)
case
cmsSigMCHFData
:
case
cmsSig15colorData
:
return
PT_MCH15
;
default:
return
(
cmsColorSpaceSignature
)
(
-
1
)
;
default:
return
(
cmsColorSpaceSignature
)
0
;
}
}
...
...
src/share/native/sun/java2d/cmm/lcms/cmsplugin.c
浏览文件 @
06bdbf91
...
...
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-201
6
Marti Maria Saguer
// Copyright (c) 1998-201
7
Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
...
...
@@ -201,14 +201,28 @@ cmsBool CMSEXPORT _cmsReadFloat32Number(cmsIOHANDLER* io, cmsFloat32Number* n)
_cmsAssert
(
io
!=
NULL
);
if
(
io
->
Read
(
io
,
&
tmp
,
sizeof
(
cmsUInt32Number
),
1
)
!=
1
)
if
(
io
->
Read
(
io
,
&
tmp
,
sizeof
(
cmsUInt32Number
),
1
)
!=
1
)
return
FALSE
;
if
(
n
!=
NULL
)
{
tmp
=
_cmsAdjustEndianess32
(
tmp
);
*
n
=
*
(
cmsFloat32Number
*
)
(
void
*
)
&
tmp
;
*
n
=
*
(
cmsFloat32Number
*
)(
void
*
)
&
tmp
;
// Safeguard which covers against absurd values
if
(
*
n
>
1E+20
||
*
n
<
-
1E+20
)
return
FALSE
;
#if defined(_MSC_VER) && _MSC_VER < 1800
return
TRUE
;
#elif defined (__BORLANDC__)
return
TRUE
;
#else
// fpclassify() required by C99 (only provided by MSVC >= 1800, VS2013 onwards)
return
((
fpclassify
(
*
n
)
==
FP_ZERO
)
||
(
fpclassify
(
*
n
)
==
FP_NORMAL
));
#endif
}
return
TRUE
;
}
...
...
@@ -222,7 +236,11 @@ cmsBool CMSEXPORT _cmsReadUInt64Number(cmsIOHANDLER* io, cmsUInt64Number* n)
if
(
io
->
Read
(
io
,
&
tmp
,
sizeof
(
cmsUInt64Number
),
1
)
!=
1
)
return
FALSE
;
if
(
n
!=
NULL
)
_cmsAdjustEndianess64
(
n
,
&
tmp
);
if
(
n
!=
NULL
)
{
_cmsAdjustEndianess64
(
n
,
&
tmp
);
}
return
TRUE
;
}
...
...
@@ -237,7 +255,7 @@ cmsBool CMSEXPORT _cmsRead15Fixed16Number(cmsIOHANDLER* io, cmsFloat64Number* n
return
FALSE
;
if
(
n
!=
NULL
)
{
*
n
=
_cms15Fixed16toDouble
(
_cmsAdjustEndianess32
(
tmp
));
*
n
=
_cms15Fixed16toDouble
(
(
cmsS15Fixed16Number
)
_cmsAdjustEndianess32
(
tmp
));
}
return
TRUE
;
...
...
@@ -254,9 +272,9 @@ cmsBool CMSEXPORT _cmsReadXYZNumber(cmsIOHANDLER* io, cmsCIEXYZ* XYZ)
if
(
XYZ
!=
NULL
)
{
XYZ
->
X
=
_cms15Fixed16toDouble
(
_cmsAdjustEndianess32
(
xyz
.
X
));
XYZ
->
Y
=
_cms15Fixed16toDouble
(
_cmsAdjustEndianess32
(
xyz
.
Y
));
XYZ
->
Z
=
_cms15Fixed16toDouble
(
_cmsAdjustEndianess32
(
xyz
.
Z
));
XYZ
->
X
=
_cms15Fixed16toDouble
(
(
cmsS15Fixed16Number
)
_cmsAdjustEndianess32
((
cmsUInt32Number
)
xyz
.
X
));
XYZ
->
Y
=
_cms15Fixed16toDouble
(
(
cmsS15Fixed16Number
)
_cmsAdjustEndianess32
((
cmsUInt32Number
)
xyz
.
Y
));
XYZ
->
Z
=
_cms15Fixed16toDouble
(
(
cmsS15Fixed16Number
)
_cmsAdjustEndianess32
((
cmsUInt32Number
)
xyz
.
Z
));
}
return
TRUE
;
}
...
...
@@ -345,7 +363,7 @@ cmsBool CMSEXPORT _cmsWrite15Fixed16Number(cmsIOHANDLER* io, cmsFloat64Number n
_cmsAssert
(
io
!=
NULL
);
tmp
=
_cmsAdjustEndianess32
(
_cmsDoubleTo15Fixed16
(
n
));
tmp
=
_cmsAdjustEndianess32
(
(
cmsUInt32Number
)
_cmsDoubleTo15Fixed16
(
n
));
if
(
io
->
Write
(
io
,
sizeof
(
cmsUInt32Number
),
&
tmp
)
!=
1
)
return
FALSE
;
...
...
@@ -359,9 +377,9 @@ cmsBool CMSEXPORT _cmsWriteXYZNumber(cmsIOHANDLER* io, const cmsCIEXYZ* XYZ)
_cmsAssert
(
io
!=
NULL
);
_cmsAssert
(
XYZ
!=
NULL
);
xyz
.
X
=
_cmsAdjustEndianess32
(
_cmsDoubleTo15Fixed16
(
XYZ
->
X
));
xyz
.
Y
=
_cmsAdjustEndianess32
(
_cmsDoubleTo15Fixed16
(
XYZ
->
Y
));
xyz
.
Z
=
_cmsAdjustEndianess32
(
_cmsDoubleTo15Fixed16
(
XYZ
->
Z
));
xyz
.
X
=
(
cmsS15Fixed16Number
)
_cmsAdjustEndianess32
((
cmsUInt32Number
)
_cmsDoubleTo15Fixed16
(
XYZ
->
X
));
xyz
.
Y
=
(
cmsS15Fixed16Number
)
_cmsAdjustEndianess32
((
cmsUInt32Number
)
_cmsDoubleTo15Fixed16
(
XYZ
->
Y
));
xyz
.
Z
=
(
cmsS15Fixed16Number
)
_cmsAdjustEndianess32
((
cmsUInt32Number
)
_cmsDoubleTo15Fixed16
(
XYZ
->
Z
));
return
io
->
Write
(
io
,
sizeof
(
cmsEncodedXYZNumber
),
&
xyz
);
}
...
...
@@ -519,7 +537,7 @@ cmsBool CMSEXPORT _cmsIOPrintf(cmsIOHANDLER* io, const char* frm, ...)
return
FALSE
;
// Truncated, which is a fatal error for us
}
rc
=
io
->
Write
(
io
,
len
,
Buffer
);
rc
=
io
->
Write
(
io
,
(
cmsUInt32Number
)
len
,
Buffer
);
va_end
(
args
);
...
...
@@ -779,6 +797,30 @@ cmsContext CMSEXPORT cmsCreateContext(void* Plugin, void* UserData)
struct
_cmsContext_struct
*
ctx
;
struct
_cmsContext_struct
fakeContext
;
// See the comments regarding locking in lcms2_internal.h
// for an explanation of why we need the following code.
#ifdef CMS_IS_WINDOWS_
#ifndef CMS_RELY_ON_WINDOWS_STATIC_MUTEX_INIT
{
static
HANDLE
_cmsWindowsInitMutex
=
NULL
;
static
volatile
HANDLE
*
mutex
=
&
_cmsWindowsInitMutex
;
if
(
*
mutex
==
NULL
)
{
HANDLE
p
=
CreateMutex
(
NULL
,
FALSE
,
NULL
);
if
(
p
&&
InterlockedCompareExchangePointer
((
void
**
)
mutex
,
(
void
*
)
p
,
NULL
)
!=
NULL
)
CloseHandle
(
p
);
}
if
(
*
mutex
==
NULL
||
WaitForSingleObject
(
*
mutex
,
INFINITE
)
==
WAIT_FAILED
)
return
NULL
;
if
(((
void
**
)
&
_cmsContextPoolHeadMutex
)[
0
]
==
NULL
)
InitializeCriticalSection
(
&
_cmsContextPoolHeadMutex
);
if
(
*
mutex
==
NULL
||
!
ReleaseMutex
(
*
mutex
))
return
NULL
;
}
#endif
#endif
_cmsInstallAllocFunctions
(
_cmsFindMemoryPlugin
(
Plugin
),
&
fakeContext
.
DefaultMemoryManager
);
fakeContext
.
chunks
[
UserPtr
]
=
UserData
;
...
...
@@ -805,7 +847,7 @@ cmsContext CMSEXPORT cmsCreateContext(void* Plugin, void* UserData)
ctx
->
chunks
[
MemPlugin
]
=
&
ctx
->
DefaultMemoryManager
;
// Now we can allocate the pool by using default memory manager
ctx
->
MemPool
=
_cmsCreateSubAlloc
(
ctx
,
22
*
sizeof
(
void
*
));
// default size about
3
2 pointers
ctx
->
MemPool
=
_cmsCreateSubAlloc
(
ctx
,
22
*
sizeof
(
void
*
));
// default size about
2
2 pointers
if
(
ctx
->
MemPool
==
NULL
)
{
cmsDeleteContext
(
ctx
);
...
...
src/share/native/sun/java2d/cmm/lcms/cmsps2.c
浏览文件 @
06bdbf91
...
...
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-201
6
Marti Maria Saguer
// Copyright (c) 1998-201
7
Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
...
...
@@ -429,7 +429,7 @@ void EmitRangeCheck(cmsIOHANDLER* m)
// Does write the intent
static
void
EmitIntent
(
cmsIOHANDLER
*
m
,
int
RenderingIntent
)
void
EmitIntent
(
cmsIOHANDLER
*
m
,
cmsUInt32Number
RenderingIntent
)
{
const
char
*
intent
;
...
...
@@ -563,7 +563,7 @@ void Emit1Gamma(cmsIOHANDLER* m, cmsToneCurve* Table)
// Compare gamma table
static
cmsBool
GammaTableEquals
(
cmsUInt16Number
*
g1
,
cmsUInt16Number
*
g2
,
int
nEntries
)
cmsBool
GammaTableEquals
(
cmsUInt16Number
*
g1
,
cmsUInt16Number
*
g2
,
cmsUInt32Number
nEntries
)
{
return
memcmp
(
g1
,
g2
,
nEntries
*
sizeof
(
cmsUInt16Number
))
==
0
;
}
...
...
@@ -572,9 +572,9 @@ cmsBool GammaTableEquals(cmsUInt16Number* g1, cmsUInt16Number* g2, int nEntries)
// Does write a set of gamma curves
static
void
EmitNGamma
(
cmsIOHANDLER
*
m
,
int
n
,
cmsToneCurve
*
g
[])
void
EmitNGamma
(
cmsIOHANDLER
*
m
,
cmsUInt32Number
n
,
cmsToneCurve
*
g
[])
{
int
i
;
cmsUInt32Number
i
;
for
(
i
=
0
;
i
<
n
;
i
++
)
{
...
...
@@ -797,7 +797,7 @@ int EmitCIEBasedABC(cmsIOHANDLER* m, cmsFloat64Number* Matrix, cmsToneCurve** Cu
static
int
EmitCIEBasedDEF
(
cmsIOHANDLER
*
m
,
cmsPipeline
*
Pipeline
,
int
Intent
,
cmsCIEXYZ
*
BlackPoint
)
int
EmitCIEBasedDEF
(
cmsIOHANDLER
*
m
,
cmsPipeline
*
Pipeline
,
cmsUInt32Number
Intent
,
cmsCIEXYZ
*
BlackPoint
)
{
const
char
*
PreMaj
;
const
char
*
PostMaj
;
...
...
@@ -857,14 +857,14 @@ int EmitCIEBasedDEF(cmsIOHANDLER* m, cmsPipeline* Pipeline, int Intent, cmsCIEXY
// Generates a curve from a gray profile
static
cmsToneCurve
*
ExtractGray2Y
(
cmsContext
ContextID
,
cmsHPROFILE
hProfile
,
int
Intent
)
cmsToneCurve
*
ExtractGray2Y
(
cmsContext
ContextID
,
cmsHPROFILE
hProfile
,
cmsUInt32Number
Intent
)
{
cmsToneCurve
*
Out
=
cmsBuildTabulatedToneCurve16
(
ContextID
,
256
,
NULL
);
cmsHPROFILE
hXYZ
=
cmsCreateXYZProfile
();
cmsHTRANSFORM
xform
=
cmsCreateTransformTHR
(
ContextID
,
hProfile
,
TYPE_GRAY_8
,
hXYZ
,
TYPE_XYZ_DBL
,
Intent
,
cmsFLAGS_NOOPTIMIZE
);
int
i
;
if
(
Out
!=
NULL
)
{
if
(
Out
!=
NULL
&&
xform
!=
NULL
)
{
for
(
i
=
0
;
i
<
256
;
i
++
)
{
cmsUInt8Number
Gray
=
(
cmsUInt8Number
)
i
;
...
...
@@ -876,8 +876,8 @@ static
}
}
cmsDeleteTransform
(
xform
);
cmsCloseProfile
(
hXYZ
);
if
(
xform
)
cmsDeleteTransform
(
xform
);
if
(
hXYZ
)
cmsCloseProfile
(
hXYZ
);
return
Out
;
}
...
...
@@ -887,7 +887,7 @@ static
// a more perceptually uniform space... I do choose Lab.
static
int
WriteInputLUT
(
cmsIOHANDLER
*
m
,
cmsHPROFILE
hProfile
,
int
Intent
,
cmsUInt32Number
dwFlags
)
int
WriteInputLUT
(
cmsIOHANDLER
*
m
,
cmsHPROFILE
hProfile
,
cmsUInt32Number
Intent
,
cmsUInt32Number
dwFlags
)
{
cmsHPROFILE
hLab
;
cmsHTRANSFORM
xform
;
...
...
@@ -972,7 +972,6 @@ cmsFloat64Number* GetPtrToMatrix(const cmsStage* mpe)
// Does create CSA based on matrix-shaper. Allowed types are gray and RGB based
static
int
WriteInputMatrixShaper
(
cmsIOHANDLER
*
m
,
cmsHPROFILE
hProfile
,
cmsStage
*
Matrix
,
cmsStage
*
Shaper
)
{
...
...
@@ -998,17 +997,17 @@ int WriteInputMatrixShaper(cmsIOHANDLER* m, cmsHPROFILE hProfile, cmsStage* Matr
memmove
(
&
Mat
,
GetPtrToMatrix
(
Matrix
),
sizeof
(
Mat
));
for
(
i
=
0
;
i
<
3
;
i
++
)
for
(
j
=
0
;
j
<
3
;
j
++
)
for
(
i
=
0
;
i
<
3
;
i
++
)
for
(
j
=
0
;
j
<
3
;
j
++
)
Mat
.
v
[
i
].
n
[
j
]
*=
MAX_ENCODEABLE_XYZ
;
rc
=
EmitCIEBasedABC
(
m
,
(
cmsFloat64Number
*
)
&
Mat
,
rc
=
EmitCIEBasedABC
(
m
,
(
cmsFloat64Number
*
)
&
Mat
,
_cmsStageGetPtrToCurveSet
(
Shaper
),
&
BlackPointAdaptedToD50
);
}
else
{
cmsSignalError
(
m
->
ContextID
,
cmsERROR_COLORSPACE_CHECK
,
"Profile is not suitable for CSA. Unsupported colorspace."
);
cmsSignalError
(
m
->
ContextID
,
cmsERROR_COLORSPACE_CHECK
,
"Profile is not suitable for CSA. Unsupported colorspace."
);
return
0
;
}
...
...
@@ -1021,12 +1020,12 @@ int WriteInputMatrixShaper(cmsIOHANDLER* m, cmsHPROFILE hProfile, cmsStage* Matr
// This is a HP extension, and it works in Lab instead of XYZ
static
int
WriteNamedColorCSA
(
cmsIOHANDLER
*
m
,
cmsHPROFILE
hNamedColor
,
int
Intent
)
int
WriteNamedColorCSA
(
cmsIOHANDLER
*
m
,
cmsHPROFILE
hNamedColor
,
cmsUInt32Number
Intent
)
{
cmsHTRANSFORM
xform
;
cmsHPROFILE
hLab
;
int
i
,
nColors
;
char
ColorName
[
32
];
cmsUInt32Number
i
,
nColors
;
char
ColorName
[
cmsMAX_PATH
];
cmsNAMEDCOLORLIST
*
NamedColorList
;
hLab
=
cmsCreateLab4ProfileTHR
(
m
->
ContextID
,
NULL
);
...
...
@@ -1304,20 +1303,20 @@ void EmitXYZ2Lab(cmsIOHANDLER* m)
// 8 bits.
static
int
WriteOutputLUT
(
cmsIOHANDLER
*
m
,
cmsHPROFILE
hProfile
,
int
Intent
,
cmsUInt32Number
dwFlags
)
int
WriteOutputLUT
(
cmsIOHANDLER
*
m
,
cmsHPROFILE
hProfile
,
cmsUInt32Number
Intent
,
cmsUInt32Number
dwFlags
)
{
cmsHPROFILE
hLab
;
cmsHTRANSFORM
xform
;
int
i
,
nChannels
;
cmsUInt32Number
i
,
nChannels
;
cmsUInt32Number
OutputFormat
;
_cmsTRANSFORM
*
v
;
cmsPipeline
*
DeviceLink
;
cmsHPROFILE
Profiles
[
3
];
cmsCIEXYZ
BlackPointAdaptedToD50
;
cmsBool
lDoBPC
=
(
dwFlags
&
cmsFLAGS_BLACKPOINTCOMPENSATION
);
cmsBool
lFixWhite
=
!
(
dwFlags
&
cmsFLAGS_NOWHITEONWHITEFIXUP
);
cmsBool
lDoBPC
=
(
cmsBool
)
(
dwFlags
&
cmsFLAGS_BLACKPOINTCOMPENSATION
);
cmsBool
lFixWhite
=
(
cmsBool
)
!
(
dwFlags
&
cmsFLAGS_NOWHITEONWHITEFIXUP
);
cmsUInt32Number
InFrm
=
TYPE_Lab_16
;
int
RelativeEncodingIntent
;
cmsUInt32Number
RelativeEncodingIntent
;
cmsColorSpaceSignature
ColorSpace
;
...
...
@@ -1413,10 +1412,10 @@ int WriteOutputLUT(cmsIOHANDLER* m, cmsHPROFILE hProfile, int Intent, cmsUInt32N
// Builds a ASCII string containing colorant list in 0..1.0 range
static
void
BuildColorantList
(
char
*
Colorant
,
int
nColorant
,
cmsUInt16Number
Out
[])
void
BuildColorantList
(
char
*
Colorant
,
cmsUInt32Number
nColorant
,
cmsUInt16Number
Out
[])
{
char
Buff
[
32
];
int
j
;
cmsUInt32Number
j
;
Colorant
[
0
]
=
0
;
if
(
nColorant
>
cmsMAXCHANNELS
)
...
...
@@ -1438,12 +1437,12 @@ void BuildColorantList(char *Colorant, int nColorant, cmsUInt16Number Out[])
// This is a HP extension.
static
int
WriteNamedColorCRD
(
cmsIOHANDLER
*
m
,
cmsHPROFILE
hNamedColor
,
int
Intent
,
cmsUInt32Number
dwFlags
)
int
WriteNamedColorCRD
(
cmsIOHANDLER
*
m
,
cmsHPROFILE
hNamedColor
,
cmsUInt32Number
Intent
,
cmsUInt32Number
dwFlags
)
{
cmsHTRANSFORM
xform
;
int
i
,
nColors
,
nColorant
;
cmsUInt32Number
i
,
nColors
,
nColorant
;
cmsUInt32Number
OutputFormat
;
char
ColorName
[
32
];
char
ColorName
[
cmsMAX_PATH
];
char
Colorant
[
128
];
cmsNAMEDCOLORLIST
*
NamedColorList
;
...
...
src/share/native/sun/java2d/cmm/lcms/cmssamp.c
浏览文件 @
06bdbf91
...
...
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-201
6
Marti Maria Saguer
// Copyright (c) 1998-201
7
Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
...
...
src/share/native/sun/java2d/cmm/lcms/cmssm.c
浏览文件 @
06bdbf91
...
...
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-201
6
Marti Maria Saguer
// Copyright (c) 1998-201
7
Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
...
...
src/share/native/sun/java2d/cmm/lcms/cmstypes.c
浏览文件 @
06bdbf91
此差异已折叠。
点击以展开。
src/share/native/sun/java2d/cmm/lcms/cmsvirt.c
浏览文件 @
06bdbf91
...
...
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-201
6
Marti Maria Saguer
// Copyright (c) 1998-201
7
Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
...
...
@@ -320,7 +320,7 @@ cmsHPROFILE CMSEXPORT cmsCreateLinearizationDeviceLinkTHR(cmsContext ContextID,
{
cmsHPROFILE
hICC
;
cmsPipeline
*
Pipeline
;
int
nChannels
;
cmsUInt32Number
nChannels
;
hICC
=
cmsCreateProfilePlaceholder
(
ContextID
);
if
(
!
hICC
)
...
...
@@ -426,7 +426,7 @@ cmsHPROFILE CMSEXPORT cmsCreateInkLimitingDeviceLinkTHR(cmsContext ContextID,
cmsHPROFILE
hICC
;
cmsPipeline
*
LUT
;
cmsStage
*
CLUT
;
int
nChannels
;
cmsUInt32Number
nChannels
;
if
(
ColorSpace
!=
cmsSigCmykData
)
{
cmsSignalError
(
ContextID
,
cmsERROR_COLORSPACE_CHECK
,
"InkLimiting: Only CMYK currently supported"
);
...
...
@@ -755,13 +755,13 @@ int bchswSampler(register const cmsUInt16Number In[], register cmsUInt16Number O
// contrast, Saturation and white point displacement
cmsHPROFILE
CMSEXPORT
cmsCreateBCHSWabstractProfileTHR
(
cmsContext
ContextID
,
int
nLUTPoints
,
cmsUInt32Number
nLUTPoints
,
cmsFloat64Number
Bright
,
cmsFloat64Number
Contrast
,
cmsFloat64Number
Hue
,
cmsFloat64Number
Saturation
,
int
TempSrc
,
int
TempDest
)
cmsUInt32Number
TempSrc
,
cmsUInt32Number
TempDest
)
{
cmsHPROFILE
hICC
;
cmsPipeline
*
Pipeline
;
...
...
@@ -769,7 +769,7 @@ cmsHPROFILE CMSEXPORT cmsCreateBCHSWabstractProfileTHR(cmsContext ContextID,
cmsCIExyY
WhitePnt
;
cmsStage
*
CLUT
;
cmsUInt32Number
Dimensions
[
MAX_INPUT_DIMENSIONS
];
int
i
;
cmsUInt32Number
i
;
bchsw
.
Brightness
=
Bright
;
bchsw
.
Contrast
=
Contrast
;
...
...
@@ -807,7 +807,7 @@ cmsHPROFILE CMSEXPORT cmsCreateBCHSWabstractProfileTHR(cmsContext ContextID,
for
(
i
=
0
;
i
<
MAX_INPUT_DIMENSIONS
;
i
++
)
Dimensions
[
i
]
=
nLUTPoints
;
CLUT
=
cmsStageAllocCLut16bitGranular
(
ContextID
,
Dimensions
,
3
,
3
,
NULL
);
if
(
CLUT
==
NULL
)
return
NULL
;
if
(
CLUT
==
NULL
)
goto
Error
;
if
(
!
cmsStageSampleCLut16bit
(
CLUT
,
bchswSampler
,
(
void
*
)
&
bchsw
,
0
))
{
...
...
@@ -840,13 +840,13 @@ Error:
}
CMSAPI
cmsHPROFILE
CMSEXPORT
cmsCreateBCHSWabstractProfile
(
int
nLUTPoints
,
CMSAPI
cmsHPROFILE
CMSEXPORT
cmsCreateBCHSWabstractProfile
(
cmsUInt32Number
nLUTPoints
,
cmsFloat64Number
Bright
,
cmsFloat64Number
Contrast
,
cmsFloat64Number
Hue
,
cmsFloat64Number
Saturation
,
int
TempSrc
,
int
TempDest
)
cmsUInt32Number
TempSrc
,
cmsUInt32Number
TempDest
)
{
return
cmsCreateBCHSWabstractProfileTHR
(
NULL
,
nLUTPoints
,
Bright
,
Contrast
,
Hue
,
Saturation
,
TempSrc
,
TempDest
);
}
...
...
@@ -859,8 +859,10 @@ cmsHPROFILE CMSEXPORT cmsCreateNULLProfileTHR(cmsContext ContextID)
cmsHPROFILE
hProfile
;
cmsPipeline
*
LUT
=
NULL
;
cmsStage
*
PostLin
;
cmsToneCurve
*
EmptyTab
;
cmsStage
*
OutLin
;
cmsToneCurve
*
EmptyTab
[
3
];
cmsUInt16Number
Zero
[
2
]
=
{
0
,
0
};
const
cmsFloat64Number
PickLstarMatrix
[]
=
{
1
,
0
,
0
};
hProfile
=
cmsCreateProfilePlaceholder
(
ContextID
);
if
(
!
hProfile
)
// can't allocate
...
...
@@ -871,22 +873,28 @@ cmsHPROFILE CMSEXPORT cmsCreateNULLProfileTHR(cmsContext ContextID)
if
(
!
SetTextTags
(
hProfile
,
L"NULL profile built-in"
))
goto
Error
;
cmsSetDeviceClass
(
hProfile
,
cmsSigOutputClass
);
cmsSetColorSpace
(
hProfile
,
cmsSigGrayData
);
cmsSetPCS
(
hProfile
,
cmsSigLabData
);
//
An empty LUTs is all we need
LUT
=
cmsPipelineAlloc
(
ContextID
,
1
,
1
);
//
Create a valid ICC 4 structure
LUT
=
cmsPipelineAlloc
(
ContextID
,
3
,
1
);
if
(
LUT
==
NULL
)
goto
Error
;
EmptyTab
=
cmsBuildTabulatedToneCurve16
(
ContextID
,
2
,
Zero
);
PostLin
=
cmsStageAllocToneCurves
(
ContextID
,
1
,
&
EmptyTab
);
cmsFreeToneCurve
(
EmptyTab
);
EmptyTab
[
0
]
=
EmptyTab
[
1
]
=
EmptyTab
[
2
]
=
cmsBuildTabulatedToneCurve16
(
ContextID
,
2
,
Zero
);
PostLin
=
cmsStageAllocToneCurves
(
ContextID
,
3
,
EmptyTab
);
OutLin
=
cmsStageAllocToneCurves
(
ContextID
,
1
,
EmptyTab
);
cmsFreeToneCurve
(
EmptyTab
[
0
]);
if
(
!
cmsPipelineInsertStage
(
LUT
,
cmsAT_END
,
PostLin
))
goto
Error
;
if
(
!
cmsPipelineInsertStage
(
LUT
,
cmsAT_END
,
cmsStageAllocMatrix
(
ContextID
,
1
,
3
,
PickLstarMatrix
,
NULL
)))
goto
Error
;
if
(
!
cmsPipelineInsertStage
(
LUT
,
cmsAT_END
,
OutLin
))
goto
Error
;
if
(
!
cmsWriteTag
(
hProfile
,
cmsSigBToA0Tag
,
(
void
*
)
LUT
))
goto
Error
;
if
(
!
cmsWriteTag
(
hProfile
,
cmsSigMediaWhitePointTag
,
cmsD50_XYZ
()))
goto
Error
;
...
...
@@ -967,7 +975,7 @@ cmsHPROFILE CreateNamedColorDevicelink(cmsHTRANSFORM xform)
{
_cmsTRANSFORM
*
v
=
(
_cmsTRANSFORM
*
)
xform
;
cmsHPROFILE
hICC
=
NULL
;
int
i
,
nColors
;
cmsUInt32Number
i
,
nColors
;
cmsNAMEDCOLORLIST
*
nc2
=
NULL
,
*
Original
=
NULL
;
// Create an empty placeholder
...
...
@@ -1084,7 +1092,7 @@ cmsHPROFILE CMSEXPORT cmsTransform2DeviceLink(cmsHTRANSFORM hTransform, cmsFloat
{
cmsHPROFILE
hProfile
=
NULL
;
cmsUInt32Number
FrmIn
,
FrmOut
,
ChansIn
,
ChansOut
;
cmsUInt32Number
ColorSpaceBitsIn
,
ColorSpaceBitsOut
;
int
ColorSpaceBitsIn
,
ColorSpaceBitsOut
;
_cmsTRANSFORM
*
xform
=
(
_cmsTRANSFORM
*
)
hTransform
;
cmsPipeline
*
LUT
=
NULL
;
cmsStage
*
mpe
;
...
...
src/share/native/sun/java2d/cmm/lcms/cmswtpnt.c
浏览文件 @
06bdbf91
...
...
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-201
6
Marti Maria Saguer
// Copyright (c) 1998-201
7
Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
...
...
@@ -105,7 +105,6 @@ cmsBool CMSEXPORT cmsWhitePointFromTemp(cmsCIExyY* WhitePoint, cmsFloat64Number
}
// Obtain y(x)
y
=
-
3
.
000
*
(
x
*
x
)
+
2
.
870
*
x
-
0
.
275
;
// wave factors (not used, but here for futures extensions)
...
...
@@ -131,7 +130,7 @@ typedef struct {
}
ISOTEMPERATURE
;
static
ISOTEMPERATURE
isotempdata
[]
=
{
static
const
ISOTEMPERATURE
isotempdata
[]
=
{
// {Mirek, Ut, Vt, Tt }
{
0
,
0
.
18006
,
0
.
26352
,
-
0
.
24341
},
{
10
,
0
.
18066
,
0
.
26589
,
-
0
.
25479
},
...
...
@@ -295,7 +294,7 @@ cmsBool _cmsAdaptMatrixToD50(cmsMAT3* r, const cmsCIExyY* SourceWhitePt)
// Build a White point, primary chromas transfer matrix from RGB to CIE XYZ
// This is just an approximation, I am not handling all the non-linear
// aspects of the RGB to XYZ process, and assumming that the gamma correction
// has transitive property in the tranformation chain.
// has transitive property in the tran
s
formation chain.
//
// the alghoritm:
//
...
...
src/share/native/sun/java2d/cmm/lcms/cmsxform.c
浏览文件 @
06bdbf91
...
...
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-201
6
Marti Maria Saguer
// Copyright (c) 1998-201
7
Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
...
...
@@ -284,6 +284,8 @@ void FloatXFORM(_cmsTRANSFORM* p,
strideIn
=
0
;
strideOut
=
0
;
memset
(
fIn
,
0
,
sizeof
(
fIn
));
memset
(
fOut
,
0
,
sizeof
(
fIn
));
for
(
i
=
0
;
i
<
LineCount
;
i
++
)
{
...
...
@@ -348,6 +350,7 @@ void NullFloatXFORM(_cmsTRANSFORM* p,
strideIn
=
0
;
strideOut
=
0
;
memset
(
fIn
,
0
,
sizeof
(
fIn
));
for
(
i
=
0
;
i
<
LineCount
;
i
++
)
{
...
...
@@ -385,6 +388,7 @@ void NullXFORM(_cmsTRANSFORM* p,
strideIn
=
0
;
strideOut
=
0
;
memset
(
wIn
,
0
,
sizeof
(
wIn
));
for
(
i
=
0
;
i
<
LineCount
;
i
++
)
{
...
...
@@ -422,6 +426,8 @@ void PrecalculatedXFORM(_cmsTRANSFORM* p,
strideIn
=
0
;
strideOut
=
0
;
memset
(
wIn
,
0
,
sizeof
(
wIn
));
memset
(
wOut
,
0
,
sizeof
(
wOut
));
for
(
i
=
0
;
i
<
LineCount
;
i
++
)
{
...
...
@@ -483,6 +489,8 @@ void PrecalculatedXFORMGamutCheck(_cmsTRANSFORM* p,
strideIn
=
0
;
strideOut
=
0
;
memset
(
wIn
,
0
,
sizeof
(
wIn
));
memset
(
wOut
,
0
,
sizeof
(
wOut
));
for
(
i
=
0
;
i
<
LineCount
;
i
++
)
{
...
...
@@ -790,7 +798,10 @@ _cmsTRANSFORM* AllocEmptyTransform(cmsContext ContextID, cmsPipeline* lut,
// Allocate needed memory
_cmsTRANSFORM
*
p
=
(
_cmsTRANSFORM
*
)
_cmsMallocZero
(
ContextID
,
sizeof
(
_cmsTRANSFORM
));
if
(
!
p
)
return
NULL
;
if
(
!
p
)
{
cmsPipelineFree
(
lut
);
return
NULL
;
}
// Store the proposed pipeline
p
->
Lut
=
lut
;
...
...
@@ -823,7 +834,7 @@ _cmsTRANSFORM* AllocEmptyTransform(cmsContext ContextID, cmsPipeline* lut,
p
->
FromInputFloat
=
_cmsGetFormatter
(
ContextID
,
*
InputFormat
,
cmsFormatterInput
,
CMS_PACK_FLAGS_FLOAT
).
FmtFloat
;
p
->
ToOutputFloat
=
_cmsGetFormatter
(
ContextID
,
*
OutputFormat
,
cmsFormatterOutput
,
CMS_PACK_FLAGS_FLOAT
).
FmtFloat
;
// Save the day?
// Save the day?
(Ignore the warning)
if
(
Plugin
->
OldXform
)
{
p
->
OldXform
=
(
_cmsTransformFn
)
p
->
xform
;
p
->
xform
=
_cmsTransform2toTransformAdaptor
;
...
...
@@ -848,7 +859,7 @@ _cmsTRANSFORM* AllocEmptyTransform(cmsContext ContextID, cmsPipeline* lut,
if
(
p
->
FromInputFloat
==
NULL
||
p
->
ToOutputFloat
==
NULL
)
{
cmsSignalError
(
ContextID
,
cmsERROR_UNKNOWN_EXTENSION
,
"Unsupported raster format"
);
_cmsFree
(
ContextID
,
p
);
cmsDeleteTransform
(
p
);
return
NULL
;
}
...
...
@@ -870,7 +881,7 @@ _cmsTRANSFORM* AllocEmptyTransform(cmsContext ContextID, cmsPipeline* lut,
}
else
{
int
BytesPerPixelInput
;
cmsUInt32Number
BytesPerPixelInput
;
p
->
FromInput
=
_cmsGetFormatter
(
ContextID
,
*
InputFormat
,
cmsFormatterInput
,
CMS_PACK_FLAGS_16BITS
).
Fmt16
;
p
->
ToOutput
=
_cmsGetFormatter
(
ContextID
,
*
OutputFormat
,
cmsFormatterOutput
,
CMS_PACK_FLAGS_16BITS
).
Fmt16
;
...
...
@@ -878,7 +889,7 @@ _cmsTRANSFORM* AllocEmptyTransform(cmsContext ContextID, cmsPipeline* lut,
if
(
p
->
FromInput
==
NULL
||
p
->
ToOutput
==
NULL
)
{
cmsSignalError
(
ContextID
,
cmsERROR_UNKNOWN_EXTENSION
,
"Unsupported raster format"
);
_cmsFree
(
ContextID
,
p
);
cmsDeleteTransform
(
p
);
return
NULL
;
}
...
...
@@ -920,13 +931,13 @@ _cmsTRANSFORM* AllocEmptyTransform(cmsContext ContextID, cmsPipeline* lut,
}
static
cmsBool
GetXFormColorSpaces
(
int
nProfiles
,
cmsHPROFILE
hProfiles
[],
cmsColorSpaceSignature
*
Input
,
cmsColorSpaceSignature
*
Output
)
cmsBool
GetXFormColorSpaces
(
cmsUInt32Number
nProfiles
,
cmsHPROFILE
hProfiles
[],
cmsColorSpaceSignature
*
Input
,
cmsColorSpaceSignature
*
Output
)
{
cmsColorSpaceSignature
ColorSpaceIn
,
ColorSpaceOut
;
cmsColorSpaceSignature
PostColorSpace
;
int
i
;
cmsUInt32Number
i
;
if
(
nProfiles
<
=
0
)
return
FALSE
;
if
(
nProfiles
=
=
0
)
return
FALSE
;
if
(
hProfiles
[
0
]
==
NULL
)
return
FALSE
;
*
Input
=
PostColorSpace
=
cmsGetColorSpace
(
hProfiles
[
0
]);
...
...
@@ -975,7 +986,7 @@ cmsBool GetXFormColorSpaces(int nProfiles, cmsHPROFILE hProfiles[], cmsColorSpac
static
cmsBool
IsProperColorSpace
(
cmsColorSpaceSignature
Check
,
cmsUInt32Number
dwFormat
)
{
int
Space1
=
T_COLORSPACE
(
dwFormat
);
int
Space1
=
(
int
)
T_COLORSPACE
(
dwFormat
);
int
Space2
=
_cmsLCMScolorSpace
(
Check
);
if
(
Space1
==
PT_ANY
)
return
TRUE
;
...
...
@@ -1231,7 +1242,7 @@ cmsHTRANSFORM CMSEXPORT cmsCreateTransformTHR(cmsContext ContextID,
hArray
[
0
]
=
Input
;
hArray
[
1
]
=
Output
;
return
cmsCreateMultiprofileTransformTHR
(
ContextID
,
hArray
,
Output
==
NULL
?
1
:
2
,
InputFormat
,
OutputFormat
,
Intent
,
dwFlags
);
return
cmsCreateMultiprofileTransformTHR
(
ContextID
,
hArray
,
Output
==
NULL
?
1
U
:
2U
,
InputFormat
,
OutputFormat
,
Intent
,
dwFlags
);
}
CMSAPI
cmsHTRANSFORM
CMSEXPORT
cmsCreateTransform
(
cmsHPROFILE
Input
,
...
...
src/share/native/sun/java2d/cmm/lcms/lcms2.h
浏览文件 @
06bdbf91
...
...
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-201
6
Marti Maria Saguer
// Copyright (c) 1998-201
7
Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
...
...
@@ -52,7 +52,7 @@
//
//---------------------------------------------------------------------------------
//
// Version 2.
8
// Version 2.
9rc3
//
#ifndef _lcms2_H
...
...
@@ -78,7 +78,7 @@
// #define CMS_USE_CPP_API
// Uncomment this line if you need strict CGATS syntax. Makes CGATS files to
// require "KEYWORD" on undefined identifiers, keep it comented out unless needed
// require "KEYWORD" on undefined identifiers, keep it com
m
ented out unless needed
// #define CMS_STRICT_CGATS 1
// Uncomment to get rid of the tables for "half" float support
...
...
@@ -87,6 +87,9 @@
// Uncomment to get rid of pthreads/windows dependency
// #define CMS_NO_PTHREADS 1
// Uncomment this for special windows mutex initialization (see lcms2_internal.h)
// #define CMS_RELY_ON_WINDOWS_STATIC_MUTEX_INIT
// ********** End of configuration toggles ******************************
// Needed for streams
...
...
@@ -104,7 +107,7 @@ extern "C" {
#endif
// Version/release
#define LCMS_VERSION 20
8
0
#define LCMS_VERSION 20
9
0
// I will give the chance of redefining basic types for compilers that are not fully C99 compliant
#ifndef CMS_BASIC_TYPES_ALREADY_DEFINED
...
...
@@ -260,10 +263,15 @@ typedef int cmsBool;
# define CMSEXPORT
# define CMSAPI
# endif
#else
#else // not Windows
# ifdef HAVE_FUNC_ATTRIBUTE_VISIBILITY
# define CMSEXPORT
# define CMSAPI __attribute__((visibility("default")))
# else
# define CMSEXPORT
# define CMSAPI
#endif
# endif
#endif // CMS_IS_WINDOWS_
#ifdef HasTHREADS
# if HasTHREADS == 1
...
...
@@ -1154,7 +1162,7 @@ typedef struct {
cmsCIEXYZ
whitePoint
;
cmsFloat64Number
Yb
;
cmsFloat64Number
La
;
int
surround
;
cmsUInt32Number
surround
;
cmsFloat64Number
D_value
;
}
cmsViewingConditions
;
...
...
@@ -1182,16 +1190,16 @@ typedef struct {
// The internal representation is none of your business.
typedef
struct
_cms_curve_struct
cmsToneCurve
;
CMSAPI
cmsToneCurve
*
CMSEXPORT
cmsBuildSegmentedToneCurve
(
cmsContext
ContextID
,
cmsInt32Number
nSegments
,
const
cmsCurveSegment
Segments
[]);
CMSAPI
cmsToneCurve
*
CMSEXPORT
cmsBuildSegmentedToneCurve
(
cmsContext
ContextID
,
cms
U
Int32Number
nSegments
,
const
cmsCurveSegment
Segments
[]);
CMSAPI
cmsToneCurve
*
CMSEXPORT
cmsBuildParametricToneCurve
(
cmsContext
ContextID
,
cmsInt32Number
Type
,
const
cmsFloat64Number
Params
[]);
CMSAPI
cmsToneCurve
*
CMSEXPORT
cmsBuildGamma
(
cmsContext
ContextID
,
cmsFloat64Number
Gamma
);
CMSAPI
cmsToneCurve
*
CMSEXPORT
cmsBuildTabulatedToneCurve16
(
cmsContext
ContextID
,
cmsInt32Number
nEntries
,
const
cmsUInt16Number
values
[]);
CMSAPI
cmsToneCurve
*
CMSEXPORT
cmsBuildTabulatedToneCurve16
(
cmsContext
ContextID
,
cms
U
Int32Number
nEntries
,
const
cmsUInt16Number
values
[]);
CMSAPI
cmsToneCurve
*
CMSEXPORT
cmsBuildTabulatedToneCurveFloat
(
cmsContext
ContextID
,
cmsUInt32Number
nEntries
,
const
cmsFloat32Number
values
[]);
CMSAPI
void
CMSEXPORT
cmsFreeToneCurve
(
cmsToneCurve
*
Curve
);
CMSAPI
void
CMSEXPORT
cmsFreeToneCurveTriple
(
cmsToneCurve
*
Curve
[
3
]);
CMSAPI
cmsToneCurve
*
CMSEXPORT
cmsDupToneCurve
(
const
cmsToneCurve
*
Src
);
CMSAPI
cmsToneCurve
*
CMSEXPORT
cmsReverseToneCurve
(
const
cmsToneCurve
*
InGamma
);
CMSAPI
cmsToneCurve
*
CMSEXPORT
cmsReverseToneCurveEx
(
cmsInt32Number
nResultSamples
,
const
cmsToneCurve
*
InGamma
);
CMSAPI
cmsToneCurve
*
CMSEXPORT
cmsReverseToneCurveEx
(
cms
U
Int32Number
nResultSamples
,
const
cmsToneCurve
*
InGamma
);
CMSAPI
cmsToneCurve
*
CMSEXPORT
cmsJoinToneCurve
(
cmsContext
ContextID
,
const
cmsToneCurve
*
X
,
const
cmsToneCurve
*
Y
,
cmsUInt32Number
nPoints
);
CMSAPI
cmsBool
CMSEXPORT
cmsSmoothToneCurve
(
cmsToneCurve
*
Tab
,
cmsFloat64Number
lambda
);
CMSAPI
cmsFloat32Number
CMSEXPORT
cmsEvalToneCurveFloat
(
const
cmsToneCurve
*
Curve
,
cmsFloat32Number
v
);
...
...
@@ -1236,7 +1244,7 @@ CMSAPI cmsBool CMSEXPORT cmsPipelineSetSaveAs8bitsFlag(cmsPipeline* lu
// Where to place/locate the stages in the pipeline chain
typedef
enum
{
cmsAT_BEGIN
,
cmsAT_END
}
cmsStageLoc
;
CMSAPI
int
CMSEXPORT
cmsPipelineInsertStage
(
cmsPipeline
*
lut
,
cmsStageLoc
loc
,
cmsStage
*
mpe
);
CMSAPI
cmsBool
CMSEXPORT
cmsPipelineInsertStage
(
cmsPipeline
*
lut
,
cmsStageLoc
loc
,
cmsStage
*
mpe
);
CMSAPI
void
CMSEXPORT
cmsPipelineUnlinkStage
(
cmsPipeline
*
lut
,
cmsStageLoc
loc
,
cmsStage
**
mpe
);
// This function is quite useful to analyze the structure of a Pipeline and retrieve the Stage elements
...
...
@@ -1459,7 +1467,7 @@ CMSAPI cmsBool CMSEXPORT cmsLinkTag(cmsHPROFILE hProfile, cmsTagSignat
CMSAPI
cmsTagSignature
CMSEXPORT
cmsTagLinkedTo
(
cmsHPROFILE
hProfile
,
cmsTagSignature
sig
);
// Read and write raw data
CMSAPI
cms
Int32Number
CMSEXPORT
cmsReadRawTag
(
cmsHPROFILE
hProfile
,
cmsTagSignature
sig
,
void
*
Buffer
,
cmsUInt32Number
BufferSize
);
CMSAPI
cms
UInt32Number
CMSEXPORT
cmsReadRawTag
(
cmsHPROFILE
hProfile
,
cmsTagSignature
sig
,
void
*
Buffer
,
cmsUInt32Number
BufferSize
);
CMSAPI
cmsBool
CMSEXPORT
cmsWriteRawTag
(
cmsHPROFILE
hProfile
,
cmsTagSignature
sig
,
const
void
*
data
,
cmsUInt32Number
Size
);
// Access header data
...
...
@@ -1550,7 +1558,7 @@ CMSAPI cmsBool CMSEXPORT cmsCloseIOhandler(cmsIOHANDLER* io);
CMSAPI
cmsBool
CMSEXPORT
cmsMD5computeID
(
cmsHPROFILE
hProfile
);
// Profile high level funtions ------------------------------------------------------------------------------------------
// Profile high level fun
c
tions ------------------------------------------------------------------------------------------
CMSAPI
cmsHPROFILE
CMSEXPORT
cmsOpenProfileFromFile
(
const
char
*
ICCProfile
,
const
char
*
sAccess
);
CMSAPI
cmsHPROFILE
CMSEXPORT
cmsOpenProfileFromFileTHR
(
cmsContext
ContextID
,
const
char
*
ICCProfile
,
const
char
*
sAccess
);
...
...
@@ -1610,21 +1618,21 @@ CMSAPI cmsHPROFILE CMSEXPORT cmsCreate_sRGBProfileTHR(cmsContext ContextID)
CMSAPI
cmsHPROFILE
CMSEXPORT
cmsCreate_sRGBProfile
(
void
);
CMSAPI
cmsHPROFILE
CMSEXPORT
cmsCreateBCHSWabstractProfileTHR
(
cmsContext
ContextID
,
int
nLUTPoints
,
cmsUInt32Number
nLUTPoints
,
cmsFloat64Number
Bright
,
cmsFloat64Number
Contrast
,
cmsFloat64Number
Hue
,
cmsFloat64Number
Saturation
,
int
TempSrc
,
int
TempDest
);
cmsUInt32Number
TempSrc
,
cmsUInt32Number
TempDest
);
CMSAPI
cmsHPROFILE
CMSEXPORT
cmsCreateBCHSWabstractProfile
(
int
nLUTPoints
,
CMSAPI
cmsHPROFILE
CMSEXPORT
cmsCreateBCHSWabstractProfile
(
cmsUInt32Number
nLUTPoints
,
cmsFloat64Number
Bright
,
cmsFloat64Number
Contrast
,
cmsFloat64Number
Hue
,
cmsFloat64Number
Saturation
,
int
TempSrc
,
int
TempDest
);
cmsUInt32Number
TempSrc
,
cmsUInt32Number
TempDest
);
CMSAPI
cmsHPROFILE
CMSEXPORT
cmsCreateNULLProfileTHR
(
cmsContext
ContextID
);
CMSAPI
cmsHPROFILE
CMSEXPORT
cmsCreateNULLProfile
(
void
);
...
...
@@ -1666,7 +1674,7 @@ CMSAPI cmsUInt32Number CMSEXPORT cmsGetSupportedIntentsTHR(cmsContext ContextID
#define cmsFLAGS_BLACKPOINTCOMPENSATION 0x2000
#define cmsFLAGS_NOWHITEONWHITEFIXUP 0x0004 // Don't fix scum dot
#define cmsFLAGS_HIGHRESPRECALC 0x0400 // Use more memory to give better accurancy
#define cmsFLAGS_LOWRESPRECALC 0x0800 // Use less memory to minimize resouces
#define cmsFLAGS_LOWRESPRECALC 0x0800 // Use less memory to minimize resou
r
ces
// For devicelink creation
#define cmsFLAGS_8BITS_DEVICELINK 0x0008 // Create 8 bits devicelinks
...
...
src/share/native/sun/java2d/cmm/lcms/lcms2_internal.h
浏览文件 @
06bdbf91
此差异已折叠。
点击以展开。
src/share/native/sun/java2d/cmm/lcms/lcms2_plugin.h
浏览文件 @
06bdbf91
...
...
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-201
6
Marti Maria Saguer
// Copyright (c) 1998-201
7
Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
...
...
@@ -347,7 +347,7 @@ typedef struct {
// Parametric curves. A negative type means same function but analytically inverted. Max. number of params is 10
// Evaluator callback for user-suplied parametric curves. May implement more than one type
// Evaluator callback for user-sup
p
lied parametric curves. May implement more than one type
typedef
cmsFloat64Number
(
*
cmsParametricCurveEvaluator
)(
cmsInt32Number
Type
,
const
cmsFloat64Number
Params
[
10
],
cmsFloat64Number
R
);
// Plug-in may implement an arbitrary number of parametric curves
...
...
@@ -457,7 +457,7 @@ typedef struct {
cmsUInt32Number
nSupportedTypes
;
// In how many types this tag can come (MAX_TYPES_IN_LCMS_PLUGIN maximum)
cmsTagTypeSignature
SupportedTypes
[
MAX_TYPES_IN_LCMS_PLUGIN
];
// For writ
t
ing
// For writing
cmsTagTypeSignature
(
*
DecideType
)(
cmsFloat64Number
ICCVersion
,
const
void
*
Data
);
}
cmsTagDescriptor
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录