diff options
author | Jeremias Maerki <jeremias@apache.org> | 2005-08-21 13:36:53 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2005-08-21 13:36:53 +0000 |
commit | 46072c1c25fae63aa3b74bfbe1fc7198fbdf163e (patch) | |
tree | 0e03f6731bca6d4537f0a40bc788665e4acebb09 /src/java/org/apache/fop/render/PrintRenderer.java | |
parent | 62167f17b8dd6c4a565af6d215071233d28eb746 (diff) | |
download | xmlgraphics-fop-46072c1c25fae63aa3b74bfbe1fc7198fbdf163e.tar.gz xmlgraphics-fop-46072c1c25fae63aa3b74bfbe1fc7198fbdf163e.zip |
A big step towards a usable PostScript renderer.
Some code that can be used by both PS and PDF renderers factored out into a common base class (AbstractPathOrientedRenderer).
Coordinate system of PS renderer and PSGraphics2D changed to be based on points rather than millipoints to be the same as the PDFRenderer. This improves the chance to reuse code.
PSGenerator set to PostScript level 2 now, should later be configurable. There may still be some PS commands which should be changed from Level 2 to Level 1, just to be able to support Level 1 later should anyone ask for it.
Bitmap, EPS and SVG support should be mostly restored now.
PSState was extended to provide the same break-out mechanism for fixed b-cs. And it has better support for tracking the graphics state.
Added some FOP-specific comments to certain constructs for people who want to post-process the PS output.
BatchDiffer shows very few visual differences now on the layout engine test cases between PDF and PS.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@234201 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render/PrintRenderer.java')
-rw-r--r-- | src/java/org/apache/fop/render/PrintRenderer.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/render/PrintRenderer.java b/src/java/org/apache/fop/render/PrintRenderer.java index aafed0355..1d97580b0 100644 --- a/src/java/org/apache/fop/render/PrintRenderer.java +++ b/src/java/org/apache/fop/render/PrintRenderer.java @@ -19,10 +19,16 @@ package org.apache.fop.render; // FOP +import org.apache.fop.area.Area; +import org.apache.fop.area.Trait; import org.apache.fop.fonts.FontInfo; import org.apache.fop.fonts.FontSetup; +import org.apache.fop.image.FopImage; +import org.apache.fop.traits.BorderProps; // Java +import java.awt.Color; +import java.awt.geom.Rectangle2D; import java.util.List; /** Abstract base class of "Print" type renderers. */ @@ -44,4 +50,25 @@ public abstract class PrintRenderer extends AbstractRenderer { FontSetup.setup(fontInfo, fontList); } + /** + * Lightens up a color for groove, ridge, inset and outset border effects. + * @param col the color to lighten up + * @param factor factor by which to lighten up (negative values darken the color) + * @return the modified color + */ + protected Color lightenColor(Color col, float factor) { + float[] cols = new float[3]; + cols = col.getColorComponents(cols); + if (factor > 0) { + cols[0] += (1.0 - cols[0]) * factor; + cols[1] += (1.0 - cols[1]) * factor; + cols[2] += (1.0 - cols[2]) * factor; + } else { + cols[0] -= cols[0] * -factor; + cols[1] -= cols[1] * -factor; + cols[2] -= cols[2] * -factor; + } + return new Color(cols[0], cols[1], cols[2]); + } + } |