Uploaded image for project: 'XMLGraphicsCommons'
  1. XMLGraphicsCommons
  2. XGC-17

Graphics2D ImageConverters make coordinate system assumption which is incorrect for AFP

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Resolution: Won't Fix
    • 2.6
    • None
    • image codecs
    • None
    • Operating System: Linux
      Platform: PC

    Description

      The ImageConverter*2G2D implementing classes in XG Commons make the assumption
      when creating their Graphics2DImagePainter implementations that the coordinate system used by the Graphics2D implementation follows the 'Standard' bottom to top ascending x and left to right y ascending axis. This assumption is fine for most cases but in the case of AFPGraphics2D implementation the coordinate system is different and you have a descending y axis.

      ^ ------------------>

       
       
       
       
       
      ----------------->

      Standard AFPGraphics2D (GOCA)

      So for AFPGraphics2D you need to a different translation and scale AffineTransform matrix to paint correctly. At the moment this translation and scale preparation is hardwired inside the paint(Graphics2D g2d, Rectangle2D area) method of the Graphics2DImagePainter implementation/instance.

      There needs to be a separation of concerns between the painting and the preparation for painting (which can be Graphics2D implementation specific).

      Attachments

        1. Java2DWithImageLoaderExample.java
          10 kB
          Jeremias Maerki

        Activity

          People

            general@xmlgraphics.apache.org XML Graphics Project Mailing List
            dev@cumiskey.com Adrian Cumiskey
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: