Skip to content

Commit dc7d3b1

Browse files
author
Alisen Chung
committedJan 12, 2024
8321489: Update LCMS to 2.16
Reviewed-by: serb, dnguyen, prr
1 parent 84cf4cb commit dc7d3b1

21 files changed

+1465
-359
lines changed
 

‎src/java.desktop/share/legal/lcms.md

+17-22
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,29 @@
1-
## Little Color Management System (LCMS) v2.15
1+
## Little Color Management System (LCMS) v2.16
22

33
### LCMS License
44
<pre>
5-
README.1ST file information
65

7-
LittleCMS core is released under MIT License
6+
MIT License
87

9-
---------------------------------
10-
11-
Little CMS
12-
Copyright (c) 1998-2023 Marti Maria Saguer
8+
Copyright (C) 1998-2023 Marti Maria Saguer
139

1410
Permission is hereby granted, free of charge, to any person obtaining
15-
a copy of this software and associated documentation files (the
16-
"Software"), to deal in the Software without restriction, including
17-
without limitation the rights to use, copy, modify, merge, publish,
18-
distribute, sublicense, and/or sell copies of the Software, and to
19-
permit persons to whom the Software is furnished to do so, subject
20-
to the following conditions:
11+
a copy of this software and associated documentation files (the "Software"),
12+
to deal in the Software without restriction, including without limitation
13+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
14+
and/or sell copies of the Software, and to permit persons to whom the Software
15+
is furnished to do so, subject to the following conditions:
2116

22-
The above copyright notice and this permission notice shall be
23-
included in all copies or substantial portions of the Software.
17+
The above copyright notice and this permission notice shall be included in
18+
all copies or substantial portions of the Software.
2419

2520
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
28-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
29-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
30-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
31-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
22+
THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
24+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3227

3328
---------------------------------
3429
The below license applies to the following files:
@@ -47,7 +42,6 @@ Users of this code must verify correctness for their application.
4742
### AUTHORS File Information
4843
```
4944
50-
5145
Main Author
5246
------------
5347
Marti Maria
@@ -91,6 +85,7 @@ Philipp Knechtges
9185
Amyspark
9286
Lovell Fuller
9387
Eli Schwartz
88+
Diogo Teles Sant'Anna
9489
9590
Special Thanks
9691
--------------

‎src/java.desktop/share/native/liblcms/cmsalpha.c

+15-11
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ static cmsFormatterAlphaFn FormattersAlpha[6][6] = {
431431

432432
// This function computes the distance from each component to the next one in bytes.
433433
static
434-
void ComputeIncrementsForChunky(cmsUInt32Number Format,
434+
cmsBool ComputeIncrementsForChunky(cmsUInt32Number Format,
435435
cmsUInt32Number ComponentStartingOrder[],
436436
cmsUInt32Number ComponentPointerIncrements[])
437437
{
@@ -445,7 +445,7 @@ void ComputeIncrementsForChunky(cmsUInt32Number Format,
445445

446446
// Sanity check
447447
if (total_chans <= 0 || total_chans >= cmsMAXCHANNELS)
448-
return;
448+
return FALSE;
449449

450450
memset(channels, 0, sizeof(channels));
451451

@@ -482,13 +482,15 @@ void ComputeIncrementsForChunky(cmsUInt32Number Format,
482482

483483
for (i = 0; i < extra; i++)
484484
ComponentStartingOrder[i] = channels[i + nchannels];
485+
486+
return TRUE;
485487
}
486488

487489

488490

489491
// On planar configurations, the distance is the stride added to any non-negative
490492
static
491-
void ComputeIncrementsForPlanar(cmsUInt32Number Format,
493+
cmsBool ComputeIncrementsForPlanar(cmsUInt32Number Format,
492494
cmsUInt32Number BytesPerPlane,
493495
cmsUInt32Number ComponentStartingOrder[],
494496
cmsUInt32Number ComponentPointerIncrements[])
@@ -502,7 +504,7 @@ void ComputeIncrementsForPlanar(cmsUInt32Number Format,
502504

503505
// Sanity check
504506
if (total_chans <= 0 || total_chans >= cmsMAXCHANNELS)
505-
return;
507+
return FALSE;
506508

507509
memset(channels, 0, sizeof(channels));
508510

@@ -538,29 +540,29 @@ void ComputeIncrementsForPlanar(cmsUInt32Number Format,
538540

539541
for (i = 0; i < extra; i++)
540542
ComponentStartingOrder[i] = channels[i + nchannels];
543+
544+
return TRUE;
541545
}
542546

543547

544548

545549
// Dispatcher por chunky and planar RGB
546550
static
547-
void ComputeComponentIncrements(cmsUInt32Number Format,
551+
cmsBool ComputeComponentIncrements(cmsUInt32Number Format,
548552
cmsUInt32Number BytesPerPlane,
549553
cmsUInt32Number ComponentStartingOrder[],
550554
cmsUInt32Number ComponentPointerIncrements[])
551555
{
552556
if (T_PLANAR(Format)) {
553557

554-
ComputeIncrementsForPlanar(Format, BytesPerPlane, ComponentStartingOrder, ComponentPointerIncrements);
558+
return ComputeIncrementsForPlanar(Format, BytesPerPlane, ComponentStartingOrder, ComponentPointerIncrements);
555559
}
556560
else {
557-
ComputeIncrementsForChunky(Format, ComponentStartingOrder, ComponentPointerIncrements);
561+
return ComputeIncrementsForChunky(Format, ComponentStartingOrder, ComponentPointerIncrements);
558562
}
559563

560564
}
561565

562-
563-
564566
// Handles extra channels copying alpha if requested by the flags
565567
void _cmsHandleExtraChannels(_cmsTRANSFORM* p, const void* in,
566568
void* out,
@@ -595,8 +597,10 @@ void _cmsHandleExtraChannels(_cmsTRANSFORM* p, const void* in,
595597
return;
596598

597599
// Compute the increments
598-
ComputeComponentIncrements(p->InputFormat, Stride->BytesPerPlaneIn, SourceStartingOrder, SourceIncrements);
599-
ComputeComponentIncrements(p->OutputFormat, Stride->BytesPerPlaneOut, DestStartingOrder, DestIncrements);
600+
if (!ComputeComponentIncrements(p->InputFormat, Stride->BytesPerPlaneIn, SourceStartingOrder, SourceIncrements))
601+
return;
602+
if (!ComputeComponentIncrements(p->OutputFormat, Stride->BytesPerPlaneOut, DestStartingOrder, DestIncrements))
603+
return;
600604

601605
// Check for conversions 8, 16, half, float, dbl
602606
copyValueFn = _cmsGetFormatterAlpha(p->ContextID, p->InputFormat, p->OutputFormat);

0 commit comments

Comments
 (0)
Please sign in to comment.