Changed the order of the BaseMonochromeBitmapSource constructor arguments to be width...
[zxing.git] / core / src / com / google / zxing / common / BaseMonochromeBitmapSource.java
index 13bdfc3..0e6699e 100644 (file)
@@ -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