X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=core%2Fsrc%2Fcom%2Fgoogle%2Fzxing%2Fcommon%2FBaseMonochromeBitmapSource.java;h=0e6699e8ffb13e409cbad9fa80dad7f49f605734;hb=7eec24ee881d16e10dac4228adb5aa199eec0b29;hp=13bdfc33eaf118dacbecf95f92af1451c3ef36b1;hpb=2cf44178b43d1fa6960fec0d9051d043753ea11b;p=zxing.git diff --git a/core/src/com/google/zxing/common/BaseMonochromeBitmapSource.java b/core/src/com/google/zxing/common/BaseMonochromeBitmapSource.java index 13bdfc33..0e6699e8 100644 --- a/core/src/com/google/zxing/common/BaseMonochromeBitmapSource.java +++ b/core/src/com/google/zxing/common/BaseMonochromeBitmapSource.java @@ -28,12 +28,16 @@ public abstract class BaseMonochromeBitmapSource implements MonochromeBitmapSour private static final int LUMINANCE_SHIFT = 8 - LUMINANCE_BITS; private static final int LUMINANCE_BUCKETS = 1 << LUMINANCE_BITS; + private final int height; + private final int width; private int blackPoint; private BlackPointEstimationMethod lastMethod; private int lastArgument; private int[] luminances; - protected BaseMonochromeBitmapSource() { + protected BaseMonochromeBitmapSource(int width, int height) { + this.height = height; + this.width = width; blackPoint = 0x7F; lastMethod = null; lastArgument = 0; @@ -151,13 +155,17 @@ public abstract class BaseMonochromeBitmapSource implements MonochromeBitmapSour return false; } - // These two methods should not need to exist because they are defined in the interface that - // this abstract class implements. However this seems to cause problems on some Nokias. - // So we write these redundant declarations. + public final int getHeight() { + return height; + } - public abstract int getHeight(); + public final int getWidth() { + return width; + } - public abstract int getWidth(); + // These methods below should not need to exist because they are defined in the interface that + // this abstract class implements. However this seems to cause problems on some Nokias. + // So we write these redundant declarations. /** * Retrieves the luminance at the pixel x,y in the bitmap. This method is only used for estimating