InvertedLuminanceSource.java revision 7e3fa36d69ffee874dd364b8e3d9aa3cab9a273b
/*
* Copyright 2013 ZXing authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* A wrapper implementation of {@link LuminanceSource} which inverts the luminances it returns -- black becomes
* white and vice versa, and each value becomes (255-value).
*
* @author Sean Owen
*/
public final class InvertedLuminanceSource extends LuminanceSource {
private final LuminanceSource delegate;
}
for (int i = 0; i < width; i++) {
}
return row;
}
public byte[] getMatrix() {
byte[] invertedMatrix = new byte[length];
for (int i = 0; i < length; i++) {
}
return invertedMatrix;
}
public boolean isCropSupported() {
return delegate.isCropSupported();
}
}
public boolean isRotateSupported() {
return delegate.isRotateSupported();
}
/**
* @return original delegate {@link LuminanceSource} since invert undoes itself
*/
public LuminanceSource invert() {
return delegate;
}
public LuminanceSource rotateCounterClockwise() {
}
public LuminanceSource rotateCounterClockwise45() {
}
}