[OpenJDK 2D-Dev] BufferedImage.getTileGridXOffset() not compliant with its specification?
martin.desruisseaux at geomatys.com
Mon Mar 9 13:29:47 UTC 2020
Thanks for the analysis. I can volunteer for creating the CSR if I can
have some pointers (e.g. template) to follow?
Indeed, I though that Graphics2D may have "if (image instanceof
BufferedImage)" optimizations that hides the issue. My plan was to
create a test with a RenderedImage wrapping a BufferedImage, which would
prevent Graphics2D to use such fast track, and see how it behaves. What
I can said however is that Graphics2D works well with multi-tiled images
compliant with the specification, such as javax.media.jai.TiledImage .
For the formula used for "pixel coordinates to tile indices"
calculation, we can use source code of  as a reference.
Le 09/03/2020 à 01:29, Sergey Bylokhov a écrit :
> I have checked the history of these methods and their usage.
> These methods were added to the BufferedImage back in 1997 when the
> generic support of rendered images was added. Since then these methods
> were used in the implementation of Graphics2D.drawRenderedImage(), but
> in fact for BufferedImage they are never called . I think it is
> possible to change getTileGridXOffset()/getTileGridYOffset to return 0.
> But it will be necessary to create a CSR, since the change has
> compatibility impact.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the 2d-dev