Made the RGB to luminance approximation/optimization a little faster -- one less...
[zxing.git] / android / src / com / google / zxing / client / android / RGBMonochromeBitmapSource.java
index 6d3f2bd..100a9d4 100755 (executable)
@@ -140,9 +140,9 @@ final class RGBMonochromeBitmapSource implements MonochromeBitmapSource {
     // corrupts the conversion. Not significant for our purposes.
     //
     // But we can get even cleverer and eliminate a few shifts:
-    return (((pixel & 0x00FF0000) >> 8)  +
-            ((pixel & 0x0000FF00) << 1) +
-            ((pixel & 0x000000FF) << 8)) >> 10;
+    return (((pixel & 0x00FF0000) >> 16)  +
+            ((pixel & 0x0000FF00) >>  7) +
+            ( pixel & 0x000000FF       )) >> 2;
   }
 
 }
\ No newline at end of file