/*
- * Copyright 2007 Google Inc.
+ * Copyright 2007 ZXing authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* <p>Encapsulates a generic black-and-white bitmap -- a collection of pixels in two dimensions.
* This unifies many possible representations, like AWT's <code>BufferedImage</code>.</p>
*
- * @author srowen@google.com (Sean Owen)
+ * @author Sean Owen
+ * @author dswitkin@google.com (Daniel Switkin)
*/
public interface MonochromeBitmapSource {
*/
BitArray getBlackRow(int y, BitArray row, int startX, int getWidth);
+ /**
+ * Entirely analogous to {@link #getBlackRow(int, BitArray, int, int)} but gets a column.
+ */
+ BitArray getBlackColumn(int x, BitArray column, int startY, int getHeight);
+
/**
* @return height of underlying image
*/
* @param method black point estimation method
* @param argument method-specific argument
*/
- void estimateBlackPoint(BlackPointEstimationMethod method, int argument);
+ void estimateBlackPoint(BlackPointEstimationMethod method, int argument) throws ReaderException;
/**
* @return {@link BlackPointEstimationMethod} representing last sampling method used
*/
BlackPointEstimationMethod getLastEstimationMethod();
+ /**
+ * <p>Optional operation which returns an implementation based on the same underlying
+ * image, but which behaves as if the underlying image had been rotated 90 degrees
+ * counterclockwise. This is useful in the context of 1D barcodes and the
+ * {@link DecodeHintType#TRY_HARDER} decode hint, and is only intended to be
+ * used in non-resource-constrained environments. Hence, implementations
+ * of this class which are only used in resource-constrained mobile environments
+ * don't have a need to implement this.</p>
+ *
+ * @throws IllegalArgumentException if not supported
+ */
+ MonochromeBitmapSource rotateCounterClockwise();
+
+ /**
+ * @return true iff rotation is supported
+ * @see #rotateCounterClockwise()
+ */
+ boolean isRotateSupported();
+
}