You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlgraphics.apache.org by ss...@apache.org on 2017/04/27 12:30:09 UTC
svn commit: r1792872 - in
/xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics:
java2d/ps/PSGraphics2D.java ps/PSImageUtils.java
Author: ssteiner
Date: Thu Apr 27 12:30:09 2017
New Revision: 1792872
URL: http://svn.apache.org/viewvc?rev=1792872&view=rev
Log:
FOP-2251: PDF to Postscript not showing transparency
Modified:
xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/java2d/ps/PSGraphics2D.java
xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/ps/PSImageUtils.java
Modified: xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/java2d/ps/PSGraphics2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/java2d/ps/PSGraphics2D.java?rev=1792872&r1=1792871&r2=1792872&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/java2d/ps/PSGraphics2D.java (original)
+++ xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/java2d/ps/PSGraphics2D.java Thu Apr 27 12:30:09 2017
@@ -248,8 +248,11 @@ public class PSGraphics2D extends Abstra
* @see java.awt.image.ImageObserver
* @see java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
*/
- public boolean drawImage(Image img, int x, int y,
- ImageObserver observer) {
+ public boolean drawImage(Image img, int x, int y, ImageObserver observer) {
+ return drawImage(img, x, y, observer, null);
+ }
+
+ public boolean drawImage(Image img, int x, int y, ImageObserver observer, Color mask) {
preparePainting();
if (DEBUG) {
System.out.println("drawImage: " + x + ", " + y + " " + img.getClass().getName());
@@ -281,8 +284,7 @@ public class PSGraphics2D extends Abstra
gen.concatMatrix(at);
Shape imclip = getClip();
writeClip(imclip);
- PSImageUtils.renderBitmapImage(buf,
- x, y, width, height, gen);
+ PSImageUtils.renderBitmapImage(buf, x, y, width, height, gen, mask);
gen.restoreGraphicsState();
} catch (IOException ioe) {
handleIOException(ioe);
@@ -682,7 +684,7 @@ public class PSGraphics2D extends Abstra
Shape imclip = getClip();
writeClip(imclip);
PSImageUtils.renderBitmapImage(img,
- 0, 0, img.getWidth(), img.getHeight(), gen);
+ 0, 0, img.getWidth(), img.getHeight(), gen, null);
gen.restoreGraphicsState();
} catch (IOException ioe) {
handleIOException(ioe);
Modified: xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/ps/PSImageUtils.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/ps/PSImageUtils.java?rev=1792872&r1=1792871&r2=1792872&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/ps/PSImageUtils.java (original)
+++ xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/ps/PSImageUtils.java Thu Apr 27 12:30:09 2017
@@ -463,7 +463,7 @@ public class PSImageUtils {
* @throws IOException In case of an I/O problem while rendering the image
*/
public static void renderBitmapImage(RenderedImage img,
- float x, float y, float w, float h, PSGenerator gen)
+ float x, float y, float w, float h, PSGenerator gen, Color mask)
throws IOException {
Rectangle2D targetRect = new Rectangle2D.Double(x, y, w, h);
ImageEncoder encoder = ImageEncodingHelper.createRenderedImageEncoder(img);
@@ -472,7 +472,11 @@ public class PSImageUtils {
ImageEncodingHelper helper = new ImageEncodingHelper(img);
ColorModel cm = helper.getEncodedColorModel();
- writeImage(encoder, imgDim, imgDescription, targetRect, cm, gen, img);
+ if (mask == null) {
+ writeImage(encoder, imgDim, imgDescription, targetRect, cm, gen, img);
+ } else {
+ writeImage(encoder, imgDim, imgDescription, targetRect, cm, gen, img, mask);
+ }
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org