Small tweaks on top of Daniel's excellent refactoring

git-svn-id: https://zxing.googlecode.com/svn/trunk@420 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2008-06-12 12:51:26 +00:00
parent 7b2cafe970
commit 31b8b3d226
3 changed files with 4 additions and 7 deletions

View file

@ -32,7 +32,7 @@ public abstract class BaseMonochromeBitmapSource implements MonochromeBitmapSour
private static final int LUMINANCE_SHIFT = 8 - LUMINANCE_BITS;
private static final int LUMINANCE_BUCKETS = 1 << LUMINANCE_BITS;
public BaseMonochromeBitmapSource() {
protected BaseMonochromeBitmapSource() {
blackPoint = 0x7F;
lastMethod = null;
lastArgument = 0;
@ -76,11 +76,6 @@ public abstract class BaseMonochromeBitmapSource implements MonochromeBitmapSour
return row;
}
public abstract int getHeight();
public abstract int getWidth();
public abstract int getLuminance(int x, int y);
public abstract void cacheRowForLuminance(int y);
public void estimateBlackPoint(BlackPointEstimationMethod method, int argument) throws ReaderException {
if (!method.equals(lastMethod) || argument != lastArgument) {
int width = getWidth();

View file

@ -21,7 +21,7 @@ import com.google.zxing.common.BaseMonochromeBitmapSource;
import javax.microedition.lcdui.Image;
/**
* <p>An implementation based on Java ME's {@link java.awt.Image} representation.</p>
* <p>An implementation based on Java ME's {@link Image} representation.</p>
*
* @author Sean Owen (srowen@google.com), Daniel Switkin (dswitkin@google.com)
*/

View file

@ -97,6 +97,7 @@ public final class BufferedImageMonochromeBitmapSource extends BaseMonochromeBit
return width;
}
@Override
public MonochromeBitmapSource rotateCounterClockwise() {
if (!isRotateSupported()) {
throw new IllegalStateException("Rotate not supported");
@ -116,6 +117,7 @@ public final class BufferedImageMonochromeBitmapSource extends BaseMonochromeBit
sourceWidth - left);
}
@Override
public boolean isRotateSupported() {
// Can't run AffineTransforms on images of unknown format
return image.getType() != BufferedImage.TYPE_CUSTOM;