ZBar bar code reader . http://zbar.sourceforge.net/ ZBar is licensed under the GNU LGPL 2.1 to enable development of both open source and commercial projects.
Dependents: GR-PEACH_Camera_in_barcode levkov_ov7670
LICENSE
The ZBar Bar Code Reader is Copyright (C) 2007-2009 Jeff Brown <spadix@users.sourceforge.net> The QR Code reader is Copyright (C) 1999-2009 Timothy B. Terriberry <tterribe@xiph.org>
You can redistribute this library and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
ISAAC is based on the public domain implementation by Robert J. Jenkins Jr., and is itself public domain.
Portions of the bit stream reader are copyright (C) The Xiph.Org Foundation 1994-2008, and are licensed under a BSD-style license.
The Reed-Solomon decoder is derived from an implementation (C) 1991-1995 Henry Minsky (hqm@ua.com, hqm@ai.mit.edu), and is licensed under the LGPL with permission.
zbar/qrcode/util.h@1:500d42699c34, 2016-04-19 (annotated)
- Committer:
- RyoheiHagimoto
- Date:
- Tue Apr 19 02:19:39 2016 +0000
- Revision:
- 1:500d42699c34
- Parent:
- 0:56c5742b9e2b
Add copying.txt and license.txt
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
RyoheiHagimoto | 0:56c5742b9e2b | 1 | /*Copyright (C) 2008-2009 Timothy B. Terriberry (tterribe@xiph.org) |
RyoheiHagimoto | 0:56c5742b9e2b | 2 | You can redistribute this library and/or modify it under the terms of the |
RyoheiHagimoto | 0:56c5742b9e2b | 3 | GNU Lesser General Public License as published by the Free Software |
RyoheiHagimoto | 0:56c5742b9e2b | 4 | Foundation; either version 2.1 of the License, or (at your option) any later |
RyoheiHagimoto | 0:56c5742b9e2b | 5 | version.*/ |
RyoheiHagimoto | 0:56c5742b9e2b | 6 | #if !defined(_qrcode_util_H) |
RyoheiHagimoto | 0:56c5742b9e2b | 7 | # define _qrcode_util_H (1) |
RyoheiHagimoto | 0:56c5742b9e2b | 8 | |
RyoheiHagimoto | 0:56c5742b9e2b | 9 | #define QR_MAXI(_a,_b) ((_a)-((_a)-(_b)&-((_b)>(_a)))) |
RyoheiHagimoto | 0:56c5742b9e2b | 10 | #define QR_MINI(_a,_b) ((_a)+((_b)-(_a)&-((_b)<(_a)))) |
RyoheiHagimoto | 0:56c5742b9e2b | 11 | #define QR_SIGNI(_x) (((_x)>0)-((_x)<0)) |
RyoheiHagimoto | 0:56c5742b9e2b | 12 | #define QR_SIGNMASK(_x) (-((_x)<0)) |
RyoheiHagimoto | 0:56c5742b9e2b | 13 | /*Unlike copysign(), simply inverts the sign of _a if _b is negative.*/ |
RyoheiHagimoto | 0:56c5742b9e2b | 14 | #define QR_FLIPSIGNI(_a,_b) ((_a)+QR_SIGNMASK(_b)^QR_SIGNMASK(_b)) |
RyoheiHagimoto | 0:56c5742b9e2b | 15 | #define QR_COPYSIGNI(_a,_b) QR_FLIPSIGNI(abs(_a),_b) |
RyoheiHagimoto | 0:56c5742b9e2b | 16 | /*Divides a signed integer by a positive value with exact rounding.*/ |
RyoheiHagimoto | 0:56c5742b9e2b | 17 | #define QR_DIVROUND(_x,_y) (((_x)+QR_FLIPSIGNI(_y>>1,_x))/(_y)) |
RyoheiHagimoto | 0:56c5742b9e2b | 18 | #define QR_CLAMPI(_a,_b,_c) (QR_MAXI(_a,QR_MINI(_b,_c))) |
RyoheiHagimoto | 0:56c5742b9e2b | 19 | #define QR_CLAMP255(_x) ((unsigned char)((((_x)<0)-1)&((_x)|-((_x)>255)))) |
RyoheiHagimoto | 0:56c5742b9e2b | 20 | /*Swaps two integers _a and _b if _a>_b.*/ |
RyoheiHagimoto | 0:56c5742b9e2b | 21 | #define QR_SORT2I(_a,_b) \ |
RyoheiHagimoto | 0:56c5742b9e2b | 22 | do{ \ |
RyoheiHagimoto | 0:56c5742b9e2b | 23 | int t__; \ |
RyoheiHagimoto | 0:56c5742b9e2b | 24 | t__=QR_MINI(_a,_b)^(_a); \ |
RyoheiHagimoto | 0:56c5742b9e2b | 25 | (_a)^=t__; \ |
RyoheiHagimoto | 0:56c5742b9e2b | 26 | (_b)^=t__; \ |
RyoheiHagimoto | 0:56c5742b9e2b | 27 | } \ |
RyoheiHagimoto | 0:56c5742b9e2b | 28 | while(0) |
RyoheiHagimoto | 0:56c5742b9e2b | 29 | #define QR_ILOG0(_v) (!!((_v)&0x2)) |
RyoheiHagimoto | 0:56c5742b9e2b | 30 | #define QR_ILOG1(_v) (((_v)&0xC)?2+QR_ILOG0((_v)>>2):QR_ILOG0(_v)) |
RyoheiHagimoto | 0:56c5742b9e2b | 31 | #define QR_ILOG2(_v) (((_v)&0xF0)?4+QR_ILOG1((_v)>>4):QR_ILOG1(_v)) |
RyoheiHagimoto | 0:56c5742b9e2b | 32 | #define QR_ILOG3(_v) (((_v)&0xFF00)?8+QR_ILOG2((_v)>>8):QR_ILOG2(_v)) |
RyoheiHagimoto | 0:56c5742b9e2b | 33 | #define QR_ILOG4(_v) (((_v)&0xFFFF0000)?16+QR_ILOG3((_v)>>16):QR_ILOG3(_v)) |
RyoheiHagimoto | 0:56c5742b9e2b | 34 | /*Computes the integer logarithm of a (positive, 32-bit) constant.*/ |
RyoheiHagimoto | 0:56c5742b9e2b | 35 | #define QR_ILOG(_v) ((int)QR_ILOG4((unsigned)(_v))) |
RyoheiHagimoto | 0:56c5742b9e2b | 36 | |
RyoheiHagimoto | 0:56c5742b9e2b | 37 | /*Multiplies 32-bit numbers _a and _b, adds (possibly 64-bit) number _r, and |
RyoheiHagimoto | 0:56c5742b9e2b | 38 | takes bits [_s,_s+31] of the result.*/ |
RyoheiHagimoto | 0:56c5742b9e2b | 39 | #define QR_FIXMUL(_a,_b,_r,_s) ((int)((_a)*(long long)(_b)+(_r)>>(_s))) |
RyoheiHagimoto | 0:56c5742b9e2b | 40 | /*Multiplies 32-bit numbers _a and _b, adds (possibly 64-bit) number _r, and |
RyoheiHagimoto | 0:56c5742b9e2b | 41 | gives all 64 bits of the result.*/ |
RyoheiHagimoto | 0:56c5742b9e2b | 42 | #define QR_EXTMUL(_a,_b,_r) ((_a)*(long long)(_b)+(_r)) |
RyoheiHagimoto | 0:56c5742b9e2b | 43 | |
RyoheiHagimoto | 0:56c5742b9e2b | 44 | unsigned qr_isqrt(unsigned _val); |
RyoheiHagimoto | 0:56c5742b9e2b | 45 | unsigned qr_ihypot(int _x,int _y); |
RyoheiHagimoto | 0:56c5742b9e2b | 46 | int qr_ilog(unsigned _val); |
RyoheiHagimoto | 0:56c5742b9e2b | 47 | |
RyoheiHagimoto | 0:56c5742b9e2b | 48 | #endif |
RyoheiHagimoto | 0:56c5742b9e2b | 49 |