forked from zxingify/zxingify-objc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Original commit message: "Issue 572 port of Data Matrix encoder from barcode4j, adapted for Android, ported by Guillaume Le Biller and stoty47 and adapted a bit more by me"
- Loading branch information
Showing
49 changed files
with
3,827 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* 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 | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* 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. | ||
*/ | ||
|
||
/** | ||
* Simply encapsulates a width and height. | ||
*/ | ||
|
||
@interface ZXDimension : NSObject | ||
|
||
@property (nonatomic, assign, readonly) int height; | ||
@property (nonatomic, assign, readonly) int width; | ||
|
||
- (id)initWithWidth:(int)width height:(int)height; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* 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 | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* 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. | ||
*/ | ||
|
||
#import "ZXDimension.h" | ||
|
||
@interface ZXDimension () | ||
|
||
@property (nonatomic, assign) int height; | ||
@property (nonatomic, assign) int width; | ||
|
||
@end | ||
|
||
@implementation ZXDimension | ||
|
||
@synthesize width = _width; | ||
@synthesize height = _height; | ||
|
||
- (id)initWithWidth:(int)width height:(int)height { | ||
if (width < 0 || height < 0) { | ||
[NSException raise:NSInvalidArgumentException | ||
format:@"Width and height must not be negative"]; | ||
} | ||
|
||
if (self = [super init]) { | ||
_width = width; | ||
_height = height; | ||
} | ||
|
||
return self; | ||
} | ||
|
||
- (BOOL)isEqual:(id)other { | ||
if ([other isKindOfClass:[ZXDimension class]]) { | ||
ZXDimension *d = (ZXDimension *)other; | ||
return self.width == d.width && self.height == d.height; | ||
} | ||
return NO; | ||
} | ||
|
||
- (NSUInteger)hash { | ||
return self.width * 32713 + self.height; | ||
} | ||
|
||
- (NSString *)description { | ||
return [NSString stringWithFormat:@"%dx%d", self.width, self.height]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* 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 | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* 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. | ||
*/ | ||
|
||
#import "ZXWriter.h" | ||
|
||
/** | ||
* This object renders a Data Matrix code as a BitMatrix 2D array of greyscale values. | ||
*/ | ||
|
||
@interface ZXDataMatrixWriter : NSObject <ZXWriter> | ||
|
||
@end |
Oops, something went wrong.