Don't use Build.VERSION_CODES as it's not in 1.5
[zxing.git] / android / src / com / google / zxing / client / android / PlanarYUVLuminanceSource.java
index 9948091..31cf7d9 100644 (file)
@@ -26,11 +26,11 @@ import android.graphics.Bitmap;
  * superfluous pixels around the perimeter and speed up decoding.
  *
  * It works for any pixel format where the Y channel is planar and appears first, including
- * YCbCr_420_SP and YCbCr_422_SP. Any subsequent color data will be ignored.
+ * YCbCr_420_SP and YCbCr_422_SP.
  *
  * @author dswitkin@google.com (Daniel Switkin)
  */
-public final class PlanarYUVLuminanceSource extends BaseLuminanceSource {
+public final class PlanarYUVLuminanceSource extends LuminanceSource {
   private final byte[] yuvData;
   private final int dataWidth;
   private final int dataHeight;
@@ -102,22 +102,14 @@ public final class PlanarYUVLuminanceSource extends BaseLuminanceSource {
     return true;
   }
 
-  @Override
-  public LuminanceSource crop(int left, int top, int width, int height) {
-    return new PlanarYUVLuminanceSource(yuvData, dataWidth, dataHeight, left, top, width, height);
-  }
-
-  @Override
   public int getDataWidth() {
     return dataWidth;
   }
 
-  @Override
   public int getDataHeight() {
     return dataHeight;
   }
 
-  @Override
   public Bitmap renderCroppedGreyscaleBitmap() {
     int width = getWidth();
     int height = getHeight();
@@ -129,7 +121,7 @@ public final class PlanarYUVLuminanceSource extends BaseLuminanceSource {
       int outputOffset = y * width;
       for (int x = 0; x < width; x++) {
         int grey = yuv[inputOffset + x] & 0xff;
-        pixels[outputOffset + x] = (0xff000000) | (grey * 0x00010101);
+        pixels[outputOffset + x] = 0xFF000000 | (grey * 0x00010101);
       }
       inputOffset += dataWidth;
     }
@@ -138,10 +130,4 @@ public final class PlanarYUVLuminanceSource extends BaseLuminanceSource {
     bitmap.setPixels(pixels, 0, width, 0, 0, width, height);
     return bitmap;
   }
-
-  // Can't be implemented here, as the color representations vary.
-  @Override
-  public Bitmap renderFullColorBitmap(boolean halfSize) {
-    throw new UnsupportedOperationException();
-  }
 }