Skip to content

Commit

Permalink
Ported r2576 from ZXing
Browse files Browse the repository at this point in the history
Original commit message: "Better take on InvertedLuminanceSource --
allow possibility of rotation and efficient un-inversion"
  • Loading branch information
cwalcott committed Mar 18, 2013
1 parent d2f7e15 commit 0c0cc1d
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions ZXingObjC/ZXInvertedLuminanceSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,31 @@ - (unsigned char *)matrix {
return invertedMatrix;
}

- (BOOL)cropSupported {
return _delegate.cropSupported;
}

- (ZXLuminanceSource *)crop:(int)left top:(int)top width:(int)aWidth height:(int)aHeight {
return [[[ZXInvertedLuminanceSource alloc] initWithDelegate:[_delegate crop:left top:top width:aWidth height:aHeight]] autorelease];
}

- (BOOL)rotateSupported {
return _delegate.rotateSupported;
}

/**
* Returns original delegate ZXLuminanceSource since invert undoes itself
*/
- (ZXLuminanceSource *)invert {
return _delegate;
}

- (ZXLuminanceSource *)rotateCounterClockwise {
return [[[ZXInvertedLuminanceSource alloc] initWithDelegate:[_delegate rotateCounterClockwise]] autorelease];
}

- (ZXLuminanceSource *)rotateCounterClockwise45 {
return [[[ZXInvertedLuminanceSource alloc] initWithDelegate:[_delegate rotateCounterClockwise45]] autorelease];
}

@end

0 comments on commit 0c0cc1d

Please sign in to comment.