You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by bu...@apache.org on 2007/07/02 13:51:09 UTC

DO NOT REPLY [Bug 42793] New: - Ability to add an instance of java.awt.geom.AffineTransform as a transcoding hint

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42793>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42793

           Summary: Ability to add an instance of
                    java.awt.geom.AffineTransform as a transcoding hint
           Product: Batik
           Version: 1.7
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: SVG Rasterizer
        AssignedTo: batik-dev@xmlgraphics.apache.org
        ReportedBy: Antti.Karanta@napa.fi


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).

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org