mirror of
https://github.com/zxing/zxing.git
synced 2025-02-02 05:41:08 -08:00
Better take on InvertedLuminanceSource -- allow possibility of rotation and efficient un-inversion
git-svn-id: https://zxing.googlecode.com/svn/trunk@2576 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
d863e71a10
commit
01e43af170
|
@ -52,4 +52,37 @@ public final class InvertedLuminanceSource extends LuminanceSource {
|
|||
return invertedMatrix;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCropSupported() {
|
||||
return delegate.isCropSupported();
|
||||
}
|
||||
|
||||
@Override
|
||||
public LuminanceSource crop(int left, int top, int width, int height) {
|
||||
return new InvertedLuminanceSource(delegate.crop(left, top, width, height));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRotateSupported() {
|
||||
return delegate.isRotateSupported();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return original delegate {@link LuminanceSource} since invert undoes itself
|
||||
*/
|
||||
@Override
|
||||
public LuminanceSource invert() {
|
||||
return delegate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LuminanceSource rotateCounterClockwise() {
|
||||
return new InvertedLuminanceSource(delegate.rotateCounterClockwise());
|
||||
}
|
||||
|
||||
@Override
|
||||
public LuminanceSource rotateCounterClockwise45() {
|
||||
return new InvertedLuminanceSource(delegate.rotateCounterClockwise45());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ public abstract class LuminanceSource {
|
|||
* @return a wrapper of this {@code LuminanceSource} which inverts the luminances it returns -- black becomes
|
||||
* white and vice versa, and each value becomes (255-value).
|
||||
*/
|
||||
public final LuminanceSource invert() {
|
||||
public LuminanceSource invert() {
|
||||
return new InvertedLuminanceSource(this);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue