/** * @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 LuminanceSource invert() { return new InvertedLuminanceSource(this); }
@Override public byte[] getRow(int y, byte[] row) { row = delegate.getRow(y, row); int width = getWidth(); for (int i = 0; i < width; i++) { row[i] = (byte) (255 - (row[i] & 0xFF)); } return row; }
@Override public byte[] getRow(int y, byte[] row) { row = delegate.getRow(y, row); int width = getWidth(); for (int i = 0; i < width; i++) { row[i] = (byte) (255 - (row[i] & 0xFF)); } return row; }
/** * @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 LuminanceSource invert() { return new InvertedLuminanceSource(this); }
@Override public LuminanceSource crop(int left, int top, int width, int height) { return new InvertedLuminanceSource(delegate.crop(left, top, width, height)); }
@Override public LuminanceSource rotateCounterClockwise45() { return new InvertedLuminanceSource(delegate.rotateCounterClockwise45()); }
@Override public LuminanceSource rotateCounterClockwise() { return new InvertedLuminanceSource(delegate.rotateCounterClockwise()); }
@Override public LuminanceSource rotateCounterClockwise() { return new InvertedLuminanceSource(delegate.rotateCounterClockwise()); }
@Override public LuminanceSource crop(int left, int top, int width, int height) { return new InvertedLuminanceSource(delegate.crop(left, top, width, height)); }
@Override public LuminanceSource rotateCounterClockwise45() { return new InvertedLuminanceSource(delegate.rotateCounterClockwise45()); }