Skip to content

Commit

Permalink
8321489: Update LCMS to 2.16
Browse files Browse the repository at this point in the history
Reviewed-by: serb, dnguyen, prr
  • Loading branch information
Alisen Chung committed Jan 12, 2024
1 parent 84cf4cb commit dc7d3b1
Show file tree
Hide file tree
Showing 21 changed files with 1,465 additions and 359 deletions.
39 changes: 17 additions & 22 deletions src/java.desktop/share/legal/lcms.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,29 @@
## Little Color Management System (LCMS) v2.15
## Little Color Management System (LCMS) v2.16

### LCMS License
<pre>
README.1ST file information

LittleCMS core is released under MIT License
MIT License

---------------------------------

Little CMS
Copyright (c) 1998-2023 Marti Maria Saguer
Copyright (C) 1998-2023 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"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject
to the following conditions:
a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

---------------------------------
The below license applies to the following files:
Expand All @@ -47,7 +42,6 @@ Users of this code must verify correctness for their application.
### AUTHORS File Information
```
Main Author
------------
Marti Maria
Expand Down Expand Up @@ -91,6 +85,7 @@ Philipp Knechtges
Amyspark
Lovell Fuller
Eli Schwartz
Diogo Teles Sant'Anna
Special Thanks
--------------
Expand Down
26 changes: 15 additions & 11 deletions src/java.desktop/share/native/liblcms/cmsalpha.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ static cmsFormatterAlphaFn FormattersAlpha[6][6] = {

// This function computes the distance from each component to the next one in bytes.
static
void ComputeIncrementsForChunky(cmsUInt32Number Format,
cmsBool ComputeIncrementsForChunky(cmsUInt32Number Format,
cmsUInt32Number ComponentStartingOrder[],
cmsUInt32Number ComponentPointerIncrements[])
{
Expand All @@ -445,7 +445,7 @@ void ComputeIncrementsForChunky(cmsUInt32Number Format,

// Sanity check
if (total_chans <= 0 || total_chans >= cmsMAXCHANNELS)
return;
return FALSE;

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

Expand Down Expand Up @@ -482,13 +482,15 @@ void ComputeIncrementsForChunky(cmsUInt32Number Format,

for (i = 0; i < extra; i++)
ComponentStartingOrder[i] = channels[i + nchannels];

return TRUE;
}



// On planar configurations, the distance is the stride added to any non-negative
static
void ComputeIncrementsForPlanar(cmsUInt32Number Format,
cmsBool ComputeIncrementsForPlanar(cmsUInt32Number Format,
cmsUInt32Number BytesPerPlane,
cmsUInt32Number ComponentStartingOrder[],
cmsUInt32Number ComponentPointerIncrements[])
Expand All @@ -502,7 +504,7 @@ void ComputeIncrementsForPlanar(cmsUInt32Number Format,

// Sanity check
if (total_chans <= 0 || total_chans >= cmsMAXCHANNELS)
return;
return FALSE;

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

Expand Down Expand Up @@ -538,29 +540,29 @@ void ComputeIncrementsForPlanar(cmsUInt32Number Format,

for (i = 0; i < extra; i++)
ComponentStartingOrder[i] = channels[i + nchannels];

return TRUE;
}



// Dispatcher por chunky and planar RGB
static
void ComputeComponentIncrements(cmsUInt32Number Format,
cmsBool ComputeComponentIncrements(cmsUInt32Number Format,
cmsUInt32Number BytesPerPlane,
cmsUInt32Number ComponentStartingOrder[],
cmsUInt32Number ComponentPointerIncrements[])
{
if (T_PLANAR(Format)) {

ComputeIncrementsForPlanar(Format, BytesPerPlane, ComponentStartingOrder, ComponentPointerIncrements);
return ComputeIncrementsForPlanar(Format, BytesPerPlane, ComponentStartingOrder, ComponentPointerIncrements);
}
else {
ComputeIncrementsForChunky(Format, ComponentStartingOrder, ComponentPointerIncrements);
return ComputeIncrementsForChunky(Format, ComponentStartingOrder, ComponentPointerIncrements);
}

}



// Handles extra channels copying alpha if requested by the flags
void _cmsHandleExtraChannels(_cmsTRANSFORM* p, const void* in,
void* out,
Expand Down Expand Up @@ -595,8 +597,10 @@ void _cmsHandleExtraChannels(_cmsTRANSFORM* p, const void* in,
return;

// Compute the increments
ComputeComponentIncrements(p->InputFormat, Stride->BytesPerPlaneIn, SourceStartingOrder, SourceIncrements);
ComputeComponentIncrements(p->OutputFormat, Stride->BytesPerPlaneOut, DestStartingOrder, DestIncrements);
if (!ComputeComponentIncrements(p->InputFormat, Stride->BytesPerPlaneIn, SourceStartingOrder, SourceIncrements))
return;
if (!ComputeComponentIncrements(p->OutputFormat, Stride->BytesPerPlaneOut, DestStartingOrder, DestIncrements))
return;

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

9 comments on commit dc7d3b1

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alisenchung
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk22u

@openjdk
Copy link

@openjdk openjdk bot commented on dc7d3b1 Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alisenchung the backport was successfully created on the branch backport-alisenchung-dc7d3b18 in my personal fork of openjdk/jdk22u. To create a pull request with this backport targeting openjdk/jdk22u:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit dc7d3b18 from the openjdk/jdk repository.

The commit being backported was authored by Alisen Chung on 12 Jan 2024 and was reviewed by Sergey Bylokhov, Damon Nguyen and Phil Race.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk22u:

$ git fetch https://github.com/openjdk-bots/jdk22u.git backport-alisenchung-dc7d3b18:backport-alisenchung-dc7d3b18
$ git checkout backport-alisenchung-dc7d3b18
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk22u.git backport-alisenchung-dc7d3b18

⚠️ @alisenchung You are not yet a collaborator in my fork openjdk-bots/jdk22u. An invite will be sent out and you need to accept it before you can proceed.

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on dc7d3b1 Mar 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk21u-dev

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on dc7d3b1 Mar 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk17u-dev

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on dc7d3b1 Mar 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk11u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on dc7d3b1 Mar 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin the backport was successfully created on the branch backport-GoeLin-dc7d3b18 in my personal fork of openjdk/jdk21u-dev. To create a pull request with this backport targeting openjdk/jdk21u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit dc7d3b18 from the openjdk/jdk repository.

The commit being backported was authored by Alisen Chung on 12 Jan 2024 and was reviewed by Sergey Bylokhov, Damon Nguyen and Phil Race.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk21u-dev:

$ git fetch https://github.com/openjdk-bots/jdk21u-dev.git backport-GoeLin-dc7d3b18:backport-GoeLin-dc7d3b18
$ git checkout backport-GoeLin-dc7d3b18
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk21u-dev.git backport-GoeLin-dc7d3b18

@openjdk
Copy link

@openjdk openjdk bot commented on dc7d3b1 Mar 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin the backport was successfully created on the branch backport-GoeLin-dc7d3b18 in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit dc7d3b18 from the openjdk/jdk repository.

The commit being backported was authored by Alisen Chung on 12 Jan 2024 and was reviewed by Sergey Bylokhov, Damon Nguyen and Phil Race.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev.git backport-GoeLin-dc7d3b18:backport-GoeLin-dc7d3b18
$ git checkout backport-GoeLin-dc7d3b18
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev.git backport-GoeLin-dc7d3b18

@openjdk
Copy link

@openjdk openjdk bot commented on dc7d3b1 Mar 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin the backport was successfully created on the branch backport-GoeLin-dc7d3b18 in my personal fork of openjdk/jdk11u-dev. To create a pull request with this backport targeting openjdk/jdk11u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit dc7d3b18 from the openjdk/jdk repository.

The commit being backported was authored by Alisen Chung on 12 Jan 2024 and was reviewed by Sergey Bylokhov, Damon Nguyen and Phil Race.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk11u-dev:

$ git fetch https://github.com/openjdk-bots/jdk11u-dev.git backport-GoeLin-dc7d3b18:backport-GoeLin-dc7d3b18
$ git checkout backport-GoeLin-dc7d3b18
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk11u-dev.git backport-GoeLin-dc7d3b18

Please sign in to comment.