pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1832190 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/blend/BlendMode.java
Date Thu, 24 May 2018 17:29:39 GMT
Author: tilman
Date: Thu May 24 17:29:38 2018
New Revision: 1832190

URL: http://svn.apache.org/viewvc?rev=1832190&view=rev
Log:
PDFBOX-4095: Sonar fix

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/blend/BlendMode.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/blend/BlendMode.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/blend/BlendMode.java?rev=1832190&r1=1832189&r2=1832190&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/blend/BlendMode.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/blend/BlendMode.java
Thu May 24 17:29:38 2018
@@ -337,9 +337,9 @@ public abstract class BlendMode
         int gs = get255Value(srcValues[1]);
         int bs = get255Value(srcValues[2]);
         delta = ((rs - rd) * 77 + (gs - gd) * 151 + (bs - bd) * 28 + 0x80) >> 8;
-        r = (rd + delta);
-        g = (gd + delta);
-        b = (bd + delta);
+        r = rd + delta;
+        g = gd + delta;
+        b = bd + delta;
 
         if (((r | g | b) & 0x100) == 0x100)
         {
@@ -348,13 +348,13 @@ public abstract class BlendMode
             {
                 int max;
                 max = Math.max(r, Math.max(g, b));
-                scale = (max == y ? 0 : ((255 - y) << 16) / (max - y));
+                scale = max == y ? 0 : ((255 - y) << 16) / (max - y);
             }
             else
             {
                 int min;
                 min = Math.min(r, Math.min(g, b));
-                scale = (y == min ? 0 : (y << 16) / (y - min));
+                scale = y == min ? 0 : (y << 16) / (y - min);
             }
             r = y + (((r - y) * scale + 0x8000) >> 16);
             g = y + (((g - y) * scale + 0x8000) >> 16);



Mime
View raw message