*/
public class ImageIOImage extends AbstractFopImage {
+ private byte[] softMask = null;
+
/**
* Creates a new ImageIOImage.
* @param info the image info from the ImageReader
}
}
} else {
- // TRANSLUCENT
- /*
- * this.isTransparent = false;
- * for (int i = 0; i < this.width * this.height; i++) {
- * if (cm.getAlpha(tmpMap[i]) == 0) {
- * this.isTransparent = true;
- * this.transparentColor = new PDFColor(cm.getRed(tmpMap[i]),
- * cm.getGreen(tmpMap[i]), cm.getBlue(tmpMap[i]));
- * break;
- * }
- * }
- * // or use special API...
- */
+ //TODO Is there another case?
this.isTransparent = false;
}
} else {
+ // TRANSLUCENT
+ this.softMask = new byte[width * height];
+ imageData.getAlphaRaster().getDataElements(
+ 0, 0, width, height, this.softMask);
this.isTransparent = false;
}
} else {
return loadDefaultOriginalData();
}
+ /** @see org.apache.fop.image.FopImage#hasSoftMask() */
+ public boolean hasSoftMask() {
+ if (this.bitmaps == null && this.raw == null) {
+ loadBitmap();
+ }
+
+ return (this.softMask != null);
+ }
+
+ /** @see org.apache.fop.image.FopImage#getSoftMask() */
+ public byte[] getSoftMask() {
+ if (this.bitmaps == null) {
+ loadBitmap();
+ }
+
+ return this.softMask;
+ }
+
}
<changes>
<release version="FOP Trunk">
+ <action context="Code" dev="JM" type="add">
+ Support for soft masks (transparency) with ImageIO image adapter.
+ </action>
<action context="Code" dev="LF" type="fix" fixes-bug="41019">
Fix incorrect behaviour of the BreakingAlgorithm when some inline content is wider than
the available ipd, causing a restart.