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;
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