Repository: bingoogolapple/BGAQRCode-Android
Branch: master
Commit: 20390b2a58c5
Files: 1186
Total size: 21.4 MB
Directory structure:
gitextract_u2lb475g/
├── .gitignore
├── README.md
├── assembleDebug.sh
├── build.gradle
├── gradle/
│ └── wrapper/
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── qrcodecore/
│ ├── build.gradle
│ └── src/
│ └── main/
│ ├── AndroidManifest.xml
│ ├── java/
│ │ └── cn/
│ │ └── bingoogolapple/
│ │ └── qrcode/
│ │ └── core/
│ │ ├── BGAQRCodeUtil.java
│ │ ├── BarcodeType.java
│ │ ├── CameraConfigurationManager.java
│ │ ├── CameraPreview.java
│ │ ├── ProcessDataTask.java
│ │ ├── QRCodeView.java
│ │ ├── ScanBoxView.java
│ │ └── ScanResult.java
│ └── res/
│ └── values/
│ ├── attrs.xml
│ └── ids.xml
├── settings.gradle
├── zbar/
│ ├── build.gradle
│ ├── consumer-proguard-rules.pro
│ └── src/
│ └── main/
│ ├── AndroidManifest.xml
│ ├── java/
│ │ ├── cn/
│ │ │ └── bingoogolapple/
│ │ │ └── qrcode/
│ │ │ └── zbar/
│ │ │ ├── BarcodeFormat.java
│ │ │ └── ZBarView.java
│ │ └── net/
│ │ └── sourceforge/
│ │ └── zbar/
│ │ ├── Config.java
│ │ ├── Image.java
│ │ ├── ImageScanner.java
│ │ ├── Modifier.java
│ │ ├── Orientation.java
│ │ ├── Symbol.java
│ │ ├── SymbolIterator.java
│ │ └── SymbolSet.java
│ └── jni/
│ ├── Android.mk
│ ├── Application.mk
│ ├── config.h
│ ├── include/
│ │ ├── Makefile.am.inc
│ │ ├── zbar/
│ │ │ ├── Decoder.h
│ │ │ ├── Exception.h
│ │ │ ├── Image.h
│ │ │ ├── ImageScanner.h
│ │ │ ├── Processor.h
│ │ │ ├── QZBar.h
│ │ │ ├── QZBarImage.h
│ │ │ ├── Scanner.h
│ │ │ ├── Symbol.h
│ │ │ ├── Video.h
│ │ │ ├── Window.h
│ │ │ └── zbargtk.h
│ │ └── zbar.h
│ ├── libiconv-1.15/
│ │ ├── ABOUT-NLS
│ │ ├── AUTHORS
│ │ ├── COPYING
│ │ ├── COPYING.LIB
│ │ ├── ChangeLog
│ │ ├── DEPENDENCIES
│ │ ├── DESIGN
│ │ ├── HACKING
│ │ ├── INSTALL.generic
│ │ ├── Makefile
│ │ ├── Makefile.devel
│ │ ├── Makefile.in
│ │ ├── NEWS
│ │ ├── NOTES
│ │ ├── README
│ │ ├── README.djgpp
│ │ ├── README.windows
│ │ ├── THANKS
│ │ ├── aclocal.m4
│ │ ├── build-aux/
│ │ │ ├── ar-lib
│ │ │ ├── compile
│ │ │ ├── config.guess
│ │ │ ├── config.libpath
│ │ │ ├── config.rpath
│ │ │ ├── config.sub
│ │ │ ├── install-reloc
│ │ │ ├── install-sh
│ │ │ ├── ltmain.sh
│ │ │ ├── missing
│ │ │ ├── mkinstalldirs
│ │ │ ├── reloc-ldflags
│ │ │ └── snippet/
│ │ │ ├── _Noreturn.h
│ │ │ ├── arg-nonnull.h
│ │ │ ├── c++defs.h
│ │ │ └── warn-on-use.h
│ │ ├── config.h
│ │ ├── config.h.in
│ │ ├── config.status
│ │ ├── configure
│ │ ├── configure.ac
│ │ ├── djgpp/
│ │ │ ├── Makefile.maint
│ │ │ ├── README
│ │ │ ├── README.in
│ │ │ ├── config.bat
│ │ │ ├── config.sed
│ │ │ ├── config.site
│ │ │ ├── edtest.bat
│ │ │ ├── fnchange.in
│ │ │ ├── fnchange.lst
│ │ │ ├── makefile.sed
│ │ │ ├── sources.sed
│ │ │ ├── stateful-check.sed
│ │ │ ├── stateless-check.sed
│ │ │ └── translit-check.sed
│ │ ├── doc/
│ │ │ └── relocatable.texi
│ │ ├── extras/
│ │ │ ├── ChangeLog
│ │ │ ├── iconv_string.c
│ │ │ └── iconv_string.h
│ │ ├── gnulib-local/
│ │ │ ├── lib/
│ │ │ │ ├── alloca.in.h
│ │ │ │ ├── error.h.diff
│ │ │ │ ├── progname.h.diff
│ │ │ │ ├── xalloc.h
│ │ │ │ ├── xmalloc.c
│ │ │ │ └── xstrdup.c
│ │ │ ├── m4/
│ │ │ │ └── alloca.m4
│ │ │ └── modules/
│ │ │ ├── libiconv-misc
│ │ │ ├── mbstate
│ │ │ └── xalloc
│ │ ├── include/
│ │ │ ├── export.h
│ │ │ ├── iconv.h
│ │ │ ├── iconv.h.build.in
│ │ │ ├── iconv.h.in
│ │ │ └── iconv.h.inst
│ │ ├── lib/
│ │ │ ├── .libs/
│ │ │ │ ├── iconv.o
│ │ │ │ ├── libiconv.lai
│ │ │ │ ├── localcharset.o
│ │ │ │ └── relocatable.o
│ │ │ ├── Makefile
│ │ │ ├── Makefile.in
│ │ │ ├── aliases.gperf
│ │ │ ├── aliases.h
│ │ │ ├── aliases2.h
│ │ │ ├── aliases_aix.h
│ │ │ ├── aliases_aix_sysaix.h
│ │ │ ├── aliases_dos.h
│ │ │ ├── aliases_extra.h
│ │ │ ├── aliases_osf1.h
│ │ │ ├── aliases_osf1_sysosf1.h
│ │ │ ├── aliases_sysaix.gperf
│ │ │ ├── aliases_sysaix.h
│ │ │ ├── aliases_syshpux.gperf
│ │ │ ├── aliases_syshpux.h
│ │ │ ├── aliases_sysosf1.gperf
│ │ │ ├── aliases_sysosf1.h
│ │ │ ├── aliases_syssolaris.gperf
│ │ │ ├── aliases_syssolaris.h
│ │ │ ├── armscii_8.h
│ │ │ ├── ascii.h
│ │ │ ├── atarist.h
│ │ │ ├── big5.h
│ │ │ ├── big5_2003.h
│ │ │ ├── big5hkscs1999.h
│ │ │ ├── big5hkscs2001.h
│ │ │ ├── big5hkscs2004.h
│ │ │ ├── big5hkscs2008.h
│ │ │ ├── c99.h
│ │ │ ├── canonical.h
│ │ │ ├── canonical_aix.h
│ │ │ ├── canonical_aix_sysaix.h
│ │ │ ├── canonical_dos.h
│ │ │ ├── canonical_extra.h
│ │ │ ├── canonical_local.h
│ │ │ ├── canonical_local_sysaix.h
│ │ │ ├── canonical_local_syshpux.h
│ │ │ ├── canonical_local_sysosf1.h
│ │ │ ├── canonical_local_syssolaris.h
│ │ │ ├── canonical_osf1.h
│ │ │ ├── canonical_osf1_sysosf1.h
│ │ │ ├── canonical_sysaix.h
│ │ │ ├── canonical_syshpux.h
│ │ │ ├── canonical_sysosf1.h
│ │ │ ├── canonical_syssolaris.h
│ │ │ ├── ces_big5.h
│ │ │ ├── ces_gbk.h
│ │ │ ├── charset.alias
│ │ │ ├── cjk_variants.h
│ │ │ ├── cns11643.h
│ │ │ ├── cns11643_1.h
│ │ │ ├── cns11643_15.h
│ │ │ ├── cns11643_2.h
│ │ │ ├── cns11643_3.h
│ │ │ ├── cns11643_4.h
│ │ │ ├── cns11643_4a.h
│ │ │ ├── cns11643_4b.h
│ │ │ ├── cns11643_5.h
│ │ │ ├── cns11643_6.h
│ │ │ ├── cns11643_7.h
│ │ │ ├── cns11643_inv.h
│ │ │ ├── config.h
│ │ │ ├── config.h.in
│ │ │ ├── converters.h
│ │ │ ├── cp1046.h
│ │ │ ├── cp1124.h
│ │ │ ├── cp1125.h
│ │ │ ├── cp1129.h
│ │ │ ├── cp1131.h
│ │ │ ├── cp1133.h
│ │ │ ├── cp1161.h
│ │ │ ├── cp1162.h
│ │ │ ├── cp1163.h
│ │ │ ├── cp1250.h
│ │ │ ├── cp1251.h
│ │ │ ├── cp1252.h
│ │ │ ├── cp1253.h
│ │ │ ├── cp1254.h
│ │ │ ├── cp1255.h
│ │ │ ├── cp1256.h
│ │ │ ├── cp1257.h
│ │ │ ├── cp1258.h
│ │ │ ├── cp437.h
│ │ │ ├── cp50221_0208_ext.h
│ │ │ ├── cp50221_0212_ext.h
│ │ │ ├── cp737.h
│ │ │ ├── cp775.h
│ │ │ ├── cp850.h
│ │ │ ├── cp852.h
│ │ │ ├── cp853.h
│ │ │ ├── cp855.h
│ │ │ ├── cp856.h
│ │ │ ├── cp857.h
│ │ │ ├── cp858.h
│ │ │ ├── cp860.h
│ │ │ ├── cp861.h
│ │ │ ├── cp862.h
│ │ │ ├── cp863.h
│ │ │ ├── cp864.h
│ │ │ ├── cp865.h
│ │ │ ├── cp866.h
│ │ │ ├── cp869.h
│ │ │ ├── cp874.h
│ │ │ ├── cp922.h
│ │ │ ├── cp932.h
│ │ │ ├── cp932ext.h
│ │ │ ├── cp936.h
│ │ │ ├── cp936ext.h
│ │ │ ├── cp943.h
│ │ │ ├── cp949.h
│ │ │ ├── cp950.h
│ │ │ ├── cp950ext.h
│ │ │ ├── dec_hanyu.h
│ │ │ ├── dec_kanji.h
│ │ │ ├── encodings.def
│ │ │ ├── encodings_aix.def
│ │ │ ├── encodings_dos.def
│ │ │ ├── encodings_extra.def
│ │ │ ├── encodings_local.def
│ │ │ ├── encodings_osf1.def
│ │ │ ├── euc_cn.h
│ │ │ ├── euc_jisx0213.h
│ │ │ ├── euc_jp.h
│ │ │ ├── euc_kr.h
│ │ │ ├── euc_tw.h
│ │ │ ├── flags.h
│ │ │ ├── flushwc.h
│ │ │ ├── gb12345.h
│ │ │ ├── gb12345ext.h
│ │ │ ├── gb18030.h
│ │ │ ├── gb18030ext.h
│ │ │ ├── gb18030uni.h
│ │ │ ├── gb2312.h
│ │ │ ├── gbk.h
│ │ │ ├── gbkext1.h
│ │ │ ├── gbkext2.h
│ │ │ ├── gbkext_inv.h
│ │ │ ├── genaliases.c
│ │ │ ├── genaliases2.c
│ │ │ ├── genflags.c
│ │ │ ├── gentranslit.c
│ │ │ ├── georgian_academy.h
│ │ │ ├── georgian_ps.h
│ │ │ ├── hkscs1999.h
│ │ │ ├── hkscs2001.h
│ │ │ ├── hkscs2004.h
│ │ │ ├── hkscs2008.h
│ │ │ ├── hp_roman8.h
│ │ │ ├── hz.h
│ │ │ ├── iconv.c
│ │ │ ├── iconv.lo
│ │ │ ├── iconv_open1.h
│ │ │ ├── iconv_open2.h
│ │ │ ├── iso2022_cn.h
│ │ │ ├── iso2022_cnext.h
│ │ │ ├── iso2022_jp.h
│ │ │ ├── iso2022_jp1.h
│ │ │ ├── iso2022_jp2.h
│ │ │ ├── iso2022_jp3.h
│ │ │ ├── iso2022_jpms.h
│ │ │ ├── iso2022_kr.h
│ │ │ ├── iso646_cn.h
│ │ │ ├── iso646_jp.h
│ │ │ ├── iso8859_1.h
│ │ │ ├── iso8859_10.h
│ │ │ ├── iso8859_11.h
│ │ │ ├── iso8859_13.h
│ │ │ ├── iso8859_14.h
│ │ │ ├── iso8859_15.h
│ │ │ ├── iso8859_16.h
│ │ │ ├── iso8859_2.h
│ │ │ ├── iso8859_3.h
│ │ │ ├── iso8859_4.h
│ │ │ ├── iso8859_5.h
│ │ │ ├── iso8859_6.h
│ │ │ ├── iso8859_7.h
│ │ │ ├── iso8859_8.h
│ │ │ ├── iso8859_9.h
│ │ │ ├── isoir165.h
│ │ │ ├── isoir165ext.h
│ │ │ ├── java.h
│ │ │ ├── jisx0201.h
│ │ │ ├── jisx0208.h
│ │ │ ├── jisx0212.h
│ │ │ ├── jisx0213.h
│ │ │ ├── johab.h
│ │ │ ├── johab_hangul.h
│ │ │ ├── koi8_r.h
│ │ │ ├── koi8_ru.h
│ │ │ ├── koi8_t.h
│ │ │ ├── koi8_u.h
│ │ │ ├── ksc5601.h
│ │ │ ├── libcharset.a
│ │ │ ├── libcharset.h
│ │ │ ├── libcharset.la
│ │ │ ├── libiconv.la
│ │ │ ├── localcharset.h
│ │ │ ├── localcharset.lo
│ │ │ ├── loop_unicode.h
│ │ │ ├── loop_wchar.h
│ │ │ ├── loops.h
│ │ │ ├── mac_arabic.h
│ │ │ ├── mac_centraleurope.h
│ │ │ ├── mac_croatian.h
│ │ │ ├── mac_cyrillic.h
│ │ │ ├── mac_greek.h
│ │ │ ├── mac_hebrew.h
│ │ │ ├── mac_iceland.h
│ │ │ ├── mac_roman.h
│ │ │ ├── mac_romania.h
│ │ │ ├── mac_thai.h
│ │ │ ├── mac_turkish.h
│ │ │ ├── mac_ukraine.h
│ │ │ ├── mulelao.h
│ │ │ ├── nextstep.h
│ │ │ ├── pt154.h
│ │ │ ├── relocatable.c
│ │ │ ├── relocatable.h
│ │ │ ├── relocatable.lo
│ │ │ ├── riscos1.h
│ │ │ ├── rk1048.h
│ │ │ ├── shift_jisx0213.h
│ │ │ ├── sjis.h
│ │ │ ├── stamp-h2
│ │ │ ├── tcvn.h
│ │ │ ├── tds565.h
│ │ │ ├── tis620.h
│ │ │ ├── translit.def
│ │ │ ├── translit.h
│ │ │ ├── ucs2.h
│ │ │ ├── ucs2be.h
│ │ │ ├── ucs2internal.h
│ │ │ ├── ucs2le.h
│ │ │ ├── ucs2swapped.h
│ │ │ ├── ucs4.h
│ │ │ ├── ucs4be.h
│ │ │ ├── ucs4internal.h
│ │ │ ├── ucs4le.h
│ │ │ ├── ucs4swapped.h
│ │ │ ├── uhc_1.h
│ │ │ ├── uhc_2.h
│ │ │ ├── utf16.h
│ │ │ ├── utf16be.h
│ │ │ ├── utf16le.h
│ │ │ ├── utf32.h
│ │ │ ├── utf32be.h
│ │ │ ├── utf32le.h
│ │ │ ├── utf7.h
│ │ │ ├── utf8.h
│ │ │ ├── vietcomb.h
│ │ │ └── viscii.h
│ │ ├── libcharset/
│ │ │ ├── AUTHORS
│ │ │ ├── COPYING.LIB
│ │ │ ├── ChangeLog
│ │ │ ├── DEPENDENCIES
│ │ │ ├── HACKING
│ │ │ ├── INSTALL.generic
│ │ │ ├── INTEGRATE
│ │ │ ├── Makefile
│ │ │ ├── Makefile.devel
│ │ │ ├── Makefile.in
│ │ │ ├── NEWS
│ │ │ ├── README
│ │ │ ├── README.djgpp
│ │ │ ├── README.windows
│ │ │ ├── autoconf/
│ │ │ │ └── aclocal.m4
│ │ │ ├── build-aux/
│ │ │ │ ├── config.guess
│ │ │ │ ├── config.libpath
│ │ │ │ ├── config.sub
│ │ │ │ ├── install-sh
│ │ │ │ ├── ltmain.sh
│ │ │ │ └── mkinstalldirs
│ │ │ ├── config.h
│ │ │ ├── config.h.in
│ │ │ ├── config.status
│ │ │ ├── configure
│ │ │ ├── configure.ac
│ │ │ ├── djgpp/
│ │ │ │ ├── Makefile.maint
│ │ │ │ ├── README
│ │ │ │ ├── README.in
│ │ │ │ ├── config.bat
│ │ │ │ ├── config.sed
│ │ │ │ ├── config.site
│ │ │ │ ├── fnchange.in
│ │ │ │ └── fnchange.lst
│ │ │ ├── include/
│ │ │ │ ├── export.h
│ │ │ │ ├── libcharset.h
│ │ │ │ ├── libcharset.h.in
│ │ │ │ ├── localcharset.h
│ │ │ │ ├── localcharset.h.build.in
│ │ │ │ ├── localcharset.h.in
│ │ │ │ └── localcharset.h.inst
│ │ │ ├── lib/
│ │ │ │ ├── .libs/
│ │ │ │ │ ├── libcharset.a
│ │ │ │ │ ├── libcharset.lai
│ │ │ │ │ ├── localcharset.o
│ │ │ │ │ └── relocatable.o
│ │ │ │ ├── ChangeLog
│ │ │ │ ├── Makefile
│ │ │ │ ├── Makefile.in
│ │ │ │ ├── charset.alias
│ │ │ │ ├── config.charset
│ │ │ │ ├── libcharset.la
│ │ │ │ ├── localcharset.c
│ │ │ │ ├── localcharset.lo
│ │ │ │ ├── localcharset.o
│ │ │ │ ├── ref-add.sed
│ │ │ │ ├── ref-add.sin
│ │ │ │ ├── ref-del.sed
│ │ │ │ ├── ref-del.sin
│ │ │ │ ├── relocatable.c
│ │ │ │ ├── relocatable.h
│ │ │ │ ├── relocatable.lo
│ │ │ │ └── relocatable.o
│ │ │ ├── libtool
│ │ │ ├── m4/
│ │ │ │ ├── codeset.m4
│ │ │ │ ├── fcntl-o.m4
│ │ │ │ ├── glibc21.m4
│ │ │ │ ├── libtool.m4
│ │ │ │ ├── ltoptions.m4
│ │ │ │ ├── ltsugar.m4
│ │ │ │ ├── ltversion.m4
│ │ │ │ ├── lt~obsolete.m4
│ │ │ │ ├── relocatable-lib.m4
│ │ │ │ └── visibility.m4
│ │ │ └── tools/
│ │ │ ├── README
│ │ │ ├── aix-3.2.5
│ │ │ ├── aix-4.1.5
│ │ │ ├── aix-4.2.0
│ │ │ ├── aix-4.3.2
│ │ │ ├── all-charsets
│ │ │ ├── all-charsets-X11
│ │ │ ├── all-locales
│ │ │ ├── beos-5
│ │ │ ├── cygwin-1.7.2
│ │ │ ├── darwin-6.8
│ │ │ ├── darwin-7.5
│ │ │ ├── darwin-9.5
│ │ │ ├── freebsd-3.3
│ │ │ ├── glibc-2.1.3
│ │ │ ├── glibc-2.1.90
│ │ │ ├── glibc-2.2
│ │ │ ├── glibc-2.2-XF86-3.3.6
│ │ │ ├── glibc-2.2-XF86-4.0.1f
│ │ │ ├── hpux-10.01
│ │ │ ├── hpux-10.20
│ │ │ ├── hpux-11.00
│ │ │ ├── irix-6.5
│ │ │ ├── locale_charmap
│ │ │ ├── locale_charset.c
│ │ │ ├── locale_codeset.c
│ │ │ ├── locale_monthnames.c
│ │ │ ├── locale_x11encoding.c
│ │ │ ├── netbsd-3.0
│ │ │ ├── openbsd-4.1
│ │ │ ├── osf1-4.0a
│ │ │ ├── osf1-4.0d
│ │ │ ├── osf1-5.1
│ │ │ ├── solaris-2.4
│ │ │ ├── solaris-2.5.1
│ │ │ ├── solaris-2.6
│ │ │ ├── solaris-2.6-cjk
│ │ │ ├── solaris-2.7
│ │ │ ├── sunos-4.1.4
│ │ │ └── win32
│ │ ├── libtool
│ │ ├── m4/
│ │ │ ├── cp.m4
│ │ │ ├── eilseq.m4
│ │ │ ├── endian.m4
│ │ │ ├── general.m4
│ │ │ ├── libtool.m4
│ │ │ ├── ln.m4
│ │ │ ├── ltoptions.m4
│ │ │ ├── ltsugar.m4
│ │ │ ├── ltversion.m4
│ │ │ ├── lt~obsolete.m4
│ │ │ └── proto.m4
│ │ ├── man/
│ │ │ ├── Makefile
│ │ │ ├── Makefile.in
│ │ │ ├── iconv.1
│ │ │ ├── iconv.1.html
│ │ │ ├── iconv.3
│ │ │ ├── iconv.3.html
│ │ │ ├── iconv_close.3
│ │ │ ├── iconv_close.3.html
│ │ │ ├── iconv_open.3
│ │ │ ├── iconv_open.3.html
│ │ │ ├── iconv_open_into.3
│ │ │ ├── iconv_open_into.3.html
│ │ │ ├── iconvctl.3
│ │ │ └── iconvctl.3.html
│ │ ├── os2/
│ │ │ └── iconv.def
│ │ ├── po/
│ │ │ ├── ChangeLog
│ │ │ ├── LINGUAS
│ │ │ ├── Makefile
│ │ │ ├── Makefile.in
│ │ │ ├── Makefile.in.in
│ │ │ ├── Makevars
│ │ │ ├── POTFILES
│ │ │ ├── POTFILES.in
│ │ │ ├── Rules-quot
│ │ │ ├── af.gmo
│ │ │ ├── af.po
│ │ │ ├── bg.gmo
│ │ │ ├── bg.po
│ │ │ ├── boldquot.sed
│ │ │ ├── ca.gmo
│ │ │ ├── ca.po
│ │ │ ├── cs.gmo
│ │ │ ├── cs.po
│ │ │ ├── da.gmo
│ │ │ ├── da.po
│ │ │ ├── de.gmo
│ │ │ ├── de.po
│ │ │ ├── el.gmo
│ │ │ ├── el.po
│ │ │ ├── en@boldquot.header
│ │ │ ├── en@quot.header
│ │ │ ├── eo.gmo
│ │ │ ├── eo.po
│ │ │ ├── es.gmo
│ │ │ ├── es.po
│ │ │ ├── et.gmo
│ │ │ ├── et.po
│ │ │ ├── fi.gmo
│ │ │ ├── fi.po
│ │ │ ├── fr.gmo
│ │ │ ├── fr.po
│ │ │ ├── ga.gmo
│ │ │ ├── ga.po
│ │ │ ├── gl.gmo
│ │ │ ├── gl.po
│ │ │ ├── hr.gmo
│ │ │ ├── hr.po
│ │ │ ├── hu.gmo
│ │ │ ├── hu.po
│ │ │ ├── id.gmo
│ │ │ ├── id.po
│ │ │ ├── insert-header.sin
│ │ │ ├── it.gmo
│ │ │ ├── it.po
│ │ │ ├── ja.gmo
│ │ │ ├── ja.po
│ │ │ ├── libiconv.pot
│ │ │ ├── nl.gmo
│ │ │ ├── nl.po
│ │ │ ├── pl.gmo
│ │ │ ├── pl.po
│ │ │ ├── pt_BR.gmo
│ │ │ ├── pt_BR.po
│ │ │ ├── quot.sed
│ │ │ ├── remove-potcdate.sin
│ │ │ ├── rm.gmo
│ │ │ ├── rm.po
│ │ │ ├── ro.gmo
│ │ │ ├── ro.po
│ │ │ ├── ru.gmo
│ │ │ ├── ru.po
│ │ │ ├── sk.gmo
│ │ │ ├── sk.po
│ │ │ ├── sl.gmo
│ │ │ ├── sl.po
│ │ │ ├── sq.gmo
│ │ │ ├── sq.po
│ │ │ ├── sr.gmo
│ │ │ ├── sr.po
│ │ │ ├── stamp-po
│ │ │ ├── sv.gmo
│ │ │ ├── sv.po
│ │ │ ├── tr.gmo
│ │ │ ├── tr.po
│ │ │ ├── uk.gmo
│ │ │ ├── uk.po
│ │ │ ├── vi.gmo
│ │ │ ├── vi.po
│ │ │ ├── wa.gmo
│ │ │ ├── wa.po
│ │ │ ├── zh_CN.gmo
│ │ │ ├── zh_CN.po
│ │ │ ├── zh_TW.gmo
│ │ │ └── zh_TW.po
│ │ ├── preload/
│ │ │ ├── Makefile
│ │ │ ├── Makefile.devel
│ │ │ ├── Makefile.in
│ │ │ ├── aclocal.m4
│ │ │ ├── config.status
│ │ │ ├── configure
│ │ │ ├── configure.ac
│ │ │ └── libtool
│ │ ├── src/
│ │ │ ├── .libs/
│ │ │ │ └── iconv_no_i18n
│ │ │ ├── Makefile
│ │ │ ├── Makefile.in
│ │ │ ├── iconv.c
│ │ │ ├── iconv.o
│ │ │ ├── iconv_no_i18n
│ │ │ ├── iconv_no_i18n.c
│ │ │ └── iconv_no_i18n.o
│ │ ├── srclib/
│ │ │ ├── Makefile
│ │ │ ├── Makefile.am
│ │ │ ├── Makefile.gnulib
│ │ │ ├── Makefile.in
│ │ │ ├── alloca.h
│ │ │ ├── alloca.in.h
│ │ │ ├── allocator.c
│ │ │ ├── allocator.h
│ │ │ ├── allocator.o
│ │ │ ├── areadlink.c
│ │ │ ├── areadlink.h
│ │ │ ├── areadlink.o
│ │ │ ├── arg-nonnull.h
│ │ │ ├── basename-lgpl.c
│ │ │ ├── basename-lgpl.o
│ │ │ ├── binary-io.c
│ │ │ ├── binary-io.h
│ │ │ ├── binary-io.o
│ │ │ ├── c++defs.h
│ │ │ ├── c-ctype.c
│ │ │ ├── c-ctype.h
│ │ │ ├── canonicalize-lgpl.c
│ │ │ ├── canonicalize-lgpl.o
│ │ │ ├── careadlinkat.c
│ │ │ ├── careadlinkat.h
│ │ │ ├── careadlinkat.o
│ │ │ ├── dirname-lgpl.c
│ │ │ ├── dirname-lgpl.o
│ │ │ ├── dirname.h
│ │ │ ├── dosname.h
│ │ │ ├── errno.in.h
│ │ │ ├── error.c
│ │ │ ├── error.h
│ │ │ ├── error.o
│ │ │ ├── fcntl.h
│ │ │ ├── fcntl.in.h
│ │ │ ├── getprogname.c
│ │ │ ├── getprogname.h
│ │ │ ├── getprogname.o
│ │ │ ├── gettext.h
│ │ │ ├── gettimeofday.c
│ │ │ ├── intprops.h
│ │ │ ├── libicrt.a
│ │ │ ├── limits.h
│ │ │ ├── limits.in.h
│ │ │ ├── localcharset.h
│ │ │ ├── lstat.c
│ │ │ ├── lstat.o
│ │ │ ├── malloc.c
│ │ │ ├── malloca.c
│ │ │ ├── malloca.h
│ │ │ ├── malloca.o
│ │ │ ├── malloca.valgrind
│ │ │ ├── msvc-inval.c
│ │ │ ├── msvc-inval.h
│ │ │ ├── msvc-nothrow.c
│ │ │ ├── msvc-nothrow.h
│ │ │ ├── pathmax.h
│ │ │ ├── progname.c
│ │ │ ├── progname.h
│ │ │ ├── progname.o
│ │ │ ├── progreloc.c
│ │ │ ├── raise.c
│ │ │ ├── read.c
│ │ │ ├── readlink.c
│ │ │ ├── readlink.o
│ │ │ ├── relocatable.c
│ │ │ ├── relocatable.h
│ │ │ ├── relocwrapper.c
│ │ │ ├── safe-read.c
│ │ │ ├── safe-read.h
│ │ │ ├── safe-read.o
│ │ │ ├── setenv.c
│ │ │ ├── signal.h
│ │ │ ├── signal.in.h
│ │ │ ├── sigprocmask.c
│ │ │ ├── stat.c
│ │ │ ├── stat.o
│ │ │ ├── stdbool.in.h
│ │ │ ├── stddef.in.h
│ │ │ ├── stdint.h
│ │ │ ├── stdint.in.h
│ │ │ ├── stdio-write.c
│ │ │ ├── stdio.h
│ │ │ ├── stdio.in.h
│ │ │ ├── stdlib.h
│ │ │ ├── stdlib.in.h
│ │ │ ├── streq.h
│ │ │ ├── strerror-override.c
│ │ │ ├── strerror-override.h
│ │ │ ├── strerror-override.o
│ │ │ ├── strerror.c
│ │ │ ├── strerror.o
│ │ │ ├── string.h
│ │ │ ├── string.in.h
│ │ │ ├── stripslash.c
│ │ │ ├── stripslash.o
│ │ │ ├── sys/
│ │ │ │ ├── stat.h
│ │ │ │ ├── time.h
│ │ │ │ └── types.h
│ │ │ ├── sys_stat.in.h
│ │ │ ├── sys_time.in.h
│ │ │ ├── sys_types.in.h
│ │ │ ├── time.h
│ │ │ ├── time.in.h
│ │ │ ├── unistd.c
│ │ │ ├── unistd.h
│ │ │ ├── unistd.in.h
│ │ │ ├── unistd.o
│ │ │ ├── unitypes.h
│ │ │ ├── unitypes.in.h
│ │ │ ├── uniwidth/
│ │ │ │ ├── .dirstamp
│ │ │ │ ├── cjk.h
│ │ │ │ ├── width.c
│ │ │ │ └── width.o
│ │ │ ├── uniwidth.h
│ │ │ ├── uniwidth.in.h
│ │ │ ├── unlocked-io.h
│ │ │ ├── verify.h
│ │ │ ├── warn-on-use.h
│ │ │ ├── xalloc-oversized.h
│ │ │ ├── xalloc.h
│ │ │ ├── xmalloc.c
│ │ │ ├── xmalloc.o
│ │ │ ├── xreadlink.c
│ │ │ ├── xreadlink.h
│ │ │ ├── xreadlink.o
│ │ │ ├── xstrdup.c
│ │ │ └── xstrdup.o
│ │ ├── srcm4/
│ │ │ ├── 00gnulib.m4
│ │ │ ├── absolute-header.m4
│ │ │ ├── alloca.m4
│ │ │ ├── asm-underscore.m4
│ │ │ ├── canonicalize.m4
│ │ │ ├── codeset.m4
│ │ │ ├── dirname.m4
│ │ │ ├── double-slash-root.m4
│ │ │ ├── eealloc.m4
│ │ │ ├── environ.m4
│ │ │ ├── errno_h.m4
│ │ │ ├── error.m4
│ │ │ ├── extensions.m4
│ │ │ ├── extern-inline.m4
│ │ │ ├── fcntl-o.m4
│ │ │ ├── fcntl_h.m4
│ │ │ ├── getprogname.m4
│ │ │ ├── gettext.m4
│ │ │ ├── gettimeofday.m4
│ │ │ ├── glibc2.m4
│ │ │ ├── glibc21.m4
│ │ │ ├── gnulib-cache.m4
│ │ │ ├── gnulib-common.m4
│ │ │ ├── gnulib-comp.m4
│ │ │ ├── gnulib-tool.m4
│ │ │ ├── iconv.m4
│ │ │ ├── include_next.m4
│ │ │ ├── intdiv0.m4
│ │ │ ├── intl.m4
│ │ │ ├── intldir.m4
│ │ │ ├── intlmacosx.m4
│ │ │ ├── intmax.m4
│ │ │ ├── inttypes-pri.m4
│ │ │ ├── inttypes_h.m4
│ │ │ ├── largefile.m4
│ │ │ ├── lcmessage.m4
│ │ │ ├── lib-ld.m4
│ │ │ ├── lib-link.m4
│ │ │ ├── lib-prefix.m4
│ │ │ ├── libunistring-base.m4
│ │ │ ├── limits-h.m4
│ │ │ ├── lock.m4
│ │ │ ├── longlong.m4
│ │ │ ├── lstat.m4
│ │ │ ├── malloc.m4
│ │ │ ├── malloca.m4
│ │ │ ├── mbstate_t.m4
│ │ │ ├── msvc-inval.m4
│ │ │ ├── msvc-nothrow.m4
│ │ │ ├── multiarch.m4
│ │ │ ├── nls.m4
│ │ │ ├── nocrash.m4
│ │ │ ├── off_t.m4
│ │ │ ├── pathmax.m4
│ │ │ ├── po.m4
│ │ │ ├── printf-posix.m4
│ │ │ ├── progtest.m4
│ │ │ ├── raise.m4
│ │ │ ├── read.m4
│ │ │ ├── readlink.m4
│ │ │ ├── relocatable-lib.m4
│ │ │ ├── relocatable.m4
│ │ │ ├── safe-read.m4
│ │ │ ├── setenv.m4
│ │ │ ├── signal_h.m4
│ │ │ ├── signalblocking.m4
│ │ │ ├── sigpipe.m4
│ │ │ ├── size_max.m4
│ │ │ ├── ssize_t.m4
│ │ │ ├── stat.m4
│ │ │ ├── stdbool.m4
│ │ │ ├── stddef_h.m4
│ │ │ ├── stdint.m4
│ │ │ ├── stdint_h.m4
│ │ │ ├── stdio_h.m4
│ │ │ ├── stdlib_h.m4
│ │ │ ├── strerror.m4
│ │ │ ├── string_h.m4
│ │ │ ├── sys_socket_h.m4
│ │ │ ├── sys_stat_h.m4
│ │ │ ├── sys_time_h.m4
│ │ │ ├── sys_types_h.m4
│ │ │ ├── threadlib.m4
│ │ │ ├── time_h.m4
│ │ │ ├── uintmax_t.m4
│ │ │ ├── unistd_h.m4
│ │ │ ├── unlocked-io.m4
│ │ │ ├── visibility.m4
│ │ │ ├── warn-on-use.m4
│ │ │ ├── wchar_t.m4
│ │ │ ├── wint_t.m4
│ │ │ └── xsize.m4
│ │ ├── stamp-h1
│ │ ├── tests/
│ │ │ ├── ARMSCII-8.IRREVERSIBLE.TXT
│ │ │ ├── ARMSCII-8.TXT
│ │ │ ├── ASCII.TXT
│ │ │ ├── ATARIST.TXT
│ │ │ ├── BIG5-2003.IRREVERSIBLE.TXT
│ │ │ ├── BIG5-2003.TXT
│ │ │ ├── BIG5-HKSCS-1999-snippet
│ │ │ ├── BIG5-HKSCS-1999-snippet.UTF-8
│ │ │ ├── BIG5-HKSCS-1999.IRREVERSIBLE.TXT
│ │ │ ├── BIG5-HKSCS-1999.TXT
│ │ │ ├── BIG5-HKSCS-2001-snippet
│ │ │ ├── BIG5-HKSCS-2001-snippet.UTF-8
│ │ │ ├── BIG5-HKSCS-2001.IRREVERSIBLE.TXT
│ │ │ ├── BIG5-HKSCS-2001.TXT
│ │ │ ├── BIG5-HKSCS-2004-snippet
│ │ │ ├── BIG5-HKSCS-2004-snippet.UTF-8
│ │ │ ├── BIG5-HKSCS-2004.IRREVERSIBLE.TXT
│ │ │ ├── BIG5-HKSCS-2004.TXT
│ │ │ ├── BIG5-HKSCS-2008-snippet
│ │ │ ├── BIG5-HKSCS-2008-snippet.UTF-8
│ │ │ ├── BIG5-HKSCS-2008.IRREVERSIBLE.TXT
│ │ │ ├── BIG5-HKSCS-2008.TXT
│ │ │ ├── BIG5.TXT
│ │ │ ├── CP1046.TXT
│ │ │ ├── CP1124.TXT
│ │ │ ├── CP1125.TXT
│ │ │ ├── CP1129.TXT
│ │ │ ├── CP1131.TXT
│ │ │ ├── CP1133.TXT
│ │ │ ├── CP1161.IRREVERSIBLE.TXT
│ │ │ ├── CP1161.TXT
│ │ │ ├── CP1162.TXT
│ │ │ ├── CP1163.IRREVERSIBLE.TXT
│ │ │ ├── CP1163.TXT
│ │ │ ├── CP1250.TXT
│ │ │ ├── CP1251.TXT
│ │ │ ├── CP1252.TXT
│ │ │ ├── CP1253.TXT
│ │ │ ├── CP1254.TXT
│ │ │ ├── CP1255-snippet
│ │ │ ├── CP1255-snippet.UTF-8
│ │ │ ├── CP1255.IRREVERSIBLE.TXT
│ │ │ ├── CP1255.TXT
│ │ │ ├── CP1256.TXT
│ │ │ ├── CP1257.TXT
│ │ │ ├── CP1258-snippet
│ │ │ ├── CP1258-snippet.UTF-8
│ │ │ ├── CP1258.IRREVERSIBLE.TXT
│ │ │ ├── CP1258.TXT
│ │ │ ├── CP437.TXT
│ │ │ ├── CP737.TXT
│ │ │ ├── CP775.TXT
│ │ │ ├── CP850.TXT
│ │ │ ├── CP852.TXT
│ │ │ ├── CP853.TXT
│ │ │ ├── CP855.TXT
│ │ │ ├── CP856.TXT
│ │ │ ├── CP857.TXT
│ │ │ ├── CP858.TXT
│ │ │ ├── CP860.TXT
│ │ │ ├── CP861.TXT
│ │ │ ├── CP862.TXT
│ │ │ ├── CP863.TXT
│ │ │ ├── CP864.TXT
│ │ │ ├── CP865.TXT
│ │ │ ├── CP866.TXT
│ │ │ ├── CP869.TXT
│ │ │ ├── CP874.TXT
│ │ │ ├── CP922.TXT
│ │ │ ├── CP932.IRREVERSIBLE.TXT
│ │ │ ├── CP932.TXT
│ │ │ ├── CP936.TXT
│ │ │ ├── CP949.TXT
│ │ │ ├── CP950.IRREVERSIBLE.TXT
│ │ │ ├── CP950.TXT
│ │ │ ├── DEC-HANYU.IRREVERSIBLE.TXT
│ │ │ ├── DEC-HANYU.TXT
│ │ │ ├── DEC-KANJI.TXT
│ │ │ ├── EUC-CN.TXT
│ │ │ ├── EUC-JISX0213.TXT
│ │ │ ├── EUC-JP.IRREVERSIBLE.TXT
│ │ │ ├── EUC-JP.TXT
│ │ │ ├── EUC-KR.TXT
│ │ │ ├── EUC-TW.IRREVERSIBLE.TXT
│ │ │ ├── EUC-TW.TXT
│ │ │ ├── GB18030-BMP.TXT
│ │ │ ├── GB18030.IRREVERSIBLE.TXT
│ │ │ ├── GBK.TXT
│ │ │ ├── Georgian-Academy.TXT
│ │ │ ├── Georgian-PS.TXT
│ │ │ ├── HP-ROMAN8.TXT
│ │ │ ├── HZ-snippet
│ │ │ ├── HZ-snippet.UTF-8
│ │ │ ├── ISO-2022-CN-EXT-snippet
│ │ │ ├── ISO-2022-CN-EXT-snippet.UTF-8
│ │ │ ├── ISO-2022-CN-snippet
│ │ │ ├── ISO-2022-CN-snippet.UTF-8
│ │ │ ├── ISO-2022-JP-1-snippet
│ │ │ ├── ISO-2022-JP-1-snippet.UTF-8
│ │ │ ├── ISO-2022-JP-2-snippet
│ │ │ ├── ISO-2022-JP-2-snippet.UTF-8
│ │ │ ├── ISO-2022-JP-3-snippet
│ │ │ ├── ISO-2022-JP-3-snippet.UTF-8
│ │ │ ├── ISO-2022-JP-MS-snippet
│ │ │ ├── ISO-2022-JP-MS-snippet.UTF-8
│ │ │ ├── ISO-2022-JP-MS-snippet.alt
│ │ │ ├── ISO-2022-JP-snippet
│ │ │ ├── ISO-2022-JP-snippet.UTF-8
│ │ │ ├── ISO-2022-KR-snippet
│ │ │ ├── ISO-2022-KR-snippet.UTF-8
│ │ │ ├── ISO-8859-1.TXT
│ │ │ ├── ISO-8859-10.TXT
│ │ │ ├── ISO-8859-11.TXT
│ │ │ ├── ISO-8859-13.TXT
│ │ │ ├── ISO-8859-14.TXT
│ │ │ ├── ISO-8859-15.TXT
│ │ │ ├── ISO-8859-16.TXT
│ │ │ ├── ISO-8859-2.TXT
│ │ │ ├── ISO-8859-3.TXT
│ │ │ ├── ISO-8859-4.TXT
│ │ │ ├── ISO-8859-5.TXT
│ │ │ ├── ISO-8859-6.TXT
│ │ │ ├── ISO-8859-7.TXT
│ │ │ ├── ISO-8859-8.TXT
│ │ │ ├── ISO-8859-9.TXT
│ │ │ ├── ISO-IR-165.IRREVERSIBLE.TXT
│ │ │ ├── ISO-IR-165.TXT
│ │ │ ├── ISO646-CN.TXT
│ │ │ ├── ISO646-JP.TXT
│ │ │ ├── JIS_X0201.TXT
│ │ │ ├── JOHAB.TXT
│ │ │ ├── KOI8-R.TXT
│ │ │ ├── KOI8-RU.TXT
│ │ │ ├── KOI8-T.TXT
│ │ │ ├── KOI8-U.TXT
│ │ │ ├── MacArabic.TXT
│ │ │ ├── MacCentralEurope.TXT
│ │ │ ├── MacCroatian.TXT
│ │ │ ├── MacCyrillic.TXT
│ │ │ ├── MacGreek.TXT
│ │ │ ├── MacHebrew.TXT
│ │ │ ├── MacIceland.TXT
│ │ │ ├── MacRoman.TXT
│ │ │ ├── MacRomania.TXT
│ │ │ ├── MacThai.TXT
│ │ │ ├── MacTurkish.TXT
│ │ │ ├── MacUkraine.TXT
│ │ │ ├── Makefile
│ │ │ ├── Makefile.in
│ │ │ ├── MuleLao-1.TXT
│ │ │ ├── NEXTSTEP.TXT
│ │ │ ├── PT154.TXT
│ │ │ ├── Quotes.ASCII
│ │ │ ├── Quotes.ISO-8859-1
│ │ │ ├── Quotes.UTF-8
│ │ │ ├── RISCOS-LATIN1.TXT
│ │ │ ├── RK1048.TXT
│ │ │ ├── SHIFT_JIS.TXT
│ │ │ ├── SHIFT_JISX0213.TXT
│ │ │ ├── TCVN-snippet
│ │ │ ├── TCVN-snippet.UTF-8
│ │ │ ├── TCVN.IRREVERSIBLE.TXT
│ │ │ ├── TCVN.TXT
│ │ │ ├── TDS565.TXT
│ │ │ ├── TIS-620.TXT
│ │ │ ├── Translit1.ASCII
│ │ │ ├── Translit1.ISO-8859-1
│ │ │ ├── TranslitFail1.ISO-8859-1
│ │ │ ├── UCS-2BE-snippet
│ │ │ ├── UCS-2BE-snippet.UTF-8
│ │ │ ├── UCS-2LE-snippet
│ │ │ ├── UCS-2LE-snippet.UTF-8
│ │ │ ├── UCS-4BE-snippet
│ │ │ ├── UCS-4BE-snippet.UTF-8
│ │ │ ├── UCS-4LE-snippet
│ │ │ ├── UCS-4LE-snippet.UTF-8
│ │ │ ├── UTF-16-snippet
│ │ │ ├── UTF-16-snippet.UTF-8
│ │ │ ├── UTF-16BE-snippet
│ │ │ ├── UTF-16BE-snippet.UTF-8
│ │ │ ├── UTF-16LE-snippet
│ │ │ ├── UTF-16LE-snippet.UTF-8
│ │ │ ├── UTF-32-snippet
│ │ │ ├── UTF-32-snippet.UTF-8
│ │ │ ├── UTF-32BE-snippet
│ │ │ ├── UTF-32BE-snippet.UTF-8
│ │ │ ├── UTF-32LE-snippet
│ │ │ ├── UTF-32LE-snippet.UTF-8
│ │ │ ├── UTF-7-snippet
│ │ │ ├── UTF-7-snippet.UTF-8
│ │ │ ├── VISCII.TXT
│ │ │ ├── check-stateful
│ │ │ ├── check-stateful.bat
│ │ │ ├── check-stateless
│ │ │ ├── check-stateless.bat
│ │ │ ├── check-subst
│ │ │ ├── check-translit
│ │ │ ├── check-translit.bat
│ │ │ ├── check-translitfailure
│ │ │ ├── gengb18030z.c
│ │ │ ├── genutf8.c
│ │ │ ├── table-from.c
│ │ │ ├── table-to.c
│ │ │ ├── test-shiftseq.c
│ │ │ ├── test-to-wchar.c
│ │ │ └── uniq-u.c
│ │ ├── tools/
│ │ │ ├── 8bit_tab_to_h.c
│ │ │ ├── CP50221-0208-EXT.TXT
│ │ │ ├── CP50221-0212-EXT.TXT
│ │ │ ├── JISX0213.TXT
│ │ │ ├── Makefile
│ │ │ ├── cjk_tab_to_h.c
│ │ │ └── cjk_variants.c
│ │ ├── windows/
│ │ │ ├── iconv.rc
│ │ │ ├── libiconv.rc
│ │ │ └── windres-options
│ │ └── woe32dll/
│ │ ├── export.h
│ │ └── iconv-exports.c
│ ├── zbar/
│ │ ├── Makefile.am.inc
│ │ ├── config.c
│ │ ├── convert.c
│ │ ├── debug.h
│ │ ├── decoder/
│ │ │ ├── codabar.c
│ │ │ ├── codabar.h
│ │ │ ├── code128.c
│ │ │ ├── code128.h
│ │ │ ├── code39.c
│ │ │ ├── code39.h
│ │ │ ├── code93.c
│ │ │ ├── code93.h
│ │ │ ├── databar.c
│ │ │ ├── databar.h
│ │ │ ├── ean.c
│ │ │ ├── ean.h
│ │ │ ├── i25.c
│ │ │ ├── i25.h
│ │ │ ├── pdf417.c
│ │ │ ├── pdf417.h
│ │ │ ├── pdf417_hash.h
│ │ │ ├── qr_finder.c
│ │ │ └── qr_finder.h
│ │ ├── decoder.c
│ │ ├── decoder.h
│ │ ├── error.c
│ │ ├── error.h
│ │ ├── event.h
│ │ ├── image.c
│ │ ├── image.h
│ │ ├── img_scanner.c
│ │ ├── img_scanner.h
│ │ ├── jpeg.c
│ │ ├── libzbar.rc
│ │ ├── mutex.h
│ │ ├── processor/
│ │ │ ├── lock.c
│ │ │ ├── null.c
│ │ │ ├── posix.c
│ │ │ ├── posix.h
│ │ │ ├── win.c
│ │ │ └── x.c
│ │ ├── processor.c
│ │ ├── processor.h
│ │ ├── qrcode/
│ │ │ ├── bch15_5.c
│ │ │ ├── bch15_5.h
│ │ │ ├── binarize.c
│ │ │ ├── binarize.h
│ │ │ ├── isaac.c
│ │ │ ├── isaac.h
│ │ │ ├── qrdec.c
│ │ │ ├── qrdec.h
│ │ │ ├── qrdectxt.c
│ │ │ ├── rs.c
│ │ │ ├── rs.h
│ │ │ ├── util.c
│ │ │ └── util.h
│ │ ├── qrcode.h
│ │ ├── refcnt.c
│ │ ├── refcnt.h
│ │ ├── scanner.c
│ │ ├── svg.c
│ │ ├── svg.h
│ │ ├── symbol.c
│ │ ├── symbol.h
│ │ ├── thread.h
│ │ ├── timer.h
│ │ ├── video/
│ │ │ ├── null.c
│ │ │ ├── v4l.c
│ │ │ ├── v4l1.c
│ │ │ ├── v4l2.c
│ │ │ └── vfw.c
│ │ ├── video.c
│ │ ├── video.h
│ │ ├── window/
│ │ │ ├── dib.c
│ │ │ ├── null.c
│ │ │ ├── vfw.c
│ │ │ ├── win.c
│ │ │ ├── win.h
│ │ │ ├── x.c
│ │ │ ├── x.h
│ │ │ ├── ximage.c
│ │ │ └── xv.c
│ │ ├── window.c
│ │ └── window.h
│ └── zbarjni.c
├── zbardemo/
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src/
│ └── main/
│ ├── AndroidManifest.xml
│ ├── java/
│ │ └── cn/
│ │ └── bingoogolapple/
│ │ └── qrcode/
│ │ └── zbardemo/
│ │ ├── MainActivity.java
│ │ └── TestScanActivity.java
│ └── res/
│ ├── drawable/
│ │ └── selector_btn_orange.xml
│ ├── layout/
│ │ ├── activity_main.xml
│ │ ├── activity_test_scan.xml
│ │ ├── toolbar.xml
│ │ └── view_control.xml
│ └── values/
│ ├── colors.xml
│ ├── strings.xml
│ ├── styles.xml
│ └── styles_base.xml
├── zxing/
│ ├── build.gradle
│ └── src/
│ └── main/
│ ├── AndroidManifest.xml
│ └── java/
│ └── cn/
│ └── bingoogolapple/
│ └── qrcode/
│ └── zxing/
│ ├── QRCodeDecoder.java
│ ├── QRCodeEncoder.java
│ └── ZXingView.java
└── zxingdemo/
├── build.gradle
├── proguard-rules.pro
└── src/
└── main/
├── AndroidManifest.xml
├── java/
│ └── cn/
│ └── bingoogolapple/
│ └── qrcode/
│ └── zxingdemo/
│ ├── MainActivity.java
│ ├── RotateTest.java
│ ├── TestGeneratectivity.java
│ └── TestScanActivity.java
└── res/
├── drawable/
│ └── selector_btn_orange.xml
├── layout/
│ ├── activity_main.xml
│ ├── activity_test_generate.xml
│ ├── activity_test_scan.xml
│ ├── toolbar.xml
│ └── view_control.xml
└── values/
├── colors.xml
├── strings.xml
├── styles.xml
└── styles_base.xml
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# Built application files
*.apk
*.ap_
# Files for the Dalvik VM
*.dex
# Java class files
*.class
# Generated files
bin/
gen/
# Gradle files
.gradle/
build/
/*/build/
# Local configuration file (sdk path, etc)
local.properties
# Proguard folder generated by Eclipse
proguard/
# Log Files
*.log
# Eclipse project files
.classpath
.project
.settings/
# Intellij project files
*.iml
*.ipr
*.iws
.idea/
# Mac system files
.DS_Store
*.keystore
captures
.externalNativeBuild/
zbarjni/src/main/obj/
zbarjni/src/main/libs/
================================================
FILE: README.md
================================================
:running:BGAQRCode-Android:running:
============
## 目录
* [功能介绍](#功能介绍)
* [常见问题](#常见问题)
* [效果图与示例 apk](#效果图与示例-apk)
* [Gradle 依赖](#gradle-依赖)
* [布局文件](#布局文件)
* [自定义属性说明](#自定义属性说明)
* [接口说明](#接口说明)
* [关于我](#关于我)
## 功能介绍
根据[之前公司](http://www.iqegg.com)的产品需求,参考 [barcodescanner](https://github.com/dm77/barcodescanner) 改的,希望能帮助到有生成二维码、扫描二维码、识别图片二维码等需求的猿友。修改幅度较大,也就没准备针对 [barcodescanner](https://github.com/dm77/barcodescanner) 库提交PR。
- [x] 可定制各式各样的扫描框
- [x] 可定制全屏扫描或只识别扫描框区域内码
- [x] 可定制要识别的码的格式(详细用法查看 TestScanActivity 中的 onClick 方法)
- [x] 可以控制闪光灯,方便夜间使用
- [x] 可以设置用前置摄像头扫描
- [x] 可以二指缩放预览
- [x] 可以监听环境亮度,提示用户打开、关闭闪光灯
- [x] 识别到比较小的码时自动放大
***
- [x] ZXing 生成可自定义颜色、带 logo 的二维码
- [x] ZXing 生成一维码
- [x] ZXing 扫描条码、二维码
- [x] ZXing 识别图库中的条码、二维码图片
***
- [x] ZBar 扫描条码、二维码「已解决中文乱码问题」
- [x] ZBar 识别图库中的条码、二维码图片
## 常见问题
#### 1.部分手机无法扫描出结果,扫描预览界面二维码被压缩
使用的时候将 Toolbar 或者其他 View 盖在 ZBarView 或者 ZXingView 的上面,让 ZBarView 或者 ZXingView 填充屏幕宽高。[ZXing 布局文件参考](https://github.com/bingoogolapple/BGAQRCode-Android/blob/master/zxingdemo/src/main/res/layout/activity_test_scan.xml) [ZBar 布局文件参考](https://github.com/bingoogolapple/BGAQRCode-Android/blob/master/zbardemo/src/main/res/layout/activity_test_scan.xml)
#### 2.出现黑屏
在自己项目里集成时记得在 onDestroy 方法中调用 mQRCodeView.onDestroy(),在 onStop 方法中调用 mQRCodeView.stopCamera(),否则会出现黑屏。如果没执行前面提到的这两个方法出现黑屏的话,那你就只能加上前面提到的两个方法后,重启手机后重新运行了
## 效果图与示例 apk





| [点击下载 ZXingDemo.apk](http://fir.im/ZXingDemo)或扫描下面的二维码安装 | [点击下载 ZBarDemo.apk](http://fir.im/ZBarDemo)或扫描下面的二维码安装 |
| :------------: | :------------: |
|  |  |
## Gradle 依赖
* 把 `maven { url 'https://jitpack.io' }` 添加到 root build.gradle 的 repositories 中
* 在 app build.gradle 中添加如下依赖,末尾的「latestVersion」指的是徽章 [](https://jitpack.io/#bingoogolapple/BGAQRCode-Android) 里的版本名称,请自行替换
>ZXing
```groovy
dependencies {
implementation 'com.github.bingoogolapple.BGAQRCode-Android:zxing:latestVersion'
}
```
>ZBar
```groovy
dependencies {
implementation 'com.github.bingoogolapple.BGAQRCode-Android:zbar:latestVersion'
}
```
## 布局文件
>ZXing
```xml
```
>ZBar
```xml
```
## 自定义属性说明
属性名 | 说明 | 默认值
:----------- | :----------- | :-----------
qrcv_topOffset | 扫描框距离 toolbar 底部的距离 | 90dp
qrcv_cornerSize | 扫描框边角线的宽度 | 3dp
qrcv_cornerLength | 扫描框边角线的长度 | 20dp
qrcv_cornerColor | 扫描框边角线的颜色 | @android:color/white
qrcv_cornerDisplayType | 扫描框边角线显示位置(相对于边框),默认值为中间 | center
qrcv_rectWidth | 扫描框的宽度 | 200dp
qrcv_barcodeRectHeight | 条码扫样式描框的高度 | 140dp
qrcv_maskColor | 除去扫描框,其余部分阴影颜色 | #33FFFFFF
qrcv_scanLineSize | 扫描线的宽度 | 1dp
qrcv_scanLineColor | 扫描线的颜色「扫描线和默认的扫描线图片的颜色」 | @android:color/white
qrcv_scanLineMargin | 扫描线距离上下或者左右边框的间距 | 0dp
qrcv_isShowDefaultScanLineDrawable | 是否显示默认的图片扫描线「设置该属性后 qrcv_scanLineSize 将失效,可以通过 qrcv_scanLineColor 设置扫描线的颜色,避免让你公司的UI单独给你出特定颜色的扫描线图片」 | false
qrcv_customScanLineDrawable | 扫描线的图片资源「默认的扫描线图片样式不能满足你的需求时使用,设置该属性后 qrcv_isShowDefaultScanLineDrawable、qrcv_scanLineSize、qrcv_scanLineColor 将失效」 | null
qrcv_borderSize | 扫描边框的宽度 | 1dp
qrcv_borderColor | 扫描边框的颜色 | @android:color/white
qrcv_animTime | 扫描线从顶部移动到底部的动画时间「单位为毫秒」 | 1000
qrcv_isCenterVertical(已废弃,如果要垂直居中用 qrcv_verticalBias="0.5"来代替) | 扫描框是否垂直居中,该属性为true时会忽略 qrcv_topOffset 属性 | false
qrcv_verticalBias | 扫描框中心点在屏幕垂直方向的比例,当设置此值时,会忽略 qrcv_topOffset 属性 | -1
qrcv_toolbarHeight | Toolbar 的高度,通过该属性来修正由 Toolbar 导致扫描框在垂直方向上的偏差 | 0dp
qrcv_isBarcode | 扫描框的样式是否为扫条形码样式 | false
qrcv_tipText | 提示文案 | null
qrcv_tipTextSize | 提示文案字体大小 | 14sp
qrcv_tipTextColor | 提示文案颜色 | @android:color/white
qrcv_isTipTextBelowRect | 提示文案是否在扫描框的底部 | false
qrcv_tipTextMargin | 提示文案与扫描框之间的间距 | 20dp
qrcv_isShowTipTextAsSingleLine | 是否把提示文案作为单行显示 | false
qrcv_isShowTipBackground | 是否显示提示文案的背景 | false
qrcv_tipBackgroundColor | 提示文案的背景色 | #22000000
qrcv_isScanLineReverse | 扫描线是否来回移动 | true
qrcv_isShowDefaultGridScanLineDrawable | 是否显示默认的网格图片扫描线 | false
qrcv_customGridScanLineDrawable | 扫描线的网格图片资源 | nulll
qrcv_isOnlyDecodeScanBoxArea | 是否只识别扫描框中的码 | false
qrcv_isShowLocationPoint | 是否显示定位点 | false
qrcv_isAutoZoom | 码太小时是否自动缩放 | false
## 接口说明
>QRCodeView
```java
/**
* ZBarView 设置识别的格式。详细用法请看 zbardemo 的 TestScanActivity 中的 onClick 方法
*
* @param barcodeType 识别的格式
* @param formatList barcodeType 为 BarcdeType.CUSTOM 时,必须指定该值
*/
public void setType(BarcodeType barcodeType, List formatList)
/**
* ZXingView 设置识别的格式。详细用法请看 zxingdemo TestScanActivity 中的 onClick 方法
*
* @param barcodeType 识别的格式
* @param hintMap barcodeType 为 BarcodeType.CUSTOM 时,必须指定该值
*/
public void setType(BarcodeType barcodeType, Map hintMap)
/**
* 设置扫描二维码的代理
*
* @param delegate 扫描二维码的代理
*/
public void setDelegate(Delegate delegate)
/**
* 显示扫描框
*/
public void showScanRect()
/**
* 隐藏扫描框
*/
public void hiddenScanRect()
/**
* 打开后置摄像头开始预览,但是并未开始识别
*/
public void startCamera()
/**
* 打开指定摄像头开始预览,但是并未开始识别
*
* @param cameraFacing Camera.CameraInfo.CAMERA_FACING_BACK or Camera.CameraInfo.CAMERA_FACING_FRONT
*/
public void startCamera(int cameraFacing)
/**
* 关闭摄像头预览,并且隐藏扫描框
*/
public void stopCamera()
/**
* 开始识别
*/
public void startSpot()
/**
* 停止识别
*/
public void stopSpot()
/**
* 停止识别,并且隐藏扫描框
*/
public void stopSpotAndHiddenRect()
/**
* 显示扫描框,并开始识别
*/
public void startSpotAndShowRect()
/**
* 打开闪光灯
*/
public void openFlashlight()
/**
* 关闭散光灯
*/
public void closeFlashlight()
/**
* 解析本地图片二维码。返回二维码图片里的内容 或 null
*
* @param picturePath 要解析的二维码图片本地路径
*/
public void decodeQRCode(String picturePath)
/**
* 解析 Bitmap 二维码。返回二维码图片里的内容 或 null
*
* @param bitmap 要解析的二维码图片
*/
public void decodeQRCode(Bitmap bitmap)
```
>QRCodeView.Delegate 扫描二维码的代理
```java
/**
* 处理扫描结果
*
* @param result 摄像头扫码时只要回调了该方法 result 就一定有值,不会为 null。解析本地图片或 Bitmap 时 result 可能为 null
*/
void onScanQRCodeSuccess(String result)
/**
* 摄像头环境亮度发生变化
*
* @param isDark 是否变暗
*/
void onCameraAmbientBrightnessChanged(boolean isDark);
/**
* 处理打开相机出错
*/
void onScanQRCodeOpenCameraError()
```
>QRCodeEncoder 创建二维码图片。几个重载方法都是耗时操作,请在子线程中调用。
```java
/**
* 同步创建黑色前景色、白色背景色的二维码图片。该方法是耗时操作,请在子线程中调用。
*
* @param content 要生成的二维码图片内容
* @param size 图片宽高,单位为px
*/
public static Bitmap syncEncodeQRCode(String content, int size)
/**
* 同步创建指定前景色、白色背景色的二维码图片。该方法是耗时操作,请在子线程中调用。
*
* @param content 要生成的二维码图片内容
* @param size 图片宽高,单位为px
* @param foregroundColor 二维码图片的前景色
*/
public static Bitmap syncEncodeQRCode(String content, int size, int foregroundColor)
/**
* 同步创建指定前景色、白色背景色、带logo的二维码图片。该方法是耗时操作,请在子线程中调用。
*
* @param content 要生成的二维码图片内容
* @param size 图片宽高,单位为px
* @param foregroundColor 二维码图片的前景色
* @param logo 二维码图片的logo
*/
public static Bitmap syncEncodeQRCode(String content, int size, int foregroundColor, Bitmap logo)
/**
* 同步创建指定前景色、指定背景色、带logo的二维码图片。该方法是耗时操作,请在子线程中调用。
*
* @param content 要生成的二维码图片内容
* @param size 图片宽高,单位为px
* @param foregroundColor 二维码图片的前景色
* @param backgroundColor 二维码图片的背景色
* @param logo 二维码图片的logo
*/
public static Bitmap syncEncodeQRCode(String content, int size, int foregroundColor, int backgroundColor, Bitmap logo)
/**
* 同步创建条形码图片
*
* @param content 要生成条形码包含的内容
* @param width 条形码的宽度,单位px
* @param height 条形码的高度,单位px
* @param textSize 字体大小,单位px,如果等于0则不在底部绘制文字
*/
public static Bitmap syncEncodeBarcode(String content, int width, int height, int textSize)
```
#### 详细用法请查看[ZBarDemo](https://github.com/bingoogolapple/BGAQRCode-Android/tree/master/zbardemo):feet:
#### 详细用法请查看[ZXingDemo](https://github.com/bingoogolapple/BGAQRCode-Android/tree/master/zxingdemo):feet:
## 作者联系方式
| 个人主页 | 邮箱 |
| ------------- | ------------ |
| bingoogolapple.cn | bingoogolapple@gmail.com |
| 个人微信号 | 微信群 | 公众号 |
| ------------ | ------------ | ------------ |
|
|
|
|
| 个人 QQ 号 | QQ 群 |
| ------------ | ------------ |
|
|
|
## 打赏支持作者
如果您觉得 BGA 系列开源库或工具软件帮您节省了大量的开发时间,可以扫描下方的二维码打赏支持。您的支持将鼓励我继续创作,打赏后还可以加我微信免费开通一年 [上帝小助手浏览器扩展/插件开发平台](https://github.com/bingoogolapple/bga-god-assistant-config) 的会员服务
| 微信 | QQ | 支付宝 |
| ------------- | ------------- | ------------- |
|
|
|
|
## 作者项目推荐
* 欢迎您使用我开发的第一个独立开发软件产品 [上帝小助手浏览器扩展/插件开发平台](https://github.com/bingoogolapple/bga-god-assistant-config)
## License
Copyright (C) 2012 The Android Open Source Project
Copyright 2014 bingoogolapple
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.
================================================
FILE: assembleDebug.sh
================================================
#!/bin/bash +x
./gradlew :zxingdemo:assembleDebug
./gradlew :zbardemo:assembleDebug
================================================
FILE: build.gradle
================================================
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
}
allprojects {
repositories {
maven { url 'https://jitpack.io' }
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
================================================
FILE: gradle/wrapper/gradle-wrapper.properties
================================================
#Sun Nov 10 17:04:31 CST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
================================================
FILE: gradle.properties
================================================
ANDROID_BUILD_MIN_SDK_VERSION=14
ANDROID_BUILD_TARGET_SDK_VERSION=28
ANDROID_BUILD_SDK_VERSION=28
VERSION_NAME=1.3.8
VERSION_CODE=138
================================================
FILE: gradlew
================================================
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
================================================
FILE: gradlew.bat
================================================
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
================================================
FILE: qrcodecore/build.gradle
================================================
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
android {
compileSdkVersion ANDROID_BUILD_SDK_VERSION as int
defaultConfig {
minSdkVersion ANDROID_BUILD_MIN_SDK_VERSION as int
targetSdkVersion ANDROID_BUILD_TARGET_SDK_VERSION as int
}
}
================================================
FILE: qrcodecore/src/main/AndroidManifest.xml
================================================
================================================
FILE: qrcodecore/src/main/java/cn/bingoogolapple/qrcode/core/BGAQRCodeUtil.java
================================================
package cn.bingoogolapple.qrcode.core;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Point;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.graphics.Rect;
import android.graphics.RectF;
import android.util.Log;
import android.util.TypedValue;
import android.view.Display;
import android.view.MotionEvent;
import android.view.WindowManager;
public class BGAQRCodeUtil {
private static boolean debug;
public static void setDebug(boolean debug) {
BGAQRCodeUtil.debug = debug;
}
public static boolean isDebug() {
return debug;
}
public static void d(String msg) {
d("BGAQRCode", msg);
}
public static void printRect(String prefix, Rect rect) {
d("BGAQRCodeFocusArea", prefix + " centerX:" + rect.centerX() + " centerY:" + rect.centerY() + " width:" + rect.width() + " height:" + rect.height()
+ " rectHalfWidth:" + rect.width() / 2 + " rectHalfHeight:" + rect.height() / 2
+ " left:" + rect.left + " top:" + rect.top + " right:" + rect.right + " bottom:" + rect.bottom);
}
public static void d(String tag, String msg) {
if (debug) {
Log.d(tag, msg);
}
}
public static void e(String msg) {
if (debug) {
Log.e("BGAQRCode", msg);
}
}
/**
* 是否为竖屏
*/
public static boolean isPortrait(Context context) {
Point screenResolution = getScreenResolution(context);
return screenResolution.y > screenResolution.x;
}
static Point getScreenResolution(Context context) {
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
Display display = wm.getDefaultDisplay();
Point screenResolution = new Point();
display.getSize(screenResolution);
return screenResolution;
}
public static int getStatusBarHeight(Context context) {
TypedArray typedArray = context.getTheme().obtainStyledAttributes(new int[]{
android.R.attr.windowFullscreen
});
boolean windowFullscreen = typedArray.getBoolean(0, false);
typedArray.recycle();
if (windowFullscreen) {
return 0;
}
int height = 0;
int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
if (resourceId > 0) {
height = context.getResources().getDimensionPixelSize(resourceId);
}
return height;
}
public static int dp2px(Context context, float dpValue) {
return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dpValue, context.getResources().getDisplayMetrics());
}
public static int sp2px(Context context, float spValue) {
return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, spValue, context.getResources().getDisplayMetrics());
}
static Bitmap adjustPhotoRotation(Bitmap inputBitmap, int orientationDegree) {
if (inputBitmap == null) {
return null;
}
Matrix matrix = new Matrix();
matrix.setRotate(orientationDegree, (float) inputBitmap.getWidth() / 2, (float) inputBitmap.getHeight() / 2);
float outputX, outputY;
if (orientationDegree == 90) {
outputX = inputBitmap.getHeight();
outputY = 0;
} else {
outputX = inputBitmap.getHeight();
outputY = inputBitmap.getWidth();
}
final float[] values = new float[9];
matrix.getValues(values);
float x1 = values[Matrix.MTRANS_X];
float y1 = values[Matrix.MTRANS_Y];
matrix.postTranslate(outputX - x1, outputY - y1);
Bitmap outputBitmap = Bitmap.createBitmap(inputBitmap.getHeight(), inputBitmap.getWidth(), Bitmap.Config.ARGB_8888);
Paint paint = new Paint();
Canvas canvas = new Canvas(outputBitmap);
canvas.drawBitmap(inputBitmap, matrix, paint);
return outputBitmap;
}
static Bitmap makeTintBitmap(Bitmap inputBitmap, int tintColor) {
if (inputBitmap == null) {
return null;
}
Bitmap outputBitmap = Bitmap.createBitmap(inputBitmap.getWidth(), inputBitmap.getHeight(), inputBitmap.getConfig());
Canvas canvas = new Canvas(outputBitmap);
Paint paint = new Paint();
paint.setColorFilter(new PorterDuffColorFilter(tintColor, PorterDuff.Mode.SRC_IN));
canvas.drawBitmap(inputBitmap, 0, 0, paint);
return outputBitmap;
}
/**
* 计算对焦和测光区域
*
* @param coefficient 比率
* @param originFocusCenterX 对焦中心点X
* @param originFocusCenterY 对焦中心点Y
* @param originFocusWidth 对焦宽度
* @param originFocusHeight 对焦高度
* @param previewViewWidth 预览宽度
* @param previewViewHeight 预览高度
*/
static Rect calculateFocusMeteringArea(float coefficient,
float originFocusCenterX, float originFocusCenterY,
int originFocusWidth, int originFocusHeight,
int previewViewWidth, int previewViewHeight) {
int halfFocusAreaWidth = (int) (originFocusWidth * coefficient / 2);
int halfFocusAreaHeight = (int) (originFocusHeight * coefficient / 2);
int centerX = (int) (originFocusCenterX / previewViewWidth * 2000 - 1000);
int centerY = (int) (originFocusCenterY / previewViewHeight * 2000 - 1000);
RectF rectF = new RectF(BGAQRCodeUtil.clamp(centerX - halfFocusAreaWidth, -1000, 1000),
BGAQRCodeUtil.clamp(centerY - halfFocusAreaHeight, -1000, 1000),
BGAQRCodeUtil.clamp(centerX + halfFocusAreaWidth, -1000, 1000),
BGAQRCodeUtil.clamp(centerY + halfFocusAreaHeight, -1000, 1000));
return new Rect(Math.round(rectF.left), Math.round(rectF.top),
Math.round(rectF.right), Math.round(rectF.bottom));
}
static int clamp(int value, int min, int max) {
return Math.min(Math.max(value, min), max);
}
/**
* 计算手指间距
*/
static float calculateFingerSpacing(MotionEvent event) {
float x = event.getX(0) - event.getX(1);
float y = event.getY(0) - event.getY(1);
return (float) Math.sqrt(x * x + y * y);
}
/**
* 将本地图片文件转换成可解码二维码的 Bitmap。为了避免图片太大,这里对图片进行了压缩。感谢 https://github.com/devilsen 提的 PR
*
* @param picturePath 本地图片文件路径
*/
public static Bitmap getDecodeAbleBitmap(String picturePath) {
try {
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeFile(picturePath, options);
int sampleSize = options.outHeight / 400;
if (sampleSize <= 0) {
sampleSize = 1;
}
options.inSampleSize = sampleSize;
options.inJustDecodeBounds = false;
return BitmapFactory.decodeFile(picturePath, options);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}
================================================
FILE: qrcodecore/src/main/java/cn/bingoogolapple/qrcode/core/BarcodeType.java
================================================
package cn.bingoogolapple.qrcode.core;
/**
* 作者:王浩
* 创建时间:2018/6/20
* 描述:识别的格式
*/
public enum BarcodeType {
/**
* 所有格式
*/
ALL,
/**
* 所有一维条码格式
*/
ONE_DIMENSION,
/**
* 所有二维条码格式
*/
TWO_DIMENSION,
/**
* 仅 QR_CODE
*/
ONLY_QR_CODE,
/**
* 仅 CODE_128
*/
ONLY_CODE_128,
/**
* 仅 EAN_13
*/
ONLY_EAN_13,
/**
* 高频率格式,包括 QR_CODE、ISBN13、UPC_A、EAN_13、CODE_128
*/
HIGH_FREQUENCY,
/**
* 自定义格式
*/
CUSTOM
}
================================================
FILE: qrcodecore/src/main/java/cn/bingoogolapple/qrcode/core/CameraConfigurationManager.java
================================================
package cn.bingoogolapple.qrcode.core;
import android.content.Context;
import android.graphics.Point;
import android.hardware.Camera;
import android.view.Display;
import android.view.Surface;
import android.view.WindowManager;
import java.util.Collection;
import java.util.List;
final class CameraConfigurationManager {
private final Context mContext;
private Point mCameraResolution;
private Point mPreviewResolution;
CameraConfigurationManager(Context context) {
mContext = context;
}
void initFromCameraParameters(Camera camera) {
Point screenResolution = BGAQRCodeUtil.getScreenResolution(mContext);
Point screenResolutionForCamera = new Point();
screenResolutionForCamera.x = screenResolution.x;
screenResolutionForCamera.y = screenResolution.y;
if (BGAQRCodeUtil.isPortrait(mContext)) {
screenResolutionForCamera.x = screenResolution.y;
screenResolutionForCamera.y = screenResolution.x;
}
mPreviewResolution = getPreviewResolution(camera.getParameters(), screenResolutionForCamera);
if (BGAQRCodeUtil.isPortrait(mContext)) {
mCameraResolution = new Point(mPreviewResolution.y, mPreviewResolution.x);
} else {
mCameraResolution = mPreviewResolution;
}
}
private static boolean autoFocusAble(Camera camera) {
List supportedFocusModes = camera.getParameters().getSupportedFocusModes();
String focusMode = findSettableValue(supportedFocusModes, Camera.Parameters.FOCUS_MODE_AUTO);
return focusMode != null;
}
Point getCameraResolution() {
return mCameraResolution;
}
void setDesiredCameraParameters(Camera camera) {
Camera.Parameters parameters = camera.getParameters();
parameters.setPreviewSize(mPreviewResolution.x, mPreviewResolution.y);
// https://github.com/googlesamples/android-vision/blob/master/visionSamples/barcode-reader/app/src/main/java/com/google/android/gms/samples/vision/barcodereader/ui/camera/CameraSource.java
int[] previewFpsRange = selectPreviewFpsRange(camera, 60.0f);
if (previewFpsRange != null) {
parameters.setPreviewFpsRange(
previewFpsRange[Camera.Parameters.PREVIEW_FPS_MIN_INDEX],
previewFpsRange[Camera.Parameters.PREVIEW_FPS_MAX_INDEX]);
}
camera.setDisplayOrientation(getDisplayOrientation());
camera.setParameters(parameters);
}
/**
* Selects the most suitable preview frames per second range, given the desired frames per
* second.
*
* @param camera the camera to select a frames per second range from
* @param desiredPreviewFps the desired frames per second for the camera preview frames
* @return the selected preview frames per second range
*/
private int[] selectPreviewFpsRange(Camera camera, float desiredPreviewFps) {
// The camera API uses integers scaled by a factor of 1000 instead of floating-point frame
// rates.
int desiredPreviewFpsScaled = (int) (desiredPreviewFps * 1000.0f);
// The method for selecting the best range is to minimize the sum of the differences between
// the desired value and the upper and lower bounds of the range. This may select a range
// that the desired value is outside of, but this is often preferred. For example, if the
// desired frame rate is 29.97, the range (30, 30) is probably more desirable than the
// range (15, 30).
int[] selectedFpsRange = null;
int minDiff = Integer.MAX_VALUE;
List previewFpsRangeList = camera.getParameters().getSupportedPreviewFpsRange();
for (int[] range : previewFpsRangeList) {
int deltaMin = desiredPreviewFpsScaled - range[Camera.Parameters.PREVIEW_FPS_MIN_INDEX];
int deltaMax = desiredPreviewFpsScaled - range[Camera.Parameters.PREVIEW_FPS_MAX_INDEX];
int diff = Math.abs(deltaMin) + Math.abs(deltaMax);
if (diff < minDiff) {
selectedFpsRange = range;
minDiff = diff;
}
}
return selectedFpsRange;
}
void openFlashlight(Camera camera) {
doSetTorch(camera, true);
}
void closeFlashlight(Camera camera) {
doSetTorch(camera, false);
}
private void doSetTorch(Camera camera, boolean newSetting) {
Camera.Parameters parameters = camera.getParameters();
String flashMode;
/** 是否支持闪光灯 */
if (newSetting) {
flashMode = findSettableValue(parameters.getSupportedFlashModes(), Camera.Parameters.FLASH_MODE_TORCH, Camera.Parameters.FLASH_MODE_ON);
} else {
flashMode = findSettableValue(parameters.getSupportedFlashModes(), Camera.Parameters.FLASH_MODE_OFF);
}
if (flashMode != null) {
parameters.setFlashMode(flashMode);
}
camera.setParameters(parameters);
}
private static String findSettableValue(Collection supportedValues, String... desiredValues) {
String result = null;
if (supportedValues != null) {
for (String desiredValue : desiredValues) {
if (supportedValues.contains(desiredValue)) {
result = desiredValue;
break;
}
}
}
return result;
}
private int getDisplayOrientation() {
Camera.CameraInfo info = new Camera.CameraInfo();
Camera.getCameraInfo(Camera.CameraInfo.CAMERA_FACING_BACK, info);
WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
if (wm == null) {
return 0;
}
Display display = wm.getDefaultDisplay();
int rotation = display.getRotation();
int degrees = 0;
switch (rotation) {
case Surface.ROTATION_0:
degrees = 0;
break;
case Surface.ROTATION_90:
degrees = 90;
break;
case Surface.ROTATION_180:
degrees = 180;
break;
case Surface.ROTATION_270:
degrees = 270;
break;
}
int result;
if (info.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) {
result = (info.orientation + degrees) % 360;
result = (360 - result) % 360;
} else {
result = (info.orientation - degrees + 360) % 360;
}
return result;
}
private static Point getPreviewResolution(Camera.Parameters parameters, Point screenResolution) {
Point previewResolution =
findBestPreviewSizeValue(parameters.getSupportedPreviewSizes(), screenResolution);
if (previewResolution == null) {
previewResolution = new Point((screenResolution.x >> 3) << 3, (screenResolution.y >> 3) << 3);
}
return previewResolution;
}
private static Point findBestPreviewSizeValue(List supportSizeList, Point screenResolution) {
int bestX = 0;
int bestY = 0;
int diff = Integer.MAX_VALUE;
for (Camera.Size previewSize : supportSizeList) {
int newX = previewSize.width;
int newY = previewSize.height;
int newDiff = Math.abs(newX - screenResolution.x) + Math.abs(newY - screenResolution.y);
if (newDiff == 0) {
bestX = newX;
bestY = newY;
break;
} else if (newDiff < diff) {
bestX = newX;
bestY = newY;
diff = newDiff;
}
}
if (bestX > 0 && bestY > 0) {
return new Point(bestX, bestY);
}
return null;
}
}
================================================
FILE: qrcodecore/src/main/java/cn/bingoogolapple/qrcode/core/CameraPreview.java
================================================
package cn.bingoogolapple.qrcode.core;
import android.content.Context;
import android.content.pm.PackageManager;
import android.graphics.Point;
import android.graphics.Rect;
import android.hardware.Camera;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import java.util.Collections;
public class CameraPreview extends SurfaceView implements SurfaceHolder.Callback {
private Camera mCamera;
private boolean mPreviewing = false;
private boolean mSurfaceCreated = false;
private boolean mIsTouchFocusing = false;
private float mOldDist = 1f;
private CameraConfigurationManager mCameraConfigurationManager;
private Delegate mDelegate;
public CameraPreview(Context context) {
super(context);
getHolder().addCallback(this);
}
void setCamera(Camera camera) {
mCamera = camera;
if (mCamera != null) {
mCameraConfigurationManager = new CameraConfigurationManager(getContext());
mCameraConfigurationManager.initFromCameraParameters(mCamera);
if (mPreviewing) {
requestLayout();
} else {
showCameraPreview();
}
}
}
void setDelegate(Delegate delegate) {
mDelegate = delegate;
}
@Override
public void surfaceCreated(SurfaceHolder surfaceHolder) {
mSurfaceCreated = true;
}
@Override
public void surfaceChanged(SurfaceHolder surfaceHolder, int format, int width, int height) {
if (surfaceHolder.getSurface() == null) {
return;
}
stopCameraPreview();
showCameraPreview();
}
@Override
public void surfaceDestroyed(SurfaceHolder surfaceHolder) {
mSurfaceCreated = false;
stopCameraPreview();
}
public void reactNativeShowCameraPreview() {
if (getHolder() == null || getHolder().getSurface() == null) {
return;
}
stopCameraPreview();
showCameraPreview();
}
private void showCameraPreview() {
if (mCamera != null) {
try {
mPreviewing = true;
SurfaceHolder surfaceHolder = getHolder();
surfaceHolder.setKeepScreenOn(true);
mCamera.setPreviewDisplay(surfaceHolder);
mCameraConfigurationManager.setDesiredCameraParameters(mCamera);
mCamera.startPreview();
if (mDelegate != null) {
mDelegate.onStartPreview();
}
startContinuousAutoFocus();
} catch (Exception e) {
e.printStackTrace();
}
}
}
void stopCameraPreview() {
if (mCamera != null) {
try {
mPreviewing = false;
mCamera.cancelAutoFocus();
mCamera.setOneShotPreviewCallback(null);
mCamera.stopPreview();
} catch (Exception e) {
e.printStackTrace();
}
}
}
void openFlashlight() {
if (flashLightAvailable()) {
mCameraConfigurationManager.openFlashlight(mCamera);
}
}
void closeFlashlight() {
if (flashLightAvailable()) {
mCameraConfigurationManager.closeFlashlight(mCamera);
}
}
private boolean flashLightAvailable() {
return isPreviewing() && getContext().getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_FLASH);
}
void onScanBoxRectChanged(Rect scanRect) {
if (mCamera == null || scanRect == null || scanRect.left <= 0 || scanRect.top <= 0) {
return;
}
int centerX = scanRect.centerX();
int centerY = scanRect.centerY();
int rectHalfWidth = scanRect.width() / 2;
int rectHalfHeight = scanRect.height() / 2;
BGAQRCodeUtil.printRect("转换前", scanRect);
if (BGAQRCodeUtil.isPortrait(getContext())) {
int temp = centerX;
centerX = centerY;
centerY = temp;
temp = rectHalfWidth;
rectHalfWidth = rectHalfHeight;
rectHalfHeight = temp;
}
scanRect = new Rect(centerX - rectHalfWidth, centerY - rectHalfHeight, centerX + rectHalfWidth, centerY + rectHalfHeight);
BGAQRCodeUtil.printRect("转换后", scanRect);
BGAQRCodeUtil.d("扫码框发生变化触发对焦测光");
handleFocusMetering(scanRect.centerX(), scanRect.centerY(), scanRect.width(), scanRect.height());
}
@Override
public boolean onTouchEvent(MotionEvent event) {
if (!isPreviewing()) {
return super.onTouchEvent(event);
}
if (event.getPointerCount() == 1 && (event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_UP) {
if (mIsTouchFocusing) {
return true;
}
mIsTouchFocusing = true;
BGAQRCodeUtil.d("手指触摸触发对焦测光");
float centerX = event.getX();
float centerY = event.getY();
if (BGAQRCodeUtil.isPortrait(getContext())) {
float temp = centerX;
centerX = centerY;
centerY = temp;
}
int focusSize = BGAQRCodeUtil.dp2px(getContext(), 120);
handleFocusMetering(centerX, centerY, focusSize, focusSize);
}
if (event.getPointerCount() == 2) {
switch (event.getAction() & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_POINTER_DOWN:
mOldDist = BGAQRCodeUtil.calculateFingerSpacing(event);
break;
case MotionEvent.ACTION_MOVE:
float newDist = BGAQRCodeUtil.calculateFingerSpacing(event);
if (newDist > mOldDist) {
handleZoom(true, mCamera);
} else if (newDist < mOldDist) {
handleZoom(false, mCamera);
}
break;
}
}
return true;
}
private static void handleZoom(boolean isZoomIn, Camera camera) {
try {
Camera.Parameters params = camera.getParameters();
if (params.isZoomSupported()) {
int zoom = params.getZoom();
if (isZoomIn && zoom < params.getMaxZoom()) {
BGAQRCodeUtil.d("放大");
zoom++;
} else if (!isZoomIn && zoom > 0) {
BGAQRCodeUtil.d("缩小");
zoom--;
} else {
BGAQRCodeUtil.d("既不放大也不缩小");
}
params.setZoom(zoom);
camera.setParameters(params);
} else {
BGAQRCodeUtil.d("不支持缩放");
}
} catch (Exception e) {
e.printStackTrace();
}
}
private void handleFocusMetering(float originFocusCenterX, float originFocusCenterY,
int originFocusWidth, int originFocusHeight) {
try {
boolean isNeedUpdate = false;
Camera.Parameters focusMeteringParameters = mCamera.getParameters();
Camera.Size size = focusMeteringParameters.getPreviewSize();
if (focusMeteringParameters.getMaxNumFocusAreas() > 0) {
BGAQRCodeUtil.d("支持设置对焦区域");
isNeedUpdate = true;
Rect focusRect = BGAQRCodeUtil.calculateFocusMeteringArea(1f,
originFocusCenterX, originFocusCenterY,
originFocusWidth, originFocusHeight,
size.width, size.height);
BGAQRCodeUtil.printRect("对焦区域", focusRect);
focusMeteringParameters.setFocusAreas(Collections.singletonList(new Camera.Area(focusRect, 1000)));
focusMeteringParameters.setFocusMode(Camera.Parameters.FOCUS_MODE_MACRO);
} else {
BGAQRCodeUtil.d("不支持设置对焦区域");
}
if (focusMeteringParameters.getMaxNumMeteringAreas() > 0) {
BGAQRCodeUtil.d("支持设置测光区域");
isNeedUpdate = true;
Rect meteringRect = BGAQRCodeUtil.calculateFocusMeteringArea(1.5f,
originFocusCenterX, originFocusCenterY,
originFocusWidth, originFocusHeight,
size.width, size.height);
BGAQRCodeUtil.printRect("测光区域", meteringRect);
focusMeteringParameters.setMeteringAreas(Collections.singletonList(new Camera.Area(meteringRect, 1000)));
} else {
BGAQRCodeUtil.d("不支持设置测光区域");
}
if (isNeedUpdate) {
mCamera.cancelAutoFocus();
mCamera.setParameters(focusMeteringParameters);
mCamera.autoFocus(new Camera.AutoFocusCallback() {
public void onAutoFocus(boolean success, Camera camera) {
if (success) {
BGAQRCodeUtil.d("对焦测光成功");
} else {
BGAQRCodeUtil.e("对焦测光失败");
}
startContinuousAutoFocus();
}
});
} else {
mIsTouchFocusing = false;
}
} catch (Exception e) {
e.printStackTrace();
BGAQRCodeUtil.e("对焦测光失败:" + e.getMessage());
startContinuousAutoFocus();
}
}
/**
* 连续对焦
*/
private void startContinuousAutoFocus() {
mIsTouchFocusing = false;
if (mCamera == null) {
return;
}
try {
Camera.Parameters parameters = mCamera.getParameters();
// 连续对焦
parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE);
mCamera.setParameters(parameters);
// 要实现连续的自动对焦,这一句必须加上
mCamera.cancelAutoFocus();
} catch (Exception e) {
BGAQRCodeUtil.e("连续对焦失败");
}
}
boolean isPreviewing() {
return mCamera != null && mPreviewing && mSurfaceCreated;
}
@Override
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int width = getDefaultSize(getSuggestedMinimumWidth(), widthMeasureSpec);
int height = getDefaultSize(getSuggestedMinimumHeight(), heightMeasureSpec);
if (mCameraConfigurationManager != null && mCameraConfigurationManager.getCameraResolution() != null) {
Point cameraResolution = mCameraConfigurationManager.getCameraResolution();
// 取出来的cameraResolution高宽值与屏幕的高宽顺序是相反的
int cameraPreviewWidth = cameraResolution.x;
int cameraPreviewHeight = cameraResolution.y;
if (width * 1f / height < cameraPreviewWidth * 1f / cameraPreviewHeight) {
float ratio = cameraPreviewHeight * 1f / cameraPreviewWidth;
width = (int) (height / ratio + 0.5f);
} else {
float ratio = cameraPreviewWidth * 1f / cameraPreviewHeight;
height = (int) (width / ratio + 0.5f);
}
}
super.onMeasure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY));
}
interface Delegate {
void onStartPreview();
}
}
================================================
FILE: qrcodecore/src/main/java/cn/bingoogolapple/qrcode/core/ProcessDataTask.java
================================================
package cn.bingoogolapple.qrcode.core;
import android.graphics.Bitmap;
import android.hardware.Camera;
import android.os.AsyncTask;
import android.text.TextUtils;
import java.lang.ref.WeakReference;
class ProcessDataTask extends AsyncTask {
private Camera mCamera;
private byte[] mData;
private boolean mIsPortrait;
private String mPicturePath;
private Bitmap mBitmap;
private WeakReference mQRCodeViewRef;
private static long sLastStartTime = 0;
ProcessDataTask(Camera camera, byte[] data, QRCodeView qrCodeView, boolean isPortrait) {
mCamera = camera;
mData = data;
mQRCodeViewRef = new WeakReference<>(qrCodeView);
mIsPortrait = isPortrait;
}
ProcessDataTask(String picturePath, QRCodeView qrCodeView) {
mPicturePath = picturePath;
mQRCodeViewRef = new WeakReference<>(qrCodeView);
}
ProcessDataTask(Bitmap bitmap, QRCodeView qrCodeView) {
mBitmap = bitmap;
mQRCodeViewRef = new WeakReference<>(qrCodeView);
}
ProcessDataTask perform() {
executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
return this;
}
void cancelTask() {
if (getStatus() != Status.FINISHED) {
cancel(true);
}
}
@Override
protected void onCancelled() {
super.onCancelled();
mQRCodeViewRef.clear();
mBitmap = null;
mData = null;
}
private ScanResult processData(QRCodeView qrCodeView) {
if (mData == null) {
return null;
}
int width = 0;
int height = 0;
byte[] data = mData;
try {
Camera.Parameters parameters = mCamera.getParameters();
Camera.Size size = parameters.getPreviewSize();
width = size.width;
height = size.height;
if (mIsPortrait) {
data = new byte[mData.length];
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
data[x * height + height - y - 1] = mData[x + y * width];
}
}
int tmp = width;
width = height;
height = tmp;
}
return qrCodeView.processData(data, width, height, false);
} catch (Exception e1) {
e1.printStackTrace();
try {
if (width != 0 && height != 0) {
BGAQRCodeUtil.d("识别失败重试");
return qrCodeView.processData(data, width, height, true);
} else {
return null;
}
} catch (Exception e2) {
e2.printStackTrace();
return null;
}
}
}
@Override
protected ScanResult doInBackground(Void... params) {
QRCodeView qrCodeView = mQRCodeViewRef.get();
if (qrCodeView == null) {
return null;
}
if (mPicturePath != null) {
return qrCodeView.processBitmapData(BGAQRCodeUtil.getDecodeAbleBitmap(mPicturePath));
} else if (mBitmap != null) {
ScanResult result = qrCodeView.processBitmapData(mBitmap);
mBitmap = null;
return result;
} else {
if (BGAQRCodeUtil.isDebug()) {
BGAQRCodeUtil.d("两次任务执行的时间间隔:" + (System.currentTimeMillis() - sLastStartTime));
sLastStartTime = System.currentTimeMillis();
}
long startTime = System.currentTimeMillis();
ScanResult scanResult = processData(qrCodeView);
if (BGAQRCodeUtil.isDebug()) {
long time = System.currentTimeMillis() - startTime;
if (scanResult != null && !TextUtils.isEmpty(scanResult.result)) {
BGAQRCodeUtil.d("识别成功时间为:" + time);
} else {
BGAQRCodeUtil.e("识别失败时间为:" + time);
}
}
return scanResult;
}
}
@Override
protected void onPostExecute(ScanResult result) {
QRCodeView qrCodeView = mQRCodeViewRef.get();
if (qrCodeView == null) {
return;
}
if (mPicturePath != null || mBitmap != null) {
mBitmap = null;
qrCodeView.onPostParseBitmapOrPicture(result);
} else {
qrCodeView.onPostParseData(result);
}
}
}
================================================
FILE: qrcodecore/src/main/java/cn/bingoogolapple/qrcode/core/QRCodeView.java
================================================
package cn.bingoogolapple.qrcode.core;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PointF;
import android.graphics.Rect;
import android.hardware.Camera;
import android.os.AsyncTask;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.View;
import android.widget.RelativeLayout;
public abstract class QRCodeView extends RelativeLayout implements Camera.PreviewCallback {
private static final int NO_CAMERA_ID = -1;
protected Camera mCamera;
protected CameraPreview mCameraPreview;
protected ScanBoxView mScanBoxView;
protected Delegate mDelegate;
protected boolean mSpotAble = false;
protected ProcessDataTask mProcessDataTask;
protected int mCameraId = Camera.CameraInfo.CAMERA_FACING_BACK;
private PointF[] mLocationPoints;
private Paint mPaint;
protected BarcodeType mBarcodeType = BarcodeType.HIGH_FREQUENCY;
private long mLastPreviewFrameTime = 0;
private ValueAnimator mAutoZoomAnimator;
private long mLastAutoZoomTime = 0;
// 上次环境亮度记录的时间戳
private long mLastAmbientBrightnessRecordTime = System.currentTimeMillis();
// 上次环境亮度记录的索引
private int mAmbientBrightnessDarkIndex = 0;
// 环境亮度历史记录的数组,255 是代表亮度最大值
private static final long[] AMBIENT_BRIGHTNESS_DARK_LIST = new long[]{255, 255, 255, 255};
// 环境亮度扫描间隔
private static final int AMBIENT_BRIGHTNESS_WAIT_SCAN_TIME = 150;
// 亮度低的阀值
private static final int AMBIENT_BRIGHTNESS_DARK = 60;
public QRCodeView(Context context, AttributeSet attributeSet) {
this(context, attributeSet, 0);
}
public QRCodeView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
initView(context, attrs);
setupReader();
}
private void initView(Context context, AttributeSet attrs) {
mCameraPreview = new CameraPreview(context);
mCameraPreview.setDelegate(new CameraPreview.Delegate() {
@Override
public void onStartPreview() {
setOneShotPreviewCallback();
}
});
mScanBoxView = new ScanBoxView(context);
mScanBoxView.init(this, attrs);
mCameraPreview.setId(R.id.bgaqrcode_camera_preview);
addView(mCameraPreview);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(context, attrs);
layoutParams.addRule(RelativeLayout.ALIGN_TOP, mCameraPreview.getId());
layoutParams.addRule(RelativeLayout.ALIGN_BOTTOM, mCameraPreview.getId());
addView(mScanBoxView, layoutParams);
mPaint = new Paint();
mPaint.setColor(getScanBoxView().getCornerColor());
mPaint.setStyle(Paint.Style.FILL);
}
private void setOneShotPreviewCallback() {
if (mSpotAble && mCameraPreview.isPreviewing()) {
try {
mCamera.setOneShotPreviewCallback(this);
} catch (Exception e) {
e.printStackTrace();
}
}
}
protected abstract void setupReader();
/**
* 设置扫描二维码的代理
*
* @param delegate 扫描二维码的代理
*/
public void setDelegate(Delegate delegate) {
mDelegate = delegate;
}
public CameraPreview getCameraPreview() {
return mCameraPreview;
}
public ScanBoxView getScanBoxView() {
return mScanBoxView;
}
/**
* 显示扫描框
*/
public void showScanRect() {
if (mScanBoxView != null) {
mScanBoxView.setVisibility(View.VISIBLE);
}
}
/**
* 隐藏扫描框
*/
public void hiddenScanRect() {
if (mScanBoxView != null) {
mScanBoxView.setVisibility(View.GONE);
}
}
/**
* 打开后置摄像头开始预览,但是并未开始识别
*/
public void startCamera() {
startCamera(mCameraId);
}
/**
* 打开指定摄像头开始预览,但是并未开始识别
*/
public void startCamera(int cameraFacing) {
if (mCamera != null || Camera.getNumberOfCameras() == 0) {
return;
}
int ultimateCameraId = findCameraIdByFacing(cameraFacing);
if (ultimateCameraId != NO_CAMERA_ID) {
startCameraById(ultimateCameraId);
return;
}
if (cameraFacing == Camera.CameraInfo.CAMERA_FACING_BACK) {
ultimateCameraId = findCameraIdByFacing(Camera.CameraInfo.CAMERA_FACING_FRONT);
} else if (cameraFacing == Camera.CameraInfo.CAMERA_FACING_FRONT) {
ultimateCameraId = findCameraIdByFacing(Camera.CameraInfo.CAMERA_FACING_BACK);
}
if (ultimateCameraId != NO_CAMERA_ID) {
startCameraById(ultimateCameraId);
}
}
private int findCameraIdByFacing(int cameraFacing) {
Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
for (int cameraId = 0; cameraId < Camera.getNumberOfCameras(); cameraId++) {
try {
Camera.getCameraInfo(cameraId, cameraInfo);
if (cameraInfo.facing == cameraFacing) {
return cameraId;
}
} catch (Exception e) {
e.printStackTrace();
}
}
return NO_CAMERA_ID;
}
private void startCameraById(int cameraId) {
try {
mCameraId = cameraId;
mCamera = Camera.open(cameraId);
mCameraPreview.setCamera(mCamera);
} catch (Exception e) {
e.printStackTrace();
if (mDelegate != null) {
mDelegate.onScanQRCodeOpenCameraError();
}
}
}
/**
* 关闭摄像头预览,并且隐藏扫描框
*/
public void stopCamera() {
try {
stopSpotAndHiddenRect();
if (mCamera != null) {
mCameraPreview.stopCameraPreview();
mCameraPreview.setCamera(null);
mCamera.release();
mCamera = null;
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 开始识别
*/
public void startSpot() {
mSpotAble = true;
startCamera();
setOneShotPreviewCallback();
}
/**
* 停止识别
*/
public void stopSpot() {
mSpotAble = false;
if (mProcessDataTask != null) {
mProcessDataTask.cancelTask();
mProcessDataTask = null;
}
if (mCamera != null) {
try {
mCamera.setOneShotPreviewCallback(null);
} catch (Exception e) {
e.printStackTrace();
}
}
}
/**
* 停止识别,并且隐藏扫描框
*/
public void stopSpotAndHiddenRect() {
stopSpot();
hiddenScanRect();
}
/**
* 显示扫描框,并开始识别
*/
public void startSpotAndShowRect() {
startSpot();
showScanRect();
}
/**
* 打开闪光灯
*/
public void openFlashlight() {
postDelayed(new Runnable() {
@Override
public void run() {
mCameraPreview.openFlashlight();
}
}, mCameraPreview.isPreviewing() ? 0 : 500);
}
/**
* 关闭闪光灯
*/
public void closeFlashlight() {
mCameraPreview.closeFlashlight();
}
/**
* 销毁二维码扫描控件
*/
public void onDestroy() {
stopCamera();
mDelegate = null;
}
/**
* 切换成扫描条码样式
*/
public void changeToScanBarcodeStyle() {
if (!mScanBoxView.getIsBarcode()) {
mScanBoxView.setIsBarcode(true);
}
}
/**
* 切换成扫描二维码样式
*/
public void changeToScanQRCodeStyle() {
if (mScanBoxView.getIsBarcode()) {
mScanBoxView.setIsBarcode(false);
}
}
/**
* 当前是否为条码扫描样式
*/
public boolean getIsScanBarcodeStyle() {
return mScanBoxView.getIsBarcode();
}
@Override
public void onPreviewFrame(final byte[] data, final Camera camera) {
if (BGAQRCodeUtil.isDebug()) {
BGAQRCodeUtil.d("两次 onPreviewFrame 时间间隔:" + (System.currentTimeMillis() - mLastPreviewFrameTime));
mLastPreviewFrameTime = System.currentTimeMillis();
}
if (mCameraPreview != null && mCameraPreview.isPreviewing()) {
try {
handleAmbientBrightness(data, camera);
} catch (Exception e) {
e.printStackTrace();
}
}
if (!mSpotAble || (mProcessDataTask != null && (mProcessDataTask.getStatus() == AsyncTask.Status.PENDING
|| mProcessDataTask.getStatus() == AsyncTask.Status.RUNNING))) {
return;
}
mProcessDataTask = new ProcessDataTask(camera, data, this, BGAQRCodeUtil.isPortrait(getContext())).perform();
}
private void handleAmbientBrightness(byte[] data, Camera camera) {
if (mCameraPreview == null || !mCameraPreview.isPreviewing()) {
return;
}
long currentTime = System.currentTimeMillis();
if (currentTime - mLastAmbientBrightnessRecordTime < AMBIENT_BRIGHTNESS_WAIT_SCAN_TIME) {
return;
}
mLastAmbientBrightnessRecordTime = currentTime;
int width = camera.getParameters().getPreviewSize().width;
int height = camera.getParameters().getPreviewSize().height;
// 像素点的总亮度
long pixelLightCount = 0L;
// 像素点的总数
long pixelCount = width * height;
// 采集步长,因为没有必要每个像素点都采集,可以跨一段采集一个,减少计算负担,必须大于等于1。
int step = 10;
// data.length - allCount * 1.5f 的目的是判断图像格式是不是 YUV420 格式,只有是这种格式才相等
//因为 int 整形与 float 浮点直接比较会出问题,所以这么比
if (Math.abs(data.length - pixelCount * 1.5f) < 0.00001f) {
for (int i = 0; i < pixelCount; i += step) {
// 如果直接加是不行的,因为 data[i] 记录的是色值并不是数值,byte 的范围是 +127 到 —128,
// 而亮度 FFFFFF 是 11111111 是 -127,所以这里需要先转为无符号 unsigned long 参考 Byte.toUnsignedLong()
pixelLightCount += ((long) data[i]) & 0xffL;
}
// 平均亮度
long cameraLight = pixelLightCount / (pixelCount / step);
// 更新历史记录
int lightSize = AMBIENT_BRIGHTNESS_DARK_LIST.length;
AMBIENT_BRIGHTNESS_DARK_LIST[mAmbientBrightnessDarkIndex = mAmbientBrightnessDarkIndex % lightSize] = cameraLight;
mAmbientBrightnessDarkIndex++;
boolean isDarkEnv = true;
// 判断在时间范围 AMBIENT_BRIGHTNESS_WAIT_SCAN_TIME * lightSize 内是不是亮度过暗
for (long ambientBrightness : AMBIENT_BRIGHTNESS_DARK_LIST) {
if (ambientBrightness > AMBIENT_BRIGHTNESS_DARK) {
isDarkEnv = false;
break;
}
}
BGAQRCodeUtil.d("摄像头环境亮度为:" + cameraLight);
if (mDelegate != null) {
mDelegate.onCameraAmbientBrightnessChanged(isDarkEnv);
}
}
}
/**
* 解析本地图片二维码。返回二维码图片里的内容 或 null
*
* @param picturePath 要解析的二维码图片本地路径
*/
public void decodeQRCode(String picturePath) {
mProcessDataTask = new ProcessDataTask(picturePath, this).perform();
}
/**
* 解析 Bitmap 二维码。返回二维码图片里的内容 或 null
*
* @param bitmap 要解析的二维码图片
*/
public void decodeQRCode(Bitmap bitmap) {
mProcessDataTask = new ProcessDataTask(bitmap, this).perform();
}
protected abstract ScanResult processData(byte[] data, int width, int height, boolean isRetry);
protected abstract ScanResult processBitmapData(Bitmap bitmap);
void onPostParseData(ScanResult scanResult) {
if (!mSpotAble) {
return;
}
String result = scanResult == null ? null : scanResult.result;
if (TextUtils.isEmpty(result)) {
try {
if (mCamera != null) {
mCamera.setOneShotPreviewCallback(QRCodeView.this);
}
} catch (Exception e) {
e.printStackTrace();
}
} else {
mSpotAble = false;
try {
if (mDelegate != null) {
mDelegate.onScanQRCodeSuccess(result);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
void onPostParseBitmapOrPicture(ScanResult scanResult) {
if (mDelegate != null) {
String result = scanResult == null ? null : scanResult.result;
mDelegate.onScanQRCodeSuccess(result);
}
}
void onScanBoxRectChanged(Rect rect) {
mCameraPreview.onScanBoxRectChanged(rect);
}
@Override
protected void dispatchDraw(Canvas canvas) {
super.dispatchDraw(canvas);
if (!isShowLocationPoint() || mLocationPoints == null) {
return;
}
for (PointF pointF : mLocationPoints) {
canvas.drawCircle(pointF.x, pointF.y, 10, mPaint);
}
mLocationPoints = null;
postInvalidateDelayed(2000);
}
/**
* 是否显示定位点
*/
protected boolean isShowLocationPoint() {
return mScanBoxView != null && mScanBoxView.isShowLocationPoint();
}
/**
* 是否自动缩放
*/
protected boolean isAutoZoom() {
return mScanBoxView != null && mScanBoxView.isAutoZoom();
}
protected boolean transformToViewCoordinates(final PointF[] pointArr, final Rect scanBoxAreaRect, final boolean isNeedAutoZoom, final String result) {
if (pointArr == null || pointArr.length == 0) {
return false;
}
try {
// 不管横屏还是竖屏,size.width 大于 size.height
Camera.Size size = mCamera.getParameters().getPreviewSize();
boolean isMirrorPreview = mCameraId == Camera.CameraInfo.CAMERA_FACING_FRONT;
int statusBarHeight = BGAQRCodeUtil.getStatusBarHeight(getContext());
PointF[] transformedPoints = new PointF[pointArr.length];
int index = 0;
for (PointF qrPoint : pointArr) {
transformedPoints[index] = transform(qrPoint.x, qrPoint.y, size.width, size.height, isMirrorPreview, statusBarHeight, scanBoxAreaRect);
index++;
}
mLocationPoints = transformedPoints;
postInvalidate();
if (isNeedAutoZoom) {
return handleAutoZoom(transformedPoints, result);
}
return false;
} catch (Exception e) {
mLocationPoints = null;
e.printStackTrace();
return false;
}
}
private boolean handleAutoZoom(PointF[] locationPoints, final String result) {
if (mCamera == null || mScanBoxView == null) {
return false;
}
if (locationPoints == null || locationPoints.length < 1) {
return false;
}
if (mAutoZoomAnimator != null && mAutoZoomAnimator.isRunning()) {
return true;
}
if (System.currentTimeMillis() - mLastAutoZoomTime < 1200) {
return true;
}
Camera.Parameters parameters = mCamera.getParameters();
if (!parameters.isZoomSupported()) {
return false;
}
float point1X = locationPoints[0].x;
float point1Y = locationPoints[0].y;
float point2X = locationPoints[1].x;
float point2Y = locationPoints[1].y;
float xLen = Math.abs(point1X - point2X);
float yLen = Math.abs(point1Y - point2Y);
int len = (int) Math.sqrt(xLen * xLen + yLen * yLen);
int scanBoxWidth = mScanBoxView.getRectWidth();
if (len > scanBoxWidth / 4) {
return false;
}
// 二维码在扫描框中的宽度小于扫描框的 1/4,放大镜头
final int maxZoom = parameters.getMaxZoom();
final int zoomStep = maxZoom / 4;
final int zoom = parameters.getZoom();
post(new Runnable() {
@Override
public void run() {
startAutoZoom(zoom, Math.min(zoom + zoomStep, maxZoom), result);
}
});
return true;
}
private void startAutoZoom(int oldZoom, int newZoom, final String result) {
mAutoZoomAnimator = ValueAnimator.ofInt(oldZoom, newZoom);
mAutoZoomAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
if (mCameraPreview == null || !mCameraPreview.isPreviewing()) {
return;
}
int zoom = (int) animation.getAnimatedValue();
Camera.Parameters parameters = mCamera.getParameters();
parameters.setZoom(zoom);
mCamera.setParameters(parameters);
}
});
mAutoZoomAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
onPostParseData(new ScanResult(result));
}
});
mAutoZoomAnimator.setDuration(600);
mAutoZoomAnimator.setRepeatCount(0);
mAutoZoomAnimator.start();
mLastAutoZoomTime = System.currentTimeMillis();
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
if (mAutoZoomAnimator != null) {
mAutoZoomAnimator.cancel();
}
}
private PointF transform(float originX, float originY, float cameraPreviewWidth, float cameraPreviewHeight, boolean isMirrorPreview, int statusBarHeight,
final Rect scanBoxAreaRect) {
int viewWidth = getWidth();
int viewHeight = getHeight();
PointF result;
float scaleX;
float scaleY;
if (BGAQRCodeUtil.isPortrait(getContext())) {
scaleX = viewWidth / cameraPreviewHeight;
scaleY = viewHeight / cameraPreviewWidth;
result = new PointF((cameraPreviewHeight - originX) * scaleX, (cameraPreviewWidth - originY) * scaleY);
result.y = viewHeight - result.y;
result.x = viewWidth - result.x;
if (scanBoxAreaRect == null) {
result.y += statusBarHeight;
}
} else {
scaleX = viewWidth / cameraPreviewWidth;
scaleY = viewHeight / cameraPreviewHeight;
result = new PointF(originX * scaleX, originY * scaleY);
if (isMirrorPreview) {
result.x = viewWidth - result.x;
}
}
if (scanBoxAreaRect != null) {
result.y += scanBoxAreaRect.top;
result.x += scanBoxAreaRect.left;
}
return result;
}
public interface Delegate {
/**
* 处理扫描结果
*
* @param result 摄像头扫码时只要回调了该方法 result 就一定有值,不会为 null。解析本地图片或 Bitmap 时 result 可能为 null
*/
void onScanQRCodeSuccess(String result);
/**
* 摄像头环境亮度发生变化
*
* @param isDark 是否变暗
*/
void onCameraAmbientBrightnessChanged(boolean isDark);
/**
* 处理打开相机出错
*/
void onScanQRCodeOpenCameraError();
}
}
================================================
FILE: qrcodecore/src/main/java/cn/bingoogolapple/qrcode/core/ScanBoxView.java
================================================
package cn.bingoogolapple.qrcode.core;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.text.Layout;
import android.text.StaticLayout;
import android.text.TextPaint;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.View;
public class ScanBoxView extends View {
private int mMoveStepDistance;
private int mAnimDelayTime;
private Rect mFramingRect;
private float mScanLineTop;
private float mScanLineLeft;
private Paint mPaint;
private TextPaint mTipPaint;
private int mMaskColor;
private int mCornerColor;
private int mCornerLength;
private int mCornerSize;
private int mRectWidth;
private int mRectHeight;
private int mBarcodeRectHeight;
private int mTopOffset;
private int mScanLineSize;
private int mScanLineColor;
private int mScanLineMargin;
private boolean mIsShowDefaultScanLineDrawable;
private Drawable mCustomScanLineDrawable;
private Bitmap mScanLineBitmap;
private int mBorderSize;
private int mBorderColor;
private int mAnimTime;
private float mVerticalBias;
private int mCornerDisplayType;
private int mToolbarHeight;
private boolean mIsBarcode;
private String mQRCodeTipText;
private String mBarCodeTipText;
private String mTipText;
private int mTipTextSize;
private int mTipTextColor;
private boolean mIsTipTextBelowRect;
private int mTipTextMargin;
private boolean mIsShowTipTextAsSingleLine;
private int mTipBackgroundColor;
private boolean mIsShowTipBackground;
private boolean mIsScanLineReverse;
private boolean mIsShowDefaultGridScanLineDrawable;
private Drawable mCustomGridScanLineDrawable;
private Bitmap mGridScanLineBitmap;
private float mGridScanLineBottom;
private float mGridScanLineRight;
private Bitmap mOriginQRCodeScanLineBitmap;
private Bitmap mOriginBarCodeScanLineBitmap;
private Bitmap mOriginQRCodeGridScanLineBitmap;
private Bitmap mOriginBarCodeGridScanLineBitmap;
private float mHalfCornerSize;
private StaticLayout mTipTextSl;
private int mTipBackgroundRadius;
private boolean mIsOnlyDecodeScanBoxArea;
private boolean mIsShowLocationPoint;
private boolean mIsAutoZoom;
private QRCodeView mQRCodeView;
public ScanBoxView(Context context) {
super(context);
mPaint = new Paint();
mPaint.setAntiAlias(true);
mMaskColor = Color.parseColor("#33FFFFFF");
mCornerColor = Color.WHITE;
mCornerLength = BGAQRCodeUtil.dp2px(context, 20);
mCornerSize = BGAQRCodeUtil.dp2px(context, 3);
mScanLineSize = BGAQRCodeUtil.dp2px(context, 1);
mScanLineColor = Color.WHITE;
mTopOffset = BGAQRCodeUtil.dp2px(context, 90);
mRectWidth = BGAQRCodeUtil.dp2px(context, 200);
mBarcodeRectHeight = BGAQRCodeUtil.dp2px(context, 140);
mScanLineMargin = 0;
mIsShowDefaultScanLineDrawable = false;
mCustomScanLineDrawable = null;
mScanLineBitmap = null;
mBorderSize = BGAQRCodeUtil.dp2px(context, 1);
mBorderColor = Color.WHITE;
mAnimTime = 1000;
mVerticalBias = -1;
mCornerDisplayType = 1;
mToolbarHeight = 0;
mIsBarcode = false;
mMoveStepDistance = BGAQRCodeUtil.dp2px(context, 2);
mTipText = null;
mTipTextSize = BGAQRCodeUtil.sp2px(context, 14);
mTipTextColor = Color.WHITE;
mIsTipTextBelowRect = false;
mTipTextMargin = BGAQRCodeUtil.dp2px(context, 20);
mIsShowTipTextAsSingleLine = false;
mTipBackgroundColor = Color.parseColor("#22000000");
mIsShowTipBackground = false;
mIsScanLineReverse = false;
mIsShowDefaultGridScanLineDrawable = false;
mTipPaint = new TextPaint();
mTipPaint.setAntiAlias(true);
mTipBackgroundRadius = BGAQRCodeUtil.dp2px(context, 4);
mIsOnlyDecodeScanBoxArea = false;
mIsShowLocationPoint = false;
mIsAutoZoom = false;
}
void init(QRCodeView qrCodeView, AttributeSet attrs) {
mQRCodeView = qrCodeView;
TypedArray typedArray = getContext().obtainStyledAttributes(attrs, R.styleable.QRCodeView);
final int count = typedArray.getIndexCount();
for (int i = 0; i < count; i++) {
initCustomAttr(typedArray.getIndex(i), typedArray);
}
typedArray.recycle();
afterInitCustomAttrs();
}
private void initCustomAttr(int attr, TypedArray typedArray) {
if (attr == R.styleable.QRCodeView_qrcv_topOffset) {
mTopOffset = typedArray.getDimensionPixelSize(attr, mTopOffset);
} else if (attr == R.styleable.QRCodeView_qrcv_cornerSize) {
mCornerSize = typedArray.getDimensionPixelSize(attr, mCornerSize);
} else if (attr == R.styleable.QRCodeView_qrcv_cornerLength) {
mCornerLength = typedArray.getDimensionPixelSize(attr, mCornerLength);
} else if (attr == R.styleable.QRCodeView_qrcv_scanLineSize) {
mScanLineSize = typedArray.getDimensionPixelSize(attr, mScanLineSize);
} else if (attr == R.styleable.QRCodeView_qrcv_rectWidth) {
mRectWidth = typedArray.getDimensionPixelSize(attr, mRectWidth);
} else if (attr == R.styleable.QRCodeView_qrcv_maskColor) {
mMaskColor = typedArray.getColor(attr, mMaskColor);
} else if (attr == R.styleable.QRCodeView_qrcv_cornerColor) {
mCornerColor = typedArray.getColor(attr, mCornerColor);
} else if (attr == R.styleable.QRCodeView_qrcv_scanLineColor) {
mScanLineColor = typedArray.getColor(attr, mScanLineColor);
} else if (attr == R.styleable.QRCodeView_qrcv_scanLineMargin) {
mScanLineMargin = typedArray.getDimensionPixelSize(attr, mScanLineMargin);
} else if (attr == R.styleable.QRCodeView_qrcv_isShowDefaultScanLineDrawable) {
mIsShowDefaultScanLineDrawable = typedArray.getBoolean(attr, mIsShowDefaultScanLineDrawable);
} else if (attr == R.styleable.QRCodeView_qrcv_customScanLineDrawable) {
mCustomScanLineDrawable = typedArray.getDrawable(attr);
} else if (attr == R.styleable.QRCodeView_qrcv_borderSize) {
mBorderSize = typedArray.getDimensionPixelSize(attr, mBorderSize);
} else if (attr == R.styleable.QRCodeView_qrcv_borderColor) {
mBorderColor = typedArray.getColor(attr, mBorderColor);
} else if (attr == R.styleable.QRCodeView_qrcv_animTime) {
mAnimTime = typedArray.getInteger(attr, mAnimTime);
} else if (attr == R.styleable.QRCodeView_qrcv_verticalBias) {
mVerticalBias = typedArray.getFloat(attr, mVerticalBias);
} else if (attr == R.styleable.QRCodeView_qrcv_cornerDisplayType) {
mCornerDisplayType = typedArray.getInteger(attr, mCornerDisplayType);
} else if (attr == R.styleable.QRCodeView_qrcv_toolbarHeight) {
mToolbarHeight = typedArray.getDimensionPixelSize(attr, mToolbarHeight);
} else if (attr == R.styleable.QRCodeView_qrcv_barcodeRectHeight) {
mBarcodeRectHeight = typedArray.getDimensionPixelSize(attr, mBarcodeRectHeight);
} else if (attr == R.styleable.QRCodeView_qrcv_isBarcode) {
mIsBarcode = typedArray.getBoolean(attr, mIsBarcode);
} else if (attr == R.styleable.QRCodeView_qrcv_barCodeTipText) {
mBarCodeTipText = typedArray.getString(attr);
} else if (attr == R.styleable.QRCodeView_qrcv_qrCodeTipText) {
mQRCodeTipText = typedArray.getString(attr);
} else if (attr == R.styleable.QRCodeView_qrcv_tipTextSize) {
mTipTextSize = typedArray.getDimensionPixelSize(attr, mTipTextSize);
} else if (attr == R.styleable.QRCodeView_qrcv_tipTextColor) {
mTipTextColor = typedArray.getColor(attr, mTipTextColor);
} else if (attr == R.styleable.QRCodeView_qrcv_isTipTextBelowRect) {
mIsTipTextBelowRect = typedArray.getBoolean(attr, mIsTipTextBelowRect);
} else if (attr == R.styleable.QRCodeView_qrcv_tipTextMargin) {
mTipTextMargin = typedArray.getDimensionPixelSize(attr, mTipTextMargin);
} else if (attr == R.styleable.QRCodeView_qrcv_isShowTipTextAsSingleLine) {
mIsShowTipTextAsSingleLine = typedArray.getBoolean(attr, mIsShowTipTextAsSingleLine);
} else if (attr == R.styleable.QRCodeView_qrcv_isShowTipBackground) {
mIsShowTipBackground = typedArray.getBoolean(attr, mIsShowTipBackground);
} else if (attr == R.styleable.QRCodeView_qrcv_tipBackgroundColor) {
mTipBackgroundColor = typedArray.getColor(attr, mTipBackgroundColor);
} else if (attr == R.styleable.QRCodeView_qrcv_isScanLineReverse) {
mIsScanLineReverse = typedArray.getBoolean(attr, mIsScanLineReverse);
} else if (attr == R.styleable.QRCodeView_qrcv_isShowDefaultGridScanLineDrawable) {
mIsShowDefaultGridScanLineDrawable = typedArray.getBoolean(attr, mIsShowDefaultGridScanLineDrawable);
} else if (attr == R.styleable.QRCodeView_qrcv_customGridScanLineDrawable) {
mCustomGridScanLineDrawable = typedArray.getDrawable(attr);
} else if (attr == R.styleable.QRCodeView_qrcv_isOnlyDecodeScanBoxArea) {
mIsOnlyDecodeScanBoxArea = typedArray.getBoolean(attr, mIsOnlyDecodeScanBoxArea);
} else if (attr == R.styleable.QRCodeView_qrcv_isShowLocationPoint) {
mIsShowLocationPoint = typedArray.getBoolean(attr, mIsShowLocationPoint);
} else if (attr == R.styleable.QRCodeView_qrcv_isAutoZoom) {
mIsAutoZoom = typedArray.getBoolean(attr, mIsAutoZoom);
}
}
private void afterInitCustomAttrs() {
if (mCustomGridScanLineDrawable != null) {
mOriginQRCodeGridScanLineBitmap = ((BitmapDrawable) mCustomGridScanLineDrawable).getBitmap();
}
if (mOriginQRCodeGridScanLineBitmap == null) {
mOriginQRCodeGridScanLineBitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.qrcode_default_grid_scan_line);
mOriginQRCodeGridScanLineBitmap = BGAQRCodeUtil.makeTintBitmap(mOriginQRCodeGridScanLineBitmap, mScanLineColor);
}
mOriginBarCodeGridScanLineBitmap = BGAQRCodeUtil.adjustPhotoRotation(mOriginQRCodeGridScanLineBitmap, 90);
mOriginBarCodeGridScanLineBitmap = BGAQRCodeUtil.adjustPhotoRotation(mOriginBarCodeGridScanLineBitmap, 90);
mOriginBarCodeGridScanLineBitmap = BGAQRCodeUtil.adjustPhotoRotation(mOriginBarCodeGridScanLineBitmap, 90);
if (mCustomScanLineDrawable != null) {
mOriginQRCodeScanLineBitmap = ((BitmapDrawable) mCustomScanLineDrawable).getBitmap();
}
if (mOriginQRCodeScanLineBitmap == null) {
mOriginQRCodeScanLineBitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.qrcode_default_scan_line);
mOriginQRCodeScanLineBitmap = BGAQRCodeUtil.makeTintBitmap(mOriginQRCodeScanLineBitmap, mScanLineColor);
}
mOriginBarCodeScanLineBitmap = BGAQRCodeUtil.adjustPhotoRotation(mOriginQRCodeScanLineBitmap, 90);
mTopOffset += mToolbarHeight;
mHalfCornerSize = 1.0f * mCornerSize / 2;
mTipPaint.setTextSize(mTipTextSize);
mTipPaint.setColor(mTipTextColor);
setIsBarcode(mIsBarcode);
}
@Override
public void onDraw(Canvas canvas) {
if (mFramingRect == null) {
return;
}
// 画遮罩层
drawMask(canvas);
// 画边框线
drawBorderLine(canvas);
// 画四个直角的线
drawCornerLine(canvas);
// 画扫描线
drawScanLine(canvas);
// 画提示文本
drawTipText(canvas);
// 移动扫描线的位置
moveScanLine();
}
/**
* 画遮罩层
*/
private void drawMask(Canvas canvas) {
int width = canvas.getWidth();
int height = canvas.getHeight();
if (mMaskColor != Color.TRANSPARENT) {
mPaint.setStyle(Paint.Style.FILL);
mPaint.setColor(mMaskColor);
canvas.drawRect(0, 0, width, mFramingRect.top, mPaint);
canvas.drawRect(0, mFramingRect.top, mFramingRect.left, mFramingRect.bottom + 1, mPaint);
canvas.drawRect(mFramingRect.right + 1, mFramingRect.top, width, mFramingRect.bottom + 1, mPaint);
canvas.drawRect(0, mFramingRect.bottom + 1, width, height, mPaint);
}
}
/**
* 画边框线
*/
private void drawBorderLine(Canvas canvas) {
if (mBorderSize > 0) {
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setColor(mBorderColor);
mPaint.setStrokeWidth(mBorderSize);
canvas.drawRect(mFramingRect, mPaint);
}
}
/**
* 画四个直角的线
*/
private void drawCornerLine(Canvas canvas) {
if (mHalfCornerSize > 0) {
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setColor(mCornerColor);
mPaint.setStrokeWidth(mCornerSize);
if (mCornerDisplayType == 1) {
canvas.drawLine(mFramingRect.left - mHalfCornerSize, mFramingRect.top, mFramingRect.left - mHalfCornerSize + mCornerLength, mFramingRect.top,
mPaint);
canvas.drawLine(mFramingRect.left, mFramingRect.top - mHalfCornerSize, mFramingRect.left, mFramingRect.top - mHalfCornerSize + mCornerLength,
mPaint);
canvas.drawLine(mFramingRect.right + mHalfCornerSize, mFramingRect.top, mFramingRect.right + mHalfCornerSize - mCornerLength, mFramingRect.top,
mPaint);
canvas.drawLine(mFramingRect.right, mFramingRect.top - mHalfCornerSize, mFramingRect.right, mFramingRect.top - mHalfCornerSize + mCornerLength,
mPaint);
canvas.drawLine(mFramingRect.left - mHalfCornerSize, mFramingRect.bottom, mFramingRect.left - mHalfCornerSize + mCornerLength,
mFramingRect.bottom, mPaint);
canvas.drawLine(mFramingRect.left, mFramingRect.bottom + mHalfCornerSize, mFramingRect.left,
mFramingRect.bottom + mHalfCornerSize - mCornerLength, mPaint);
canvas.drawLine(mFramingRect.right + mHalfCornerSize, mFramingRect.bottom, mFramingRect.right + mHalfCornerSize - mCornerLength,
mFramingRect.bottom, mPaint);
canvas.drawLine(mFramingRect.right, mFramingRect.bottom + mHalfCornerSize, mFramingRect.right,
mFramingRect.bottom + mHalfCornerSize - mCornerLength, mPaint);
} else if (mCornerDisplayType == 2) {
canvas.drawLine(mFramingRect.left, mFramingRect.top + mHalfCornerSize, mFramingRect.left + mCornerLength, mFramingRect.top + mHalfCornerSize,
mPaint);
canvas.drawLine(mFramingRect.left + mHalfCornerSize, mFramingRect.top, mFramingRect.left + mHalfCornerSize, mFramingRect.top + mCornerLength,
mPaint);
canvas.drawLine(mFramingRect.right, mFramingRect.top + mHalfCornerSize, mFramingRect.right - mCornerLength, mFramingRect.top + mHalfCornerSize,
mPaint);
canvas.drawLine(mFramingRect.right - mHalfCornerSize, mFramingRect.top, mFramingRect.right - mHalfCornerSize, mFramingRect.top + mCornerLength,
mPaint);
canvas.drawLine(mFramingRect.left, mFramingRect.bottom - mHalfCornerSize, mFramingRect.left + mCornerLength,
mFramingRect.bottom - mHalfCornerSize, mPaint);
canvas.drawLine(mFramingRect.left + mHalfCornerSize, mFramingRect.bottom, mFramingRect.left + mHalfCornerSize,
mFramingRect.bottom - mCornerLength, mPaint);
canvas.drawLine(mFramingRect.right, mFramingRect.bottom - mHalfCornerSize, mFramingRect.right - mCornerLength,
mFramingRect.bottom - mHalfCornerSize, mPaint);
canvas.drawLine(mFramingRect.right - mHalfCornerSize, mFramingRect.bottom, mFramingRect.right - mHalfCornerSize,
mFramingRect.bottom - mCornerLength, mPaint);
}
}
}
/**
* 画扫描线
*/
private void drawScanLine(Canvas canvas) {
if (mIsBarcode) {
if (mGridScanLineBitmap != null) {
RectF dstGridRectF = new RectF(mFramingRect.left + mHalfCornerSize + 0.5f, mFramingRect.top + mHalfCornerSize + mScanLineMargin,
mGridScanLineRight, mFramingRect.bottom - mHalfCornerSize - mScanLineMargin);
Rect srcGridRect = new Rect((int) (mGridScanLineBitmap.getWidth() - dstGridRectF.width()), 0, mGridScanLineBitmap.getWidth(),
mGridScanLineBitmap.getHeight());
if (srcGridRect.left < 0) {
srcGridRect.left = 0;
dstGridRectF.left = dstGridRectF.right - srcGridRect.width();
}
canvas.drawBitmap(mGridScanLineBitmap, srcGridRect, dstGridRectF, mPaint);
} else if (mScanLineBitmap != null) {
RectF lineRect = new RectF(mScanLineLeft, mFramingRect.top + mHalfCornerSize + mScanLineMargin, mScanLineLeft + mScanLineBitmap.getWidth(),
mFramingRect.bottom - mHalfCornerSize - mScanLineMargin);
canvas.drawBitmap(mScanLineBitmap, null, lineRect, mPaint);
} else {
mPaint.setStyle(Paint.Style.FILL);
mPaint.setColor(mScanLineColor);
canvas.drawRect(mScanLineLeft, mFramingRect.top + mHalfCornerSize + mScanLineMargin, mScanLineLeft + mScanLineSize,
mFramingRect.bottom - mHalfCornerSize - mScanLineMargin, mPaint);
}
} else {
if (mGridScanLineBitmap != null) {
RectF dstGridRectF = new RectF(mFramingRect.left + mHalfCornerSize + mScanLineMargin, mFramingRect.top + mHalfCornerSize + 0.5f,
mFramingRect.right - mHalfCornerSize - mScanLineMargin, mGridScanLineBottom);
Rect srcRect = new Rect(0, (int) (mGridScanLineBitmap.getHeight() - dstGridRectF.height()), mGridScanLineBitmap.getWidth(),
mGridScanLineBitmap.getHeight());
if (srcRect.top < 0) {
srcRect.top = 0;
dstGridRectF.top = dstGridRectF.bottom - srcRect.height();
}
canvas.drawBitmap(mGridScanLineBitmap, srcRect, dstGridRectF, mPaint);
} else if (mScanLineBitmap != null) {
RectF lineRect = new RectF(mFramingRect.left + mHalfCornerSize + mScanLineMargin, mScanLineTop,
mFramingRect.right - mHalfCornerSize - mScanLineMargin, mScanLineTop + mScanLineBitmap.getHeight());
canvas.drawBitmap(mScanLineBitmap, null, lineRect, mPaint);
} else {
mPaint.setStyle(Paint.Style.FILL);
mPaint.setColor(mScanLineColor);
canvas.drawRect(mFramingRect.left + mHalfCornerSize + mScanLineMargin, mScanLineTop, mFramingRect.right - mHalfCornerSize - mScanLineMargin,
mScanLineTop + mScanLineSize, mPaint);
}
}
}
/**
* 画提示文本
*/
private void drawTipText(Canvas canvas) {
if (TextUtils.isEmpty(mTipText) || mTipTextSl == null) {
return;
}
if (mIsTipTextBelowRect) {
if (mIsShowTipBackground) {
mPaint.setColor(mTipBackgroundColor);
mPaint.setStyle(Paint.Style.FILL);
if (mIsShowTipTextAsSingleLine) {
Rect tipRect = new Rect();
mTipPaint.getTextBounds(mTipText, 0, mTipText.length(), tipRect);
float left = (canvas.getWidth() - tipRect.width()) / 2 - mTipBackgroundRadius;
canvas.drawRoundRect(
new RectF(left, mFramingRect.bottom + mTipTextMargin - mTipBackgroundRadius, left + tipRect.width() + 2 * mTipBackgroundRadius,
mFramingRect.bottom + mTipTextMargin + mTipTextSl.getHeight() + mTipBackgroundRadius), mTipBackgroundRadius,
mTipBackgroundRadius, mPaint);
} else {
canvas.drawRoundRect(new RectF(mFramingRect.left, mFramingRect.bottom + mTipTextMargin - mTipBackgroundRadius, mFramingRect.right,
mFramingRect.bottom + mTipTextMargin + mTipTextSl.getHeight() + mTipBackgroundRadius), mTipBackgroundRadius,
mTipBackgroundRadius,
mPaint);
}
}
canvas.save();
if (mIsShowTipTextAsSingleLine) {
canvas.translate(0, mFramingRect.bottom + mTipTextMargin);
} else {
canvas.translate(mFramingRect.left + mTipBackgroundRadius, mFramingRect.bottom + mTipTextMargin);
}
mTipTextSl.draw(canvas);
canvas.restore();
} else {
if (mIsShowTipBackground) {
mPaint.setColor(mTipBackgroundColor);
mPaint.setStyle(Paint.Style.FILL);
if (mIsShowTipTextAsSingleLine) {
Rect tipRect = new Rect();
mTipPaint.getTextBounds(mTipText, 0, mTipText.length(), tipRect);
float left = (canvas.getWidth() - tipRect.width()) / 2 - mTipBackgroundRadius;
canvas.drawRoundRect(new RectF(left, mFramingRect.top - mTipTextMargin - mTipTextSl.getHeight() - mTipBackgroundRadius,
left + tipRect.width() + 2 * mTipBackgroundRadius, mFramingRect.top - mTipTextMargin + mTipBackgroundRadius),
mTipBackgroundRadius,
mTipBackgroundRadius, mPaint);
} else {
canvas.drawRoundRect(
new RectF(mFramingRect.left, mFramingRect.top - mTipTextMargin - mTipTextSl.getHeight() - mTipBackgroundRadius, mFramingRect.right,
mFramingRect.top - mTipTextMargin + mTipBackgroundRadius), mTipBackgroundRadius, mTipBackgroundRadius, mPaint);
}
}
canvas.save();
if (mIsShowTipTextAsSingleLine) {
canvas.translate(0, mFramingRect.top - mTipTextMargin - mTipTextSl.getHeight());
} else {
canvas.translate(mFramingRect.left + mTipBackgroundRadius, mFramingRect.top - mTipTextMargin - mTipTextSl.getHeight());
}
mTipTextSl.draw(canvas);
canvas.restore();
}
}
/**
* 移动扫描线的位置
*/
private void moveScanLine() {
if (mIsBarcode) {
if (mGridScanLineBitmap == null) {
// 处理非网格扫描图片的情况
mScanLineLeft += mMoveStepDistance;
int scanLineSize = mScanLineSize;
if (mScanLineBitmap != null) {
scanLineSize = mScanLineBitmap.getWidth();
}
if (mIsScanLineReverse) {
if (mScanLineLeft + scanLineSize > mFramingRect.right - mHalfCornerSize || mScanLineLeft < mFramingRect.left + mHalfCornerSize) {
mMoveStepDistance = -mMoveStepDistance;
}
} else {
if (mScanLineLeft + scanLineSize > mFramingRect.right - mHalfCornerSize) {
mScanLineLeft = mFramingRect.left + mHalfCornerSize + 0.5f;
}
}
} else {
// 处理网格扫描图片的情况
mGridScanLineRight += mMoveStepDistance;
if (mGridScanLineRight > mFramingRect.right - mHalfCornerSize) {
mGridScanLineRight = mFramingRect.left + mHalfCornerSize + 0.5f;
}
}
} else {
if (mGridScanLineBitmap == null) {
// 处理非网格扫描图片的情况
mScanLineTop += mMoveStepDistance;
int scanLineSize = mScanLineSize;
if (mScanLineBitmap != null) {
scanLineSize = mScanLineBitmap.getHeight();
}
if (mIsScanLineReverse) {
if (mScanLineTop + scanLineSize > mFramingRect.bottom - mHalfCornerSize || mScanLineTop < mFramingRect.top + mHalfCornerSize) {
mMoveStepDistance = -mMoveStepDistance;
}
} else {
if (mScanLineTop + scanLineSize > mFramingRect.bottom - mHalfCornerSize) {
mScanLineTop = mFramingRect.top + mHalfCornerSize + 0.5f;
}
}
} else {
// 处理网格扫描图片的情况
mGridScanLineBottom += mMoveStepDistance;
if (mGridScanLineBottom > mFramingRect.bottom - mHalfCornerSize) {
mGridScanLineBottom = mFramingRect.top + mHalfCornerSize + 0.5f;
}
}
}
postInvalidateDelayed(mAnimDelayTime, mFramingRect.left, mFramingRect.top, mFramingRect.right, mFramingRect.bottom);
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
calFramingRect();
}
private void calFramingRect() {
int leftOffset = (getWidth() - mRectWidth) / 2;
mFramingRect = new Rect(leftOffset, mTopOffset, leftOffset + mRectWidth, mTopOffset + mRectHeight);
if (mIsBarcode) {
mGridScanLineRight = mScanLineLeft = mFramingRect.left + mHalfCornerSize + 0.5f;
} else {
mGridScanLineBottom = mScanLineTop = mFramingRect.top + mHalfCornerSize + 0.5f;
}
if (mQRCodeView != null && isOnlyDecodeScanBoxArea()) {
mQRCodeView.onScanBoxRectChanged(new Rect(mFramingRect));
}
}
public Rect getScanBoxAreaRect(int previewHeight) {
if (mIsOnlyDecodeScanBoxArea && getVisibility() == View.VISIBLE) {
Rect rect = new Rect(mFramingRect);
float ratio = 1.0f * previewHeight / getMeasuredHeight();
float centerX = rect.exactCenterX() * ratio;
float centerY = rect.exactCenterY() * ratio;
float halfWidth = rect.width() / 2f;
float halfHeight = rect.height() / 2f;
float newHalfWidth = halfWidth * ratio;
float newHalfHeight = halfHeight * ratio;
rect.left = (int) (centerX - newHalfWidth);
rect.right = (int) (centerX + newHalfWidth);
rect.top = (int) (centerY - newHalfHeight);
rect.bottom = (int) (centerY + newHalfHeight);
return rect;
} else {
return null;
}
}
public void setIsBarcode(boolean isBarcode) {
mIsBarcode = isBarcode;
refreshScanBox();
}
private void refreshScanBox() {
if (mCustomGridScanLineDrawable != null || mIsShowDefaultGridScanLineDrawable) {
if (mIsBarcode) {
mGridScanLineBitmap = mOriginBarCodeGridScanLineBitmap;
} else {
mGridScanLineBitmap = mOriginQRCodeGridScanLineBitmap;
}
} else if (mCustomScanLineDrawable != null || mIsShowDefaultScanLineDrawable) {
if (mIsBarcode) {
mScanLineBitmap = mOriginBarCodeScanLineBitmap;
} else {
mScanLineBitmap = mOriginQRCodeScanLineBitmap;
}
}
if (mIsBarcode) {
mTipText = mBarCodeTipText;
mRectHeight = mBarcodeRectHeight;
mAnimDelayTime = (int) ((1.0f * mAnimTime * mMoveStepDistance) / mRectWidth);
} else {
mTipText = mQRCodeTipText;
mRectHeight = mRectWidth;
mAnimDelayTime = (int) ((1.0f * mAnimTime * mMoveStepDistance) / mRectHeight);
}
if (!TextUtils.isEmpty(mTipText)) {
if (mIsShowTipTextAsSingleLine) {
mTipTextSl = new StaticLayout(mTipText, mTipPaint, BGAQRCodeUtil.getScreenResolution(getContext()).x, Layout.Alignment.ALIGN_CENTER, 1.0f, 0,
true);
} else {
mTipTextSl = new StaticLayout(mTipText, mTipPaint, mRectWidth - 2 * mTipBackgroundRadius, Layout.Alignment.ALIGN_CENTER, 1.0f, 0, true);
}
}
if (mVerticalBias != -1) {
int screenHeight = BGAQRCodeUtil.getScreenResolution(getContext()).y - BGAQRCodeUtil.getStatusBarHeight(getContext());
if (mToolbarHeight == 0) {
mTopOffset = (int) (screenHeight * mVerticalBias - mRectHeight / 2);
} else {
mTopOffset = mToolbarHeight + (int) ((screenHeight - mToolbarHeight) * mVerticalBias - mRectHeight / 2);
}
}
calFramingRect();
postInvalidate();
}
public boolean getIsBarcode() {
return mIsBarcode;
}
public int getMaskColor() {
return mMaskColor;
}
public void setMaskColor(int maskColor) {
mMaskColor = maskColor;
refreshScanBox();
}
public int getCornerColor() {
return mCornerColor;
}
public void setCornerColor(int cornerColor) {
mCornerColor = cornerColor;
refreshScanBox();
}
public int getCornerLength() {
return mCornerLength;
}
public void setCornerLength(int cornerLength) {
mCornerLength = cornerLength;
refreshScanBox();
}
public int getCornerSize() {
return mCornerSize;
}
public void setCornerSize(int cornerSize) {
mCornerSize = cornerSize;
refreshScanBox();
}
public int getRectWidth() {
return mRectWidth;
}
public void setRectWidth(int rectWidth) {
mRectWidth = rectWidth;
refreshScanBox();
}
public int getRectHeight() {
return mRectHeight;
}
public void setRectHeight(int rectHeight) {
mRectHeight = rectHeight;
refreshScanBox();
}
public int getBarcodeRectHeight() {
return mBarcodeRectHeight;
}
public void setBarcodeRectHeight(int barcodeRectHeight) {
mBarcodeRectHeight = barcodeRectHeight;
refreshScanBox();
}
public int getTopOffset() {
return mTopOffset;
}
public void setTopOffset(int topOffset) {
mTopOffset = topOffset;
refreshScanBox();
}
public int getScanLineSize() {
return mScanLineSize;
}
public void setScanLineSize(int scanLineSize) {
mScanLineSize = scanLineSize;
refreshScanBox();
}
public int getScanLineColor() {
return mScanLineColor;
}
public void setScanLineColor(int scanLineColor) {
mScanLineColor = scanLineColor;
refreshScanBox();
}
public int getScanLineMargin() {
return mScanLineMargin;
}
public void setScanLineMargin(int scanLineMargin) {
mScanLineMargin = scanLineMargin;
refreshScanBox();
}
public boolean isShowDefaultScanLineDrawable() {
return mIsShowDefaultScanLineDrawable;
}
public void setShowDefaultScanLineDrawable(boolean showDefaultScanLineDrawable) {
mIsShowDefaultScanLineDrawable = showDefaultScanLineDrawable;
refreshScanBox();
}
public Drawable getCustomScanLineDrawable() {
return mCustomScanLineDrawable;
}
public void setCustomScanLineDrawable(Drawable customScanLineDrawable) {
mCustomScanLineDrawable = customScanLineDrawable;
refreshScanBox();
}
public Bitmap getScanLineBitmap() {
return mScanLineBitmap;
}
public void setScanLineBitmap(Bitmap scanLineBitmap) {
mScanLineBitmap = scanLineBitmap;
refreshScanBox();
}
public int getBorderSize() {
return mBorderSize;
}
public void setBorderSize(int borderSize) {
mBorderSize = borderSize;
refreshScanBox();
}
public int getBorderColor() {
return mBorderColor;
}
public void setBorderColor(int borderColor) {
mBorderColor = borderColor;
refreshScanBox();
}
public int getAnimTime() {
return mAnimTime;
}
public void setAnimTime(int animTime) {
mAnimTime = animTime;
refreshScanBox();
}
public float getVerticalBias() {
return mVerticalBias;
}
public void setVerticalBias(float verticalBias) {
mVerticalBias = verticalBias;
refreshScanBox();
}
public int getToolbarHeight() {
return mToolbarHeight;
}
public void setToolbarHeight(int toolbarHeight) {
mToolbarHeight = toolbarHeight;
refreshScanBox();
}
public String getQRCodeTipText() {
return mQRCodeTipText;
}
public void setQRCodeTipText(String qrCodeTipText) {
mQRCodeTipText = qrCodeTipText;
refreshScanBox();
}
public String getBarCodeTipText() {
return mBarCodeTipText;
}
public void setBarCodeTipText(String barCodeTipText) {
mBarCodeTipText = barCodeTipText;
refreshScanBox();
}
public String getTipText() {
return mTipText;
}
public void setTipText(String tipText) {
if (mIsBarcode) {
mBarCodeTipText = tipText;
} else {
mQRCodeTipText = tipText;
}
refreshScanBox();
}
public int getTipTextColor() {
return mTipTextColor;
}
public void setTipTextColor(int tipTextColor) {
mTipTextColor = tipTextColor;
mTipPaint.setColor(mTipTextColor);
refreshScanBox();
}
public int getTipTextSize() {
return mTipTextSize;
}
public void setTipTextSize(int tipTextSize) {
mTipTextSize = tipTextSize;
mTipPaint.setTextSize(mTipTextSize);
refreshScanBox();
}
public boolean isTipTextBelowRect() {
return mIsTipTextBelowRect;
}
public void setTipTextBelowRect(boolean tipTextBelowRect) {
mIsTipTextBelowRect = tipTextBelowRect;
refreshScanBox();
}
public int getTipTextMargin() {
return mTipTextMargin;
}
public void setTipTextMargin(int tipTextMargin) {
mTipTextMargin = tipTextMargin;
refreshScanBox();
}
public boolean isShowTipTextAsSingleLine() {
return mIsShowTipTextAsSingleLine;
}
public void setShowTipTextAsSingleLine(boolean showTipTextAsSingleLine) {
mIsShowTipTextAsSingleLine = showTipTextAsSingleLine;
refreshScanBox();
}
public boolean isShowTipBackground() {
return mIsShowTipBackground;
}
public void setShowTipBackground(boolean showTipBackground) {
mIsShowTipBackground = showTipBackground;
refreshScanBox();
}
public int getTipBackgroundColor() {
return mTipBackgroundColor;
}
public void setTipBackgroundColor(int tipBackgroundColor) {
mTipBackgroundColor = tipBackgroundColor;
refreshScanBox();
}
public boolean isScanLineReverse() {
return mIsScanLineReverse;
}
public void setScanLineReverse(boolean scanLineReverse) {
mIsScanLineReverse = scanLineReverse;
refreshScanBox();
}
public boolean isShowDefaultGridScanLineDrawable() {
return mIsShowDefaultGridScanLineDrawable;
}
public void setShowDefaultGridScanLineDrawable(boolean showDefaultGridScanLineDrawable) {
mIsShowDefaultGridScanLineDrawable = showDefaultGridScanLineDrawable;
refreshScanBox();
}
public float getHalfCornerSize() {
return mHalfCornerSize;
}
public void setHalfCornerSize(float halfCornerSize) {
mHalfCornerSize = halfCornerSize;
refreshScanBox();
}
public StaticLayout getTipTextSl() {
return mTipTextSl;
}
public void setTipTextSl(StaticLayout tipTextSl) {
mTipTextSl = tipTextSl;
refreshScanBox();
}
public int getTipBackgroundRadius() {
return mTipBackgroundRadius;
}
public void setTipBackgroundRadius(int tipBackgroundRadius) {
mTipBackgroundRadius = tipBackgroundRadius;
refreshScanBox();
}
public boolean isOnlyDecodeScanBoxArea() {
return mIsOnlyDecodeScanBoxArea;
}
public void setOnlyDecodeScanBoxArea(boolean onlyDecodeScanBoxArea) {
mIsOnlyDecodeScanBoxArea = onlyDecodeScanBoxArea;
calFramingRect();
}
public boolean isShowLocationPoint() {
return mIsShowLocationPoint;
}
public void setShowLocationPoint(boolean showLocationPoint) {
mIsShowLocationPoint = showLocationPoint;
}
public boolean isAutoZoom() {
return mIsAutoZoom;
}
public void setAutoZoom(boolean autoZoom) {
mIsAutoZoom = autoZoom;
}
}
================================================
FILE: qrcodecore/src/main/java/cn/bingoogolapple/qrcode/core/ScanResult.java
================================================
package cn.bingoogolapple.qrcode.core;
import android.graphics.PointF;
/**
* 作者:王浩
* 创建时间:2018/6/15
* 描述:
*/
public class ScanResult {
String result;
PointF[] resultPoints;
public ScanResult(String result) {
this.result = result;
}
public ScanResult(String result, PointF[] resultPoints) {
this.result = result;
this.resultPoints = resultPoints;
}
}
================================================
FILE: qrcodecore/src/main/res/values/attrs.xml
================================================
================================================
FILE: qrcodecore/src/main/res/values/ids.xml
================================================
================================================
FILE: settings.gradle
================================================
include ':qrcodecore', ':zxing', ':zbar', ':zxingdemo', ':zbardemo'
================================================
FILE: zbar/build.gradle
================================================
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
android {
compileSdkVersion ANDROID_BUILD_SDK_VERSION as int
defaultConfig {
minSdkVersion ANDROID_BUILD_MIN_SDK_VERSION as int
targetSdkVersion ANDROID_BUILD_TARGET_SDK_VERSION as int
consumerProguardFiles 'consumer-proguard-rules.pro'
}
def isBuildSo = false
if (isBuildSo) { // 构建生成 so 文件
sourceSets {
main {
jniLibs.srcDirs = []
}
}
externalNativeBuild {
ndkBuild {
path 'src/main/jni/Android.mk'
}
}
} else { // 生成 so 文件后,打包时直接使用生成的 so
sourceSets {
main {
jni.srcDirs = []
}
}
delete(file('.externalNativeBuild'), file('src/main/libs'), file('src/main/obj'))
}
}
dependencies {
api project(':qrcodecore')
}
tasks.whenTaskAdded {
if (it.name == 'releaseAndroidJavadocs') {
it.enabled = false
}
}
================================================
FILE: zbar/consumer-proguard-rules.pro
================================================
-keep class net.sourceforge.zbar.ImageScanner { *; }
-keep class net.sourceforge.zbar.Image { *; }
-keep class net.sourceforge.zbar.SymbolSet { *; }
-keep class net.sourceforge.zbar.Symbol { *; }
================================================
FILE: zbar/src/main/AndroidManifest.xml
================================================
================================================
FILE: zbar/src/main/java/cn/bingoogolapple/qrcode/zbar/BarcodeFormat.java
================================================
package cn.bingoogolapple.qrcode.zbar;
import net.sourceforge.zbar.Symbol;
import java.util.ArrayList;
import java.util.List;
/**
* 一维条码、二维码各种类型简介 https://blog.csdn.net/xdg_blog/article/details/52932707
* 在线生成各种码 https://barcode.tec-it.com/zh/
*/
public class BarcodeFormat {
private int mId;
private String mName;
public static final BarcodeFormat NONE = new BarcodeFormat(Symbol.NONE, "NONE");
public static final BarcodeFormat PARTIAL = new BarcodeFormat(Symbol.PARTIAL, "PARTIAL");
public static final BarcodeFormat EAN8 = new BarcodeFormat(Symbol.EAN8, "EAN8");
public static final BarcodeFormat UPCE = new BarcodeFormat(Symbol.UPCE, "UPCE");
public static final BarcodeFormat ISBN10 = new BarcodeFormat(Symbol.ISBN10, "ISBN10");
public static final BarcodeFormat UPCA = new BarcodeFormat(Symbol.UPCA, "UPCA");
public static final BarcodeFormat EAN13 = new BarcodeFormat(Symbol.EAN13, "EAN13");
public static final BarcodeFormat ISBN13 = new BarcodeFormat(Symbol.ISBN13, "ISBN13");
public static final BarcodeFormat I25 = new BarcodeFormat(Symbol.I25, "I25");
public static final BarcodeFormat DATABAR = new BarcodeFormat(Symbol.DATABAR, "DATABAR");
public static final BarcodeFormat DATABAR_EXP = new BarcodeFormat(Symbol.DATABAR_EXP, "DATABAR_EXP");
public static final BarcodeFormat CODABAR = new BarcodeFormat(Symbol.CODABAR, "CODABAR");
public static final BarcodeFormat CODE39 = new BarcodeFormat(Symbol.CODE39, "CODE39");
public static final BarcodeFormat PDF417 = new BarcodeFormat(Symbol.PDF417, "PDF417");
public static final BarcodeFormat QRCODE = new BarcodeFormat(Symbol.QRCODE, "QRCODE");
public static final BarcodeFormat CODE93 = new BarcodeFormat(Symbol.CODE93, "CODE93");
public static final BarcodeFormat CODE128 = new BarcodeFormat(Symbol.CODE128, "CODE128");
static final List ALL_FORMAT_LIST = new ArrayList<>();
static {
ALL_FORMAT_LIST.add(BarcodeFormat.PARTIAL);
ALL_FORMAT_LIST.add(BarcodeFormat.EAN8);
ALL_FORMAT_LIST.add(BarcodeFormat.UPCE);
// ALL_FORMAT_LIST.add(BarcodeFormat.ISBN10);
ALL_FORMAT_LIST.add(BarcodeFormat.UPCA);
ALL_FORMAT_LIST.add(BarcodeFormat.EAN13);
ALL_FORMAT_LIST.add(BarcodeFormat.ISBN13);
ALL_FORMAT_LIST.add(BarcodeFormat.I25);
// ALL_FORMAT_LIST.add(BarcodeFormat.DATABAR);
ALL_FORMAT_LIST.add(BarcodeFormat.DATABAR_EXP);
ALL_FORMAT_LIST.add(BarcodeFormat.CODABAR);
ALL_FORMAT_LIST.add(BarcodeFormat.CODE39);
ALL_FORMAT_LIST.add(BarcodeFormat.PDF417);
ALL_FORMAT_LIST.add(BarcodeFormat.QRCODE);
ALL_FORMAT_LIST.add(BarcodeFormat.CODE93);
ALL_FORMAT_LIST.add(BarcodeFormat.CODE128);
}
static final List ONE_DIMENSION_FORMAT_LIST = new ArrayList<>();
static {
ONE_DIMENSION_FORMAT_LIST.add(BarcodeFormat.PARTIAL);
ONE_DIMENSION_FORMAT_LIST.add(BarcodeFormat.EAN8);
ONE_DIMENSION_FORMAT_LIST.add(BarcodeFormat.UPCE);
// ONE_DIMENSION_FORMAT_LIST.add(BarcodeFormat.ISBN10);
ONE_DIMENSION_FORMAT_LIST.add(BarcodeFormat.UPCA);
ONE_DIMENSION_FORMAT_LIST.add(BarcodeFormat.EAN13);
ONE_DIMENSION_FORMAT_LIST.add(BarcodeFormat.ISBN13);
ONE_DIMENSION_FORMAT_LIST.add(BarcodeFormat.I25);
// ONE_DIMENSION_FORMAT_LIST.add(BarcodeFormat.DATABAR);
ONE_DIMENSION_FORMAT_LIST.add(BarcodeFormat.DATABAR_EXP);
ONE_DIMENSION_FORMAT_LIST.add(BarcodeFormat.CODABAR);
ONE_DIMENSION_FORMAT_LIST.add(BarcodeFormat.CODE39);
ONE_DIMENSION_FORMAT_LIST.add(BarcodeFormat.PDF417);
ONE_DIMENSION_FORMAT_LIST.add(BarcodeFormat.CODE93);
ONE_DIMENSION_FORMAT_LIST.add(BarcodeFormat.CODE128);
}
static final List TWO_DIMENSION_FORMAT_LIST = new ArrayList<>();
static {
TWO_DIMENSION_FORMAT_LIST.add(BarcodeFormat.PDF417);
TWO_DIMENSION_FORMAT_LIST.add(BarcodeFormat.QRCODE);
}
static final List HIGH_FREQUENCY_FORMAT_LIST = new ArrayList<>();
static {
HIGH_FREQUENCY_FORMAT_LIST.add(BarcodeFormat.QRCODE);
HIGH_FREQUENCY_FORMAT_LIST.add(BarcodeFormat.ISBN13);
HIGH_FREQUENCY_FORMAT_LIST.add(BarcodeFormat.UPCA);
HIGH_FREQUENCY_FORMAT_LIST.add(BarcodeFormat.EAN13);
HIGH_FREQUENCY_FORMAT_LIST.add(BarcodeFormat.CODE128);
}
private BarcodeFormat(int id, String name) {
mId = id;
mName = name;
}
public int getId() {
return mId;
}
public String getName() {
return mName;
}
public static BarcodeFormat getFormatById(int id) {
for (BarcodeFormat format : ALL_FORMAT_LIST) {
if (format.getId() == id) {
return format;
}
}
return BarcodeFormat.NONE;
}
}
================================================
FILE: zbar/src/main/java/cn/bingoogolapple/qrcode/zbar/ZBarView.java
================================================
package cn.bingoogolapple.qrcode.zbar;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Rect;
import android.text.TextUtils;
import android.util.AttributeSet;
import net.sourceforge.zbar.Config;
import net.sourceforge.zbar.Image;
import net.sourceforge.zbar.ImageScanner;
import net.sourceforge.zbar.Symbol;
import java.nio.charset.StandardCharsets;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import cn.bingoogolapple.qrcode.core.BarcodeType;
import cn.bingoogolapple.qrcode.core.QRCodeView;
import cn.bingoogolapple.qrcode.core.ScanResult;
public class ZBarView extends QRCodeView {
static {
System.loadLibrary("iconv");
}
private ImageScanner mScanner;
private List mFormatList;
public ZBarView(Context context, AttributeSet attributeSet) {
this(context, attributeSet, 0);
}
public ZBarView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
setupReader();
}
@Override
protected void setupReader() {
mScanner = new ImageScanner();
mScanner.setConfig(0, Config.X_DENSITY, 3);
mScanner.setConfig(0, Config.Y_DENSITY, 3);
mScanner.setConfig(Symbol.NONE, Config.ENABLE, 0);
for (BarcodeFormat format : getFormats()) {
mScanner.setConfig(format.getId(), Config.ENABLE, 1);
}
}
public Collection getFormats() {
if (mBarcodeType == BarcodeType.ONE_DIMENSION) {
return BarcodeFormat.ONE_DIMENSION_FORMAT_LIST;
} else if (mBarcodeType == BarcodeType.TWO_DIMENSION) {
return BarcodeFormat.TWO_DIMENSION_FORMAT_LIST;
} else if (mBarcodeType == BarcodeType.ONLY_QR_CODE) {
return Collections.singletonList(BarcodeFormat.QRCODE);
} else if (mBarcodeType == BarcodeType.ONLY_CODE_128) {
return Collections.singletonList(BarcodeFormat.CODE128);
} else if (mBarcodeType == BarcodeType.ONLY_EAN_13) {
return Collections.singletonList(BarcodeFormat.EAN13);
} else if (mBarcodeType == BarcodeType.HIGH_FREQUENCY) {
return BarcodeFormat.HIGH_FREQUENCY_FORMAT_LIST;
} else if (mBarcodeType == BarcodeType.CUSTOM) {
return mFormatList;
} else {
return BarcodeFormat.ALL_FORMAT_LIST;
}
}
/**
* 设置识别的格式
*
* @param barcodeType 识别的格式
* @param formatList barcodeType 为 BarcodeType.CUSTOM 时,必须指定该值
*/
public void setType(BarcodeType barcodeType, List formatList) {
mBarcodeType = barcodeType;
mFormatList = formatList;
if (mBarcodeType == BarcodeType.CUSTOM && (mFormatList == null || mFormatList.isEmpty())) {
throw new RuntimeException("barcodeType 为 BarcodeType.CUSTOM 时 formatList 不能为空");
}
setupReader();
}
@Override
protected ScanResult processData(byte[] data, int width, int height, boolean isRetry) {
Image barcode = new Image(width, height, "Y800");
Rect scanBoxAreaRect = mScanBoxView.getScanBoxAreaRect(height);
if (scanBoxAreaRect != null && !isRetry && scanBoxAreaRect.left + scanBoxAreaRect.width() <= width
&& scanBoxAreaRect.top + scanBoxAreaRect.height() <= height) {
barcode.setCrop(scanBoxAreaRect.left, scanBoxAreaRect.top, scanBoxAreaRect.width(), scanBoxAreaRect.height());
}
barcode.setData(data);
String result = processData(barcode);
return new ScanResult(result);
}
private String processData(Image barcode) {
if (mScanner.scanImage(barcode) == 0) {
return null;
}
for (Symbol symbol : mScanner.getResults()) {
// 未能识别的格式继续遍历
if (symbol.getType() == Symbol.NONE) {
continue;
}
String symData;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
symData = new String(symbol.getDataBytes(), StandardCharsets.UTF_8);
} else {
symData = symbol.getData();
}
// 空数据继续遍历
if (TextUtils.isEmpty(symData)) {
continue;
}
// 处理自动缩放和定位点
boolean isNeedAutoZoom = isNeedAutoZoom(symbol);
if (isShowLocationPoint() || isNeedAutoZoom) {
if (transformToViewCoordinates(symbol.getLocationPoints(), null, isNeedAutoZoom, symData)) {
return null;
} else {
return symData;
}
} else {
return symData;
}
}
return null;
}
private boolean isNeedAutoZoom(Symbol symbol) {
return isAutoZoom() && symbol.getType() == Symbol.QRCODE;
}
@Override
protected ScanResult processBitmapData(Bitmap bitmap) {
try {
int picWidth = bitmap.getWidth();
int picHeight = bitmap.getHeight();
Image barcode = new Image(picWidth, picHeight, "RGB4");
int[] pix = new int[picWidth * picHeight];
bitmap.getPixels(pix, 0, picWidth, 0, 0, picWidth, picHeight);
barcode.setData(pix);
String result = processData(barcode.convert("Y800"));
return new ScanResult(result);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}
================================================
FILE: zbar/src/main/java/net/sourceforge/zbar/Config.java
================================================
/*------------------------------------------------------------------------
* Config
*
* Copyright 2010 (c) Jeff Brown
*
* This file is part of the ZBar Bar Code Reader.
*
* The ZBar Bar Code Reader is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* The ZBar Bar Code Reader 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 Public License for more details.
*
* You should have received a copy of the GNU Lesser Public License
* along with the ZBar Bar Code Reader; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*
* http://sourceforge.net/projects/zbar
*------------------------------------------------------------------------*/
package net.sourceforge.zbar;
/** Decoder configuration options.
*/
public class Config
{
/** Enable symbology/feature. */
public static final int ENABLE = 0;
/** Enable check digit when optional. */
public static final int ADD_CHECK = 1;
/** Return check digit when present. */
public static final int EMIT_CHECK = 2;
/** Enable full ASCII character set. */
public static final int ASCII = 3;
/** Minimum data length for valid decode. */
public static final int MIN_LEN = 0x20;
/** Maximum data length for valid decode. */
public static final int MAX_LEN = 0x21;
/** Required video consistency frames. */
public static final int UNCERTAINTY = 0x40;
/** Enable scanner to collect position data. */
public static final int POSITION = 0x80;
/** Image scanner vertical scan density. */
public static final int X_DENSITY = 0x100;
/** Image scanner horizontal scan density. */
public static final int Y_DENSITY = 0x101;
}
================================================
FILE: zbar/src/main/java/net/sourceforge/zbar/Image.java
================================================
/*------------------------------------------------------------------------
* Image
*
* Copyright 2007-2010 (c) Jeff Brown
*
* This file is part of the ZBar Bar Code Reader.
*
* The ZBar Bar Code Reader is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* The ZBar Bar Code Reader 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 Public License for more details.
*
* You should have received a copy of the GNU Lesser Public License
* along with the ZBar Bar Code Reader; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*
* http://sourceforge.net/projects/zbar
*------------------------------------------------------------------------*/
package net.sourceforge.zbar;
/** stores image data samples along with associated format and size
* metadata.
*/
public class Image
{
/** C pointer to a zbar_symbol_t. */
private long peer;
private Object data;
static
{
System.loadLibrary("zbarjni");
init();
}
private static native void init();
public Image ()
{
peer = create();
}
public Image (int width, int height)
{
this();
setSize(width, height);
}
public Image (int width, int height, String format)
{
this();
setSize(width, height);
setFormat(format);
}
public Image (String format)
{
this();
setFormat(format);
}
Image (long peer)
{
this.peer = peer;
}
/** Create an associated peer instance. */
private native long create();
protected void finalize ()
{
destroy();
}
/** Clean up native data associated with an instance. */
public synchronized void destroy ()
{
if(peer != 0) {
destroy(peer);
peer = 0;
}
}
/** Destroy the associated peer instance. */
private native void destroy(long peer);
/** Image format conversion.
* @returns a @em new image with the sample data from the original
* image converted to the requested format fourcc. the original
* image is unaffected.
*/
public Image convert (String format)
{
long newpeer = convert(peer, format);
if(newpeer == 0)
return(null);
return(new Image(newpeer));
}
private native long convert(long peer, String format);
/** Retrieve the image format fourcc. */
public native String getFormat();
/** Specify the fourcc image format code for image sample data. */
public native void setFormat(String format);
/** Retrieve a "sequence" (page/frame) number associated with this
* image.
*/
public native int getSequence();
/** Associate a "sequence" (page/frame) number with this image. */
public native void setSequence(int seq);
/** Retrieve the width of the image. */
public native int getWidth();
/** Retrieve the height of the image. */
public native int getHeight();
/** Retrieve the size of the image. */
public native int[] getSize();
/** Specify the pixel size of the image. */
public native void setSize(int width, int height);
/** Specify the pixel size of the image. */
public native void setSize(int[] size);
/** Retrieve the crop region of the image. */
public native int[] getCrop();
/** Specify the crop region of the image. */
public native void setCrop(int x, int y, int width, int height);
/** Specify the crop region of the image. */
public native void setCrop(int[] crop);
/** Retrieve the image sample data. */
public native byte[] getData();
/** Specify image sample data. */
public native void setData(byte[] data);
/** Specify image sample data. */
public native void setData(int[] data);
/** Retrieve the decoded results associated with this image. */
public SymbolSet getSymbols ()
{
return(new SymbolSet(getSymbols(peer)));
}
private native long getSymbols(long peer);
}
================================================
FILE: zbar/src/main/java/net/sourceforge/zbar/ImageScanner.java
================================================
/*------------------------------------------------------------------------
* ImageScanner
*
* Copyright 2007-2010 (c) Jeff Brown
*
* This file is part of the ZBar Bar Code Reader.
*
* The ZBar Bar Code Reader is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* The ZBar Bar Code Reader 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 Public License for more details.
*
* You should have received a copy of the GNU Lesser Public License
* along with the ZBar Bar Code Reader; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*
* http://sourceforge.net/projects/zbar
*------------------------------------------------------------------------*/
package net.sourceforge.zbar;
/** Read barcodes from 2-D images.
*/
public class ImageScanner
{
/** C pointer to a zbar_image_scanner_t. */
private long peer;
static
{
System.loadLibrary("zbarjni");
init();
}
private static native void init();
public ImageScanner ()
{
peer = create();
}
/** Create an associated peer instance. */
private native long create();
protected void finalize ()
{
destroy();
}
/** Clean up native data associated with an instance. */
public synchronized void destroy ()
{
if(peer != 0) {
destroy(peer);
peer = 0;
}
}
/** Destroy the associated peer instance. */
private native void destroy(long peer);
/** Set config for indicated symbology (0 for all) to specified value.
*/
public native void setConfig(int symbology, int config, int value)
throws IllegalArgumentException;
/** Parse configuration string and apply to image scanner. */
public native void parseConfig(String config);
/** Enable or disable the inter-image result cache (default disabled).
* Mostly useful for scanning video frames, the cache filters duplicate
* results from consecutive images, while adding some consistency
* checking and hysteresis to the results. Invoking this method also
* clears the cache.
*/
public native void enableCache(boolean enable);
/** Retrieve decode results for last scanned image.
* @returns the SymbolSet result container
*/
public SymbolSet getResults ()
{
return(new SymbolSet(getResults(peer)));
}
private native long getResults(long peer);
/** Scan for symbols in provided Image.
* The image format must currently be "Y800" or "GRAY".
* @returns the number of symbols successfully decoded from the image.
*/
public native int scanImage(Image image);
}
================================================
FILE: zbar/src/main/java/net/sourceforge/zbar/Modifier.java
================================================
/*------------------------------------------------------------------------
* Modifier
*
* Copyright 2010 (c) Jeff Brown
*
* This file is part of the ZBar Bar Code Reader.
*
* The ZBar Bar Code Reader is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* The ZBar Bar Code Reader 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 Public License for more details.
*
* You should have received a copy of the GNU Lesser Public License
* along with the ZBar Bar Code Reader; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*
* http://sourceforge.net/projects/zbar
*------------------------------------------------------------------------*/
package net.sourceforge.zbar;
/** Decoder symbology modifiers.
*/
public class Modifier
{
/** barcode tagged as GS1 (EAN.UCC) reserved
* (eg, FNC1 before first data character).
* data may be parsed as a sequence of GS1 AIs
*/
public static final int GS1 = 0;
/** barcode tagged as AIM reserved
* (eg, FNC1 after first character or digit pair)
*/
public static final int AIM = 1;
}
================================================
FILE: zbar/src/main/java/net/sourceforge/zbar/Orientation.java
================================================
/*------------------------------------------------------------------------
* Orientation
*
* Copyright 2010 (c) Jeff Brown
*
* This file is part of the ZBar Bar Code Reader.
*
* The ZBar Bar Code Reader is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* The ZBar Bar Code Reader 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 Public License for more details.
*
* You should have received a copy of the GNU Lesser Public License
* along with the ZBar Bar Code Reader; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*
* http://sourceforge.net/projects/zbar
*------------------------------------------------------------------------*/
package net.sourceforge.zbar;
/** Decoded symbol coarse orientation.
*/
public class Orientation
{
/** Unable to determine orientation. */
public static final int UNKNOWN = -1;
/** Upright, read left to right. */
public static final int UP = 0;
/** sideways, read top to bottom */
public static final int RIGHT = 1;
/** upside-down, read right to left */
public static final int DOWN = 2;
/** sideways, read bottom to top */
public static final int LEFT = 3;
}
================================================
FILE: zbar/src/main/java/net/sourceforge/zbar/Symbol.java
================================================
/*------------------------------------------------------------------------
* Symbol
*
* Copyright 2007-2010 (c) Jeff Brown
*
* This file is part of the ZBar Bar Code Reader.
*
* The ZBar Bar Code Reader is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* The ZBar Bar Code Reader 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 Public License for more details.
*
* You should have received a copy of the GNU Lesser Public License
* along with the ZBar Bar Code Reader; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*
* http://sourceforge.net/projects/zbar
*------------------------------------------------------------------------*/
package net.sourceforge.zbar;
import android.graphics.PointF;
/**
* Immutable container for decoded result symbols associated with an image
* or a composite symbol.
*/
public class Symbol {
/** No symbol decoded. */
public static final int NONE = 0;
/** Symbol detected but not decoded. */
public static final int PARTIAL = 1;
/** EAN-8. */
public static final int EAN8 = 8;
/** UPC-E. */
public static final int UPCE = 9;
/** ISBN-10 (from EAN-13). */
public static final int ISBN10 = 10;
/** UPC-A. */
public static final int UPCA = 12;
/** EAN-13. */
public static final int EAN13 = 13;
/** ISBN-13 (from EAN-13). */
public static final int ISBN13 = 14;
/** Interleaved 2 of 5. */
public static final int I25 = 25;
/** DataBar (RSS-14). */
public static final int DATABAR = 34;
/** DataBar Expanded. */
public static final int DATABAR_EXP = 35;
/** Codabar. */
public static final int CODABAR = 38;
/** Code 39. */
public static final int CODE39 = 39;
/** PDF417. */
public static final int PDF417 = 57;
/** QR Code. */
public static final int QRCODE = 64;
/** Code 93. */
public static final int CODE93 = 93;
/** Code 128. */
public static final int CODE128 = 128;
/** C pointer to a zbar_symbol_t. */
private long peer;
/** Cached attributes. */
private int type;
static {
System.loadLibrary("zbarjni");
init();
}
private static native void init();
/** Symbols are only created by other package methods. */
Symbol(long peer) {
this.peer = peer;
}
protected void finalize() {
destroy();
}
/** Clean up native data associated with an instance. */
public synchronized void destroy() {
if (peer != 0) {
destroy(peer);
peer = 0;
}
}
/** Release the associated peer instance. */
private native void destroy(long peer);
/** Retrieve type of decoded symbol. */
public int getType() {
if (type == 0) {
type = getType(peer);
}
return (type);
}
private native int getType(long peer);
/** Retrieve symbology boolean configs settings used during decode. */
public native int getConfigMask();
/** Retrieve symbology characteristics detected during decode. */
public native int getModifierMask();
/** Retrieve data decoded from symbol as a String. */
public native String getData();
/** Retrieve raw data bytes decoded from symbol. */
public native byte[] getDataBytes();
/**
* Retrieve a symbol confidence metric. Quality is an unscaled,
* relative quantity: larger values are better than smaller
* values, where "large" and "small" are application dependent.
*/
public native int getQuality();
/**
* Retrieve current cache count. When the cache is enabled for
* the image_scanner this provides inter-frame reliability and
* redundancy information for video streams.
*
* @returns < 0 if symbol is still uncertain
* @returns 0 if symbol is newly verified
* @returns > 0 for duplicate symbols
*/
public native int getCount();
public int getLocationSize() {
return getLocationSize(peer);
}
/**
* Retrieve an approximate, axis-aligned bounding box for the
* symbol.
*/
public int[] getBounds() {
int n = getLocationSize(peer);
if (n <= 0) {
return (null);
}
int[] bounds = new int[4];
int xmin = Integer.MAX_VALUE;
int xmax = Integer.MIN_VALUE;
int ymin = Integer.MAX_VALUE;
int ymax = Integer.MIN_VALUE;
for (int i = 0; i < n; i++) {
int x = getLocationX(peer, i);
if (xmin > x) xmin = x;
if (xmax < x) xmax = x;
int y = getLocationY(peer, i);
if (ymin > y) ymin = y;
if (ymax < y) ymax = y;
}
bounds[0] = xmin;
bounds[1] = ymin;
bounds[2] = xmax - xmin;
bounds[3] = ymax - ymin;
return (bounds);
}
private native int getLocationSize(long peer);
private native int getLocationX(long peer, int idx);
private native int getLocationY(long peer, int idx);
public int[] getLocationPoint(int idx) {
int[] p = new int[2];
p[0] = getLocationX(peer, idx);
p[1] = getLocationY(peer, idx);
return (p);
}
public PointF[] getLocationPoints() {
int locationSize = getLocationSize(peer);
final PointF[] pointArr = new PointF[locationSize];
for (int pointIndex = 0; pointIndex < locationSize; pointIndex++) {
pointArr[pointIndex] = new PointF(getLocationX(peer, pointIndex), getLocationY(peer, pointIndex));
}
return pointArr;
}
/**
* Retrieve general axis-aligned, orientation of decoded
* symbol.
*/
public native int getOrientation();
/** Retrieve components of a composite result. */
public SymbolSet getComponents() {
return (new SymbolSet(getComponents(peer)));
}
private native long getComponents(long peer);
native long next();
}
================================================
FILE: zbar/src/main/java/net/sourceforge/zbar/SymbolIterator.java
================================================
/*------------------------------------------------------------------------
* SymbolIterator
*
* Copyright 2007-2010 (c) Jeff Brown
*
* This file is part of the ZBar Bar Code Reader.
*
* The ZBar Bar Code Reader is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* The ZBar Bar Code Reader 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 Public License for more details.
*
* You should have received a copy of the GNU Lesser Public License
* along with the ZBar Bar Code Reader; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*
* http://sourceforge.net/projects/zbar
*------------------------------------------------------------------------*/
package net.sourceforge.zbar;
/** Iterator over a SymbolSet.
*/
public class SymbolIterator
implements java.util.Iterator
{
/** Next symbol to be returned by the iterator. */
private Symbol current;
/** SymbolIterators are only created by internal interface methods. */
SymbolIterator (Symbol first)
{
current = first;
}
/** Returns true if the iteration has more elements. */
public boolean hasNext ()
{
return(current != null);
}
/** Retrieves the next element in the iteration. */
public Symbol next ()
{
if(current == null)
throw(new java.util.NoSuchElementException
("access past end of SymbolIterator"));
Symbol result = current;
long sym = current.next();
if(sym != 0)
current = new Symbol(sym);
else
current = null;
return(result);
}
/** Raises UnsupportedOperationException. */
public void remove ()
{
throw(new UnsupportedOperationException
("SymbolIterator is immutable"));
}
}
================================================
FILE: zbar/src/main/java/net/sourceforge/zbar/SymbolSet.java
================================================
/*------------------------------------------------------------------------
* SymbolSet
*
* Copyright 2007-2010 (c) Jeff Brown
*
* This file is part of the ZBar Bar Code Reader.
*
* The ZBar Bar Code Reader is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* The ZBar Bar Code Reader 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 Public License for more details.
*
* You should have received a copy of the GNU Lesser Public License
* along with the ZBar Bar Code Reader; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*
* http://sourceforge.net/projects/zbar
*------------------------------------------------------------------------*/
package net.sourceforge.zbar;
/** Immutable container for decoded result symbols associated with an image
* or a composite symbol.
*/
public class SymbolSet
extends java.util.AbstractCollection
{
/** C pointer to a zbar_symbol_set_t. */
private long peer;
static
{
System.loadLibrary("zbarjni");
init();
}
private static native void init();
/** SymbolSets are only created by other package methods. */
SymbolSet (long peer)
{
this.peer = peer;
}
protected void finalize ()
{
destroy();
}
/** Clean up native data associated with an instance. */
public synchronized void destroy ()
{
if(peer != 0) {
destroy(peer);
peer = 0;
}
}
/** Release the associated peer instance. */
private native void destroy(long peer);
/** Retrieve an iterator over the Symbol elements in this collection. */
public java.util.Iterator iterator ()
{
long sym = firstSymbol(peer);
if(sym == 0)
return(new SymbolIterator(null));
return(new SymbolIterator(new Symbol(sym)));
}
/** Retrieve the number of elements in the collection. */
public native int size();
/** Retrieve C pointer to first symbol in the set. */
private native long firstSymbol(long peer);
}
================================================
FILE: zbar/src/main/jni/Android.mk
================================================
#
# Android NDK makefile
#
# build - /ndk-build ICONV_SRC=
# clean - /ndk-build clean
#
MY_LOCAL_PATH := $(call my-dir)
# libiconv
include $(CLEAR_VARS)
ICONV_SRC := $(MY_LOCAL_PATH)/libiconv-1.15
LOCAL_PATH := $(ICONV_SRC)
LOCAL_MODULE := libiconv
LOCAL_CFLAGS := \
-Wno-multichar \
-D_ANDROID \
-DLIBDIR="c" \
-DBUILDING_LIBICONV \
-DBUILDING_LIBCHARSET \
-DIN_LIBRARY
LOCAL_SRC_FILES := \
lib/iconv.c \
libcharset/lib/localcharset.c \
lib/relocatable.c
LOCAL_C_INCLUDES := \
$(ICONV_SRC)/include \
$(ICONV_SRC)/libcharset \
$(ICONV_SRC)/libcharset/include
include $(BUILD_SHARED_LIBRARY)
LOCAL_LDLIBS := -llog -lcharset
# libzbarjni
include $(CLEAR_VARS)
LOCAL_PATH := $(MY_LOCAL_PATH)
LOCAL_MODULE := zbarjni
LOCAL_SRC_FILES := zbarjni.c \
zbar/img_scanner.c \
zbar/decoder.c \
zbar/image.c \
zbar/symbol.c \
zbar/convert.c \
zbar/config.c \
zbar/scanner.c \
zbar/error.c \
zbar/refcnt.c \
zbar/video.c \
zbar/video/null.c \
zbar/decoder/code128.c \
zbar/decoder/code39.c \
zbar/decoder/code93.c \
zbar/decoder/codabar.c \
zbar/decoder/databar.c \
zbar/decoder/ean.c \
zbar/decoder/i25.c \
zbar/decoder/qr_finder.c \
zbar/qrcode/bch15_5.c \
zbar/qrcode/binarize.c \
zbar/qrcode/isaac.c \
zbar/qrcode/qrdec.c \
zbar/qrcode/qrdectxt.c \
zbar/qrcode/rs.c \
zbar/qrcode/util.c
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include \
$(LOCAL_PATH)/zbar \
$(ICONV_SRC)/include
LOCAL_SHARED_LIBRARIES := libiconv
include $(BUILD_SHARED_LIBRARY)
================================================
FILE: zbar/src/main/jni/Application.mk
================================================
APP_ABI := all
================================================
FILE: zbar/src/main/jni/config.h
================================================
/* manually customized for iPhone platform */
#define HAVE_LANGINFO_CODESET 0
/* whether to build support for Code 128 symbology */
#define ENABLE_CODE128 1
/* whether to build support for Code 93 symbology */
#define ENABLE_CODE93 1
/* whether to build support for Code 39 symbology */
#define ENABLE_CODE39 1
/* whether to build support for Codabar symbology */
#define ENABLE_CODABAR 1
/* whether to build support for DataBar symbology */
#define ENABLE_DATABAR 1
/* whether to build support for EAN symbologies */
#define ENABLE_EAN 1
/* whether to build support for Interleaved 2 of 5 symbology */
#define ENABLE_I25 1
/* whether to build support for PDF417 symbology */
#undef ENABLE_PDF417
/* whether to build support for QR Code */
#define ENABLE_QRCODE 1
/* Define to 1 if you have the `atexit' function. */
#undef HAVE_ATEXIT
/* Define to 1 if you have the header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the header file. */
#undef HAVE_FEATURES_H
/* Define to 1 if you have the `getpagesize' function. */
#undef HAVE_GETPAGESIZE
/* Define if you have the iconv() function and it works. */
#undef HAVE_ICONV
/* Define to 1 if you have the header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the header file. */
#undef HAVE_JPEGLIB_H
/* Define to 1 if you have the `jpeg' library (-ljpeg). */
#undef HAVE_LIBJPEG
/* Define to 1 if you have the `pthread' library (-lpthread). */
#undef HAVE_LIBPTHREAD
/* Define to 1 if you have the header file. */
#undef HAVE_LINUX_VIDEODEV2_H
/* Define to 1 if you have the header file. */
#undef HAVE_LINUX_VIDEODEV_H
/* Define to 1 if you have the header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `memset' function. */
#define HAVE_MEMSET 1
/* Define to 1 if you have a working `mmap' system call. */
#undef HAVE_MMAP
/* Define to 1 if you have the header file. */
#undef HAVE_POLL_H
/* Define to 1 if you have the header file. */
#undef HAVE_PTHREAD_H
/* Define to 1 if you have the `setenv' function. */
#undef HAVE_SETENV
/* Define to 1 if you have the header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the header file. */
#undef HAVE_SYS_IOCTL_H
/* Define to 1 if you have the header file. */
#undef HAVE_SYS_IPC_H
/* Define to 1 if you have the header file. */
#undef HAVE_SYS_MMAN_H
/* Define to 1 if you have the header file. */
#undef HAVE_SYS_SHM_H
/* Define to 1 if you have the header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the header file. */
#define HAVE_SYS_TIMES_H 1
/* Define to 1 if you have the header file. */
#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if the system has the type `uintptr_t'. */
#define HAVE_UINTPTR_T 1
/* Define to 1 if you have the header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the header file. */
#undef HAVE_VFW_H
/* Define to 1 if you have the header file. */
#undef HAVE_X11_EXTENSIONS_XSHM_H
/* Define to 1 if you have the header file. */
#undef HAVE_X11_EXTENSIONS_XVLIB_H
/* Define as const if the declaration of iconv() needs const. */
#undef ICONV_CONST
/* Library major version */
#define LIB_VERSION_MAJOR 0
/* Library minor version */
#define LIB_VERSION_MINOR 2
/* Library revision */
#define LIB_VERSION_REVISION 0
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#undef LT_OBJDIR
/* Define to 1 if assertions should be disabled. */
//#undef NDEBUG
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
#undef NO_MINUS_C_MINUS_O
/* Name of package */
#define PACKAGE "zbar"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "spadix@users.sourceforge.net"
/* Define to the full name of this package. */
#define PACKAGE_NAME "zbar"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "zbar 0.10"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "zbar"
/* Define to the version of this package. */
#define PACKAGE_VERSION "0.10"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Version number of package */
#define VERSION "0.10"
/* Define to 1 if the X Window System is missing or not being used. */
#define X_DISPLAY_MISSING 1
/* Program major version (before the '.') as a number */
#define ZBAR_VERSION_MAJOR 0
/* Program minor version (after '.') as a number */
#define ZBAR_VERSION_MINOR 10
/* Define for Solaris 2.5.1 so the uint32_t typedef from ,
, or is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
#undef _UINT32_T
/* Define for Solaris 2.5.1 so the uint8_t typedef from ,
, or is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
#undef _UINT8_T
/* Minimum Windows API version */
#undef _WIN32_WINNT
/* used only for pthread debug attributes */
#undef __USE_UNIX98
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
#undef inline
#endif
/* Define to the type of a signed integer type of width exactly 32 bits if
such a type exists and the standard includes do not define it. */
#undef int32_t
/* Define to the type of an unsigned integer type of width exactly 32 bits if
such a type exists and the standard includes do not define it. */
#undef uint32_t
/* Define to the type of an unsigned integer type of width exactly 8 bits if
such a type exists and the standard includes do not define it. */
#undef uint8_t
/* Define to the type of an unsigned integer type wide enough to hold a
pointer, if such a type exists, and if the system does not define it. */
#undef uintptr_t
#ifndef X_DISPLAY_MISSING
# define HAVE_X
#endif
================================================
FILE: zbar/src/main/jni/include/Makefile.am.inc
================================================
zincludedir = $(includedir)/zbar
include_HEADERS = include/zbar.h
zinclude_HEADERS = include/zbar/Scanner.h include/zbar/Decoder.h \
include/zbar/Exception.h include/zbar/Symbol.h include/zbar/Image.h \
include/zbar/ImageScanner.h include/zbar/Video.h include/zbar/Window.h \
include/zbar/Processor.h
if HAVE_GTK
zinclude_HEADERS += include/zbar/zbargtk.h
endif
if HAVE_QT
zinclude_HEADERS += include/zbar/QZBar.h include/zbar/QZBarImage.h
endif
================================================
FILE: zbar/src/main/jni/include/zbar/Decoder.h
================================================
//------------------------------------------------------------------------
// Copyright 2007-2010 (c) Jeff Brown
//
// This file is part of the ZBar Bar Code Reader.
//
// The ZBar Bar Code Reader is free software; you can redistribute it
// and/or modify it under the terms of the GNU Lesser Public License as
// published by the Free Software Foundation; either version 2.1 of
// the License, or (at your option) any later version.
//
// The ZBar Bar Code Reader 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 Public License for more details.
//
// You should have received a copy of the GNU Lesser Public License
// along with the ZBar Bar Code Reader; if not, write to the Free
// Software Foundation, Inc., 51 Franklin St, Fifth Floor,
// Boston, MA 02110-1301 USA
//
// http://sourceforge.net/projects/zbar
//------------------------------------------------------------------------
#ifndef _ZBAR_DECODER_H_
#define _ZBAR_DECODER_H_
/// @file
/// Decoder C++ wrapper
#ifndef _ZBAR_H_
# error "include zbar.h in your application, **not** zbar/Decoder.h"
#endif
#include
namespace zbar {
/// low-level bar width stream decoder interface.
/// identifies symbols and extracts encoded data
class Decoder {
public:
/// Decoder result handler.
/// applications should subtype this and pass an instance to
/// set_handler() to implement result processing
class Handler {
public:
virtual ~Handler() { }
/// invoked by the Decoder as decode results become available.
virtual void decode_callback(Decoder &decoder) = 0;
};
/// constructor.
Decoder ()
: _handler(NULL)
{
_decoder = zbar_decoder_create();
}
~Decoder ()
{
zbar_decoder_destroy(_decoder);
}
/// clear all decoder state.
/// see zbar_decoder_reset()
void reset ()
{
zbar_decoder_reset(_decoder);
}
/// mark start of a new scan pass.
/// see zbar_decoder_new_scan()
void new_scan ()
{
zbar_decoder_new_scan(_decoder);
}
/// process next bar/space width from input stream.
/// see zbar_decode_width()
zbar_symbol_type_t decode_width (unsigned width)
{
return(zbar_decode_width(_decoder, width));
}
/// process next bar/space width from input stream.
/// see zbar_decode_width()
Decoder& operator<< (unsigned width)
{
zbar_decode_width(_decoder, width);
return(*this);
}
/// retrieve color of @em next element passed to Decoder.
/// see zbar_decoder_get_color()
zbar_color_t get_color () const
{
return(zbar_decoder_get_color(_decoder));
}
/// retrieve last decoded symbol type.
/// see zbar_decoder_get_type()
zbar_symbol_type_t get_type () const
{
return(zbar_decoder_get_type(_decoder));
}
/// retrieve string name of last decoded symbol type.
/// see zbar_get_symbol_name()
const char *get_symbol_name () const
{
return(zbar_get_symbol_name(zbar_decoder_get_type(_decoder)));
}
/// retrieve string name for last decode addon.
/// see zbar_get_addon_name()
/// @deprecated in 0.11
const char *get_addon_name () const
{
return(zbar_get_addon_name(zbar_decoder_get_type(_decoder)));
}
/// retrieve last decoded data in ASCII format as a char array.
/// see zbar_decoder_get_data()
const char *get_data_chars() const
{
return(zbar_decoder_get_data(_decoder));
}
/// retrieve last decoded data as a std::string.
/// see zbar_decoder_get_data()
const std::string get_data_string() const
{
return(std::string(zbar_decoder_get_data(_decoder),
zbar_decoder_get_data_length(_decoder)));
}
/// retrieve last decoded data as a std::string.
/// see zbar_decoder_get_data()
const std::string get_data() const
{
return(get_data_string());
}
/// retrieve length of decoded binary data.
/// see zbar_decoder_get_data_length()
int get_data_length() const
{
return(zbar_decoder_get_data_length(_decoder));
}
/// retrieve last decode direction.
/// see zbar_decoder_get_direction()
/// @since 0.11
int get_direction() const
{
return(zbar_decoder_get_direction(_decoder));
}
/// setup callback to handle result data.
void set_handler (Handler &handler)
{
_handler = &handler;
zbar_decoder_set_handler(_decoder, _cb);
zbar_decoder_set_userdata(_decoder, this);
}
/// set config for indicated symbology (0 for all) to specified value.
/// @see zbar_decoder_set_config()
/// @since 0.4
int set_config (zbar_symbol_type_t symbology,
zbar_config_t config,
int value)
{
return(zbar_decoder_set_config(_decoder, symbology, config, value));
}
/// set config parsed from configuration string.
/// @see zbar_decoder_parse_config()
/// @since 0.4
int set_config (std::string cfgstr)
{
return(zbar_decoder_parse_config(_decoder, cfgstr.c_str()));
}
private:
friend class Scanner;
zbar_decoder_t *_decoder;
Handler *_handler;
static void _cb (zbar_decoder_t *cdcode)
{
Decoder *dcode = (Decoder*)zbar_decoder_get_userdata(cdcode);
if(dcode && dcode->_handler)
dcode->_handler->decode_callback(*dcode);
}
};
}
#endif
================================================
FILE: zbar/src/main/jni/include/zbar/Exception.h
================================================
//------------------------------------------------------------------------
// Copyright 2007-2009 (c) Jeff Brown
//
// This file is part of the ZBar Bar Code Reader.
//
// The ZBar Bar Code Reader is free software; you can redistribute it
// and/or modify it under the terms of the GNU Lesser Public License as
// published by the Free Software Foundation; either version 2.1 of
// the License, or (at your option) any later version.
//
// The ZBar Bar Code Reader 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 Public License for more details.
//
// You should have received a copy of the GNU Lesser Public License
// along with the ZBar Bar Code Reader; if not, write to the Free
// Software Foundation, Inc., 51 Franklin St, Fifth Floor,
// Boston, MA 02110-1301 USA
//
// http://sourceforge.net/projects/zbar
//------------------------------------------------------------------------
#ifndef _ZBAR_EXCEPTION_H_
#define _ZBAR_EXCEPTION_H_
/// @file
/// C++ Exception definitions
#ifndef _ZBAR_H_
# error "include zbar.h in your application, **not** zbar/Exception.h"
#endif
#include
#include
namespace zbar {
/// base class for exceptions defined by this API.
class Exception : public std::exception {
public:
/// create exception from C library error
Exception (const void *obj = NULL)
: std::exception(),
_obj(obj)
{ }
~Exception () throw() { }
/// retrieve error message
virtual const char* what () const throw()
{
if(!_obj)
return("zbar library unspecified generic error");
return(_zbar_error_string(_obj, 0));
}
private:
const void *_obj;
};
/// internal library error.
class InternalError : public Exception {
public:
/// create exception from C library error
InternalError (const void *obj)
: Exception(obj)
{ }
};
/// unsupported request.
class UnsupportedError : public Exception {
public:
/// create exception from C library error
UnsupportedError (const void *obj)
: Exception(obj)
{ }
};
/// invalid request.
class InvalidError : public Exception {
public:
/// create exception from C library error
InvalidError (const void *obj)
: Exception(obj)
{ }
};
/// failed system call.
class SystemError : public Exception {
public:
/// create exception from C library error
SystemError (const void *obj)
: Exception(obj)
{ }
};
/// locking error.
class LockingError : public Exception {
public:
/// create exception from C library error
LockingError (const void *obj)
: Exception(obj)
{ }
};
/// all resources busy.
class BusyError : public Exception {
public:
/// create exception from C library error
BusyError (const void *obj)
: Exception(obj)
{ }
};
/// X11 display error.
class XDisplayError : public Exception {
public:
/// create exception from C library error
XDisplayError (const void *obj)
: Exception(obj)
{ }
};
/// X11 protocol error.
class XProtoError : public Exception {
public:
/// create exception from C library error
XProtoError (const void *obj)
: Exception(obj)
{ }
};
/// output window is closed.
class ClosedError : public Exception {
public:
/// create exception from C library error
ClosedError (const void *obj)
: Exception(obj)
{ }
};
/// image format error
class FormatError : public Exception {
// FIXME needs c equivalent
virtual const char* what () const throw()
{
// FIXME what format?
return("unsupported format");
}
};
/// @internal
/// extract error information and create exception.
static inline std::exception throw_exception (const void *obj)
{
switch(_zbar_get_error_code(obj)) {
case ZBAR_ERR_NOMEM:
throw std::bad_alloc();
case ZBAR_ERR_INTERNAL:
throw InternalError(obj);
case ZBAR_ERR_UNSUPPORTED:
throw UnsupportedError(obj);
case ZBAR_ERR_INVALID:
throw InvalidError(obj);
case ZBAR_ERR_SYSTEM:
throw SystemError(obj);
case ZBAR_ERR_LOCKING:
throw LockingError(obj);
case ZBAR_ERR_BUSY:
throw BusyError(obj);
case ZBAR_ERR_XDISPLAY:
throw XDisplayError(obj);
case ZBAR_ERR_XPROTO:
throw XProtoError(obj);
case ZBAR_ERR_CLOSED:
throw ClosedError(obj);
default:
throw Exception(obj);
}
}
}
#endif
================================================
FILE: zbar/src/main/jni/include/zbar/Image.h
================================================
//------------------------------------------------------------------------
// Copyright 2007-2010 (c) Jeff Brown
//
// This file is part of the ZBar Bar Code Reader.
//
// The ZBar Bar Code Reader is free software; you can redistribute it
// and/or modify it under the terms of the GNU Lesser Public License as
// published by the Free Software Foundation; either version 2.1 of
// the License, or (at your option) any later version.
//
// The ZBar Bar Code Reader 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 Public License for more details.
//
// You should have received a copy of the GNU Lesser Public License
// along with the ZBar Bar Code Reader; if not, write to the Free
// Software Foundation, Inc., 51 Franklin St, Fifth Floor,
// Boston, MA 02110-1301 USA
//
// http://sourceforge.net/projects/zbar
//------------------------------------------------------------------------
#ifndef _ZBAR_IMAGE_H_
#define _ZBAR_IMAGE_H_
/// @file
/// Image C++ wrapper
#ifndef _ZBAR_H_
# error "include zbar.h in your application, **not** zbar/Image.h"
#endif
#include
#include
#include "Symbol.h"
#include "Exception.h"
namespace zbar {
class Video;
/// stores image data samples along with associated format and size
/// metadata
class Image {
public:
/// general Image result handler.
/// applications should subtype this and pass an instance to
/// eg. ImageScanner::set_handler() to implement result processing
class Handler {
public:
virtual ~Handler() { }
/// invoked by library when Image should be processed
virtual void image_callback(Image &image) = 0;
/// cast this handler to the C handler
operator zbar_image_data_handler_t* () const
{
return(_cb);
}
private:
static void _cb (zbar_image_t *zimg,
const void *userdata)
{
if(userdata) {
Image *image = (Image*)zbar_image_get_userdata(zimg);
if(image)
((Handler*)userdata)->image_callback(*image);
else {
Image tmp(zimg, 1);
((Handler*)userdata)->image_callback(tmp);
}
}
}
};
class SymbolIterator : public zbar::SymbolIterator {
public:
/// default constructor.
SymbolIterator ()
: zbar::SymbolIterator()
{ }
/// constructor.
SymbolIterator (const SymbolSet &syms)
: zbar::SymbolIterator(syms)
{ }
/// copy constructor.
SymbolIterator (const SymbolIterator& iter)
: zbar::SymbolIterator(iter)
{ }
};
/// constructor.
/// create a new Image with the specified parameters
Image (unsigned width = 0,
unsigned height = 0,
const std::string& format = "",
const void *data = NULL,
unsigned long length = 0)
: _img(zbar_image_create())
{
zbar_image_set_userdata(_img, this);
if(width && height)
set_size(width, height);
if(format.length())
set_format(format);
if(data && length)
set_data(data, length);
}
~Image ()
{
if(zbar_image_get_userdata(_img) == this)
zbar_image_set_userdata(_img, NULL);
zbar_image_ref(_img, -1);
}
/// cast to C image object
operator const zbar_image_t* () const
{
return(_img);
}
/// cast to C image object
operator zbar_image_t* ()
{
return(_img);
}
/// retrieve the image format.
/// see zbar_image_get_format()
unsigned long get_format () const
{
return(zbar_image_get_format(_img));
}
/// specify the fourcc image format code for image sample data.
/// see zbar_image_set_format()
void set_format (unsigned long format)
{
zbar_image_set_format(_img, format);
}
/// specify the fourcc image format code for image sample data.
/// see zbar_image_set_format()
void set_format (const std::string& format)
{
unsigned long fourcc = zbar_fourcc_parse(format.c_str());
zbar_image_set_format(_img, fourcc);
}
/// retrieve a "sequence" (page/frame) number associated with this
/// image.
/// see zbar_image_get_sequence()
/// @since 0.6
unsigned get_sequence () const
{
return(zbar_image_get_sequence(_img));
}
/// associate a "sequence" (page/frame) number with this image.
/// see zbar_image_set_sequence()
/// @since 0.6
void set_sequence (unsigned sequence_num)
{
zbar_image_set_sequence(_img, sequence_num);
}
/// retrieve the width of the image.
/// see zbar_image_get_width()
unsigned get_width () const
{
return(zbar_image_get_width(_img));
}
/// retrieve the height of the image.
/// see zbar_image_get_height()
unsigned get_height () const
{
return(zbar_image_get_height(_img));
}
/// retrieve both dimensions of the image.
/// see zbar_image_get_size()
/// @since 0.11
void get_size (unsigned &width,
unsigned &height) const
{
zbar_image_get_size(_img, &width, &height);
}
/// specify the pixel size of the image.
/// see zbar_image_set_size()
void set_size (unsigned width,
unsigned height)
{
zbar_image_set_size(_img, width, height);
}
/// retrieve the scan crop rectangle.
/// see zbar_image_get_crop()
void get_crop (unsigned &x,
unsigned &y,
unsigned &width,
unsigned &height) const
{
zbar_image_get_crop(_img, &x, &y, &width, &height);
}
/// set the scan crop rectangle.
/// see zbar_image_set_crop()
void set_crop (unsigned x,
unsigned y,
unsigned width,
unsigned height)
{
zbar_image_set_crop(_img, x, y, width, height);
}
/// return the image sample data.
/// see zbar_image_get_data()
const void *get_data () const
{
return(zbar_image_get_data(_img));
}
/// return the size of the image sample data.
/// see zbar_image_get_data_length()
/// @since 0.6
unsigned long get_data_length () const
{
return(zbar_image_get_data_length(_img));
}
/// specify image sample data.
/// see zbar_image_set_data()
void set_data (const void *data,
unsigned long length)
{
zbar_image_set_data(_img, data, length, _cleanup);
}
/// image format conversion.
/// see zbar_image_convert()
Image convert (unsigned long format) const
{
zbar_image_t *img = zbar_image_convert(_img, format);
if(img)
return(Image(img));
throw FormatError();
}
/// image format conversion.
/// see zbar_image_convert()
/// @since 0.11
Image convert (std::string format) const
{
unsigned long fourcc = zbar_fourcc_parse(format.c_str());
return(convert(fourcc));
}
/// image format conversion with crop/pad.
/// see zbar_image_convert_resize()
/// @since 0.4
Image convert (unsigned long format,
unsigned width,
unsigned height) const
{
zbar_image_t *img =
zbar_image_convert_resize(_img, format, width, height);
if(img)
return(Image(img));
throw FormatError();
}
const SymbolSet get_symbols () const {
return(SymbolSet(zbar_image_get_symbols(_img)));
}
void set_symbols (const SymbolSet &syms) {
zbar_image_set_symbols(_img, syms);
}
/// create a new SymbolIterator over decoded results.
SymbolIterator symbol_begin () const {
return(SymbolIterator(get_symbols()));
}
/// return a SymbolIterator suitable for ending iteration.
SymbolIterator symbol_end () const {
return(SymbolIterator());
}
protected:
friend class Video;
/// constructor.
/// @internal
/// create a new Image from a zbar_image_t C object
Image (zbar_image_t *src,
int refs = 0)
: _img(src)
{
if(refs)
zbar_image_ref(_img, refs);
zbar_image_set_userdata(_img, this);
}
/// default data cleanup (noop)
/// @internal
static void _cleanup (zbar_image_t *img)
{
// by default nothing is cleaned
assert(img);
}
private:
zbar_image_t *_img;
};
}
#endif
================================================
FILE: zbar/src/main/jni/include/zbar/ImageScanner.h
================================================
//------------------------------------------------------------------------
// Copyright 2007-2009 (c) Jeff Brown
//
// This file is part of the ZBar Bar Code Reader.
//
// The ZBar Bar Code Reader is free software; you can redistribute it
// and/or modify it under the terms of the GNU Lesser Public License as
// published by the Free Software Foundation; either version 2.1 of
// the License, or (at your option) any later version.
//
// The ZBar Bar Code Reader 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 Public License for more details.
//
// You should have received a copy of the GNU Lesser Public License
// along with the ZBar Bar Code Reader; if not, write to the Free
// Software Foundation, Inc., 51 Franklin St, Fifth Floor,
// Boston, MA 02110-1301 USA
//
// http://sourceforge.net/projects/zbar
//------------------------------------------------------------------------
#ifndef _ZBAR_IMAGE_SCANNER_H_
#define _ZBAR_IMAGE_SCANNER_H_
/// @file
/// Image Scanner C++ wrapper
#ifndef _ZBAR_H_
# error "include zbar.h in your application, **not** zbar/ImageScanner.h"
#endif
#include "Image.h"
namespace zbar {
/// mid-level image scanner interface.
/// reads barcodes from a 2-D Image
class ImageScanner {
public:
/// constructor.
ImageScanner (zbar_image_scanner_t *scanner = NULL)
{
if(scanner)
_scanner = scanner;
else
_scanner = zbar_image_scanner_create();
}
~ImageScanner ()
{
zbar_image_scanner_destroy(_scanner);
}
/// cast to C image_scanner object
operator zbar_image_scanner_t* () const
{
return(_scanner);
}
/// setup result handler callback.
void set_handler (Image::Handler &handler)
{
zbar_image_scanner_set_data_handler(_scanner, handler, &handler);
}
/// set config for indicated symbology (0 for all) to specified value.
/// @see zbar_image_scanner_set_config()
/// @since 0.4
int set_config (zbar_symbol_type_t symbology,
zbar_config_t config,
int value)
{
return(zbar_image_scanner_set_config(_scanner, symbology,
config, value));
}
/// set config parsed from configuration string.
/// @see zbar_image_scanner_parse_config()
/// @since 0.4
int set_config (std::string cfgstr)
{
return(zbar_image_scanner_parse_config(_scanner, cfgstr.c_str()));
}
/// enable or disable the inter-image result cache.
/// see zbar_image_scanner_enable_cache()
void enable_cache (bool enable = true)
{
zbar_image_scanner_enable_cache(_scanner, enable);
}
/// remove previous results from scanner and image.
/// @see zbar_image_scanner_recycle_image()
/// @since 0.10
void recycle_image (Image &image)
{
zbar_image_scanner_recycle_image(_scanner, image);
}
/// retrieve decode results for last scanned image.
/// @see zbar_image_scanner_get_results()
/// @since 0.10
const SymbolSet get_results () const {
return(SymbolSet(zbar_image_scanner_get_results(_scanner)));
}
/// scan for symbols in provided image.
/// see zbar_scan_image()
int scan (Image& image)
{
return(zbar_scan_image(_scanner, image));
}
/// scan for symbols in provided image.
/// see zbar_scan_image()
ImageScanner& operator<< (Image& image)
{
scan(image);
return(*this);
}
private:
zbar_image_scanner_t *_scanner;
};
}
#endif
================================================
FILE: zbar/src/main/jni/include/zbar/Processor.h
================================================
//------------------------------------------------------------------------
// Copyright 2007-2010 (c) Jeff Brown
//
// This file is part of the ZBar Bar Code Reader.
//
// The ZBar Bar Code Reader is free software; you can redistribute it
// and/or modify it under the terms of the GNU Lesser Public License as
// published by the Free Software Foundation; either version 2.1 of
// the License, or (at your option) any later version.
//
// The ZBar Bar Code Reader 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 Public License for more details.
//
// You should have received a copy of the GNU Lesser Public License
// along with the ZBar Bar Code Reader; if not, write to the Free
// Software Foundation, Inc., 51 Franklin St, Fifth Floor,
// Boston, MA 02110-1301 USA
//
// http://sourceforge.net/projects/zbar
//------------------------------------------------------------------------
#ifndef _ZBAR_PROCESSOR_H_
#define _ZBAR_PROCESSOR_H_
/// @file
/// Processor C++ wrapper
#ifndef _ZBAR_H_
# error "include zbar.h in your application, **not** zbar/Processor.h"
#endif
#include "Exception.h"
#include "Image.h"
namespace zbar {
/// high-level self-contained image processor.
/// processes video and images for barcodes, optionally displaying
/// images to a library owned output window
class Processor {
public:
/// value to pass for no timeout.
static const int FOREVER = -1;
/// constructor.
Processor (bool threaded = true,
const char *video_device = "",
bool enable_display = true)
{
_processor = zbar_processor_create(threaded);
if(!_processor)
throw std::bad_alloc();
init(video_device, enable_display);
}
~Processor ()
{
zbar_processor_destroy(_processor);
}
/// cast to C processor object.
operator zbar_processor_t* ()
{
return(_processor);
}
/// opens a video input device and/or prepares to display output.
/// see zbar_processor_init()
void init (const char *video_device = "",
bool enable_display = true)
{
if(zbar_processor_init(_processor, video_device, enable_display))
throw_exception(_processor);
}
/// setup result handler callback.
/// see zbar_processor_set_data_handler()
void set_handler (Image::Handler& handler)
{
zbar_processor_set_data_handler(_processor, handler, &handler);
}
/// set config for indicated symbology (0 for all) to specified value.
/// @see zbar_processor_set_config()
/// @since 0.4
int set_config (zbar_symbol_type_t symbology,
zbar_config_t config,
int value)
{
return(zbar_processor_set_config(_processor, symbology,
config, value));
}
/// set config parsed from configuration string.
/// @see zbar_processor_parse_config()
/// @since 0.4
int set_config (std::string cfgstr)
{
return(zbar_processor_parse_config(_processor, cfgstr.c_str()));
}
/// retrieve the current state of the ouput window.
/// see zbar_processor_is_visible()
bool is_visible ()
{
int rc = zbar_processor_is_visible(_processor);
if(rc < 0)
throw_exception(_processor);
return(rc != 0);
}
/// show or hide the display window owned by the library.
/// see zbar_processor_set_visible()
void set_visible (bool visible = true)
{
if(zbar_processor_set_visible(_processor, visible) < 0)
throw_exception(_processor);
}
/// control the processor in free running video mode.
/// see zbar_processor_set_active()
void set_active (bool active = true)
{
if(zbar_processor_set_active(_processor, active) < 0)
throw_exception(_processor);
}
/// retrieve decode results for last scanned image.
/// @see zbar_processor_get_results()
/// @since 0.10
const SymbolSet get_results () const {
return(SymbolSet(zbar_processor_get_results(_processor)));
}
/// wait for input to the display window from the user.
/// see zbar_processor_user_wait()
int user_wait (int timeout = FOREVER)
{
int rc = zbar_processor_user_wait(_processor, timeout);
if(rc < 0)
throw_exception(_processor);
return(rc);
}
/// process from the video stream until a result is available.
/// see zbar_process_one()
void process_one (int timeout = FOREVER)
{
if(zbar_process_one(_processor, timeout) < 0)
throw_exception(_processor);
}
/// process the provided image for barcodes.
/// see zbar_process_image()
void process_image (Image& image)
{
if(zbar_process_image(_processor, image) < 0)
throw_exception(_processor);
}
/// process the provided image for barcodes.
/// see zbar_process_image()
Processor& operator<< (Image& image)
{
process_image(image);
return(*this);
}
/// force specific input and output formats for debug/testing.
/// see zbar_processor_force_format()
void force_format (unsigned long input_format,
unsigned long output_format)
{
if(zbar_processor_force_format(_processor, input_format,
output_format))
throw_exception(_processor);
}
/// force specific input and output formats for debug/testing.
/// see zbar_processor_force_format()
void force_format (std::string& input_format,
std::string& output_format)
{
unsigned long ifourcc = zbar_fourcc_parse(input_format.c_str());
unsigned long ofourcc = zbar_fourcc_parse(output_format.c_str());
if(zbar_processor_force_format(_processor, ifourcc, ofourcc))
throw_exception(_processor);
}
/// request a preferred size for the video image from the device.
/// see zbar_processor_request_size()
/// @since 0.6
void request_size (int width, int height)
{
zbar_processor_request_size(_processor, width, height);
}
/// request a preferred driver interface version for debug/testing.
/// see zbar_processor_request_interface()
/// @since 0.6
void request_interface (int version)
{
zbar_processor_request_interface(_processor, version);
}
/// request a preferred I/O mode for debug/testing.
/// see zbar_processor_request_iomode()
/// @since 0.7
void request_iomode (int iomode)
{
if(zbar_processor_request_iomode(_processor, iomode))
throw_exception(_processor);
}
private:
zbar_processor_t *_processor;
};
}
#endif
================================================
FILE: zbar/src/main/jni/include/zbar/QZBar.h
================================================
//------------------------------------------------------------------------
// Copyright 2008-2009 (c) Jeff Brown
//
// This file is part of the ZBar Bar Code Reader.
//
// The ZBar Bar Code Reader is free software; you can redistribute it
// and/or modify it under the terms of the GNU Lesser Public License as
// published by the Free Software Foundation; either version 2.1 of
// the License, or (at your option) any later version.
//
// The ZBar Bar Code Reader 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 Public License for more details.
//
// You should have received a copy of the GNU Lesser Public License
// along with the ZBar Bar Code Reader; if not, write to the Free
// Software Foundation, Inc., 51 Franklin St, Fifth Floor,
// Boston, MA 02110-1301 USA
//
// http://sourceforge.net/projects/zbar
//------------------------------------------------------------------------
#ifndef _QZBAR_H_
#define _QZBAR_H_
/// @file
/// Barcode Reader Qt4 Widget
#include
namespace zbar {
class QZBarThread;
/// barcode reader Qt4 widget.
/// embeds a barcode reader directly into a Qt4 based GUI. the widget
/// can process barcodes from a video source (using the QZBar::videoDevice
/// and QZBar::videoEnabled properties) or from individual QImages
/// supplied to the QZBar::scanImage() slot
/// @since 1.5
class QZBar : public QWidget
{
Q_OBJECT
/// the currently opened video device.
///
/// setting a new device opens it and automatically sets
/// QZBar::videoEnabled
///
/// @see videoDevice(), setVideoDevice()
Q_PROPERTY(QString videoDevice
READ videoDevice
WRITE setVideoDevice
DESIGNABLE false)
/// video device streaming state.
///
/// use to pause/resume video scanning.
///
/// @see isVideoEnabled(), setVideoEnabled()
Q_PROPERTY(bool videoEnabled
READ isVideoEnabled
WRITE setVideoEnabled
DESIGNABLE false)
/// video device opened state.
///
/// (re)setting QZBar::videoDevice should eventually cause it
/// to be opened or closed. any errors while streaming/scanning
/// will also cause the device to be closed
///
/// @see isVideoOpened()
Q_PROPERTY(bool videoOpened
READ isVideoOpened
DESIGNABLE false)
public:
/// constructs a barcode reader widget with the given @a parent
QZBar(QWidget *parent = NULL);
~QZBar();
/// retrieve the currently opened video device.
/// @returns the current video device or the empty string if no
/// device is opened
QString videoDevice() const;
/// retrieve the current video enabled state.
/// @returns true if video scanning is currently enabled, false
/// otherwise
bool isVideoEnabled() const;
/// retrieve the current video opened state.
/// @returns true if video device is currently opened, false otherwise
bool isVideoOpened() const;
/// @{
/// @internal
QSize sizeHint() const;
int heightForWidth(int) const;
QPaintEngine *paintEngine() const;
/// @}
public Q_SLOTS:
/// open a new video device.
///
/// use an empty string to close a currently opened device.
///
/// @note since opening a device may take some time, this call will
/// return immediately and the device will be opened asynchronously
void setVideoDevice(const QString &videoDevice);
/// enable/disable video scanning.
/// has no effect unless a video device is opened
void setVideoEnabled(bool videoEnabled = true);
/// scan for barcodes in a QImage.
void scanImage(const QImage &image);
Q_SIGNALS:
/// emitted when when a video device is opened or closed.
///
/// (re)setting QZBar::videoDevice should eventually cause it
/// to be opened or closed. any errors while streaming/scanning
/// will also cause the device to be closed
void videoOpened(bool videoOpened);
/// emitted when a barcode is decoded from an image.
/// the symbol type and contained data are provided as separate
/// parameters.
void decoded(int type, const QString &data);
/// emitted when a barcode is decoded from an image.
/// the symbol type name is prefixed to the data, separated by a
/// colon
void decodedText(const QString &text);
/// @{
/// @internal
protected:
void attach();
void showEvent(QShowEvent*);
void paintEvent(QPaintEvent*);
void resizeEvent(QResizeEvent*);
void changeEvent(QEvent*);
void dragEnterEvent(QDragEnterEvent*);
void dropEvent(QDropEvent*);
protected Q_SLOTS:
void sizeChange();
/// @}
private:
QZBarThread *thread;
QString _videoDevice;
bool _videoEnabled;
bool _attached;
};
};
#endif
================================================
FILE: zbar/src/main/jni/include/zbar/QZBarImage.h
================================================
//------------------------------------------------------------------------
// Copyright 2008-2010 (c) Jeff Brown
//
// This file is part of the ZBar Bar Code Reader.
//
// The ZBar Bar Code Reader is free software; you can redistribute it
// and/or modify it under the terms of the GNU Lesser Public License as
// published by the Free Software Foundation; either version 2.1 of
// the License, or (at your option) any later version.
//
// The ZBar Bar Code Reader 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 Public License for more details.
//
// You should have received a copy of the GNU Lesser Public License
// along with the ZBar Bar Code Reader; if not, write to the Free
// Software Foundation, Inc., 51 Franklin St, Fifth Floor,
// Boston, MA 02110-1301 USA
//
// http://sourceforge.net/projects/zbar
//------------------------------------------------------------------------
#ifndef _QZBARIMAGE_H_
#define _QZBARIMAGE_H_
/// @file
/// QImage to Image type conversion wrapper
#include
#include
namespace zbar {
/// wrap a QImage and convert into a format suitable for scanning.
class QZBarImage
: public Image
{
public:
/// construct a zbar library image based on an existing QImage.
QZBarImage (const QImage &qimg)
: qimg(qimg)
{
QImage::Format fmt = qimg.format();
if(fmt != QImage::Format_RGB32 &&
fmt != QImage::Format_ARGB32 &&
fmt != QImage::Format_ARGB32_Premultiplied)
throw FormatError();
unsigned bpl = qimg.bytesPerLine();
unsigned width = bpl / 4;
unsigned height = qimg.height();
set_size(width, height);
set_format(zbar_fourcc('B','G','R','4'));
unsigned long datalen = qimg.numBytes();
set_data(qimg.bits(), datalen);
if((width * 4 != bpl) ||
(width * height * 4 > datalen))
throw FormatError();
}
private:
QImage qimg;
};
};
#endif
================================================
FILE: zbar/src/main/jni/include/zbar/Scanner.h
================================================
//------------------------------------------------------------------------
// Copyright 2007-2009 (c) Jeff Brown
//
// This file is part of the ZBar Bar Code Reader.
//
// The ZBar Bar Code Reader is free software; you can redistribute it
// and/or modify it under the terms of the GNU Lesser Public License as
// published by the Free Software Foundation; either version 2.1 of
// the License, or (at your option) any later version.
//
// The ZBar Bar Code Reader 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 Public License for more details.
//
// You should have received a copy of the GNU Lesser Public License
// along with the ZBar Bar Code Reader; if not, write to the Free
// Software Foundation, Inc., 51 Franklin St, Fifth Floor,
// Boston, MA 02110-1301 USA
//
// http://sourceforge.net/projects/zbar
//------------------------------------------------------------------------
#ifndef _ZBAR_SCANNER_H_
#define _ZBAR_SCANNER_H_
/// @file
/// Scanner C++ wrapper
#ifndef _ZBAR_H_
# error "include zbar.h in your application, **not** zbar/Scanner.h"
#endif
#include
namespace zbar {
/// low-level linear intensity sample stream scanner interface.
/// identifies "bar" edges and measures width between them.
/// optionally passes to bar width Decoder
class Scanner {
public:
/// constructor.
/// @param decoder reference to a Decoder instance which will
/// be passed scan results automatically
Scanner (Decoder& decoder)
{
_scanner = zbar_scanner_create(decoder._decoder);
}
/// constructor.
/// @param decoder pointer to a Decoder instance which will
/// be passed scan results automatically
Scanner (Decoder* decoder = NULL)
{
zbar_decoder_t *zdcode = NULL;
if(decoder)
zdcode = decoder->_decoder;
_scanner = zbar_scanner_create(zdcode);
}
~Scanner ()
{
zbar_scanner_destroy(_scanner);
}
/// clear all scanner state.
/// see zbar_scanner_reset()
void reset ()
{
zbar_scanner_reset(_scanner);
}
/// mark start of a new scan pass.
/// see zbar_scanner_new_scan()
zbar_symbol_type_t new_scan ()
{
_type = zbar_scanner_new_scan(_scanner);
return(_type);
}
/// flush scanner pipeline.
/// see zbar_scanner_flush()
zbar_symbol_type_t flush ()
{
_type = zbar_scanner_flush(_scanner);
return(_type);
}
/// process next sample intensity value.
/// see zbar_scan_y()
zbar_symbol_type_t scan_y (int y)
{
_type = zbar_scan_y(_scanner, y);
return(_type);
}
/// process next sample intensity value.
/// see zbar_scan_y()
Scanner& operator<< (int y)
{
_type = zbar_scan_y(_scanner, y);
return(*this);
}
/// process next sample from RGB (or BGR) triple.
/// see zbar_scan_rgb24()
zbar_symbol_type_t scan_rgb24 (unsigned char *rgb)
{
_type = zbar_scan_rgb24(_scanner, rgb);
return(_type);
}
/// process next sample from RGB (or BGR) triple.
/// see zbar_scan_rgb24()
Scanner& operator<< (unsigned char *rgb)
{
_type = zbar_scan_rgb24(_scanner, rgb);
return(*this);
}
/// retrieve last scanned width.
/// see zbar_scanner_get_width()
unsigned get_width () const
{
return(zbar_scanner_get_width(_scanner));
}
/// retrieve last scanned color.
/// see zbar_scanner_get_color()
zbar_color_t get_color () const
{
return(zbar_scanner_get_color(_scanner));
}
/// retrieve last scan result.
zbar_symbol_type_t get_type () const
{
return(_type);
}
/// cast to C scanner
operator zbar_scanner_t* () const
{
return(_scanner);
}
/// retrieve C scanner
const zbar_scanner_t *get_c_scanner () const
{
return(_scanner);
}
private:
zbar_scanner_t *_scanner;
zbar_symbol_type_t _type;
};
}
#endif
================================================
FILE: zbar/src/main/jni/include/zbar/Symbol.h
================================================
//------------------------------------------------------------------------
// Copyright 2007-2010 (c) Jeff Brown
//
// This file is part of the ZBar Bar Code Reader.
//
// The ZBar Bar Code Reader is free software; you can redistribute it
// and/or modify it under the terms of the GNU Lesser Public License as
// published by the Free Software Foundation; either version 2.1 of
// the License, or (at your option) any later version.
//
// The ZBar Bar Code Reader 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 Public License for more details.
//
// You should have received a copy of the GNU Lesser Public License
// along with the ZBar Bar Code Reader; if not, write to the Free
// Software Foundation, Inc., 51 Franklin St, Fifth Floor,
// Boston, MA 02110-1301 USA
//
// http://sourceforge.net/projects/zbar
//------------------------------------------------------------------------
#ifndef _ZBAR_SYMBOL_H_
#define _ZBAR_SYMBOL_H_
/// @file
/// Symbol C++ wrapper
#ifndef _ZBAR_H_
# error "include zbar.h in your application, **not** zbar/Symbol.h"
#endif
#include
#include
#include
#include
namespace zbar {
class SymbolIterator;
/// container for decoded result symbols associated with an image
/// or a composite symbol.
class SymbolSet {
public:
/// constructor.
SymbolSet (const zbar_symbol_set_t *syms = NULL)
: _syms(syms)
{
ref();
}
/// copy constructor.
SymbolSet (const SymbolSet& syms)
: _syms(syms._syms)
{
ref();
}
/// destructor.
~SymbolSet ()
{
ref(-1);
}
/// assignment.
SymbolSet& operator= (const SymbolSet& syms)
{
syms.ref();
ref(-1);
_syms = syms._syms;
return(*this);
}
/// truth testing.
bool operator! () const
{
return(!_syms || !get_size());
}
/// manipulate reference count.
void ref (int delta = 1) const
{
if(_syms)
zbar_symbol_set_ref((zbar_symbol_set_t*)_syms, delta);
}
/// cast to C symbol set.
operator const zbar_symbol_set_t* () const
{
return(_syms);
}
int get_size () const
{
return((_syms) ? zbar_symbol_set_get_size(_syms) : 0);
}
/// create a new SymbolIterator over decoded results.
SymbolIterator symbol_begin() const;
/// return a SymbolIterator suitable for ending iteration.
const SymbolIterator symbol_end() const;
private:
const zbar_symbol_set_t *_syms;
};
/// decoded barcode symbol result object. stores type, data, and
/// image location of decoded symbol
class Symbol {
public:
/// image pixel location (x, y) coordinate tuple.
class Point {
public:
int x; ///< x-coordinate.
int y; ///< y-coordinate.
Point () { }
Point(int x, int y)
: x(x), y(y)
{ }
/// copy constructor.
Point (const Point& pt)
: x(pt.x),
y(pt.y)
{ }
/// assignment.
Point& operator= (const Point& pt)
{
x = pt.x;
y = pt.y;
return(*this);
}
};
/// iteration over Point objects in a symbol location polygon.
class PointIterator
: public std::iterator {
public:
/// constructor.
PointIterator (const Symbol *sym = NULL,
int index = 0)
: _sym(sym),
_index(index)
{
if(sym)
sym->ref(1);
if(!sym ||
(unsigned)_index >= zbar_symbol_get_loc_size(*_sym))
_index = -1;
}
/// copy constructor.
PointIterator (const PointIterator& iter)
: _sym(iter._sym),
_index(iter._index)
{
if(_sym)
_sym->ref();
}
/// destructor.
~PointIterator ()
{
if(_sym)
_sym->ref(-1);
}
/// assignment.
PointIterator& operator= (const PointIterator& iter)
{
if(iter._sym)
iter._sym->ref();
if(_sym)
_sym->ref(-1);
_sym = iter._sym;
_index = iter._index;
return(*this);
}
/// truth testing.
bool operator! () const
{
return(!_sym || _index < 0);
}
/// advance iterator to next Point.
PointIterator& operator++ ()
{
unsigned int i = ++_index;
if(!_sym || i >= zbar_symbol_get_loc_size(*_sym))
_index = -1;
return(*this);
}
/// retrieve currently referenced Point.
const Point operator* () const
{
assert(!!*this);
if(!*this)
return(Point());
return(Point(zbar_symbol_get_loc_x(*_sym, _index),
zbar_symbol_get_loc_y(*_sym, _index)));
}
/// test if two iterators refer to the same Point in the same
/// Symbol.
bool operator== (const PointIterator& iter) const
{
return(_index == iter._index &&
((_index < 0) || _sym == iter._sym));
}
/// test if two iterators refer to the same Point in the same
/// Symbol.
bool operator!= (const PointIterator& iter) const
{
return(!(*this == iter));
}
private:
const Symbol *_sym;
int _index;
};
/// constructor.
Symbol (const zbar_symbol_t *sym = NULL)
: _xmlbuf(NULL),
_xmllen(0)
{
init(sym);
ref();
}
/// copy constructor.
Symbol (const Symbol& sym)
: _sym(sym._sym),
_type(sym._type),
_data(sym._data),
_xmlbuf(NULL),
_xmllen(0)
{
ref();
}
/// destructor.
~Symbol () {
if(_xmlbuf)
free(_xmlbuf);
ref(-1);
}
/// assignment.
Symbol& operator= (const Symbol& sym)
{
sym.ref(1);
ref(-1);
_sym = sym._sym;
_type = sym._type;
_data = sym._data;
return(*this);
}
Symbol& operator= (const zbar_symbol_t *sym)
{
if(sym)
zbar_symbol_ref(sym, 1);
ref(-1);
init(sym);
return(*this);
}
/// truth testing.
bool operator! () const
{
return(!_sym);
}
void ref (int delta = 1) const
{
if(_sym)
zbar_symbol_ref((zbar_symbol_t*)_sym, delta);
}
/// cast to C symbol.
operator const zbar_symbol_t* () const
{
return(_sym);
}
/// test if two Symbol objects refer to the same C symbol.
bool operator== (const Symbol& sym) const
{
return(_sym == sym._sym);
}
/// test if two Symbol objects refer to the same C symbol.
bool operator!= (const Symbol& sym) const
{
return(!(*this == sym));
}
/// retrieve type of decoded symbol.
zbar_symbol_type_t get_type () const
{
return(_type);
}
/// retrieve the string name of the symbol type.
const std::string get_type_name () const
{
return(zbar_get_symbol_name(_type));
}
/// retrieve the string name for any addon.
/// @deprecated in 0.11
const std::string get_addon_name () const
{
return(zbar_get_addon_name(_type));
}
/// retrieve data decoded from symbol.
const std::string get_data () const
{
return(_data);
}
/// retrieve length of binary data
unsigned get_data_length () const
{
return((_sym) ? zbar_symbol_get_data_length(_sym) : 0);
}
/// retrieve inter-frame coherency count.
/// see zbar_symbol_get_count()
/// @since 0.5
int get_count () const
{
return((_sym) ? zbar_symbol_get_count(_sym) : -1);
}
/// retrieve loosely defined relative quality metric.
/// see zbar_symbol_get_quality()
/// @since 0.11
int get_quality () const
{
return((_sym) ? zbar_symbol_get_quality(_sym) : 0);
}
SymbolSet get_components () const
{
return(SymbolSet((_sym) ? zbar_symbol_get_components(_sym) : NULL));
}
/// create a new PointIterator at the start of the location
/// polygon.
PointIterator point_begin() const
{
return(PointIterator(this));
}
/// return a PointIterator suitable for ending iteration.
const PointIterator point_end() const
{
return(PointIterator());
}
/// see zbar_symbol_get_loc_size().
int get_location_size () const
{
return((_sym) ? zbar_symbol_get_loc_size(_sym) : 0);
}
/// see zbar_symbol_get_loc_x().
int get_location_x (unsigned index) const
{
return((_sym) ? zbar_symbol_get_loc_x(_sym, index) : -1);
}
/// see zbar_symbol_get_loc_y().
int get_location_y (unsigned index) const
{
return((_sym) ? zbar_symbol_get_loc_y(_sym, index) : -1);
}
/// see zbar_symbol_get_orientation().
/// @since 0.11
int get_orientation () const
{
return(zbar_symbol_get_orientation(_sym));
}
/// see zbar_symbol_xml().
const std::string xml () const
{
if(!_sym)
return("");
return(zbar_symbol_xml(_sym, (char**)&_xmlbuf, (unsigned*)&_xmllen));
}
protected:
/// (re)initialize Symbol from C symbol object.
void init (const zbar_symbol_t *sym = NULL)
{
_sym = sym;
if(sym) {
_type = zbar_symbol_get_type(sym);
_data = std::string(zbar_symbol_get_data(sym),
zbar_symbol_get_data_length(sym));
}
else {
_type = ZBAR_NONE;
_data = "";
}
}
private:
const zbar_symbol_t *_sym;
zbar_symbol_type_t _type;
std::string _data;
char *_xmlbuf;
unsigned _xmllen;
};
/// iteration over Symbol result objects in a scanned Image or SymbolSet.
class SymbolIterator
: public std::iterator {
public:
/// default constructor.
SymbolIterator ()
{ }
/// constructor.
SymbolIterator (const SymbolSet &syms)
: _syms(syms)
{
const zbar_symbol_set_t *zsyms = _syms;
if(zsyms)
_sym = zbar_symbol_set_first_symbol(zsyms);
}
/// copy constructor.
SymbolIterator (const SymbolIterator& iter)
: _syms(iter._syms)
{
const zbar_symbol_set_t *zsyms = _syms;
if(zsyms)
_sym = zbar_symbol_set_first_symbol(zsyms);
}
~SymbolIterator ()
{
}
/// assignment.
SymbolIterator& operator= (const SymbolIterator& iter)
{
_syms = iter._syms;
_sym = iter._sym;
return(*this);
}
bool operator! () const
{
return(!_syms || !_sym);
}
/// advance iterator to next Symbol.
SymbolIterator& operator++ ()
{
if(!!_sym)
_sym = zbar_symbol_next(_sym);
else if(!!_syms)
_sym = zbar_symbol_set_first_symbol(_syms);
return(*this);
}
/// retrieve currently referenced Symbol.
const Symbol operator* () const
{
return(_sym);
}
/// access currently referenced Symbol.
const Symbol* operator-> () const
{
return(&_sym);
}
/// test if two iterators refer to the same Symbol
bool operator== (const SymbolIterator& iter) const
{
// it is enough to test the symbols, as they belong
// to only one set (also simplifies invalid case)
return(_sym == iter._sym);
}
/// test if two iterators refer to the same Symbol
bool operator!= (const SymbolIterator& iter) const
{
return(!(*this == iter));
}
const SymbolIterator end () const {
return(SymbolIterator());
}
private:
SymbolSet _syms;
Symbol _sym;
};
inline SymbolIterator SymbolSet::symbol_begin () const {
return(SymbolIterator(*this));
}
inline const SymbolIterator SymbolSet::symbol_end () const {
return(SymbolIterator());
}
/// @relates Symbol
/// stream the string representation of a Symbol.
static inline std::ostream& operator<< (std::ostream& out,
const Symbol& sym)
{
out << sym.get_type_name() << ":" << sym.get_data();
return(out);
}
}
#endif
================================================
FILE: zbar/src/main/jni/include/zbar/Video.h
================================================
//------------------------------------------------------------------------
// Copyright 2007-2010 (c) Jeff Brown
//
// This file is part of the ZBar Bar Code Reader.
//
// The ZBar Bar Code Reader is free software; you can redistribute it
// and/or modify it under the terms of the GNU Lesser Public License as
// published by the Free Software Foundation; either version 2.1 of
// the License, or (at your option) any later version.
//
// The ZBar Bar Code Reader 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 Public License for more details.
//
// You should have received a copy of the GNU Lesser Public License
// along with the ZBar Bar Code Reader; if not, write to the Free
// Software Foundation, Inc., 51 Franklin St, Fifth Floor,
// Boston, MA 02110-1301 USA
//
// http://sourceforge.net/projects/zbar
//------------------------------------------------------------------------
#ifndef _ZBAR_VIDEO_H_
#define _ZBAR_VIDEO_H_
/// @file
/// Video Input C++ wrapper
#ifndef _ZBAR_H_
# error "include zbar.h in your application, **not** zbar/Video.h"
#endif
#include "Image.h"
namespace zbar {
/// mid-level video source abstraction.
/// captures images from a video device
class Video {
public:
/// constructor.
Video (zbar_video_t *video = NULL)
{
if(video)
_video = video;
else
_video = zbar_video_create();
}
/// constructor.
Video (std::string& device)
{
_video = zbar_video_create();
open(device);
}
~Video ()
{
zbar_video_destroy(_video);
}
/// cast to C video object.
operator zbar_video_t* () const
{
return(_video);
}
/// open and probe a video device.
void open (std::string& device)
{
if(zbar_video_open(_video, device.c_str()))
throw_exception(_video);
}
/// close video device if open.
void close ()
{
if(zbar_video_open(_video, NULL))
throw_exception(_video);
}
/// initialize video using a specific format for debug.
/// see zbar_video_init()
void init (unsigned long fourcc)
{
if(zbar_video_init(_video, fourcc))
throw_exception(_video);
}
/// initialize video using a specific format for debug.
/// see zbar_video_init()
void init (std::string& format)
{
unsigned int fourcc = zbar_fourcc_parse(format.c_str());
if(zbar_video_init(_video, fourcc))
throw_exception(_video);
}
/// retrieve file descriptor associated with open *nix video device.
/// see zbar_video_get_fd()
int get_fd ()
{
return(zbar_video_get_fd(_video));
}
/// retrieve current output image width.
/// see zbar_video_get_width()
int get_width ()
{
return(zbar_video_get_width(_video));
}
/// retrieve current output image height.
/// see zbar_video_get_height()
int get_height ()
{
return(zbar_video_get_height(_video));
}
/// start/stop video capture.
/// see zbar_video_enable()
void enable (bool enable = true)
{
if(zbar_video_enable(_video, enable))
throw_exception(_video);
}
/// retrieve next captured image.
/// see zbar_video_next_image()
Image next_image ()
{
zbar_image_t *img = zbar_video_next_image(_video);
if(!img)
throw_exception(_video);
return(Image(img));
}
/// request a preferred size for the video image from the device.
/// see zbar_video_request_size()
/// @since 0.6
void request_size (int width, int height)
{
zbar_video_request_size(_video, width, height);
}
/// request a preferred driver interface version for debug/testing.
/// see zbar_video_request_interface()
/// @since 0.6
void request_interface (int version)
{
zbar_video_request_interface(_video, version);
}
/// request a preferred I/O mode for debug/testing.
/// see zbar_video_request_iomode()
/// @since 0.7
void request_iomode (int iomode)
{
if(zbar_video_request_iomode(_video, iomode))
throw_exception(_video);
}
private:
zbar_video_t *_video;
};
}
#endif
================================================
FILE: zbar/src/main/jni/include/zbar/Window.h
================================================
//------------------------------------------------------------------------
// Copyright 2007-2009 (c) Jeff Brown
//
// This file is part of the ZBar Bar Code Reader.
//
// The ZBar Bar Code Reader is free software; you can redistribute it
// and/or modify it under the terms of the GNU Lesser Public License as
// published by the Free Software Foundation; either version 2.1 of
// the License, or (at your option) any later version.
//
// The ZBar Bar Code Reader 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 Public License for more details.
//
// You should have received a copy of the GNU Lesser Public License
// along with the ZBar Bar Code Reader; if not, write to the Free
// Software Foundation, Inc., 51 Franklin St, Fifth Floor,
// Boston, MA 02110-1301 USA
//
// http://sourceforge.net/projects/zbar
//------------------------------------------------------------------------
#ifndef _ZBAR_WINDOW_H_
#define _ZBAR_WINDOW_H_
/// @file
/// Output Window C++ wrapper
#ifndef _ZBAR_H_
# error "include zbar.h in your application, **not** zbar/Window.h"
#endif
#include "Image.h"
namespace zbar {
/// mid-level output window abstraction.
/// displays images to user-specified platform specific output window
class Window {
public:
/// constructor.
Window (zbar_window_t *window = NULL)
{
if(window)
_window = window;
else
_window = zbar_window_create();
}
/// constructor.
Window (void *x11_display_w32_hwnd,
unsigned long x11_drawable)
{
_window = zbar_window_create();
attach(x11_display_w32_hwnd, x11_drawable);
}
~Window ()
{
zbar_window_destroy(_window);
}
/// cast to C window object.
operator zbar_window_t* () const
{
return(_window);
}
/// associate reader with an existing platform window.
/// see zbar_window_attach()
void attach (void *x11_display_w32_hwnd,
unsigned long x11_drawable = 0)
{
if(zbar_window_attach(_window,
x11_display_w32_hwnd, x11_drawable) < 0)
throw_exception(_window);
}
/// control content level of the reader overlay.
/// see zbar_window_set_overlay()
void set_overlay (int level)
{
zbar_window_set_overlay(_window, level);
}
/// retrieve current content level of reader overlay.
/// see zbar_window_get_overlay()
/// draw a new image into the output window.
/// see zbar_window_draw()
void draw (Image& image)
{
if(zbar_window_draw(_window, image) < 0)
throw_exception(_window);
}
/// clear the image from the output window.
/// see zbar_window_draw()
void clear ()
{
if(zbar_window_draw(_window, NULL) < 0)
throw_exception(_window);
}
/// redraw the last image.
/// zbar_window_redraw()
void redraw ()
{
if(zbar_window_redraw(_window) < 0)
throw_exception(_window);
}
/// resize the image window.
/// zbar_window_resize()
void resize (unsigned width, unsigned height)
{
if(zbar_window_resize(_window, width, height) < 0)
throw_exception(_window);
}
private:
zbar_window_t *_window;
};
/// select a compatible format between video input and output window.
/// see zbar_negotiate_format()
static inline void negotiate_format (Video& video, Window& window)
{
if(zbar_negotiate_format(video, window) < 0)
throw_exception(video);
}
}
#endif
================================================
FILE: zbar/src/main/jni/include/zbar/zbargtk.h
================================================
/*------------------------------------------------------------------------
* Copyright 2008-2009 (c) Jeff Brown
*
* This file is part of the ZBar Bar Code Reader.
*
* The ZBar Bar Code Reader is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* The ZBar Bar Code Reader 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 Public License for more details.
*
* You should have received a copy of the GNU Lesser Public License
* along with the ZBar Bar Code Reader; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*
* http://sourceforge.net/projects/zbar
*------------------------------------------------------------------------*/
#ifndef __ZBAR_GTK_H__
#define __ZBAR_GTK_H__
/** SECTION:ZBarGtk
* @short_description: barcode reader GTK+ 2.x widget
* @include: zbar/zbargtk.h
*
* embeds a barcode reader directly into a GTK+ based GUI. the widget
* can process barcodes from a video source (using the
* #ZBarGtk:video-device and #ZBarGtk:video-enabled properties) or
* from individual GdkPixbufs supplied to zbar_gtk_scan_image()
*
* Since: 1.5
*/
#include
#include
#include
#include
G_BEGIN_DECLS
#define ZBAR_TYPE_GTK (zbar_gtk_get_type())
#define ZBAR_GTK(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), ZBAR_TYPE_GTK, ZBarGtk))
#define ZBAR_GTK_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass), ZBAR_TYPE_GTK, ZBarGtkClass))
#define ZBAR_IS_GTK(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj), ZBAR_TYPE_GTK))
#define ZBAR_IS_GTK_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass), ZBAR_TYPE_GTK))
#define ZBAR_GTK_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS((obj), ZBAR_TYPE_GTK, ZBarGtkClass))
typedef struct _ZBarGtk ZBarGtk;
typedef struct _ZBarGtkClass ZBarGtkClass;
struct _ZBarGtk {
GtkWidget widget;
gpointer *_private;
/* properties */
/**
* ZBarGtk:video-device:
*
* the currently set video device.
*
* setting a new device opens it and automatically sets
* #ZBarGtk:video-enabled. set the empty string ("") or NULL to
* close.
*/
/**
* ZBarGtk:video-enabled:
*
* video device streaming state.
*
* use to pause/resume video scanning.
*/
/**
* ZBarGtk:video-opened:
*
* video device opened state.
*
* (re)setting #ZBarGtk:video-device should eventually cause it
* to be opened or closed. any errors while streaming/scanning
* will also cause the device to be closed
*/
};
struct _ZBarGtkClass {
GtkWidgetClass parent_class;
/* signals */
/**
* ZBarGtk::decoded:
* @widget: the object that received the signal
* @symbol_type: the type of symbol decoded (a zbar_symbol_type_t)
* @data: the data decoded from the symbol
*
* emitted when a barcode is decoded from an image.
* the symbol type and contained data are provided as separate
* parameters
*/
void (*decoded) (ZBarGtk *zbar,
zbar_symbol_type_t symbol_type,
const char *data);
/**
* ZBarGtk::decoded-text:
* @widget: the object that received the signal
* @text: the decoded data prefixed by the string name of the
* symbol type (separated by a colon)
*
* emitted when a barcode is decoded from an image.
* the symbol type name is prefixed to the data, separated by a
* colon
*/
void (*decoded_text) (ZBarGtk *zbar,
const char *text);
/**
* ZBarGtk::scan-image:
* @widget: the object that received the signal
* @image: the image to scan for barcodes
*/
void (*scan_image) (ZBarGtk *zbar,
GdkPixbuf *image);
};
GType zbar_gtk_get_type(void) G_GNUC_CONST;
/**
* zbar_gtk_new:
* create a new barcode reader widget instance.
* initially has no associated video device or image.
*
* Returns: a new #ZBarGtk widget instance
*/
GtkWidget *zbar_gtk_new(void);
/**
* zbar_gtk_scan_image:
*
*/
void zbar_gtk_scan_image(ZBarGtk *zbar,
GdkPixbuf *image);
/** retrieve the currently opened video device.
*
* Returns: the current video device or NULL if no device is opened
*/
const char *zbar_gtk_get_video_device(ZBarGtk *zbar);
/** open a new video device.
*
* @video_device: the platform specific name of the device to open.
* use NULL to close a currently opened device.
*
* @note since opening a device may take some time, this call will
* return immediately and the device will be opened asynchronously
*/
void zbar_gtk_set_video_device(ZBarGtk *zbar,
const char *video_device);
/** retrieve the current video enabled state.
*
* Returns: true if video scanning is currently enabled, false otherwise
*/
gboolean zbar_gtk_get_video_enabled(ZBarGtk *zbar);
/** enable/disable video scanning.
* @video_enabled: true to enable video scanning, false to disable
*
* has no effect unless a video device is opened
*/
void zbar_gtk_set_video_enabled(ZBarGtk *zbar,
gboolean video_enabled);
/** retrieve the current video opened state.
*
* Returns: true if video device is currently opened, false otherwise
*/
gboolean zbar_gtk_get_video_opened(ZBarGtk *zbar);
/** set video camera resolution.
* @width: width in pixels
* @height: height in pixels
*
* @note this call must be made before video is initialized
*/
void zbar_gtk_request_video_size(ZBarGtk *zbar,
int width,
int height);
/**
* utility function to populate a zbar_image_t from a GdkPixbuf.
* @image: the zbar library image destination to populate
* @pixbuf: the GdkPixbuf source
*
* Returns: TRUE if successful or FALSE if the conversion could not be
* performed for some reason
*/
gboolean zbar_gtk_image_from_pixbuf(zbar_image_t *image,
GdkPixbuf *pixbuf);
G_END_DECLS
#endif
================================================
FILE: zbar/src/main/jni/include/zbar.h
================================================
/*------------------------------------------------------------------------
* Copyright 2007-2010 (c) Jeff Brown
*
* This file is part of the ZBar Bar Code Reader.
*
* The ZBar Bar Code Reader is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* The ZBar Bar Code Reader 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 Public License for more details.
*
* You should have received a copy of the GNU Lesser Public License
* along with the ZBar Bar Code Reader; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*
* http://sourceforge.net/projects/zbar
*------------------------------------------------------------------------*/
#ifndef _ZBAR_H_
#define _ZBAR_H_
/** @file
* ZBar Barcode Reader C API definition
*/
/** @mainpage
*
* interface to the barcode reader is available at several levels.
* most applications will want to use the high-level interfaces:
*
* @section high-level High-Level Interfaces
*
* these interfaces wrap all library functionality into an easy-to-use
* package for a specific toolkit:
* - the "GTK+ 2.x widget" may be used with GTK GUI applications. a
* Python wrapper is included for PyGtk
* - the @ref zbar::QZBar "Qt4 widget" may be used with Qt GUI
* applications
* - the Processor interface (in @ref c-processor "C" or @ref
* zbar::Processor "C++") adds a scanning window to an application
* with no GUI.
*
* @section mid-level Intermediate Interfaces
*
* building blocks used to construct high-level interfaces:
* - the ImageScanner (in @ref c-imagescanner "C" or @ref
* zbar::ImageScanner "C++") looks for barcodes in a library defined
* image object
* - the Window abstraction (in @ref c-window "C" or @ref
* zbar::Window "C++") sinks library images, displaying them on the
* platform display
* - the Video abstraction (in @ref c-video "C" or @ref zbar::Video
* "C++") sources library images from a video device
*
* @section low-level Low-Level Interfaces
*
* direct interaction with barcode scanning and decoding:
* - the Scanner (in @ref c-scanner "C" or @ref zbar::Scanner "C++")
* looks for barcodes in a linear intensity sample stream
* - the Decoder (in @ref c-decoder "C" or @ref zbar::Decoder "C++")
* extracts barcodes from a stream of bar and space widths
*/
#ifdef __cplusplus
/** C++ namespace for library interfaces */
namespace zbar {
extern "C" {
#endif
/** @name Global library interfaces */
/*@{*/
/** "color" of element: bar or space. */
typedef enum zbar_color_e {
ZBAR_SPACE = 0, /**< light area or space between bars */
ZBAR_BAR = 1, /**< dark area or colored bar segment */
} zbar_color_t;
/** decoded symbol type. */
typedef enum zbar_symbol_type_e {
ZBAR_NONE = 0, /**< no symbol decoded */
ZBAR_PARTIAL = 1, /**< intermediate status */
ZBAR_EAN2 = 2, /**< GS1 2-digit add-on */
ZBAR_EAN5 = 5, /**< GS1 5-digit add-on */
ZBAR_EAN8 = 8, /**< EAN-8 */
ZBAR_UPCE = 9, /**< UPC-E */
ZBAR_ISBN10 = 10, /**< ISBN-10 (from EAN-13). @since 0.4 */
ZBAR_UPCA = 12, /**< UPC-A */
ZBAR_EAN13 = 13, /**< EAN-13 */
ZBAR_ISBN13 = 14, /**< ISBN-13 (from EAN-13). @since 0.4 */
ZBAR_COMPOSITE = 15, /**< EAN/UPC composite */
ZBAR_I25 = 25, /**< Interleaved 2 of 5. @since 0.4 */
ZBAR_DATABAR = 34, /**< GS1 DataBar (RSS). @since 0.11 */
ZBAR_DATABAR_EXP = 35, /**< GS1 DataBar Expanded. @since 0.11 */
ZBAR_CODABAR = 38, /**< Codabar. @since 0.11 */
ZBAR_CODE39 = 39, /**< Code 39. @since 0.4 */
ZBAR_PDF417 = 57, /**< PDF417. @since 0.6 */
ZBAR_QRCODE = 64, /**< QR Code. @since 0.10 */
ZBAR_CODE93 = 93, /**< Code 93. @since 0.11 */
ZBAR_CODE128 = 128, /**< Code 128 */
/** mask for base symbol type.
* @deprecated in 0.11, remove this from existing code
*/
ZBAR_SYMBOL = 0x00ff,
/** 2-digit add-on flag.
* @deprecated in 0.11, a ::ZBAR_EAN2 component is used for
* 2-digit GS1 add-ons
*/
ZBAR_ADDON2 = 0x0200,
/** 5-digit add-on flag.
* @deprecated in 0.11, a ::ZBAR_EAN5 component is used for
* 5-digit GS1 add-ons
*/
ZBAR_ADDON5 = 0x0500,
/** add-on flag mask.
* @deprecated in 0.11, GS1 add-ons are represented using composite
* symbols of type ::ZBAR_COMPOSITE; add-on components use ::ZBAR_EAN2
* or ::ZBAR_EAN5
*/
ZBAR_ADDON = 0x0700,
} zbar_symbol_type_t;
/** decoded symbol coarse orientation.
* @since 0.11
*/
typedef enum zbar_orientation_e {
ZBAR_ORIENT_UNKNOWN = -1, /**< unable to determine orientation */
ZBAR_ORIENT_UP, /**< upright, read left to right */
ZBAR_ORIENT_RIGHT, /**< sideways, read top to bottom */
ZBAR_ORIENT_DOWN, /**< upside-down, read right to left */
ZBAR_ORIENT_LEFT, /**< sideways, read bottom to top */
} zbar_orientation_t;
/** error codes. */
typedef enum zbar_error_e {
ZBAR_OK = 0, /**< no error */
ZBAR_ERR_NOMEM, /**< out of memory */
ZBAR_ERR_INTERNAL, /**< internal library error */
ZBAR_ERR_UNSUPPORTED, /**< unsupported request */
ZBAR_ERR_INVALID, /**< invalid request */
ZBAR_ERR_SYSTEM, /**< system error */
ZBAR_ERR_LOCKING, /**< locking error */
ZBAR_ERR_BUSY, /**< all resources busy */
ZBAR_ERR_XDISPLAY, /**< X11 display error */
ZBAR_ERR_XPROTO, /**< X11 protocol error */
ZBAR_ERR_CLOSED, /**< output window is closed */
ZBAR_ERR_WINAPI, /**< windows system error */
ZBAR_ERR_NUM /**< number of error codes */
} zbar_error_t;
/** decoder configuration options.
* @since 0.4
*/
typedef enum zbar_config_e {
ZBAR_CFG_ENABLE = 0, /**< enable symbology/feature */
ZBAR_CFG_ADD_CHECK, /**< enable check digit when optional */
ZBAR_CFG_EMIT_CHECK, /**< return check digit when present */
ZBAR_CFG_ASCII, /**< enable full ASCII character set */
ZBAR_CFG_NUM, /**< number of boolean decoder configs */
ZBAR_CFG_MIN_LEN = 0x20, /**< minimum data length for valid decode */
ZBAR_CFG_MAX_LEN, /**< maximum data length for valid decode */
ZBAR_CFG_UNCERTAINTY = 0x40,/**< required video consistency frames */
ZBAR_CFG_POSITION = 0x80, /**< enable scanner to collect position data */
ZBAR_CFG_X_DENSITY = 0x100, /**< image scanner vertical scan density */
ZBAR_CFG_Y_DENSITY, /**< image scanner horizontal scan density */
} zbar_config_t;
/** decoder symbology modifier flags.
* @since 0.11
*/
typedef enum zbar_modifier_e {
/** barcode tagged as GS1 (EAN.UCC) reserved
* (eg, FNC1 before first data character).
* data may be parsed as a sequence of GS1 AIs
*/
ZBAR_MOD_GS1 = 0,
/** barcode tagged as AIM reserved
* (eg, FNC1 after first character or digit pair)
*/
ZBAR_MOD_AIM,
/** number of modifiers */
ZBAR_MOD_NUM,
} zbar_modifier_t;
/** retrieve runtime library version information.
* @param major set to the running major version (unless NULL)
* @param minor set to the running minor version (unless NULL)
* @returns 0
*/
extern int zbar_version(unsigned *major,
unsigned *minor);
/** set global library debug level.
* @param verbosity desired debug level. higher values create more spew
*/
extern void zbar_set_verbosity(int verbosity);
/** increase global library debug level.
* eg, for -vvvv
*/
extern void zbar_increase_verbosity(void);
/** retrieve string name for symbol encoding.
* @param sym symbol type encoding
* @returns the static string name for the specified symbol type,
* or "UNKNOWN" if the encoding is not recognized
*/
extern const char *zbar_get_symbol_name(zbar_symbol_type_t sym);
/** retrieve string name for addon encoding.
* @param sym symbol type encoding
* @returns static string name for any addon, or the empty string
* if no addons were decoded
* @deprecated in 0.11
*/
extern const char *zbar_get_addon_name(zbar_symbol_type_t sym);
/** retrieve string name for configuration setting.
* @param config setting to name
* @returns static string name for config,
* or the empty string if value is not a known config
*/
extern const char *zbar_get_config_name(zbar_config_t config);
/** retrieve string name for modifier.
* @param modifier flag to name
* @returns static string name for modifier,
* or the empty string if the value is not a known flag
*/
extern const char *zbar_get_modifier_name(zbar_modifier_t modifier);
/** retrieve string name for orientation.
* @param orientation orientation encoding
* @returns the static string name for the specified orientation,
* or "UNKNOWN" if the orientation is not recognized
* @since 0.11
*/
extern const char *zbar_get_orientation_name(zbar_orientation_t orientation);
/** parse a configuration string of the form "[symbology.]config[=value]".
* the config must match one of the recognized names.
* the symbology, if present, must match one of the recognized names.
* if symbology is unspecified, it will be set to 0.
* if value is unspecified it will be set to 1.
* @returns 0 if the config is parsed successfully, 1 otherwise
* @since 0.4
*/
extern int zbar_parse_config(const char *config_string,
zbar_symbol_type_t *symbology,
zbar_config_t *config,
int *value);
/** consistently compute fourcc values across architectures
* (adapted from v4l2 specification)
* @since 0.11
*/
#define zbar_fourcc(a, b, c, d) \
((unsigned long)(a) | \
((unsigned long)(b) << 8) | \
((unsigned long)(c) << 16) | \
((unsigned long)(d) << 24))
/** parse a fourcc string into its encoded integer value.
* @since 0.11
*/
static inline unsigned long zbar_fourcc_parse (const char *format)
{
unsigned long fourcc = 0;
if(format) {
int i;
for(i = 0; i < 4 && format[i]; i++)
fourcc |= ((unsigned long)format[i]) << (i * 8);
}
return(fourcc);
}
/** @internal type unsafe error API (don't use) */
extern int _zbar_error_spew(const void *object,
int verbosity);
extern const char *_zbar_error_string(const void *object,
int verbosity);
extern zbar_error_t _zbar_get_error_code(const void *object);
/*@}*/
struct zbar_symbol_s;
typedef struct zbar_symbol_s zbar_symbol_t;
struct zbar_symbol_set_s;
typedef struct zbar_symbol_set_s zbar_symbol_set_t;
/*------------------------------------------------------------*/
/** @name Symbol interface
* decoded barcode symbol result object. stores type, data, and image
* location of decoded symbol. all memory is owned by the library
*/
/*@{*/
/** @typedef zbar_symbol_t
* opaque decoded symbol object.
*/
/** symbol reference count manipulation.
* increment the reference count when you store a new reference to the
* symbol. decrement when the reference is no longer used. do not
* refer to the symbol once the count is decremented and the
* containing image has been recycled or destroyed.
* @note the containing image holds a reference to the symbol, so you
* only need to use this if you keep a symbol after the image has been
* destroyed or reused.
* @since 0.9
*/
extern void zbar_symbol_ref(const zbar_symbol_t *symbol,
int refs);
/** retrieve type of decoded symbol.
* @returns the symbol type
*/
extern zbar_symbol_type_t zbar_symbol_get_type(const zbar_symbol_t *symbol);
/** retrieve symbology boolean config settings.
* @returns a bitmask indicating which configs were set for the detected
* symbology during decoding.
* @since 0.11
*/
extern unsigned int zbar_symbol_get_configs(const zbar_symbol_t *symbol);
/** retrieve symbology modifier flag settings.
* @returns a bitmask indicating which characteristics were detected
* during decoding.
* @since 0.11
*/
extern unsigned int zbar_symbol_get_modifiers(const zbar_symbol_t *symbol);
/** retrieve data decoded from symbol.
* @returns the data string
*/
extern const char *zbar_symbol_get_data(const zbar_symbol_t *symbol);
/** retrieve length of binary data.
* @returns the length of the decoded data
*/
extern unsigned int zbar_symbol_get_data_length(const zbar_symbol_t *symbol);
/** retrieve a symbol confidence metric.
* @returns an unscaled, relative quantity: larger values are better
* than smaller values, where "large" and "small" are application
* dependent.
* @note expect the exact definition of this quantity to change as the
* metric is refined. currently, only the ordered relationship
* between two values is defined and will remain stable in the future
* @since 0.9
*/
extern int zbar_symbol_get_quality(const zbar_symbol_t *symbol);
/** retrieve current cache count. when the cache is enabled for the
* image_scanner this provides inter-frame reliability and redundancy
* information for video streams.
* @returns < 0 if symbol is still uncertain.
* @returns 0 if symbol is newly verified.
* @returns > 0 for duplicate symbols
*/
extern int zbar_symbol_get_count(const zbar_symbol_t *symbol);
/** retrieve the number of points in the location polygon. the
* location polygon defines the image area that the symbol was
* extracted from.
* @returns the number of points in the location polygon
* @note this is currently not a polygon, but the scan locations
* where the symbol was decoded
*/
extern unsigned zbar_symbol_get_loc_size(const zbar_symbol_t *symbol);
/** retrieve location polygon x-coordinates.
* points are specified by 0-based index.
* @returns the x-coordinate for a point in the location polygon.
* @returns -1 if index is out of range
*/
extern int zbar_symbol_get_loc_x(const zbar_symbol_t *symbol,
unsigned index);
/** retrieve location polygon y-coordinates.
* points are specified by 0-based index.
* @returns the y-coordinate for a point in the location polygon.
* @returns -1 if index is out of range
*/
extern int zbar_symbol_get_loc_y(const zbar_symbol_t *symbol,
unsigned index);
/** retrieve general orientation of decoded symbol.
* @returns a coarse, axis-aligned indication of symbol orientation or
* ::ZBAR_ORIENT_UNKNOWN if unknown
* @since 0.11
*/
extern zbar_orientation_t
zbar_symbol_get_orientation(const zbar_symbol_t *symbol);
/** iterate the set to which this symbol belongs (there can be only one).
* @returns the next symbol in the set, or
* @returns NULL when no more results are available
*/
extern const zbar_symbol_t *zbar_symbol_next(const zbar_symbol_t *symbol);
/** retrieve components of a composite result.
* @returns the symbol set containing the components
* @returns NULL if the symbol is already a physical symbol
* @since 0.10
*/
extern const zbar_symbol_set_t*
zbar_symbol_get_components(const zbar_symbol_t *symbol);
/** iterate components of a composite result.
* @returns the first physical component symbol of a composite result
* @returns NULL if the symbol is already a physical symbol
* @since 0.10
*/
extern const zbar_symbol_t*
zbar_symbol_first_component(const zbar_symbol_t *symbol);
/** print XML symbol element representation to user result buffer.
* @see http://zbar.sourceforge.net/2008/barcode.xsd for the schema.
* @param symbol is the symbol to print
* @param buffer is the inout result pointer, it will be reallocated
* with a larger size if necessary.
* @param buflen is inout length of the result buffer.
* @returns the buffer pointer
* @since 0.6
*/
extern char *zbar_symbol_xml(const zbar_symbol_t *symbol,
char **buffer,
unsigned *buflen);
/*@}*/
/*------------------------------------------------------------*/
/** @name Symbol Set interface
* container for decoded result symbols associated with an image
* or a composite symbol.
* @since 0.10
*/
/*@{*/
/** @typedef zbar_symbol_set_t
* opaque symbol iterator object.
* @since 0.10
*/
/** reference count manipulation.
* increment the reference count when you store a new reference.
* decrement when the reference is no longer used. do not refer to
* the object any longer once references have been released.
* @since 0.10
*/
extern void zbar_symbol_set_ref(const zbar_symbol_set_t *symbols,
int refs);
/** retrieve set size.
* @returns the number of symbols in the set.
* @since 0.10
*/
extern int zbar_symbol_set_get_size(const zbar_symbol_set_t *symbols);
/** set iterator.
* @returns the first decoded symbol result in a set
* @returns NULL if the set is empty
* @since 0.10
*/
extern const zbar_symbol_t*
zbar_symbol_set_first_symbol(const zbar_symbol_set_t *symbols);
/** raw result iterator.
* @returns the first decoded symbol result in a set, *before* filtering
* @returns NULL if the set is empty
* @since 0.11
*/
extern const zbar_symbol_t*
zbar_symbol_set_first_unfiltered(const zbar_symbol_set_t *symbols);
/*@}*/
/*------------------------------------------------------------*/
/** @name Image interface
* stores image data samples along with associated format and size
* metadata
*/
/*@{*/
struct zbar_image_s;
/** opaque image object. */
typedef struct zbar_image_s zbar_image_t;
/** cleanup handler callback function.
* called to free sample data when an image is destroyed.
*/
typedef void (zbar_image_cleanup_handler_t)(zbar_image_t *image);
/** data handler callback function.
* called when decoded symbol results are available for an image
*/
typedef void (zbar_image_data_handler_t)(zbar_image_t *image,
const void *userdata);
/** new image constructor.
* @returns a new image object with uninitialized data and format.
* this image should be destroyed (using zbar_image_destroy()) as
* soon as the application is finished with it
*/
extern zbar_image_t *zbar_image_create(void);
/** image destructor. all images created by or returned to the
* application should be destroyed using this function. when an image
* is destroyed, the associated data cleanup handler will be invoked
* if available
* @note make no assumptions about the image or the data buffer.
* they may not be destroyed/cleaned immediately if the library
* is still using them. if necessary, use the cleanup handler hook
* to keep track of image data buffers
*/
extern void zbar_image_destroy(zbar_image_t *image);
/** image reference count manipulation.
* increment the reference count when you store a new reference to the
* image. decrement when the reference is no longer used. do not
* refer to the image any longer once the count is decremented.
* zbar_image_ref(image, -1) is the same as zbar_image_destroy(image)
* @since 0.5
*/
extern void zbar_image_ref(zbar_image_t *image,
int refs);
/** image format conversion. refer to the documentation for supported
* image formats
* @returns a @em new image with the sample data from the original image
* converted to the requested format. the original image is
* unaffected.
* @note the converted image size may be rounded (up) due to format
* constraints
*/
extern zbar_image_t *zbar_image_convert(const zbar_image_t *image,
unsigned long format);
/** image format conversion with crop/pad.
* if the requested size is larger than the image, the last row/column
* are duplicated to cover the difference. if the requested size is
* smaller than the image, the extra rows/columns are dropped from the
* right/bottom.
* @returns a @em new image with the sample data from the original
* image converted to the requested format and size.
* @note the image is @em not scaled
* @see zbar_image_convert()
* @since 0.4
*/
extern zbar_image_t *zbar_image_convert_resize(const zbar_image_t *image,
unsigned long format,
unsigned width,
unsigned height);
/** retrieve the image format.
* @returns the fourcc describing the format of the image sample data
*/
extern unsigned long zbar_image_get_format(const zbar_image_t *image);
/** retrieve a "sequence" (page/frame) number associated with this image.
* @since 0.6
*/
extern unsigned zbar_image_get_sequence(const zbar_image_t *image);
/** retrieve the width of the image.
* @returns the width in sample columns
*/
extern unsigned zbar_image_get_width(const zbar_image_t *image);
/** retrieve the height of the image.
* @returns the height in sample rows
*/
extern unsigned zbar_image_get_height(const zbar_image_t *image);
/** retrieve both dimensions of the image.
* fills in the width and height in samples
*/
extern void zbar_image_get_size(const zbar_image_t *image,
unsigned *width,
unsigned *height);
/** retrieve the crop rectangle.
* fills in the image coordinates of the upper left corner and size
* of an axis-aligned rectangular area of the image that will be scanned.
* defaults to the full image
* @since 0.11
*/
extern void zbar_image_get_crop(const zbar_image_t *image,
unsigned *x,
unsigned *y,
unsigned *width,
unsigned *height);
/** return the image sample data. the returned data buffer is only
* valid until zbar_image_destroy() is called
*/
extern const void *zbar_image_get_data(const zbar_image_t *image);
/** return the size of image data.
* @since 0.6
*/
extern unsigned long zbar_image_get_data_length(const zbar_image_t *img);
/** retrieve the decoded results.
* @returns the (possibly empty) set of decoded symbols
* @returns NULL if the image has not been scanned
* @since 0.10
*/
extern const zbar_symbol_set_t*
zbar_image_get_symbols(const zbar_image_t *image);
/** associate the specified symbol set with the image, replacing any
* existing results. use NULL to release the current results from the
* image.
* @see zbar_image_scanner_recycle_image()
* @since 0.10
*/
extern void zbar_image_set_symbols(zbar_image_t *image,
const zbar_symbol_set_t *symbols);
/** image_scanner decode result iterator.
* @returns the first decoded symbol result for an image
* or NULL if no results are available
*/
extern const zbar_symbol_t*
zbar_image_first_symbol(const zbar_image_t *image);
/** specify the fourcc image format code for image sample data.
* refer to the documentation for supported formats.
* @note this does not convert the data!
* (see zbar_image_convert() for that)
*/
extern void zbar_image_set_format(zbar_image_t *image,
unsigned long format);
/** associate a "sequence" (page/frame) number with this image.
* @since 0.6
*/
extern void zbar_image_set_sequence(zbar_image_t *image,
unsigned sequence_num);
/** specify the pixel size of the image.
* @note this also resets the crop rectangle to the full image
* (0, 0, width, height)
* @note this does not affect the data!
*/
extern void zbar_image_set_size(zbar_image_t *image,
unsigned width,
unsigned height);
/** specify a rectangular region of the image to scan.
* the rectangle will be clipped to the image boundaries.
* defaults to the full image specified by zbar_image_set_size()
*/
extern void zbar_image_set_crop(zbar_image_t *image,
unsigned x,
unsigned y,
unsigned width,
unsigned height);
/** specify image sample data. when image data is no longer needed by
* the library the specific data cleanup handler will be called
* (unless NULL)
* @note application image data will not be modified by the library
*/
extern void zbar_image_set_data(zbar_image_t *image,
const void *data,
unsigned long data_byte_length,
zbar_image_cleanup_handler_t *cleanup_hndlr);
/** built-in cleanup handler.
* passes the image data buffer to free()
*/
extern void zbar_image_free_data(zbar_image_t *image);
/** associate user specified data value with an image.
* @since 0.5
*/
extern void zbar_image_set_userdata(zbar_image_t *image,
void *userdata);
/** return user specified data value associated with the image.
* @since 0.5
*/
extern void *zbar_image_get_userdata(const zbar_image_t *image);
/** dump raw image data to a file for debug.
* the data will be prefixed with a 16 byte header consisting of:
* - 4 bytes uint = 0x676d697a ("zimg")
* - 4 bytes format fourcc
* - 2 bytes width
* - 2 bytes height
* - 4 bytes size of following image data in bytes
* this header can be dumped w/eg:
* @verbatim
od -Ax -tx1z -N16 -w4 [file]
@endverbatim
* for some formats the image can be displayed/converted using
* ImageMagick, eg:
* @verbatim
display -size 640x480+16 [-depth ?] [-sampling-factor ?x?] \
{GRAY,RGB,UYVY,YUV}:[file]
@endverbatim
*
* @param image the image object to dump
* @param filebase base filename, appended with ".XXXX.zimg" where
* XXXX is the format fourcc
* @returns 0 on success or a system error code on failure
*/
extern int zbar_image_write(const zbar_image_t *image,
const char *filebase);
/** read back an image in the format written by zbar_image_write()
* @note TBD
*/
extern zbar_image_t *zbar_image_read(char *filename);
/*@}*/
/*------------------------------------------------------------*/
/** @name Processor interface
* @anchor c-processor
* high-level self-contained image processor.
* processes video and images for barcodes, optionally displaying
* images to a library owned output window
*/
/*@{*/
struct zbar_processor_s;
/** opaque standalone processor object. */
typedef struct zbar_processor_s zbar_processor_t;
/** constructor.
* if threaded is set and threading is available the processor
* will spawn threads where appropriate to avoid blocking and
* improve responsiveness
*/
extern zbar_processor_t *zbar_processor_create(int threaded);
/** destructor. cleans up all resources associated with the processor
*/
extern void zbar_processor_destroy(zbar_processor_t *processor);
/** (re)initialization.
* opens a video input device and/or prepares to display output
*/
extern int zbar_processor_init(zbar_processor_t *processor,
const char *video_device,
int enable_display);
/** request a preferred size for the video image from the device.
* the request may be adjusted or completely ignored by the driver.
* @note must be called before zbar_processor_init()
* @since 0.6
*/
extern int zbar_processor_request_size(zbar_processor_t *processor,
unsigned width,
unsigned height);
/** request a preferred video driver interface version for
* debug/testing.
* @note must be called before zbar_processor_init()
* @since 0.6
*/
extern int zbar_processor_request_interface(zbar_processor_t *processor,
int version);
/** request a preferred video I/O mode for debug/testing. You will
* get errors if the driver does not support the specified mode.
* @verbatim
0 = auto-detect
1 = force I/O using read()
2 = force memory mapped I/O using mmap()
3 = force USERPTR I/O (v4l2 only)
@endverbatim
* @note must be called before zbar_processor_init()
* @since 0.7
*/
extern int zbar_processor_request_iomode(zbar_processor_t *video,
int iomode);
/** force specific input and output formats for debug/testing.
* @note must be called before zbar_processor_init()
*/
extern int zbar_processor_force_format(zbar_processor_t *processor,
unsigned long input_format,
unsigned long output_format);
/** setup result handler callback.
* the specified function will be called by the processor whenever
* new results are available from the video stream or a static image.
* pass a NULL value to disable callbacks.
* @param processor the object on which to set the handler.
* @param handler the function to call when new results are available.
* @param userdata is set as with zbar_processor_set_userdata().
* @returns the previously registered handler
*/
extern zbar_image_data_handler_t*
zbar_processor_set_data_handler(zbar_processor_t *processor,
zbar_image_data_handler_t *handler,
const void *userdata);
/** associate user specified data value with the processor.
* @since 0.6
*/
extern void zbar_processor_set_userdata(zbar_processor_t *processor,
void *userdata);
/** return user specified data value associated with the processor.
* @since 0.6
*/
extern void *zbar_processor_get_userdata(const zbar_processor_t *processor);
/** set config for indicated symbology (0 for all) to specified value.
* @returns 0 for success, non-0 for failure (config does not apply to
* specified symbology, or value out of range)
* @see zbar_decoder_set_config()
* @since 0.4
*/
extern int zbar_processor_set_config(zbar_processor_t *processor,
zbar_symbol_type_t symbology,
zbar_config_t config,
int value);
/** parse configuration string using zbar_parse_config()
* and apply to processor using zbar_processor_set_config().
* @returns 0 for success, non-0 for failure
* @see zbar_parse_config()
* @see zbar_processor_set_config()
* @since 0.4
*/
static inline int zbar_processor_parse_config (zbar_processor_t *processor,
const char *config_string)
{
zbar_symbol_type_t sym;
zbar_config_t cfg;
int val;
return(zbar_parse_config(config_string, &sym, &cfg, &val) ||
zbar_processor_set_config(processor, sym, cfg, val));
}
/** retrieve the current state of the ouput window.
* @returns 1 if the output window is currently displayed, 0 if not.
* @returns -1 if an error occurs
*/
extern int zbar_processor_is_visible(zbar_processor_t *processor);
/** show or hide the display window owned by the library.
* the size will be adjusted to the input size
*/
extern int zbar_processor_set_visible(zbar_processor_t *processor,
int visible);
/** control the processor in free running video mode.
* only works if video input is initialized. if threading is in use,
* scanning will occur in the background, otherwise this is only
* useful wrapping calls to zbar_processor_user_wait(). if the
* library output window is visible, video display will be enabled.
*/
extern int zbar_processor_set_active(zbar_processor_t *processor,
int active);
/** retrieve decode results for last scanned image/frame.
* @returns the symbol set result container or NULL if no results are
* available
* @note the returned symbol set has its reference count incremented;
* ensure that the count is decremented after use
* @since 0.10
*/
extern const zbar_symbol_set_t*
zbar_processor_get_results(const zbar_processor_t *processor);
/** wait for input to the display window from the user
* (via mouse or keyboard).
* @returns >0 when input is received, 0 if timeout ms expired
* with no input or -1 in case of an error
*/
extern int zbar_processor_user_wait(zbar_processor_t *processor,
int timeout);
/** process from the video stream until a result is available,
* or the timeout (in milliseconds) expires.
* specify a timeout of -1 to scan indefinitely
* (zbar_processor_set_active() may still be used to abort the scan
* from another thread).
* if the library window is visible, video display will be enabled.
* @note that multiple results may still be returned (despite the
* name).
* @returns >0 if symbols were successfully decoded,
* 0 if no symbols were found (ie, the timeout expired)
* or -1 if an error occurs
*/
extern int zbar_process_one(zbar_processor_t *processor,
int timeout);
/** process the provided image for barcodes.
* if the library window is visible, the image will be displayed.
* @returns >0 if symbols were successfully decoded,
* 0 if no symbols were found or -1 if an error occurs
*/
extern int zbar_process_image(zbar_processor_t *processor,
zbar_image_t *image);
/** display detail for last processor error to stderr.
* @returns a non-zero value suitable for passing to exit()
*/
static inline int
zbar_processor_error_spew (const zbar_processor_t *processor,
int verbosity)
{
return(_zbar_error_spew(processor, verbosity));
}
/** retrieve the detail string for the last processor error. */
static inline const char*
zbar_processor_error_string (const zbar_processor_t *processor,
int verbosity)
{
return(_zbar_error_string(processor, verbosity));
}
/** retrieve the type code for the last processor error. */
static inline zbar_error_t
zbar_processor_get_error_code (const zbar_processor_t *processor)
{
return(_zbar_get_error_code(processor));
}
/*@}*/
/*------------------------------------------------------------*/
/** @name Video interface
* @anchor c-video
* mid-level video source abstraction.
* captures images from a video device
*/
/*@{*/
struct zbar_video_s;
/** opaque video object. */
typedef struct zbar_video_s zbar_video_t;
/** constructor. */
extern zbar_video_t *zbar_video_create(void);
/** destructor. */
extern void zbar_video_destroy(zbar_video_t *video);
/** open and probe a video device.
* the device specified by platform specific unique name
* (v4l device node path in *nix eg "/dev/video",
* DirectShow DevicePath property in windows).
* @returns 0 if successful or -1 if an error occurs
*/
extern int zbar_video_open(zbar_video_t *video,
const char *device);
/** retrieve file descriptor associated with open *nix video device
* useful for using select()/poll() to tell when new images are
* available (NB v4l2 only!!).
* @returns the file descriptor or -1 if the video device is not open
* or the driver only supports v4l1
*/
extern int zbar_video_get_fd(const zbar_video_t *video);
/** request a preferred size for the video image from the device.
* the request may be adjusted or completely ignored by the driver.
* @returns 0 if successful or -1 if the video device is already
* initialized
* @since 0.6
*/
extern int zbar_video_request_size(zbar_video_t *video,
unsigned width,
unsigned height);
/** request a preferred driver interface version for debug/testing.
* @note must be called before zbar_video_open()
* @since 0.6
*/
extern int zbar_video_request_interface(zbar_video_t *video,
int version);
/** request a preferred I/O mode for debug/testing. You will get
* errors if the driver does not support the specified mode.
* @verbatim
0 = auto-detect
1 = force I/O using read()
2 = force memory mapped I/O using mmap()
3 = force USERPTR I/O (v4l2 only)
@endverbatim
* @note must be called before zbar_video_open()
* @since 0.7
*/
extern int zbar_video_request_iomode(zbar_video_t *video,
int iomode);
/** retrieve current output image width.
* @returns the width or 0 if the video device is not open
*/
extern int zbar_video_get_width(const zbar_video_t *video);
/** retrieve current output image height.
* @returns the height or 0 if the video device is not open
*/
extern int zbar_video_get_height(const zbar_video_t *video);
/** initialize video using a specific format for debug.
* use zbar_negotiate_format() to automatically select and initialize
* the best available format
*/
extern int zbar_video_init(zbar_video_t *video,
unsigned long format);
/** start/stop video capture.
* all buffered images are retired when capture is disabled.
* @returns 0 if successful or -1 if an error occurs
*/
extern int zbar_video_enable(zbar_video_t *video,
int enable);
/** retrieve next captured image. blocks until an image is available.
* @returns NULL if video is not enabled or an error occurs
*/
extern zbar_image_t *zbar_video_next_image(zbar_video_t *video);
/** display detail for last video error to stderr.
* @returns a non-zero value suitable for passing to exit()
*/
static inline int zbar_video_error_spew (const zbar_video_t *video,
int verbosity)
{
return(_zbar_error_spew(video, verbosity));
}
/** retrieve the detail string for the last video error. */
static inline const char *zbar_video_error_string (const zbar_video_t *video,
int verbosity)
{
return(_zbar_error_string(video, verbosity));
}
/** retrieve the type code for the last video error. */
static inline zbar_error_t
zbar_video_get_error_code (const zbar_video_t *video)
{
return(_zbar_get_error_code(video));
}
/*@}*/
/*------------------------------------------------------------*/
/** @name Window interface
* @anchor c-window
* mid-level output window abstraction.
* displays images to user-specified platform specific output window
*/
/*@{*/
struct zbar_window_s;
/** opaque window object. */
typedef struct zbar_window_s zbar_window_t;
/** constructor. */
extern zbar_window_t *zbar_window_create(void);
/** destructor. */
extern void zbar_window_destroy(zbar_window_t *window);
/** associate reader with an existing platform window.
* This can be any "Drawable" for X Windows or a "HWND" for windows.
* input images will be scaled into the output window.
* pass NULL to detach from the resource, further input will be
* ignored
*/
extern int zbar_window_attach(zbar_window_t *window,
void *x11_display_w32_hwnd,
unsigned long x11_drawable);
/** control content level of the reader overlay.
* the overlay displays graphical data for informational or debug
* purposes. higher values increase the level of annotation (possibly
* decreasing performance). @verbatim
0 = disable overlay
1 = outline decoded symbols (default)
2 = also track and display input frame rate
@endverbatim
*/
extern void zbar_window_set_overlay(zbar_window_t *window,
int level);
/** retrieve current content level of reader overlay.
* @see zbar_window_set_overlay()
* @since 0.10
*/
extern int zbar_window_get_overlay(const zbar_window_t *window);
/** draw a new image into the output window. */
extern int zbar_window_draw(zbar_window_t *window,
zbar_image_t *image);
/** redraw the last image (exposure handler). */
extern int zbar_window_redraw(zbar_window_t *window);
/** resize the image window (reconfigure handler).
* this does @em not update the contents of the window
* @since 0.3, changed in 0.4 to not redraw window
*/
extern int zbar_window_resize(zbar_window_t *window,
unsigned width,
unsigned height);
/** display detail for last window error to stderr.
* @returns a non-zero value suitable for passing to exit()
*/
static inline int zbar_window_error_spew (const zbar_window_t *window,
int verbosity)
{
return(_zbar_error_spew(window, verbosity));
}
/** retrieve the detail string for the last window error. */
static inline const char*
zbar_window_error_string (const zbar_window_t *window,
int verbosity)
{
return(_zbar_error_string(window, verbosity));
}
/** retrieve the type code for the last window error. */
static inline zbar_error_t
zbar_window_get_error_code (const zbar_window_t *window)
{
return(_zbar_get_error_code(window));
}
/** select a compatible format between video input and output window.
* the selection algorithm attempts to use a format shared by
* video input and window output which is also most useful for
* barcode scanning. if a format conversion is necessary, it will
* heuristically attempt to minimize the cost of the conversion
*/
extern int zbar_negotiate_format(zbar_video_t *video,
zbar_window_t *window);
/*@}*/
/*------------------------------------------------------------*/
/** @name Image Scanner interface
* @anchor c-imagescanner
* mid-level image scanner interface.
* reads barcodes from 2-D images
*/
/*@{*/
struct zbar_image_scanner_s;
/** opaque image scanner object. */
typedef struct zbar_image_scanner_s zbar_image_scanner_t;
/** constructor. */
extern zbar_image_scanner_t *zbar_image_scanner_create(void);
/** destructor. */
extern void zbar_image_scanner_destroy(zbar_image_scanner_t *scanner);
/** setup result handler callback.
* the specified function will be called by the scanner whenever
* new results are available from a decoded image.
* pass a NULL value to disable callbacks.
* @returns the previously registered handler
*/
extern zbar_image_data_handler_t*
zbar_image_scanner_set_data_handler(zbar_image_scanner_t *scanner,
zbar_image_data_handler_t *handler,
const void *userdata);
/** set config for indicated symbology (0 for all) to specified value.
* @returns 0 for success, non-0 for failure (config does not apply to
* specified symbology, or value out of range)
* @see zbar_decoder_set_config()
* @since 0.4
*/
extern int zbar_image_scanner_set_config(zbar_image_scanner_t *scanner,
zbar_symbol_type_t symbology,
zbar_config_t config,
int value);
/** parse configuration string using zbar_parse_config()
* and apply to image scanner using zbar_image_scanner_set_config().
* @returns 0 for success, non-0 for failure
* @see zbar_parse_config()
* @see zbar_image_scanner_set_config()
* @since 0.4
*/
static inline int
zbar_image_scanner_parse_config (zbar_image_scanner_t *scanner,
const char *config_string)
{
zbar_symbol_type_t sym;
zbar_config_t cfg;
int val;
return(zbar_parse_config(config_string, &sym, &cfg, &val) ||
zbar_image_scanner_set_config(scanner, sym, cfg, val));
}
/** enable or disable the inter-image result cache (default disabled).
* mostly useful for scanning video frames, the cache filters
* duplicate results from consecutive images, while adding some
* consistency checking and hysteresis to the results.
* this interface also clears the cache
*/
extern void zbar_image_scanner_enable_cache(zbar_image_scanner_t *scanner,
int enable);
/** remove any previously decoded results from the image scanner and the
* specified image. somewhat more efficient version of
* zbar_image_set_symbols(image, NULL) which may retain memory for
* subsequent decodes
* @since 0.10
*/
extern void zbar_image_scanner_recycle_image(zbar_image_scanner_t *scanner,
zbar_image_t *image);
/** retrieve decode results for last scanned image.
* @returns the symbol set result container or NULL if no results are
* available
* @note the symbol set does not have its reference count adjusted;
* ensure that the count is incremented if the results may be kept
* after the next image is scanned
* @since 0.10
*/
extern const zbar_symbol_set_t*
zbar_image_scanner_get_results(const zbar_image_scanner_t *scanner);
/** scan for symbols in provided image. The image format must be
* "Y800" or "GRAY".
* @returns >0 if symbols were successfully decoded from the image,
* 0 if no symbols were found or -1 if an error occurs
* @see zbar_image_convert()
* @since 0.9 - changed to only accept grayscale images
*/
extern int zbar_scan_image(zbar_image_scanner_t *scanner,
zbar_image_t *image);
/*@}*/
/*------------------------------------------------------------*/
/** @name Decoder interface
* @anchor c-decoder
* low-level bar width stream decoder interface.
* identifies symbols and extracts encoded data
*/
/*@{*/
struct zbar_decoder_s;
/** opaque decoder object. */
typedef struct zbar_decoder_s zbar_decoder_t;
/** decoder data handler callback function.
* called by decoder when new data has just been decoded
*/
typedef void (zbar_decoder_handler_t)(zbar_decoder_t *decoder);
/** constructor. */
extern zbar_decoder_t *zbar_decoder_create(void);
/** destructor. */
extern void zbar_decoder_destroy(zbar_decoder_t *decoder);
/** set config for indicated symbology (0 for all) to specified value.
* @returns 0 for success, non-0 for failure (config does not apply to
* specified symbology, or value out of range)
* @since 0.4
*/
extern int zbar_decoder_set_config(zbar_decoder_t *decoder,
zbar_symbol_type_t symbology,
zbar_config_t config,
int value);
/** parse configuration string using zbar_parse_config()
* and apply to decoder using zbar_decoder_set_config().
* @returns 0 for success, non-0 for failure
* @see zbar_parse_config()
* @see zbar_decoder_set_config()
* @since 0.4
*/
static inline int zbar_decoder_parse_config (zbar_decoder_t *decoder,
const char *config_string)
{
zbar_symbol_type_t sym;
zbar_config_t cfg;
int val;
return(zbar_parse_config(config_string, &sym, &cfg, &val) ||
zbar_decoder_set_config(decoder, sym, cfg, val));
}
/** retrieve symbology boolean config settings.
* @returns a bitmask indicating which configs are currently set for the
* specified symbology.
* @since 0.11
*/
extern unsigned int zbar_decoder_get_configs(const zbar_decoder_t *decoder,
zbar_symbol_type_t symbology);
/** clear all decoder state.
* any partial symbols are flushed
*/
extern void zbar_decoder_reset(zbar_decoder_t *decoder);
/** mark start of a new scan pass.
* clears any intra-symbol state and resets color to ::ZBAR_SPACE.
* any partially decoded symbol state is retained
*/
extern void zbar_decoder_new_scan(zbar_decoder_t *decoder);
/** process next bar/space width from input stream.
* the width is in arbitrary relative units. first value of a scan
* is ::ZBAR_SPACE width, alternating from there.
* @returns appropriate symbol type if width completes
* decode of a symbol (data is available for retrieval)
* @returns ::ZBAR_PARTIAL as a hint if part of a symbol was decoded
* @returns ::ZBAR_NONE (0) if no new symbol data is available
*/
extern zbar_symbol_type_t zbar_decode_width(zbar_decoder_t *decoder,
unsigned width);
/** retrieve color of @em next element passed to
* zbar_decode_width(). */
extern zbar_color_t zbar_decoder_get_color(const zbar_decoder_t *decoder);
/** retrieve last decoded data.
* @returns the data string or NULL if no new data available.
* the returned data buffer is owned by library, contents are only
* valid between non-0 return from zbar_decode_width and next library
* call
*/
extern const char *zbar_decoder_get_data(const zbar_decoder_t *decoder);
/** retrieve length of binary data.
* @returns the length of the decoded data or 0 if no new data
* available.
*/
extern unsigned int
zbar_decoder_get_data_length(const zbar_decoder_t *decoder);
/** retrieve last decoded symbol type.
* @returns the type or ::ZBAR_NONE if no new data available
*/
extern zbar_symbol_type_t
zbar_decoder_get_type(const zbar_decoder_t *decoder);
/** retrieve modifier flags for the last decoded symbol.
* @returns a bitmask indicating which characteristics were detected
* during decoding.
* @since 0.11
*/
extern unsigned int zbar_decoder_get_modifiers(const zbar_decoder_t *decoder);
/** retrieve last decode direction.
* @returns 1 for forward and -1 for reverse
* @returns 0 if the decode direction is unknown or does not apply
* @since 0.11
*/
extern int zbar_decoder_get_direction(const zbar_decoder_t *decoder);
/** setup data handler callback.
* the registered function will be called by the decoder
* just before zbar_decode_width() returns a non-zero value.
* pass a NULL value to disable callbacks.
* @returns the previously registered handler
*/
extern zbar_decoder_handler_t*
zbar_decoder_set_handler(zbar_decoder_t *decoder,
zbar_decoder_handler_t *handler);
/** associate user specified data value with the decoder. */
extern void zbar_decoder_set_userdata(zbar_decoder_t *decoder,
void *userdata);
/** return user specified data value associated with the decoder. */
extern void *zbar_decoder_get_userdata(const zbar_decoder_t *decoder);
/*@}*/
/*------------------------------------------------------------*/
/** @name Scanner interface
* @anchor c-scanner
* low-level linear intensity sample stream scanner interface.
* identifies "bar" edges and measures width between them.
* optionally passes to bar width decoder
*/
/*@{*/
struct zbar_scanner_s;
/** opaque scanner object. */
typedef struct zbar_scanner_s zbar_scanner_t;
/** constructor.
* if decoder is non-NULL it will be attached to scanner
* and called automatically at each new edge
* current color is initialized to ::ZBAR_SPACE
* (so an initial BAR->SPACE transition may be discarded)
*/
extern zbar_scanner_t *zbar_scanner_create(zbar_decoder_t *decoder);
/** destructor. */
extern void zbar_scanner_destroy(zbar_scanner_t *scanner);
/** clear all scanner state.
* also resets an associated decoder
*/
extern zbar_symbol_type_t zbar_scanner_reset(zbar_scanner_t *scanner);
/** mark start of a new scan pass. resets color to ::ZBAR_SPACE.
* also updates an associated decoder.
* @returns any decode results flushed from the pipeline
* @note when not using callback handlers, the return value should
* be checked the same as zbar_scan_y()
* @note call zbar_scanner_flush() at least twice before calling this
* method to ensure no decode results are lost
*/
extern zbar_symbol_type_t zbar_scanner_new_scan(zbar_scanner_t *scanner);
/** flush scanner processing pipeline.
* forces current scanner position to be a scan boundary.
* call multiple times (max 3) to completely flush decoder.
* @returns any decode/scan results flushed from the pipeline
* @note when not using callback handlers, the return value should
* be checked the same as zbar_scan_y()
* @since 0.9
*/
extern zbar_symbol_type_t zbar_scanner_flush(zbar_scanner_t *scanner);
/** process next sample intensity value.
* intensity (y) is in arbitrary relative units.
* @returns result of zbar_decode_width() if a decoder is attached,
* otherwise @returns (::ZBAR_PARTIAL) when new edge is detected
* or 0 (::ZBAR_NONE) if no new edge is detected
*/
extern zbar_symbol_type_t zbar_scan_y(zbar_scanner_t *scanner,
int y);
/** process next sample from RGB (or BGR) triple. */
static inline zbar_symbol_type_t zbar_scan_rgb24 (zbar_scanner_t *scanner,
unsigned char *rgb)
{
return(zbar_scan_y(scanner, rgb[0] + rgb[1] + rgb[2]));
}
/** retrieve last scanned width. */
extern unsigned zbar_scanner_get_width(const zbar_scanner_t *scanner);
/** retrieve sample position of last edge.
* @since 0.10
*/
extern unsigned zbar_scanner_get_edge(const zbar_scanner_t *scn,
unsigned offset,
int prec);
/** retrieve last scanned color. */
extern zbar_color_t zbar_scanner_get_color(const zbar_scanner_t *scanner);
/*@}*/
#ifdef __cplusplus
}
}
# include "zbar/Exception.h"
# include "zbar/Decoder.h"
# include "zbar/Scanner.h"
# include "zbar/Symbol.h"
# include "zbar/Image.h"
# include "zbar/ImageScanner.h"
# include "zbar/Video.h"
# include "zbar/Window.h"
# include "zbar/Processor.h"
#endif
#endif
================================================
FILE: zbar/src/main/jni/libiconv-1.15/ABOUT-NLS
================================================
1 Notes on the Free Translation Project
***************************************
Free software is going international! The Free Translation Project is a
way to get maintainers of free software, translators, and users all
together, so that free software will gradually become able to speak many
languages. A few packages already provide translations for their
messages.
If you found this 'ABOUT-NLS' file inside a distribution, you may
assume that the distributed package does use GNU 'gettext' internally,
itself available at your nearest GNU archive site. But you do _not_
need to install GNU 'gettext' prior to configuring, installing or using
this package with messages translated.
Installers will find here some useful hints. These notes also
explain how users should proceed for getting the programs to use the
available translations. They tell how people wanting to contribute and
work on translations can contact the appropriate team.
1.1 INSTALL Matters
===================
Some packages are "localizable" when properly installed; the programs
they contain can be made to speak your own native language. Most such
packages use GNU 'gettext'. Other packages have their own ways to
internationalization, predating GNU 'gettext'.
By default, this package will be installed to allow translation of
messages. It will automatically detect whether the system already
provides the GNU 'gettext' functions. Installers may use special
options at configuration time for changing the default behaviour. The
command:
./configure --disable-nls
will _totally_ disable translation of messages.
When you already have GNU 'gettext' installed on your system and run
configure without an option for your new package, 'configure' will
probably detect the previously built and installed 'libintl' library and
will decide to use it. If not, you may have to to use the
'--with-libintl-prefix' option to tell 'configure' where to look for it.
Internationalized packages usually have many 'po/LL.po' files, where
LL gives an ISO 639 two-letter code identifying the language. Unless
translations have been forbidden at 'configure' time by using the
'--disable-nls' switch, all available translations are installed
together with the package. However, the environment variable 'LINGUAS'
may be set, prior to configuration, to limit the installed set.
'LINGUAS' should then contain a space separated list of two-letter
codes, stating which languages are allowed.
1.2 Using This Package
======================
As a user, if your language has been installed for this package, you
only have to set the 'LANG' environment variable to the appropriate
'LL_CC' combination. If you happen to have the 'LC_ALL' or some other
'LC_xxx' environment variables set, you should unset them before setting
'LANG', otherwise the setting of 'LANG' will not have the desired
effect. Here 'LL' is an ISO 639 two-letter language code, and 'CC' is
an ISO 3166 two-letter country code. For example, let's suppose that
you speak German and live in Germany. At the shell prompt, merely
execute 'setenv LANG de_DE' (in 'csh'), 'export LANG; LANG=de_DE' (in
'sh') or 'export LANG=de_DE' (in 'bash'). This can be done from your
'.login' or '.profile' file, once and for all.
You might think that the country code specification is redundant.
But in fact, some languages have dialects in different countries. For
example, 'de_AT' is used for Austria, and 'pt_BR' for Brazil. The
country code serves to distinguish the dialects.
The locale naming convention of 'LL_CC', with 'LL' denoting the
language and 'CC' denoting the country, is the one use on systems based
on GNU libc. On other systems, some variations of this scheme are used,
such as 'LL' or 'LL_CC.ENCODING'. You can get the list of locales
supported by your system for your language by running the command
'locale -a | grep '^LL''.
Not all programs have translations for all languages. By default, an
English message is shown in place of a nonexistent translation. If you
understand other languages, you can set up a priority list of languages.
This is done through a different environment variable, called
'LANGUAGE'. GNU 'gettext' gives preference to 'LANGUAGE' over 'LANG'
for the purpose of message handling, but you still need to have 'LANG'
set to the primary language; this is required by other parts of the
system libraries. For example, some Swedish users who would rather read
translations in German than English for when Swedish is not available,
set 'LANGUAGE' to 'sv:de' while leaving 'LANG' to 'sv_SE'.
Special advice for Norwegian users: The language code for Norwegian
bokma*l changed from 'no' to 'nb' recently (in 2003). During the
transition period, while some message catalogs for this language are
installed under 'nb' and some older ones under 'no', it's recommended
for Norwegian users to set 'LANGUAGE' to 'nb:no' so that both newer and
older translations are used.
In the 'LANGUAGE' environment variable, but not in the 'LANG'
environment variable, 'LL_CC' combinations can be abbreviated as 'LL' to
denote the language's main dialect. For example, 'de' is equivalent to
'de_DE' (German as spoken in Germany), and 'pt' to 'pt_PT' (Portuguese
as spoken in Portugal) in this context.
1.3 Translating Teams
=====================
For the Free Translation Project to be a success, we need interested
people who like their own language and write it well, and who are also
able to synergize with other translators speaking the same language.
Each translation team has its own mailing list. The up-to-date list of
teams can be found at the Free Translation Project's homepage,
'http://translationproject.org/', in the "Teams" area.
If you'd like to volunteer to _work_ at translating messages, you
should become a member of the translating team for your own language.
The subscribing address is _not_ the same as the list itself, it has
'-request' appended. For example, speakers of Swedish can send a
message to 'sv-request@li.org', having this message body:
subscribe
Keep in mind that team members are expected to participate _actively_
in translations, or at solving translational difficulties, rather than
merely lurking around. If your team does not exist yet and you want to
start one, or if you are unsure about what to do or how to get started,
please write to 'coordinator@translationproject.org' to reach the
coordinator for all translator teams.
The English team is special. It works at improving and uniformizing
the terminology in use. Proven linguistic skills are praised more than
programming skills, here.
1.4 Available Packages
======================
Languages are not equally supported in all packages. The following
matrix shows the current state of internationalization, as of Jun 2014.
The matrix shows, in regard of each package, for which languages PO
files have been submitted to translation coordination, with a
translation percentage of at least 50%.
Ready PO files af am an ar as ast az be bg bn bn_IN bs ca crh cs
+---------------------------------------------------+
a2ps | [] [] [] |
aegis | |
anubis | |
aspell | [] [] [] |
bash | [] [] [] |
bfd | |
binutils | [] |
bison | |
bison-runtime | [] |
buzztrax | [] |
ccd2cue | |
ccide | |
cflow | |
clisp | |
coreutils | [] [] |
cpio | |
cppi | |
cpplib | [] |
cryptsetup | [] |
datamash | |
denemo | [] [] |
dfarc | [] |
dialog | [] [] [] |
dico | |
diffutils | [] |
dink | [] |
direvent | |
doodle | [] |
dos2unix | |
dos2unix-man | |
e2fsprogs | [] [] |
enscript | [] |
exif | [] |
fetchmail | [] [] |
findutils | [] |
flex | [] |
freedink | [] [] |
fusionforge | |
gas | |
gawk | [] |
gcal | [] |
gcc | |
gdbm | |
gettext-examples | [] [] [] [] [] |
gettext-runtime | [] [] [] |
gettext-tools | [] [] |
gjay | |
glunarclock | [] [] [] |
gnubiff | [] |
gnubik | [] |
gnucash | () () [] |
gnuchess | |
gnulib | [] |
gnunet | |
gnunet-gtk | |
gold | |
gphoto2 | [] |
gprof | [] |
gramadoir | |
grep | [] [] [] |
grub | [] |
gsasl | |
gss | |
gst-plugins-bad | [] [] |
gst-plugins-base | [] [] [] |
gst-plugins-good | [] [] [] |
gst-plugins-ugly | [] [] [] |
gstreamer | [] [] [] [] |
gtick | [] |
gtkam | [] [] |
gtkspell | [] [] [] [] [] |
guix | |
guix-packages | |
gutenprint | [] |
hello | [] |
help2man | |
help2man-texi | |
hylafax | |
idutils | |
iso_15924 | [] |
iso_3166 | [] [] [] [] [] [] [] [] [] [] |
iso_3166_2 | |
iso_4217 | [] |
iso_639 | [] [] [] [] [] [] [] [] [] |
iso_639_3 | [] [] |
iso_639_5 | |
jwhois | |
kbd | [] |
klavaro | [] [] [] [] [] |
ld | [] |
leafpad | [] [] [] [] |
libc | [] [] [] |
libexif | () |
libextractor | |
libgnutls | [] |
libgphoto2 | [] |
libgphoto2_port | [] |
libgsasl | |
libiconv | [] [] |
libidn | [] |
liferea | [] [] [] [] |
lilypond | [] [] |
lordsawar | [] |
lprng | |
lynx | [] [] |
m4 | [] |
mailfromd | |
mailutils | |
make | [] |
man-db | [] [] |
man-db-manpages | |
midi-instruments | [] [] [] |
minicom | [] |
mkisofs | [] |
myserver | [] |
nano | [] [] [] |
opcodes | |
parted | [] |
pies | |
pnmixer | |
popt | [] |
procps-ng | |
procps-ng-man | |
psmisc | [] |
pspp | [] |
pushover | [] |
pwdutils | |
pyspread | |
radius | [] |
recode | [] [] [] |
recutils | |
rpm | |
rush | |
sarg | |
sed | [] [] [] [] |
sharutils | [] |
shishi | |
skribilo | |
solfege | [] [] |
solfege-manual | |
spotmachine | |
sudo | [] [] |
sudoers | [] [] |
sysstat | [] |
tar | [] [] [] |
texinfo | [] [] |
texinfo_document | [] [] |
tigervnc | [] |
tin | |
tin-man | |
tracgoogleappsa... | |
trader | |
util-linux | [] |
ve | |
vice | |
vmm | |
vorbis-tools | [] |
wastesedge | |
wcd | |
wcd-man | |
wdiff | [] [] |
wget | [] |
wyslij-po | |
xboard | |
xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] |
xkeyboard-config | [] [] [] |
+---------------------------------------------------+
af am an ar as ast az be bg bn bn_IN bs ca crh cs
4 0 2 5 3 11 0 8 25 3 3 1 55 4 74
da de el en en_GB en_ZA eo es et eu fa fi fr
+--------------------------------------------------+
a2ps | [] [] [] [] [] [] [] [] [] |
aegis | [] [] [] [] |
anubis | [] [] [] [] [] |
aspell | [] [] [] [] [] [] [] |
bash | [] [] [] |
bfd | [] [] [] [] |
binutils | [] [] [] |
bison | [] [] [] [] [] [] [] [] |
bison-runtime | [] [] [] [] [] [] [] [] |
buzztrax | [] [] [] [] |
ccd2cue | [] [] [] [] |
ccide | [] [] [] [] [] [] |
cflow | [] [] [] [] [] |
clisp | [] [] [] [] [] |
coreutils | [] [] [] [] [] |
cpio | [] [] [] [] [] |
cppi | [] [] [] [] [] |
cpplib | [] [] [] [] [] [] |
cryptsetup | [] [] [] [] [] |
datamash | [] [] [] [] |
denemo | [] |
dfarc | [] [] [] [] [] [] |
dialog | [] [] [] [] [] [] [] [] [] |
dico | [] [] [] [] |
diffutils | [] [] [] [] [] [] |
dink | [] [] [] [] [] [] |
direvent | [] [] [] [] |
doodle | [] [] [] [] |
dos2unix | [] [] [] [] [] |
dos2unix-man | [] [] [] |
e2fsprogs | [] [] [] [] [] |
enscript | [] [] [] [] [] [] |
exif | [] [] [] [] [] [] |
fetchmail | [] () [] [] [] [] [] |
findutils | [] [] [] [] [] [] [] [] |
flex | [] [] [] [] [] [] |
freedink | [] [] [] [] [] [] [] [] |
fusionforge | [] [] [] |
gas | [] [] [] |
gawk | [] [] [] [] [] |
gcal | [] [] [] [] |
gcc | [] |
gdbm | [] [] [] [] [] |
gettext-examples | [] [] [] [] [] [] [] |
gettext-runtime | [] [] [] [] [] [] |
gettext-tools | [] [] [] [] [] |
gjay | [] [] [] [] |
glunarclock | [] [] [] [] [] |
gnubiff | () [] [] () |
gnubik | [] [] [] [] [] |
gnucash | [] () () () () () () |
gnuchess | [] [] [] [] |
gnulib | [] [] [] [] [] [] [] |
gnunet | [] |
gnunet-gtk | [] |
gold | [] [] [] |
gphoto2 | [] () [] [] |
gprof | [] [] [] [] [] [] |
gramadoir | [] [] [] [] [] |
grep | [] [] [] [] [] [] [] |
grub | [] [] [] [] [] |
gsasl | [] [] [] [] [] |
gss | [] [] [] [] [] |
gst-plugins-bad | [] [] [] |
gst-plugins-base | [] [] [] [] [] [] |
gst-plugins-good | [] [] [] [] [] [] [] |
gst-plugins-ugly | [] [] [] [] [] [] [] [] |
gstreamer | [] [] [] [] [] [] [] |
gtick | [] () [] [] [] |
gtkam | [] () [] [] [] [] |
gtkspell | [] [] [] [] [] [] [] [] |
guix | [] [] |
guix-packages | |
gutenprint | [] [] [] [] |
hello | [] [] [] [] [] [] [] [] |
help2man | [] [] [] [] [] [] [] |
help2man-texi | [] [] [] |
hylafax | [] [] |
idutils | [] [] [] [] [] |
iso_15924 | [] () [] [] () [] () |
iso_3166 | [] () [] [] [] [] () [] () |
iso_3166_2 | [] () () () |
iso_4217 | [] () [] [] [] () [] () |
iso_639 | [] () [] [] () [] () |
iso_639_3 | () () () |
iso_639_5 | () () () |
jwhois | [] [] [] [] [] |
kbd | [] [] [] [] [] [] |
klavaro | [] [] [] [] [] [] [] |
ld | [] [] [] [] |
leafpad | [] [] [] [] [] [] [] [] |
libc | [] [] [] [] [] |
libexif | [] [] () [] [] |
libextractor | [] |
libgnutls | [] [] [] [] |
libgphoto2 | [] () [] |
libgphoto2_port | [] () [] [] [] [] |
libgsasl | [] [] [] [] [] |
libiconv | [] [] [] [] [] [] [] |
libidn | [] [] [] [] [] |
liferea | [] () [] [] [] [] [] |
lilypond | [] [] [] [] [] [] |
lordsawar | [] [] |
lprng | |
lynx | [] [] [] [] [] [] |
m4 | [] [] [] [] [] [] |
mailfromd | [] |
mailutils | [] [] [] [] |
make | [] [] [] [] [] |
man-db | [] [] [] [] |
man-db-manpages | [] [] |
midi-instruments | [] [] [] [] [] [] [] [] [] |
minicom | [] [] [] [] [] |
mkisofs | [] [] [] |
myserver | [] [] [] [] |
nano | [] [] [] [] [] [] [] |
opcodes | [] [] [] [] [] |
parted | [] [] [] |
pies | [] |
pnmixer | [] [] |
popt | [] [] [] [] [] [] |
procps-ng | [] [] |
procps-ng-man | [] [] |
psmisc | [] [] [] [] [] [] [] |
pspp | [] [] [] |
pushover | () [] [] [] |
pwdutils | [] [] [] |
pyspread | [] [] [] |
radius | [] [] |
recode | [] [] [] [] [] [] [] |
recutils | [] [] [] [] |
rpm | [] [] [] [] [] |
rush | [] [] [] |
sarg | [] [] |
sed | [] [] [] [] [] [] [] [] |
sharutils | [] [] [] [] |
shishi | [] [] [] |
skribilo | [] [] [] |
solfege | [] [] [] [] [] [] [] [] |
solfege-manual | [] [] [] [] [] |
spotmachine | [] [] [] [] [] |
sudo | [] [] [] [] [] [] |
sudoers | [] [] [] [] [] [] |
sysstat | [] [] [] [] [] [] |
tar | [] [] [] [] [] [] [] |
texinfo | [] [] [] [] [] |
texinfo_document | [] [] [] [] |
tigervnc | [] [] [] [] [] [] |
tin | [] [] [] [] |
tin-man | [] |
tracgoogleappsa... | [] [] [] [] [] |
trader | [] [] [] [] [] [] |
util-linux | [] [] [] [] |
ve | [] [] [] [] [] |
vice | () () () |
vmm | [] [] |
vorbis-tools | [] [] [] [] |
wastesedge | [] |
wcd | [] [] [] [] |
wcd-man | [] |
wdiff | [] [] [] [] [] [] [] |
wget | [] [] [] [] [] [] |
wyslij-po | [] [] [] [] |
xboard | [] [] [] [] |
xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] |
xkeyboard-config | [] [] [] [] [] [] [] |
+--------------------------------------------------+
da de el en en_GB en_ZA eo es et eu fa fi fr
119 131 32 1 6 0 94 95 22 13 4 102 139
ga gd gl gu he hi hr hu hy ia id is it ja ka kk
+-------------------------------------------------+
a2ps | [] [] [] [] |
aegis | [] |
anubis | [] [] [] [] |
aspell | [] [] [] [] [] |
bash | [] [] [] [] |
bfd | [] [] |
binutils | [] [] [] |
bison | [] |
bison-runtime | [] [] [] [] [] [] [] [] |
buzztrax | |
ccd2cue | [] |
ccide | [] [] |
cflow | [] [] [] |
clisp | |
coreutils | [] [] |
cpio | [] [] [] [] [] [] |
cppi | [] [] [] [] [] |
cpplib | [] [] |
cryptsetup | [] |
datamash | |
denemo | [] |
dfarc | [] [] [] |
dialog | [] [] [] [] [] [] [] [] [] [] |
dico | |
diffutils | [] [] [] [] |
dink | [] |
direvent | [] |
doodle | [] [] |
dos2unix | [] [] |
dos2unix-man | |
e2fsprogs | [] [] |
enscript | [] [] [] |
exif | [] [] [] [] [] [] |
fetchmail | [] [] [] |
findutils | [] [] [] [] [] [] [] |
flex | [] |
freedink | [] [] [] [] |
fusionforge | |
gas | [] |
gawk | [] () [] |
gcal | |
gcc | |
gdbm | |
gettext-examples | [] [] [] [] [] [] [] |
gettext-runtime | [] [] [] [] [] [] [] |
gettext-tools | [] [] [] |
gjay | [] |
glunarclock | [] [] [] [] [] [] |
gnubiff | [] [] () |
gnubik | [] [] [] |
gnucash | () () () () () |
gnuchess | |
gnulib | [] [] [] [] [] |
gnunet | |
gnunet-gtk | |
gold | [] [] |
gphoto2 | [] [] [] [] |
gprof | [] [] [] [] |
gramadoir | [] [] [] |
grep | [] [] [] [] [] [] [] |
grub | [] [] [] |
gsasl | [] [] [] [] [] |
gss | [] [] [] [] [] |
gst-plugins-bad | [] [] [] |
gst-plugins-base | [] [] [] [] |
gst-plugins-good | [] [] [] [] [] [] |
gst-plugins-ugly | [] [] [] [] [] [] |
gstreamer | [] [] [] [] [] |
gtick | [] [] [] [] [] |
gtkam | [] [] [] [] [] |
gtkspell | [] [] [] [] [] [] [] [] [] [] |
guix | |
guix-packages | |
gutenprint | [] [] [] |
hello | [] [] [] [] [] |
help2man | [] [] [] |
help2man-texi | |
hylafax | [] |
idutils | [] [] |
iso_15924 | [] [] [] [] [] [] |
iso_3166 | [] [] [] [] [] [] [] [] [] [] [] [] [] |
iso_3166_2 | [] [] |
iso_4217 | [] [] [] [] [] [] |
iso_639 | [] [] [] [] [] [] [] [] [] |
iso_639_3 | [] [] |
iso_639_5 | |
jwhois | [] [] [] [] |
kbd | [] [] [] |
klavaro | [] [] [] [] [] |
ld | [] [] [] [] |
leafpad | [] [] [] [] [] [] [] () |
libc | [] [] [] [] [] |
libexif | [] |
libextractor | |
libgnutls | [] |
libgphoto2 | [] [] |
libgphoto2_port | [] [] |
libgsasl | [] [] [] [] |
libiconv | [] [] [] [] [] [] [] |
libidn | [] [] [] [] |
liferea | [] [] [] [] [] |
lilypond | [] |
lordsawar | |
lprng | [] |
lynx | [] [] [] [] |
m4 | [] [] [] [] [] |
mailfromd | |
mailutils | |
make | [] [] [] [] |
man-db | [] [] |
man-db-manpages | [] [] |
midi-instruments | [] [] [] [] [] [] [] [] [] |
minicom | [] [] [] |
mkisofs | [] [] |
myserver | [] |
nano | [] [] [] [] [] [] |
opcodes | [] [] [] |
parted | [] [] [] [] [] |
pies | |
pnmixer | [] [] |
popt | [] [] [] [] [] [] [] [] [] [] |
procps-ng | |
procps-ng-man | |
psmisc | [] [] [] [] |
pspp | [] [] |
pushover | [] |
pwdutils | [] |
pyspread | |
radius | [] |
recode | [] [] [] [] [] [] [] |
recutils | |
rpm | [] |
rush | [] |
sarg | |
sed | [] [] [] [] [] [] [] |
sharutils | |
shishi | |
skribilo | [] |
solfege | [] [] |
solfege-manual | |
spotmachine | |
sudo | [] [] [] [] |
sudoers | [] [] [] |
sysstat | [] [] [] [] |
tar | [] [] [] [] [] [] |
texinfo | [] [] [] |
texinfo_document | [] [] [] |
tigervnc | |
tin | |
tin-man | |
tracgoogleappsa... | [] [] [] [] |
trader | [] [] |
util-linux | [] |
ve | [] |
vice | () () |
vmm | |
vorbis-tools | [] [] |
wastesedge | [] |
wcd | |
wcd-man | |
wdiff | [] [] [] |
wget | [] [] [] [] |
wyslij-po | [] [] [] |
xboard | |
xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] [] |
xkeyboard-config | [] [] [] [] [] [] |
+-------------------------------------------------+
ga gd gl gu he hi hr hu hy ia id is it ja ka kk
35 2 47 4 8 2 60 71 2 6 81 11 87 57 0 3
kn ko ku ky lg lt lv mk ml mn mr ms mt nb ne nl
+--------------------------------------------------+
a2ps | [] [] |
aegis | [] |
anubis | [] [] [] |
aspell | [] [] |
bash | [] [] |
bfd | |
binutils | |
bison | [] |
bison-runtime | [] [] [] [] [] [] |
buzztrax | |
ccd2cue | |
ccide | [] [] |
cflow | [] |
clisp | [] |
coreutils | [] [] |
cpio | [] |
cppi | |
cpplib | [] |
cryptsetup | [] |
datamash | [] [] |
denemo | |
dfarc | [] [] |
dialog | [] [] [] [] [] [] |
dico | |
diffutils | [] [] [] |
dink | [] |
direvent | [] |
doodle | [] |
dos2unix | [] [] |
dos2unix-man | [] |
e2fsprogs | [] |
enscript | [] |
exif | [] [] [] |
fetchmail | [] |
findutils | [] [] |
flex | [] |
freedink | [] [] |
fusionforge | |
gas | |
gawk | [] |
gcal | |
gcc | |
gdbm | |
gettext-examples | [] [] [] [] [] [] |
gettext-runtime | [] [] [] |
gettext-tools | [] |
gjay | |
glunarclock | [] [] |
gnubiff | [] |
gnubik | [] [] |
gnucash | () () () () () () () [] |
gnuchess | [] [] |
gnulib | [] |
gnunet | |
gnunet-gtk | |
gold | |
gphoto2 | [] |
gprof | [] [] |
gramadoir | [] |
grep | [] [] |
grub | [] [] [] |
gsasl | [] |
gss | |
gst-plugins-bad | [] [] [] |
gst-plugins-base | [] [] [] |
gst-plugins-good | [] [] [] [] |
gst-plugins-ugly | [] [] [] [] [] |
gstreamer | [] [] [] |
gtick | [] |
gtkam | [] [] |
gtkspell | [] [] [] [] [] [] [] |
guix | |
guix-packages | |
gutenprint | [] |
hello | [] [] [] |
help2man | [] |
help2man-texi | |
hylafax | [] |
idutils | [] |
iso_15924 | () [] [] |
iso_3166 | [] [] [] () [] [] [] [] [] [] |
iso_3166_2 | () [] |
iso_4217 | () [] [] [] |
iso_639 | [] [] () [] [] [] [] |
iso_639_3 | [] () [] |
iso_639_5 | () |
jwhois | [] [] |
kbd | [] |
klavaro | [] [] |
ld | |
leafpad | [] [] [] [] [] |
libc | [] [] |
libexif | [] |
libextractor | [] |
libgnutls | [] [] |
libgphoto2 | [] |
libgphoto2_port | [] |
libgsasl | [] |
libiconv | [] [] |
libidn | [] |
liferea | [] [] [] |
lilypond | [] |
lordsawar | |
lprng | |
lynx | [] |
m4 | [] |
mailfromd | |
mailutils | |
make | [] [] |
man-db | [] |
man-db-manpages | [] |
midi-instruments | [] [] [] [] [] [] [] |
minicom | [] |
mkisofs | [] |
myserver | |
nano | [] [] [] |
opcodes | [] |
parted | [] [] |
pies | |
pnmixer | [] |
popt | [] [] [] [] [] |
procps-ng | |
procps-ng-man | |
psmisc | [] |
pspp | [] [] |
pushover | |
pwdutils | [] |
pyspread | |
radius | [] |
recode | [] [] |
recutils | [] |
rpm | [] |
rush | [] |
sarg | |
sed | [] [] |
sharutils | [] |
shishi | |
skribilo | |
solfege | [] [] |
solfege-manual | [] |
spotmachine | [] |
sudo | [] [] [] |
sudoers | [] [] [] |
sysstat | [] [] |
tar | [] [] [] |
texinfo | [] |
texinfo_document | [] |
tigervnc | [] |
tin | |
tin-man | |
tracgoogleappsa... | [] [] [] |
trader | [] |
util-linux | [] |
ve | [] |
vice | [] |
vmm | [] |
vorbis-tools | [] |
wastesedge | [] |
wcd | [] |
wcd-man | [] |
wdiff | [] |
wget | [] [] |
wyslij-po | [] |
xboard | [] |
xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] |
xkeyboard-config | [] [] [] |
+--------------------------------------------------+
kn ko ku ky lg lt lv mk ml mn mr ms mt nb ne nl
5 15 4 6 0 13 23 3 3 3 4 11 2 42 1 125
nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr
+------------------------------------------------+
a2ps | [] [] [] [] [] [] [] |
aegis | [] [] |
anubis | [] [] [] |
aspell | [] [] [] [] [] [] [] |
bash | [] [] [] [] [] [] |
bfd | [] [] |
binutils | [] [] |
bison | [] [] [] |
bison-runtime | [] [] [] [] [] [] [] [] |
buzztrax | [] |
ccd2cue | [] [] |
ccide | [] [] [] |
cflow | [] [] [] |
clisp | [] |
coreutils | [] [] [] [] |
cpio | [] [] [] |
cppi | [] [] [] |
cpplib | [] [] [] |
cryptsetup | [] [] [] |
datamash | [] [] |
denemo | |
dfarc | [] [] [] |
dialog | [] [] [] [] [] [] [] |
dico | [] |
diffutils | [] [] [] |
dink | |
direvent | [] [] [] |
doodle | [] [] |
dos2unix | [] [] [] [] |
dos2unix-man | [] [] |
e2fsprogs | [] |
enscript | [] [] [] [] [] [] |
exif | [] [] [] [] [] [] |
fetchmail | [] [] [] |
findutils | [] [] [] [] [] [] |
flex | [] [] [] [] [] |
freedink | [] [] [] [] [] |
fusionforge | |
gas | |
gawk | [] |
gcal | |
gcc | |
gdbm | [] [] [] |
gettext-examples | [] [] [] [] [] [] [] [] |
gettext-runtime | [] [] [] [] [] [] [] [] [] |
gettext-tools | [] [] [] [] [] [] [] |
gjay | [] |
glunarclock | [] [] [] [] [] [] |
gnubiff | [] |
gnubik | [] [] [] [] |
gnucash | () () () () () [] |
gnuchess | [] [] |
gnulib | [] [] [] [] [] |
gnunet | |
gnunet-gtk | |
gold | |
gphoto2 | [] [] [] [] [] |
gprof | [] [] [] [] |
gramadoir | [] [] |
grep | [] [] [] [] [] [] |
grub | [] [] [] [] [] |
gsasl | [] [] [] |
gss | [] [] [] [] |
gst-plugins-bad | [] [] [] [] [] |
gst-plugins-base | [] [] [] [] [] [] |
gst-plugins-good | [] [] [] [] [] [] [] |
gst-plugins-ugly | [] [] [] [] [] [] [] |
gstreamer | [] [] [] [] [] [] [] |
gtick | [] [] [] [] [] |
gtkam | [] [] [] [] [] [] |
gtkspell | [] [] [] [] [] [] [] [] [] |
guix | |
guix-packages | |
gutenprint | [] [] |
hello | [] [] [] [] [] [] |
help2man | [] [] [] [] |
help2man-texi | [] |
hylafax | |
idutils | [] [] [] |
iso_15924 | [] () [] [] [] [] |
iso_3166 | [] [] [] [] () [] [] [] [] [] [] [] [] |
iso_3166_2 | [] () [] |
iso_4217 | [] [] () [] [] [] [] [] |
iso_639 | [] [] [] () [] [] [] [] [] [] |
iso_639_3 | [] () |
iso_639_5 | () [] |
jwhois | [] [] [] [] |
kbd | [] [] |
klavaro | [] [] [] [] [] |
ld | |
leafpad | [] [] [] [] [] [] [] [] |
libc | [] [] [] |
libexif | [] () [] |
libextractor | [] |
libgnutls | [] |
libgphoto2 | [] |
libgphoto2_port | [] [] [] [] [] |
libgsasl | [] [] [] [] |
libiconv | [] [] [] [] [] |
libidn | [] [] [] |
liferea | [] [] [] [] () [] [] |
lilypond | |
lordsawar | |
lprng | [] |
lynx | [] [] |
m4 | [] [] [] [] [] |
mailfromd | [] |
mailutils | [] |
make | [] [] [] |
man-db | [] [] [] |
man-db-manpages | [] [] [] |
midi-instruments | [] [] [] [] [] [] [] [] |
minicom | [] [] [] [] |
mkisofs | [] [] [] |
myserver | [] [] |
nano | [] [] [] [] [] [] |
opcodes | |
parted | [] [] [] [] [] [] |
pies | [] |
pnmixer | [] |
popt | [] [] [] [] [] [] |
procps-ng | [] |
procps-ng-man | [] |
psmisc | [] [] [] [] |
pspp | [] [] |
pushover | |
pwdutils | [] |
pyspread | [] [] |
radius | [] [] |
recode | [] [] [] [] [] [] [] [] |
recutils | [] [] |
rpm | [] |
rush | [] [] [] |
sarg | [] [] |
sed | [] [] [] [] [] [] [] [] |
sharutils | [] [] [] |
shishi | [] [] |
skribilo | [] |
solfege | [] [] [] |
solfege-manual | [] [] |
spotmachine | [] [] |
sudo | [] [] [] [] [] [] |
sudoers | [] [] [] [] |
sysstat | [] [] [] [] [] |
tar | [] [] [] [] [] |
texinfo | [] [] [] |
texinfo_document | [] [] |
tigervnc | [] [] [] |
tin | [] |
tin-man | |
tracgoogleappsa... | [] [] [] [] |
trader | [] [] |
util-linux | [] [] |
ve | [] [] [] |
vice | |
vmm | |
vorbis-tools | [] [] [] |
wastesedge | |
wcd | |
wcd-man | |
wdiff | [] [] [] [] [] |
wget | [] [] [] [] [] |
wyslij-po | [] [] [] [] |
xboard | [] [] [] |
xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] |
xkeyboard-config | [] [] [] [] |
+------------------------------------------------+
nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr
7 3 6 114 1 12 88 32 82 3 40 45 7 101
sv sw ta te tg th tr uk ur vi wa wo zh_CN
+----------------------------------------------+
a2ps | [] [] [] [] [] |
aegis | [] |
anubis | [] [] [] [] |
aspell | [] [] [] [] [] |
bash | [] [] [] [] |
bfd | [] [] [] |
binutils | [] [] [] |
bison | [] [] [] [] |
bison-runtime | [] [] [] [] [] [] |
buzztrax | [] [] [] |
ccd2cue | [] [] [] |
ccide | [] [] [] [] |
cflow | [] [] [] [] |
clisp | |
coreutils | [] [] [] |
cpio | [] [] [] [] [] |
cppi | [] [] [] [] |
cpplib | [] [] [] [] [] |
cryptsetup | [] [] [] |
datamash | [] [] [] |
denemo | [] |
dfarc | [] [] |
dialog | [] [] [] [] [] [] |
dico | [] |
diffutils | [] [] [] [] [] |
dink | [] |
direvent | [] [] |
doodle | [] [] |
dos2unix | [] [] [] [] |
dos2unix-man | [] [] [] |
e2fsprogs | [] [] [] [] |
enscript | [] [] [] [] |
exif | [] [] [] [] [] |
fetchmail | [] [] [] [] |
findutils | [] [] [] [] [] |
flex | [] [] [] [] |
freedink | [] [] [] |
fusionforge | |
gas | [] |
gawk | [] [] [] |
gcal | [] [] [] |
gcc | [] |
gdbm | [] [] |
gettext-examples | [] [] [] [] [] |
gettext-runtime | [] [] [] [] [] |
gettext-tools | [] [] [] [] [] |
gjay | [] [] [] |
glunarclock | [] [] [] [] |
gnubiff | [] [] |
gnubik | [] [] [] [] |
gnucash | () () () () [] |
gnuchess | [] [] [] |
gnulib | [] [] [] [] |
gnunet | |
gnunet-gtk | |
gold | [] [] |
gphoto2 | [] [] [] [] |
gprof | [] [] [] [] |
gramadoir | [] [] [] |
grep | [] [] [] [] [] |
grub | [] [] [] [] |
gsasl | [] [] [] [] |
gss | [] [] [] |
gst-plugins-bad | [] [] [] [] [] |
gst-plugins-base | [] [] [] [] [] |
gst-plugins-good | [] [] [] [] [] |
gst-plugins-ugly | [] [] [] [] [] |
gstreamer | [] [] [] [] [] |
gtick | [] [] [] |
gtkam | [] [] [] [] |
gtkspell | [] [] [] [] [] [] [] |
guix | |
guix-packages | |
gutenprint | [] [] [] [] |
hello | [] [] [] [] [] [] |
help2man | [] [] [] |
help2man-texi | [] |
hylafax | [] |
idutils | [] [] [] |
iso_15924 | [] () [] [] () [] |
iso_3166 | [] [] () [] [] () [] [] |
iso_3166_2 | () [] [] () [] |
iso_4217 | [] () [] [] () [] |
iso_639 | [] [] [] () [] [] () [] [] |
iso_639_3 | [] () [] [] () |
iso_639_5 | () [] () |
jwhois | [] [] [] [] |
kbd | [] [] [] [] |
klavaro | [] [] [] [] [] [] |
ld | [] [] [] [] [] |
leafpad | [] [] [] [] [] [] |
libc | [] [] [] [] [] |
libexif | [] [] () |
libextractor | [] [] |
libgnutls | [] [] [] [] |
libgphoto2 | [] [] [] |
libgphoto2_port | [] [] [] [] |
libgsasl | [] [] [] [] |
libiconv | [] [] [] [] [] |
libidn | () [] [] [] |
liferea | [] [] [] [] [] |
lilypond | [] |
lordsawar | |
lprng | [] |
lynx | [] [] [] [] |
m4 | [] [] [] |
mailfromd | [] [] |
mailutils | [] |
make | [] [] [] [] |
man-db | [] [] [] |
man-db-manpages | [] [] |
midi-instruments | [] [] [] [] [] [] |
minicom | [] [] |
mkisofs | [] [] [] |
myserver | [] |
nano | [] [] [] [] |
opcodes | [] [] [] |
parted | [] [] [] [] [] |
pies | [] [] |
pnmixer | [] [] [] |
popt | [] [] [] [] [] [] [] |
procps-ng | [] [] |
procps-ng-man | [] |
psmisc | [] [] [] [] |
pspp | [] [] [] |
pushover | [] |
pwdutils | [] [] |
pyspread | [] |
radius | [] [] |
recode | [] [] [] [] |
recutils | [] [] [] |
rpm | [] [] [] [] |
rush | [] [] |
sarg | |
sed | [] [] [] [] [] |
sharutils | [] [] [] [] |
shishi | [] [] |
skribilo | [] [] |
solfege | [] [] [] [] |
solfege-manual | [] |
spotmachine | [] [] [] |
sudo | [] [] [] [] [] |
sudoers | [] [] [] [] |
sysstat | [] [] [] [] [] |
tar | [] [] [] [] [] |
texinfo | [] [] [] |
texinfo_document | [] |
tigervnc | [] [] [] |
tin | [] |
tin-man | |
tracgoogleappsa... | [] [] [] [] [] |
trader | [] |
util-linux | [] [] [] [] |
ve | [] [] [] [] |
vice | () () |
vmm | |
vorbis-tools | [] [] |
wastesedge | |
wcd | [] [] [] |
wcd-man | [] |
wdiff | [] [] [] [] |
wget | [] [] [] |
wyslij-po | [] [] |
xboard | [] [] |
xdg-user-dirs | [] [] [] [] [] [] [] [] |
xkeyboard-config | [] [] [] [] |
+----------------------------------------------+
sv sw ta te tg th tr uk ur vi wa wo zh_CN
106 1 4 3 0 13 51 115 1 125 7 1 100
zh_HK zh_TW
+-------------+
a2ps | | 30
aegis | | 9
anubis | | 19
aspell | | 29
bash | [] | 23
bfd | | 11
binutils | | 12
bison | [] | 18
bison-runtime | [] | 38
buzztrax | | 9
ccd2cue | | 10
ccide | | 17
cflow | | 16
clisp | | 10
coreutils | | 18
cpio | | 20
cppi | | 17
cpplib | [] | 19
cryptsetup | | 14
datamash | | 11
denemo | | 5
dfarc | | 17
dialog | [] | 42
dico | | 6
diffutils | | 22
dink | | 10
direvent | | 11
doodle | | 12
dos2unix | [] | 18
dos2unix-man | | 9
e2fsprogs | | 15
enscript | | 21
exif | | 27
fetchmail | | 19
findutils | | 29
flex | [] | 19
freedink | | 24
fusionforge | | 3
gas | | 5
gawk | | 13
gcal | | 8
gcc | | 2
gdbm | | 10
gettext-examples | [] [] | 40
gettext-runtime | [] [] | 35
gettext-tools | [] | 24
gjay | | 9
glunarclock | [] | 27
gnubiff | | 9
gnubik | | 19
gnucash | () | 6
gnuchess | | 11
gnulib | | 23
gnunet | | 1
gnunet-gtk | | 1
gold | | 7
gphoto2 | [] | 19
gprof | | 21
gramadoir | | 14
grep | [] | 31
grub | | 21
gsasl | [] | 19
gss | | 17
gst-plugins-bad | | 21
gst-plugins-base | | 27
gst-plugins-good | | 32
gst-plugins-ugly | | 34
gstreamer | [] | 32
gtick | | 19
gtkam | | 24
gtkspell | [] [] | 48
guix | | 2
guix-packages | | 0
gutenprint | | 15
hello | [] | 30
help2man | | 18
help2man-texi | | 5
hylafax | | 5
idutils | | 14
iso_15924 | [] | 23
iso_3166 | [] [] | 58
iso_3166_2 | | 9
iso_4217 | [] [] | 28
iso_639 | [] [] | 46
iso_639_3 | | 10
iso_639_5 | | 2
jwhois | [] | 20
kbd | | 17
klavaro | | 30
ld | [] | 15
leafpad | [] | 39
libc | [] | 24
libexif | | 10
libextractor | | 5
libgnutls | | 13
libgphoto2 | | 10
libgphoto2_port | [] | 19
libgsasl | | 18
libiconv | [] | 29
libidn | | 17
liferea | | 29
lilypond | | 11
lordsawar | | 3
lprng | | 3
lynx | | 19
m4 | [] | 22
mailfromd | | 4
mailutils | | 6
make | | 19
man-db | | 15
man-db-manpages | | 10
midi-instruments | [] | 43
minicom | [] | 17
mkisofs | | 13
myserver | | 9
nano | [] | 30
opcodes | | 12
parted | [] | 23
pies | | 4
pnmixer | | 9
popt | [] | 36
procps-ng | | 5
procps-ng-man | | 4
psmisc | [] | 22
pspp | | 13
pushover | | 6
pwdutils | | 8
pyspread | | 6
radius | | 9
recode | | 31
recutils | | 10
rpm | [] | 13
rush | | 10
sarg | | 4
sed | [] | 35
sharutils | | 13
shishi | | 7
skribilo | | 7
solfege | | 21
solfege-manual | | 9
spotmachine | | 11
sudo | | 26
sudoers | | 22
sysstat | | 23
tar | [] | 30
texinfo | | 17
texinfo_document | | 13
tigervnc | | 14
tin | [] | 7
tin-man | | 1
tracgoogleappsa... | [] | 22
trader | | 12
util-linux | | 13
ve | | 14
vice | | 1
vmm | | 3
vorbis-tools | | 13
wastesedge | | 3
wcd | | 8
wcd-man | | 3
wdiff | [] | 23
wget | | 21
wyslij-po | | 14
xboard | | 10
xdg-user-dirs | [] [] | 68
xkeyboard-config | [] | 28
+-------------+
89 teams zh_HK zh_TW
166 domains 7 42 2809
Some counters in the preceding matrix are higher than the number of
visible blocks let us expect. This is because a few extra PO files are
used for implementing regional variants of languages, or language
dialects.
For a PO file in the matrix above to be effective, the package to
which it applies should also have been internationalized and distributed
as such by its maintainer. There might be an observable lag between the
mere existence a PO file and its wide availability in a distribution.
If Jun 2014 seems to be old, you may fetch a more recent copy of this
'ABOUT-NLS' file on most GNU archive sites. The most up-to-date matrix
with full percentage details can be found at
'http://translationproject.org/extra/matrix.html'.
1.5 Using 'gettext' in new packages
===================================
If you are writing a freely available program and want to
internationalize it you are welcome to use GNU 'gettext' in your
package. Of course you have to respect the GNU Lesser General Public
License which covers the use of the GNU 'gettext' library. This means
in particular that even non-free programs can use 'libintl' as a shared
library, whereas only free software can use 'libintl' as a static
library or use modified versions of 'libintl'.
Once the sources are changed appropriately and the setup can handle
the use of 'gettext' the only thing missing are the translations. The
Free Translation Project is also available for packages which are not
developed inside the GNU project. Therefore the information given above
applies also for every other Free Software Project. Contact
'coordinator@translationproject.org' to make the '.pot' files available
to the translation teams.
================================================
FILE: zbar/src/main/jni/libiconv-1.15/AUTHORS
================================================
Bruno Haible
================================================
FILE: zbar/src/main/jni/libiconv-1.15/COPYING
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
================================================
FILE: zbar/src/main/jni/libiconv-1.15/COPYING.LIB
================================================
GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the library GPL. It is
numbered 2 because it goes with version 2 of the ordinary GPL.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Library General Public License, applies to some
specially designated Free Software Foundation software, and to any
other libraries whose authors decide to use it. You can use it for
your libraries, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if
you distribute copies of the library, or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link a program with the library, you must provide
complete object files to the recipients so that they can relink them
with the library, after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
Our method of protecting your rights has two steps: (1) copyright
the library, and (2) offer you this license which gives you legal
permission to copy, distribute and/or modify the library.
Also, for each distributor's protection, we want to make certain
that everyone understands that there is no warranty for this free
library. If the library is modified by someone else and passed on, we
want its recipients to know that what they have is not the original
version, so that any problems introduced by others will not reflect on
the original authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that companies distributing free
software will individually obtain patent licenses, thus in effect
transforming the program into proprietary software. To prevent this,
we have made it clear that any patent must be licensed for everyone's
free use or not licensed at all.
Most GNU software, including some libraries, is covered by the ordinary
GNU General Public License, which was designed for utility programs. This
license, the GNU Library General Public License, applies to certain
designated libraries. This license is quite different from the ordinary
one; be sure to read it in full, and don't assume that anything in it is
the same as in the ordinary license.
The reason we have a separate public license for some libraries is that
they blur the distinction we usually make between modifying or adding to a
program and simply using it. Linking a program with a library, without
changing the library, is in some sense simply using the library, and is
analogous to running a utility program or application program. However, in
a textual and legal sense, the linked executable is a combined work, a
derivative of the original library, and the ordinary General Public License
treats it as such.
Because of this blurred distinction, using the ordinary General
Public License for libraries did not effectively promote software
sharing, because most developers did not use the libraries. We
concluded that weaker conditions might promote sharing better.
However, unrestricted linking of non-free programs would deprive the
users of those programs of all benefit from the free status of the
libraries themselves. This Library General Public License is intended to
permit developers of non-free programs to use free libraries, while
preserving your freedom as a user of such programs to change the free
libraries that are incorporated in them. (We have not seen how to achieve
this as regards changes in header files, but we have achieved it as regards
changes in the actual functions of the Library.) The hope is that this
will lead to faster development of free libraries.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, while the latter only
works together with the library.
Note that it is possible for a library to be covered by the ordinary
General Public License rather than by this special one.
GNU LIBRARY GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library which
contains a notice placed by the copyright holder or other authorized
party saying it may be distributed under the terms of this Library
General Public License (also called "this License"). Each licensee is
addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also compile or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
c) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
d) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the source code distributed need not include anything that is normally
distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Library General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
Copyright (C)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 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
Library General Public License for more details.
You should have received a copy of the GNU Library 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
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
================================================
FILE: zbar/src/main/jni/libiconv-1.15/ChangeLog
================================================
2017-01-30 Bruno Haible
Prepare for version 1.15.
* src/iconv.c (print_version): Update copyright year.
* windows/iconv.rc: Likewise.
* windows/libiconv.rc: Likewise.
2016-12-29 Bruno Haible
Make Makefile.devel consistent with .gitignore.
* Makefile.devel (srclib/Makefile.in): Depend on aclocal.m4.
(totally-clean): Remove also aclocal.m4.
2016-12-25 Bruno Haible
Tweak autogen.sh.
* autogen.sh: Emit a "done" diagnostic when autogen.sh completed
successfully.
2016-12-25 Bruno Haible
Reorder Makefile.devel.
* Makefile.devel: Reorder: put gnulib targets before autotools targets.
2016-12-14 Bruno Haible
Cleanup useless removals.
* lib/Makefile.in (distclean): No need to remove 'libtool'.
2016-12-04 Bruno Haible
Update comments.
* Makefile.devel: Update comments about release process.
2016-12-04 Bruno Haible
Create tarballs through an Automake-like "make dist" command.
* Makefile.in (SOURCE_FILES, LIBTOOL_IMPORTED_FILES,
AUTOMAKE_OLD_IMPORTED_FILES, AUTOMAKE_IMPORTED_FILES, IMPORTED_FILES,
GENERATED_FILES, DISTRIBUTED_BUILT_FILES, DISTFILES): New macros.
(distdir): New target.
(PACKAGE, VERSION, TAR, GZIP): New macros.
(dist): New target.
* lib/Makefile.in (SOURCE_FILES, IMPORTED_FILES, GENERATED_FILES,
DISTRIBUTED_BUILT_FILES, DISTFILES): New macros.
(distdir): New target.
* man/Makefile.in (SOURCE_FILES, IMPORTED_FILES, GENERATED_FILES,
DISTRIBUTED_BUILT_FILES, DISTFILES): New macros.
(distdir): New target.
* preload/Makefile.in (SOURCE_FILES, IMPORTED_FILES, GENERATED_FILES,
DISTRIBUTED_BUILT_FILES, DISTFILES): New macros.
(distdir): New target.
* src/Makefile.in (SOURCE_FILES, IMPORTED_FILES, GENERATED_FILES,
DISTRIBUTED_BUILT_FILES, DISTFILES): New macros.
(distdir): New target.
* tests/Makefile.in (SOURCE_FILES, IMPORTED_FILES, GENERATED_FILES,
DISTRIBUTED_BUILT_FILES, DISTFILES): New macros.
(distdir): New target.
2016-12-04 Bruno Haible
Remove duplicates of imported files from version control.
* autogen.sh: Copy imported files to libcharset.
2016-12-04 Bruno Haible
Always use the newest released copies of files brought in from Automake.
* Makefile.devel (srclib/Makefile.in): Make sure to get new versions of
files brought in by automake.
* build-aux/install-sh: Remove from version control.
* build-aux/missing: Likewise.
2016-12-04 Bruno Haible
Always use the newest copies of config.guess, config.sub.
* Makefile.devel (gnulib-imported-files): New target.
* autogen.sh: Invoke it.
* build-aux/config.guess: Remove from version control.
* build-aux/config.sub: Likewise.
2016-12-04 Bruno Haible
Always use the newest copy of fcntl-o.m4.
* m4/fcntl-o.m4: Remove file. Rely on srcm4/fcntl-o.m4 instead.
2016-12-04 Bruno Haible
Remove obsolete documentation.
* PORTS: Remove file.
2016-12-03 Bruno Haible
Make Makefile.devel more useful for the users of the released tarball.
* Makefile.devel (srclib/Makefile.gnulib): Don't force this target.
(gnulib-clean): New target.
(totally-clean): New target. Do the removals from autogen.sh. Also,
remove lib/aliases*.gperf, lib/canonical*.h, man/iconvctl.3.html,
man/iconv_open_into.3.html.
* autogen.sh: Invoke target gnulib-clean before srclib/Makefile.gnulib.
Invoke target totally-clean before all.
* preload/Makefile.devel (totally-clean): New target.
2016-12-03 Bruno Haible
Modernize configure.ac.
* configure.ac: Use 2-argument AC_INIT. Avoid an AM_INIT_AUTOMAKE
warning.
* preload/configure.ac: Use 2-argument AC_INIT. Use AC_CONFIG_SRCDIR.
2016-12-03 Bruno Haible
Towards reproducible builds.
* Makefile.devel (man/%.html): Remove the CreationDate comment line
from the output.
2016-12-04 Bruno Haible
Update to gettext-0.19.8.1.
* ABOUT-NLS: Update through 'gettextize'.
2016-12-03 Bruno Haible
Update documentation.
* HACKING: Refer to the Git repository.
2016-12-03 Bruno Haible
Avoid compilation warnings in 'genflags' program.
* lib/genflags.c: Avoid warnings from GCC's -Wunused-function option.
2016-12-02 Bruno Haible
* relocatable.c: Update from gnulib.
2016-11-25 Bruno Haible
Prepare for version 1.15.
* configure.ac: Bump version number to 1.15.
* README: Likewise.
* include/iconv.h.in (_LIBICONV_VERSION): Likewise.
* windows/iconv.rc: Update.
* windows/libiconv.rc: Update.
* Makefile.devel: Update comments.
* lib/Makefile.in (LIBICONV_VERSION_INFO): Bump to 8:0:6.
* src/iconv.c (print_version): Update copyright year.
2016-11-23 Bruno Haible
Update installation instructions for Windows.
* README.windows: Assume a 64-bit Windows. Explain both 32-bit and
64-bit builds. Add instructions for the MS Visual C/C++ tool chain.
Revamp instructions for Cygwin.
2016-11-23 Bruno Haible
Drop the nickname "woe32".
* README.windows: Renamed from README.woe32.
2016-11-22 Bruno Haible
Update support for building with MSVC.
* Makefile.devel (srclib/Makefile.in): Import 'ar-lib' and 'compile'
from gnulib.
* lib/Makefile.in (install-lib, install): Install the .la file with
$(INSTALL), not $(INSTALL_DATA). Otherwise the native Windows DLL gets
installed without execution permissions, and programs linked to it fail:
in a Cygwin shell with exit code 127, or from a cmd.exe window with a
dialog "The application was unable to start correctly (0xc0000022)."
2016-11-19 Bruno Haible
Fix link error when compiling with gcc -O0.
* lib/iconv.c (aliases2_lookup): Make static.
Reported by Chung-Lin Tang
at https://savannah.gnu.org/bugs/?47953 .
2016-11-17 Bruno Haible
UTF-8: Reject surrogates and out-of-range code points.
* lib/utf8.h (utf8_mbtowc, utf8_wctomb): Reject code points in the
range 0xD800..0xDFFF and >= 0x110000.
* tests/genutf8.c (main): Don't emit mappings for 0xD800..0xDFFF.
2016-10-22 Bruno Haible
Switch to libtool 2.4.6.
* m4/libtool.m4: Update from libtool-2.4.6, with modifications:
2008-04-06 Bruno Haible
* m4/libtool.m4 (LT_INIT): When setting LIBTOOL, use
CONFIG_SHELL; don't assume that the Makefile.in will set SHELL
to ${CONFIG_SHELL}..
* m4/ltoptions.m4: Likewise.
* m4/ltversion.m4: Likewise.
* build-aux/ltmain.sh: Likewise.
2016-10-14 Bruno Haible
Use 'size_t', not 'int', for the length of a string.
* lib/iconv.c: Include .
* lib/genflags.c: Likewise.
* lib/converters.h (struct mbtowc_funcs, struct wctomb_funcs): Change
'int n' parameter to 'size_t n'.
(RET_COUNT_MAX): New macro.
* lib/*.h: Use 'size_t n' instead of 'int n'.
* lib/ucs2.h (ucs2_mbtowc): Make sure 'count' does not cause an 'int'
overflow.
* lib/ucs4.h (ucs4_mbtowc): Likewise.
* lib/utf16.h (utf16_mbtowc): Likewise.
* lib/utf32.h (utf32_mbtowc): Likewise.
* tools/8bit_tab_to_h.c: Generate function signatures with 'size_t n'.
* tools/cjk_tab_to_h.c: Likewise.
* NEWS: Mention the change.
2016-10-04 Bruno Haible
Extend CP1255 mapping.
* lib/cp1255.h (cp1255_2uni, cp1255_page05): Map 0xCA to U+05BA.
* tests/CP1255.TXT: Likewise.
This matches http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WindowsBestFit/bestfit1255.txt
and what the native Windows converter does since at least Windows XP.
2016-10-01 Ben Noordhuis (tiny change)
Bruno Haible
Remove large stack requirement from gentranslit.
* lib/gentranslit.c (main): Heap-allocate large arrays.
* Makefile.devel (lib/translit.h): Remove 'ulimit -s unlimited' command.
2015-12-10 Ben Noordhuis (tiny change)
Remove unused array from gentranslit.
* lib/gentranslit.c (main): Remove unused array.
* Makefile.devel (CC): Add -Wall option.
Reported in https://savannah.gnu.org/bugs/?46663 .
2016-10-01 Bruno Haible
Fix bug #41187.
* src/iconv.c (main): Increment i after parsing the --silent option.
Reported in https://savannah.gnu.org/bugs/?41187 .
2016-10-01 Bruno Haible
Update to current gnulib.
* Makefile.devel (GNULIB_MODULES): Remove memmove.
* tests/Makefile.in (INCLUDES): Make sure to include the top-level
"config.h". Needed for the 'binary-io' module.
2016-10-01 Bruno Haible
Switch to automake 1.15.
* autogen.sh: Update comment.
* Makefile.devel (AUTOMAKE, ACLOCAL): Switch to version 1.15.
(srclib/Makefile.in): Don't remove auxiliary files brought in by
automake.
* preload/Makefile.devel (ACLOCAL): Switch to version 1.15.
* srclib/Makefile.am (AUTOMAKE_OPTIONS): Add subdir-objects.
* build-aux/missing: Update from automake-1.15.
2016-10-01 Bruno Haible
Remove autogenerated doc files from version control.
* man/iconvctl.3.html: Remove file.
* man/iconv_open_into.3.html: Remove file.
2012-12-06 Bruno Haible
Change copyright holder of man pages.
* man/*.[13]: Replace myself with FSF.
2012-06-30 Bruno Haible
Make it possible to run 'genaliases2' on native Windows.
* lib/genaliases2.c (main): Expect 3 arguments. Open the output files
explicitly. Complain if they don't exist.
* Makefile.devel (lib/aliases_*.h): Pass the output filenames as
arguments to genaliases.
Reported at .
Make it possible to run 'genaliases' on native Windows.
* lib/genaliases.c (main): Expect 3 arguments. Open the output files
explicitly. Complain if they don't exist. Improve error checking.
* Makefile.devel (lib/aliases*.h): Pass the output filenames as
arguments to genaliases.
Reported at .
2012-05-13 Bruno Haible
Tweak the GB18030 converter to map 0x8135F437 to U+E7C7.
* lib/gb18030.h (gb18030_pua2charset, gb18030_wctomb): Remove mapping
from U+E7C7 to 0xA8BC.
* lib/gb18030uni.h (gb18030uni_mbtowc): Treat 0x8135F437 as a special
case.
(gb18030uni_wctomb): Treat U+E7C7 as a special case.
* tests/GB18030-BMP.TXT: Map 0x8135F437 to U+E7C7, not U+1E3F.
* tests/GB18030.IRREVERSIBLE.TXT: Remove irreversible mappings for
0x8135F437 and U+E7C7.
2012-04-28 Bruno Haible
Switch to autoconf 2.69 and automake 1.12.
* autogen.sh: Update comment.
* Makefile.devel (AUTOCONF, AUTOHEADER): Switch to version 2.69.
(AUTOMAKE, ACLOCAL): Switch to version 1.12.
* preload/Makefile.devel (AUTOCONF): Switch to version 2.69.
(ACLOCAL): Switch to version 1.12.
2012-03-24 Bruno Haible
Avoid a GCC warning.
* lib/isoir165.h (isoir165_mbtowc): Don't shadow the 'ret' variable.
2012-01-26 Bruno Haible
Modernize quoting.
* README: Quote 'like this', not `like this', as per the recent change
to the GNU coding standards.
* NOTES: Likewise.
* gnulib-local/lib/xmalloc.c: Likewise.
* lib/config.h.in: Likewise.
* src/iconv.c (usage): Likewise.
* tests/uniq-u.c: Likewise.
* tools/cjk_tab_to_h.c (output_uni2charset_sparse, do_jisx0213):
Likewise.
* lib/big5.h: Update accordingly.
* lib/cns11643_inv.h: Likewise.
* lib/cp932ext.h: Likewise.
* lib/cp950ext.h: Likewise.
* lib/gb12345ext.h: Likewise.
* lib/gb2312.h: Likewise.
* lib/gbkext_inv.h: Likewise.
* lib/hkscs1999.h: Likewise.
* lib/hkscs2001.h: Likewise.
* lib/hkscs2004.h: Likewise.
* lib/hkscs2008.h: Likewise.
* lib/isoir165ext.h: Likewise.
* lib/jisx0208.h: Likewise.
* lib/jisx0212.h: Likewise.
* lib/jisx0213.h: Likewise.
* lib/ksc5601.h: Likewise.
* lib/uhc_1.h: Likewise.
* lib/uhc_2.h: Likewise.
2012-01-15 Bruno Haible
Support for MSVC 9.
* lib/config.h.in (inline, mode_t, ssize_t): Copy snippets from top
config.h.in.
* tests/genutf8.c: Include config.h.
* tests/gengb18030z.c: Likewise.
* woe32dll/export.h (VARIABLE): Define to empty if not using GCC.
2011-01-28 Bruno Haible
Add a comment.
* woe32dll/export.h: Add a reference to the woe32dll writeup.
2012-01-06 Bruno Haible
Update after gnulib changed.
* gnulib-local/lib/error.h.diff: Update.
2012-01-06 Bruno Haible
Talk about "native Windows API", not "Woe32".
* lib/relocatable.c: Update comments to mention native Windows.
2012-01-04 Bruno Haible
Talk about "native Windows API", not "Win32".
* lib/relocatable.c: Update comments to mention native Windows.
(WINDOWS_NATIVE): Renamed from WIN32_NATIVE.
2011-10-27 Bruno Haible
Fix bug with error handling in UCS-2, UCS-4, UTF-32 decoders.
* lib/ucs2.h (ucs2_mbtowc): Increment count only after validating wc.
* lib/ucs4.h (ucs4_mbtowc): Likewise.
* lib/utf32.h (utf32_mbtowc): Likewise.
Reported at .
2012-06-30 Bruno Haible
Improve ISO-2022-CP-MS versus CP932.
* lib/iso2022_jpms.h (iso2022_jpms_mbtowc): Recognize characters from
the rows 0x79..0x7C as rows from CP932.
* tests/ISO-2022-JP-MS-snippet.alt: New file, renamed from
tests/ISO-2022-JP-MS-snippet.
* tests/ISO-2022-JP-MS-snippet.UTF-8: Update the rows that correspond
to ESC $ B 0x79..0x7C.
* tests/ISO-2022-JP-MS-snippet: Likewise.
* tests/check-stateful: Also test the *-snippet.alt file if it exists.
* tests/check-stateful.bat: Likewise.
2012-06-30 Bruno Haible
Improve ISO-2022-CP-MS versus CP932.
* lib/cp50221_0208_ext.h (cp50221_0208_ext_page30): Map U+301D like
U+301E.
* lib/iso2022_jpms.h (iso2022_jpms_wctomb): Map U+663B to JISX0208
0x7A 0x36, U+FFE2 to 0x7C 0x7B, U+FFE4 to 0x7C 0x7C.
Reported by Jeff Diehl .
2011-10-23 Bruno Haible
New encoding ISO-2022-CP-MS.
* NOTES: Mention ISO-2022-JP-MS.
* tools/CP50221-0208-EXT.TXT: New file.
* tools/CP50221-0212-EXT.TXT: New file.
* tools/8bit_tab_to_h.c: Add comments about how to generate
cp50221_0208_ext.h, cp50221_0212_ext.h.
* tools/Makefile: Add rules for generating cp50221_0208_ext.h,
cp50221_0212_ext.h.
* lib/cp50221_0208_ext.h: New file, mostly generated.
* lib/cp50221_0212_ext.h: New file, mostly generated.
* lib/iso2022_jpms.h: New file.
* lib/converters.h: Include it.
* lib/encodings.def: Add ISO-2022-JP-MS.
* README, man/iconv_open.3: Add ISO-2022-JP-MS.
* tests/ISO-2022-JP-MS-snippet: New file.
* tests/ISO-2022-JP-MS-snippet.UTF-8: New file.
* tests/Makefile.in (check): Also test ISO-2022-JP-MS.
Reported by Jeff Diehl .
2011-10-23 Bruno Haible
* lib/encodings.def: Add comments about Windows names of encodings.
2011-10-18 Bruno Haible
* m4/libtool.m4: Update from libtool-2.4.2, with modifications:
2008-04-06 Bruno Haible
* m4/libtool.m4 (LT_INIT): When setting LIBTOOL, use
CONFIG_SHELL; don't assume that the Makefile.in will set SHELL
to ${CONFIG_SHELL}..
* m4/ltoptions.m4: Likewise.
* m4/ltversion.m4: Likewise.
* build-aux/ltmain.sh: Likewise.
2011-10-03 Bruno Haible
* lib/relocatable.c: Update from gnulib.
2011-09-02 Bruno Haible
Fix "make check" failure when $(srcdir) != $(builddir).
* tests/Makefile.in (check): When $(srcdir) != ., temporarily copy
GB18030.IRREVERSIBLE.TXT into the build directory.
Reported by Christian Weisgerber .
2011-08-07 Bruno Haible
Ensure all HTML-formatted man pages are up-to-date.
* Makefile.devel (all): Depend on man/iconvctl.3.html and
man/iconv_open_into.3.html.
2011-08-07 Bruno Haible
* Version 1.14 released.
2011-08-07 Bruno Haible
* configure.ac: Bump version number to 1.14.
* README: Likewise.
* include/iconv.h.in (_LIBICONV_VERSION): Likewise.
* windows/iconv.rc: Update.
* lib/Makefile.in (LIBICONV_VERSION_INFO): Bump to 7:1:5.
* src/iconv.c (print_version): Update copyright year.
2011-08-07 Bruno Haible
Avoid a test failure on Solaris 2.6 and HP-UX 11.00.
* tests/test-to-wchar.c (main): Skip the test if conversion to wchar_t
is not supported.
2011-08-07 Bruno Haible
* tests/check-subst: Add comments about OSF/1.
2011-08-07 Bruno Haible
* lib/relocatable.c: Update from gnulib.
2011-08-06 Bruno Haible
Upgrade the GB18030 converter to the version from 2005.
* lib/gb18030ext.h (gb18030ext_2uni_pagefe): Change element type to
'unsigned int'. Change values for 0xFE51..0xFE53, 0xFE59, 0xFE61,
0xFE66, 0xFE67, 0xFE6C, 0xFE6D, 0xFE76, 0xFE7E, 0xFE90, 0xFE91, 0xFEA0.
(gb18030ext_mbtowc): Change type of wc to 'unsigned int'. Change values
for 0xA6D9..0xA6DF, 0xA6EC..0xA6ED, 0xA6F3, 0xA8BC.
(gb18030ext_page9f, gb18030ext_pagefe): New constant arrays.
(gb18030ext_wctomb): Change values for U+1E3F, U+9FB4..U+9FBB,
U+FE10..U+FE19, U+20087, U+20089, U+200CC, U+215D7, U+2298F, U+241FE.
* tests/GB18030-BMP.TXT: Change values for 0xA6D9..0xA6DF,
0xA6EC..0xA6ED, 0xA6F3, 0xA8BC, 0xFE51..0xFE53, 0xFE59, 0xFE61, 0xFE66,
0xFE67, 0xFE6C, 0xFE6D, 0xFE76, 0xFE7E, 0xFE90, 0xFE91, 0xFEA0, to map
to now-assigned Unicode codepoints.
* tests/GB18030.IRREVERSIBLE.TXT: New file.
2011-08-06 Bruno Haible
Fix conversion bug in CP1258 converter.
* lib/vietcomb.h (viet_comp_table_data): Remove entry for
U+00A5 U+0301. Fix entry for U+00A8 U+0301.
(viet_decomp_table): Fix entry for U+0385.
* tests/CP1258.IRREVERSIBLE.TXT: Update.
Reported by Gertjan Halkes .
2011-07-03 Bruno Haible
Improve interactive behaviour of iconv program.
* src/iconv.c (convert): Flush the output before starting a possibly
blocking safe_read call.
2011-07-03 Bruno Haible
Fix interactive behaviour of iconv program.
* Makefile.devel (GNULIB_MODULES): Add safe-read.
* src/iconv.c: Include safe-read.h.
(convert): Take the infile as a file descriptor, not as a FILE stream.
Use safe_read() instead of fread().
(main): Update.
Reported by Xavier Pucel .
2011-05-02 Bruno Haible
Update after gnulib changed.
* autogen.sh (GNULIB_MODULES): Remove exit, add stdlib.
2011-06-02 Bruno Haible
Update after gnulib changed.
* gnulib-local/m4/alloca.m4 (gl_FUNC_ALLOCA): Update.
2011-06-04 Bruno Haible
Work around bug on OSF/1 5.1.
* lib/loop_wchar.h: Before including , include and
some other includes.
2011-03-27 KO Myung-Hun
Fix installation on OS/2.
* src/Makefile.in (all, iconv_no_i18n): Add $(EXEEXT) suffix to
iconv_no_i18n. This is the recommended way to use libtool, see
.
2011-03-31 Bruno Haible
gentranslit: Fix buffer overrun.
* lib/gentranslit.c (main): Allocate more room for the suffix strings
of the translit pages.
Reported by Ben Noordhuis .
2011-02-28 Bruno Haible
* lib/relocatable.h: Update from gnulib.
* lib/relocatable.c: Likewise.
2011-01-29 Corinna Vinschen
Bruno Haible
Simplify "wchar_t" handling on Cygwin 1.7.x.
* lib/iconv.c (iconv_canonicalize): On Cygwin >= 1.7, map
ei_local_wchar_t to ei_utf16le or ei_utf16be, not ei_ucs2internal.
* lib/iconv_open1.h: Likewise.
Rationale: .
2011-01-29 Bruno Haible
Adjust the meaning of "wchar_t" on native Windows systems.
* lib/iconv.c (iconv_canonicalize): On native Windows, map
ei_local_wchar_t to ei_utf16le or ei_utf16be, not ei_ucs2internal.
* lib/iconv_open1.h: Likewise.
Reported by Corinna Vinschen
in .
2010-11-23 Bruno Haible
Implement newer release of BIG5-HKSCS.
* tools/Makefile (ALL): Add hkscs2008.h.
(hkscs2008.h): New rule.
* tools/cjk_tab_to_h.c (main): Recognize hkscs2008.
* lib/encodings.def: Add BIG5-HKSCS:2008. Change BIG5-HKSCS alias to be
equivalent to BIG5-HKSCS:2008.
* lib/hkscs2008.h: New file, autogenerated.
* lib/big5hkscs2008.h: New file, based on lib/big5hkscs2004.h.
* lib/converters.h: Include the new file.
* README, man/iconv_open.3: Add BIG5-HKSCS:2004.
* tests/BIG5-HKSCS-2008.TXT: New file, based on
tests/BIG5-HKSCS-2004.TXT.
* tests/BIG5-HKSCS-2008.IRREVERSIBLE.TXT: New file, copied from
tests/BIG5-HKSCS-2004.IRREVERSIBLE.TXT
* tests/BIG5-HKSCS-2008-snippet: New file, based on
tests/BIG5-HKSCS-2004-snippet.
* tests/BIG5-HKSCS-2008-snippet.UTF-8: New file, based on
tests/BIG5-HKSCS-2004-snippet.UTF-8.
* tests/Makefile.in (check): Check also BIG5-HKSCS:2008.
Reported by oCameLo .
2010-11-23 Bruno Haible
Make cjk_tab_to_h 64-bit clean.
* tools/cjk_tab_to_h.c (do_jisx0213): Add a cast from size_t to int.
(output_title): Update copyright year.
2010-09-23 Bruno Haible
Switch to autoconf 2.68.
* autogen.sh: Update comment.
* configure.ac: Fix AC_COMPILE_IFELSE invocation.
* Makefile.devel (AUTOCONF, AUTOHEADER): Switch to version 2.68.
* preload/Makefile.devel (AUTOCONF): Likewise.
2010-09-23 Bruno Haible
* m4/libtool.m4: Update from libtool-2.4, with modifications:
2008-04-06 Bruno Haible
* m4/libtool.m4 (LT_INIT): When setting LIBTOOL, use
CONFIG_SHELL; don't assume that the Makefile.in will set SHELL
to ${CONFIG_SHELL}.
* m4/ltversion.m4: Update from libtool-2.4.
* build-aux/ltmain.sh: Likewise.
2010-09-23 Bruno Haible
Simplify use of gnulib-tool now that gnulib-tool --import works better.
* autogen.sh: Don't remove gnulib-cache.m4 before running gnulib-tool.
* Makefile.devel (srclib/Makefile.gnulib): Depend on 'force'.
2010-07-31 Bruno Haible
* Makefile.devel (AUTOCONF, AUTOHEADER): Switch to version 2.67.
* preload/Makefile.devel (AUTOCONF): Likewise.
2010-07-03 Bruno Haible
* Makefile.devel (AUTOCONF, AUTOHEADER): Switch to version 2.66.
* preload/Makefile.devel (AUTOCONF): Likewise.
2010-06-04 Bruno Haible
Addendum to 2009-10-18 commit.
* m4/fcntl-o.m4: New file, from gnulib.
* configure.ac: Invoke gl_FCNTL_O_FLAGS.
* lib/config.h.in (HAVE_WORKING_O_NOFOLLOW): New macro.
2010-06-04 Bruno Haible
* m4/libtool.m4: Update from libtool-2.2.8, with modifications:
2008-04-06 Bruno Haible
* m4/libtool.m4 (LT_INIT): When setting LIBTOOL, use
CONFIG_SHELL; don't assume that the Makefile.in will set SHELL
to ${CONFIG_SHELL}.
* m4/ltoptions.m4: Update from libtool-2.2.8.
* m4/ltversion.m4: Likewise.
* m4/lt~obsolete.m4: Likewise.
* build-aux/ltmain.sh: Likewise.
2010-04-06 Bruno Haible
Avoid a compilation error of gnulib's test-iconv-h-c++.cc on mingw.
* include/iconv.h.in: Restrict the extern "C" { ... } scope so that it
doesn't contains #include directives.
2010-03-30 Bruno Haible
* README.woe32: Update for Cygwin 1.7.x.
2009-12-26 Bruno Haible
* windows/libiconv.rc: Update.
* windows/iconv.rc: Update.
2009-12-11 Bruno Haible
* include/iconv.h.in: Untabify.
* gnulib-local/lib/xalloc.h: Untabify.
* woe32dll/export.h: Untabify.
* tests/uniq-u.c: Untabify.
2009-12-11 Bruno Haible
* srclib/Makefile.am (MOSTLYCLEANDIRS): New macro.
2009-12-11 Bruno Haible
* Makefile.devel (AUTOCONF, AUTOHEADER): Switch to version 2.65.
* preload/Makefile.devel (AUTOCONF): Likewise.
2009-11-22 Bruno Haible
* tests/check-subst: Add reference to the Solaris printf bug.
Reported by Dagobert Michelsen .
2009-09-01 Bruno Haible
* README.woe32: Put the -mno-cygwin option into CC and CXX.
Recommended by Paolo Bonzini and Eric Blake.
2009-08-15 Bruno Haible
* Makefile.devel (AUTOCONF, AUTOHEADER): Switch to version 2.64.
* preload/Makefile.devel (AUTOCONF): Likewise.
2009-08-15 Bruno Haible
Use .git/info/exclude, not .gitignore, for imported or generated files.
* Makefile.devel (srclib/Makefile.gnulib): Pass option --no-vc-files to
gnulib-tool.
2009-07-07 Bruno Haible
Fix an endless loop.
* lib/loop_wchar.h (wchar_to_loop_convert): Handle the case of
incomplete input correctly.
* tests/test-to-wchar.c: New file.
* tests/Makefile.in (tests-to-wchar, tests-to-wchar.o): New rules.
(check): Depend on and run tests-to-wchar.
(clean): Add tests-to-wchar.
Reported by Tristan Gingold .
2009-06-30 Bruno Haible
* Version 1.13.1 released.
2009-06-30 Bruno Haible
* configure.ac: Bump version number to 1.13.1.
* README: Likewise.
2009-06-04 Bruno Haible
* preload/Makefile.devel (AUTOCONF): Switch to version 2.63.
(ACLOCAL): Switch to version 1.11.
2009-05-19 Bruno Haible
* Makefile.devel (AUTOMAKE, ACLOCAL): Switch to version 1.11.
* autogen.sh: Update comments.
2009-04-24 Bruno Haible
Fix a compilation error on HP-UX 11.00, introduced on 2008-09-16.
* src/iconv_open2.h: Don't initialize nonexistent field if
!(HAVE_WCRTOMB || HAVE_MBRTOWC).
Patch by Joel Brobecker .
2009-04-15 Bruno Haible
* src/Makefile.in (install, uninstall): Append the $(EXEEXT) suffix
explicitly. Needed on Cygwin.
2009-04-11 Bruno Haible
* configure.ac: Move the statements for WOE32 and WINDRES.
2009-03-26 Bruno Haible
* Version 1.13 released.
2009-03-26 Bruno Haible
* src/iconv.c: Update copyright header to GPLv3+.
(print_version): Update license info.
2009-03-26 Bruno Haible
* src/iconv.c (print_version): Bump year.
2009-03-25 Bruno Haible
* build-aux/config.guess: Update to GNU version 2009-02-03.
* build-aux/config.sub: Likewise.
2009-03-25 Bruno Haible
* configure.ac: Bump version number to 1.13.
* README: Likewise.
* include/iconv.h.in (_LIBICONV_VERSION): Likewise.
* windows/iconv.rc: Update.
* lib/Makefile.in (LIBICONV_VERSION_INFO): Bump to 7:0:5.
2009-03-25 Bruno Haible
Fix the handling of Windows resources in shared libraries.
* configure.ac: Invoke LT_LANG for 'Windows Resource'.
* lib/Makefile.in (RC): New variable.
(WINDRES): Remove variable.
(OBJECTS_RES_yes): Add .lo suffix.
(libiconv.res.lo): Renamed from libiconv.res. Use libtool --tag=RC.
(clean): Simplify.
Based on a patch by Roumen Petrov .
2009-03-14 Bruno Haible
* autogen.sh: Checkout gnulib using 'git' instead of 'cvs'.
2009-01-24 Bruno Haible
* tools/Makefile (ALL): Add cp1131.h.
(cp1131.h): New rule.
* lib/encodings.def: Add CP1131.
* lib/cp1131.h: New file.
* lib/converters.h: Include it.
* README, man/iconv_open.3: Add CP1131.
* NOTES: Mention CP1131.
* tests/CP1131.TXT: New file.
* tests/Makefile.in (check): Also test CP1131.
2009-01-17 Bruno Haible
Add support for "make install-strip".
* configure.ac: Search for 'strip'. Invoke AM_PROG_INSTALL_STRIP.
* Makefile.in (install-strip): New rule.
* src/Makefile.in (STRIP, INSTALL_STRIP_PROGRAM, install_sh): New
variables.
(install-strip): New rule.
* lib/Makefile.in (install-strip): New target.
* preload/Makefile.in (install-strip): Likewise.
* man/Makefile.in (install-strip): Likewise.
Reported by Alon Bar-Lev .
2009-01-17 Bruno Haible
Update after gnulib changed.
* src/Makefile.in (RELOCATABLE_STRIP): New variable.
2009-01-17 Bruno Haible
Make --enable-relocatable work on glibc systems.
* src/Makefile.in (host): New variable.
2009-01-17 Bruno Haible
* lib/genflags.c: Include .
2009-01-14 Bruno Haible
* configure.ac: More consistent m4 quoting.
* preload/configure.ac: Likewise.
2008-09-28 Bruno Haible
* build-aux/ltmain.sh (func_emit_cwrapperexe_src): On mingw,
preprocess the argument vector through prepare_spawn.
2008-09-27 Bruno Haible
* build-aux/config.guess: Update to GNU version 2008-09-08.
* build-aux/config.sub: Likewise.
2008-09-26 Bruno Haible
* tests/test-shiftseq.c (main1, main2): Use ICONV_CONST.
2008-09-26 Bruno Haible
* Makefile.devel (GNULIB_MODULES): Add sigpipe, stdio.
* tests/Makefile.in (check, table-from, table-to, test-shiftseq): Link
all programs against libicrt.a. Needed for the stdio function
replacements on mingw.
2008-09-21 Tadamasa Teranishi
* lib/encodings_extra.def: Add aliases for EUC-JISX0213, SHIFT_JISX0213,
ISO-2022-JP-3, found on .
2008-09-20 Bruno Haible
* man/iconv_open_into.3: New file.
2008-09-16 Bruno Haible