* @param crop The rectangle within the yuvData to expose to MonochromeBitmapSource users
*/
YUVMonochromeBitmapSource(byte[] yuvData, int dataWidth, int dataHeight, Rect crop) {
+ if (crop.width() > dataWidth || crop.height() > dataHeight) {
+ throw new IllegalArgumentException();
+ }
mYUVData = yuvData;
mDataWidth = dataWidth;
mCrop = crop;
- assert (crop.width() <= dataWidth);
- assert (crop.height() <= dataHeight);
}
@Override
private BarcodeFormat mFormat;
public BenchmarkItem(String path, int runs) {
+ if (runs <= 0) {
+ throw new IllegalArgumentException();
+ }
mPath = path;
- assert(runs > 0);
mTimes = new int[runs];
mPosition = 0;
mDecoded = false;
private void save(byte[] data, int width, int height) {
int framingWidth = mFramingRect.width();
int framingHeight = mFramingRect.height();
- assert (framingWidth <= width);
- assert (framingHeight <= height);
+ if (framingWidth > width || framingHeight > height) {
+ throw new IllegalArgumentException();
+ }
int leftOffset = mFramingRect.left;
int topOffset = mFramingRect.top;