[prev in list] [next in list] [prev in thread] [next in thread]
List: openjdk-2d-dev
Subject: Re: RFR: 8318850: Duplicate code in the LCMSImageLayout
From: Phil Race <prr () openjdk ! org>
Date: 2023-10-26 19:08:30
Message-ID: _8VKEoZ7Ay_QCcLkG_h464T8GVvu9gIlBJmlb1c45hs=.a58ee2f5-b40b-406f-8bc5-c5d787c52493 () github ! com
[Download RAW message or body]
On Thu, 26 Oct 2023 01:14:57 GMT, Sergey Bylokhov <serb@openjdk.org> wrote:
> Small cleanup:
> * The code to handle the TYPE_XBYTE_XX and TYPE_BYTE_GRAY in the LCMSImageLayout \
> class is mostly identical, there is only one difference in offset calculation
> int firstBand = byteRaster.getSampleModel().getNumBands() - 1;
> l.offset = byteRaster.getDataOffset(firstBand);
> or
> l.offset = byteRaster.getDataOffset(0);
>
> But since the TYPE_BYTE_GRAY has only one band, both codes calculate the same \
> value. so we can simply remove the special branch for TYPE_BYTE_GRAY
> * the PREMUL_SH method is replaced by the constant PREMUL since we always pass the \
> "1" as a parameter
looks fine.
-------------
Marked as reviewed by prr (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/16371#pullrequestreview-1700467141
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic