pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1647921 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/blend/SoftMaskPaint.java
Date Thu, 25 Dec 2014 22:05:39 GMT
Author: tilman
Date: Thu Dec 25 22:05:38 2014
New Revision: 1647921

URL: http://svn.apache.org/r1647921
Log:
PDFBOX-2576: remove Math.round() on an int

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/blend/SoftMaskPaint.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/blend/SoftMaskPaint.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/blend/SoftMaskPaint.java?rev=1647921&r1=1647920&r2=1647921&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/blend/SoftMaskPaint.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/blend/SoftMaskPaint.java
Thu Dec 25 22:05:38 2014
@@ -37,7 +37,7 @@ import java.io.IOException;
  * AWT Paint that adds a soft mask to the alpha channel of the existing parent paint. If
the parent
  * paint does not have an alpha channel, a new raster is created.
  * 
- * @author Kühn & Weyh Software, GmbH
+ * @author Kühn & Weyh Software, GmbH
  */
 public final class SoftMaskPaint implements Paint
 {
@@ -53,11 +53,13 @@ public final class SoftMaskPaint impleme
         this.softMaskRaster = softMaskRaster;
     }
 
+    @Override
     public int getTransparency()
     {
         return Transparency.TRANSLUCENT;
     }
 
+    @Override
     public PaintContext createContext(ColorModel cm, Rectangle deviceBounds,
             Rectangle2D userBounds, AffineTransform at, RenderingHints hints)
     {
@@ -75,7 +77,7 @@ public final class SoftMaskPaint impleme
 
     private class Context implements PaintContext
     {
-        private PaintContext parentContext;
+        private final PaintContext parentContext;
         private final ColorModel colorModel;
         private final int numColorComponents;
         private final ColorModel parentColorModel;
@@ -96,11 +98,13 @@ public final class SoftMaskPaint impleme
             numColorComponents = colorModel.getNumColorComponents();
         }
 
+        @Override
         public ColorModel getColorModel()
         {
             return colorModel;
         }
 
+        @Override
         public Raster getRaster(int x, int y, int w, int h)
         {
             Raster parentRaster = parentContext.getRaster(x, y, w, h);
@@ -153,7 +157,7 @@ public final class SoftMaskPaint impleme
                     if ((rx >= softMaskMinX) && (rx < softMaskMaxX) &&
(ry >= softMaskMinY)
                             && (ry < softMaskMaxY))
                     {
-                        alpha = softMaskRaster.getSample(Math.round(rx), Math.round(ry),
0);
+                        alpha = softMaskRaster.getSample(rx, ry, 0);
                     }
                     else
                     {
@@ -167,6 +171,7 @@ public final class SoftMaskPaint impleme
             return result;
         }
 
+        @Override
         public void dispose()
         {
             // do nothing



Mime
View raw message