On Fri, 27 Dec 2024 11:05:30 GMT, GennadiyKrivoshein <d...@openjdk.org> wrote:
>> This update allows users to print with grayscale using color printers. >> Actually, it is not possible to use the "Monochrome" option from the "Color >> Appearance" panel. Also Chromaticity.MONOCHROME can't be used to print >> grayscale on color printers >> ([JDK-8315113](https://bugs.openjdk.org/browse/JDK-8315113)). >> >> **Fix description** >> When a printer supports color printing and a user adds >> Chromaticity.MONOCHROME attribute to a PrintRequestAttributeSet, then the >> final printing raster is transformed to the grayscale color using >> java.awt.image.ColorConvertOp. When the job is a PostScript job, then the >> "setColor" and "setPaint" methods of the Graphics are overridden, and user >> colors (paints) are transformed to the grayscale form using the new proxy >> class GrayscaleProxyGraphics2D. >> >> This approach is assumed to be platform, CUPS, and IPP protocol independent. >> >> **Tests** >> The fix was tested on Ubuntu 22.04 and MacOS 12.6.1. > > GennadiyKrivoshein has updated the pull request with a new target base due to > a merge or a rebase. The pull request now contains 15 commits: > > - Update copyright, fix typos, move the proxy to the macos > - Merge branch 'master' into monochrome-printing > - proxy mac only > - Revert "grammar fixes" > > This reverts commit 355b2b8f1dbc71cef433e9a925dfb8a7fff56f99. > - Revert "formatting" > > This reverts commit fde514baeadc2775fa502a2a2d312c6038880e7a. > - Revert "update copyright" > > This reverts commit 60e9b4f024544cfac4ddaddc1ea3653bd4a2fe4c. > - Revert "move grayscale methods to PSPathGraphics" > > This reverts commit 1ef135680645ad2647c4430e852095dda8aa7e0c. > - Merge remote-tracking branch 'openjdk/master' into monochrome-printing > > # Conflicts: > # src/java.desktop/share/classes/sun/print/RasterPrinterJob.java > - Merge remote-tracking branch 'openjdk/master' into monochrome-printing > - move grayscale methods to PSPathGraphics > - ... and 5 more: https://git.openjdk.org/jdk/compare/6c591854...5486473b I updated the branch according to the comments. I moved updates to the Mac sources and updated color convertion process using override ProxyGraphics2D. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21930#issuecomment-2647124348