X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=android%2Fsrc%2Fcom%2Fgoogle%2Fzxing%2Fclient%2Fandroid%2FYUVMonochromeBitmapSource.java;h=ff03fcf2f575ee20fc3beba6a8544d8e846e6bf6;hb=3952301b023d6d26f1ed3cc3d466dd5ef3ec9086;hp=e2614c172dfa993bf73a2de9817268d49b1ef67a;hpb=3862ba7262be818bdbcbd0216e339f65a83d6e9e;p=zxing.git diff --git a/android/src/com/google/zxing/client/android/YUVMonochromeBitmapSource.java b/android/src/com/google/zxing/client/android/YUVMonochromeBitmapSource.java index e2614c17..ff03fcf2 100755 --- a/android/src/com/google/zxing/client/android/YUVMonochromeBitmapSource.java +++ b/android/src/com/google/zxing/client/android/YUVMonochromeBitmapSource.java @@ -19,6 +19,7 @@ package com.google.zxing.client.android; import android.graphics.Bitmap; import com.google.zxing.BlackPointEstimationMethod; import com.google.zxing.MonochromeBitmapSource; +import com.google.zxing.ReaderException; import com.google.zxing.common.BitArray; import com.google.zxing.common.BlackPointEstimator; @@ -30,7 +31,9 @@ import com.google.zxing.common.BlackPointEstimator; * * @author dswitkin@google.com (Daniel Switkin) * @author srowen@google.com (Sean Owen) + * @deprecated */ +@Deprecated final class YUVMonochromeBitmapSource implements MonochromeBitmapSource { private final Bitmap image; @@ -77,12 +80,11 @@ final class YUVMonochromeBitmapSource implements MonochromeBitmapSource { return image.width(); } - public void estimateBlackPoint(BlackPointEstimationMethod method, int argument) { + public void estimateBlackPoint(BlackPointEstimationMethod method, int argument) throws ReaderException { if (!method.equals(lastMethod) || argument != lastArgument) { int width = image.width(); int height = image.height(); int[] histogram = new int[LUMINANCE_BUCKETS]; - float biasTowardsWhite = 1.0f; if (method.equals(BlackPointEstimationMethod.TWO_D_SAMPLING)) { int minDimension = width < height ? width : height; int startI = height == minDimension ? 0 : (height - width) >> 1; @@ -95,7 +97,6 @@ final class YUVMonochromeBitmapSource implements MonochromeBitmapSource { if (argument < 0 || argument >= height) { throw new IllegalArgumentException("Row is not within the image: " + argument); } - biasTowardsWhite = 2.0f; int[] pixelRow = new int[width]; image.getPixels(pixelRow, 0, width, 0, argument, width, 1); for (int x = 0; x < width; x++) { @@ -104,7 +105,7 @@ final class YUVMonochromeBitmapSource implements MonochromeBitmapSource { } else { throw new IllegalArgumentException("Unknown method: " + method); } - blackPoint = BlackPointEstimator.estimate(histogram, biasTowardsWhite) << LUMINANCE_SHIFT; + blackPoint = BlackPointEstimator.estimate(histogram) << LUMINANCE_SHIFT; lastMethod = method; lastArgument = argument; } @@ -114,4 +115,12 @@ final class YUVMonochromeBitmapSource implements MonochromeBitmapSource { return lastMethod; } + public MonochromeBitmapSource rotateCounterClockwise() { + throw new IllegalStateException("Rotate not supported"); + } + + public boolean isRotateSupported() { + return false; + } + } \ No newline at end of file