Uploaded image for project: 'Batik'
  1. Batik
  2. BATIK-756

Ability to add an instance of java.awt.geom.AffineTransform as a transcoding hint

    Details

    • Type: Improvement
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: 1.7
    • Fix Version/s: None
    • Component/s: SVG Rasterizer
    • Labels:
      None
    • Environment:
      Operating System: other
      Platform: Other

      Description

      It would be useful to be able to add an instance of
      java.awt.geom.AffineTransform as a transcoding hint when rasterizing images.
      This would allow e.g. rotation and scaling.

      Implementing this would be fairly simple - if I did not miss anything, it
      requires a couple of lines in SVGAbstractTranscoder.transcode, after (lines 286-
      291)

      286 if (cgn != null)

      { 287 cgn.setViewingTransform(Px); 288 curTxf = new AffineTransform(); 289 }

      else

      { 290 curTxf = Px; 291 }

      I think inserting something like this after the above should do it:

      // constant KEY_TRANSFORM needs to be defined, of course
      if (hints.containsKey(KEY_TRANSFORM))

      { AffineTransform a = (AffineTransform)hints.get(KEY_TRANSFORM); curTxf.concatenate(a); }

      ATM, it is not possible to affect the value of (protected instance variable)
      curTxf during transcoding even by subclassing ImageTranscoder as curTxf is
      internally set during the transcoding operation (the above lines of quoted
      code).

        Attachments

          Activity

            People

            • Assignee:
              batik-dev@xmlgraphics.apache.org Batik Developer's Mailing list
              Reporter:
              antti.karanta@napa.fi Antti Karanta
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: