• 大小: 13.81MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-06-26
  • 语言: C/C++
  • 标签: zxing  C++  Opencv  二维码  

资源简介

VS2010,整合官网上面zxing的C++版本和OpenCV,可直接使用OpenCV得Mat进行二维码识别,若遇到显示中文乱码,可尝试将字符编码方式在UTF-8和gb2312之间切换。

资源截图

代码片段和文件信息

/*
 * iconv implementation using Win32 API to convert.
 *
 * This file is placed in the public domain.
 */

/* for WC_NO_BEST_FIT_CHARS */
#ifndef WINVER
# define WINVER 0x0500
#endif

#define STRICT
#include 
#include 
#include 
#include 

/* WORKAROUND: */
#ifndef UNDER_CE
#define GetProcAddressA GetProcAddress
#endif

#if 0
# define MAKE_EXE
# define MAKE_DLL
# define USE_LIBICONV_DLL
#endif

#if !defined(DEFAULT_LIBICONV_DLL)
# define DEFAULT_LIBICONV_DLL ““
#endif

#define MB_CHAR_MAX 16

#define UNICODE_MODE_BOM_DONE   1
#define UNICODE_MODE_SWAPPED    2

#define FLAG_USE_BOM            1
#define FLAG_TRANSLIT           2 /* //TRANSLIT */
#define FLAG_IGNORE             4 /* //IGNORE */

typedef unsigned char uchar;
typedef unsigned short ushort;
typedef unsigned int uint;

typedef void* iconv_t;

iconv_t iconv_open(const char *tocode const char *fromcode);
int iconv_close(iconv_t cd);
size_t iconv(iconv_t cd char **inbuf size_t *inbytesleft char **outbuf size_t *outbytesleft);

/* libiconv interface for vim */
#if defined(MAKE_DLL)
int
iconvctl (iconv_t cd int request void* argument)
{
    /* not supported */
    return 0;
}
#endif

typedef struct compat_t compat_t;
typedef struct csconv_t csconv_t;
typedef struct rec_iconv_t rec_iconv_t;

typedef iconv_t (*f_iconv_open)(const char *tocode const char *fromcode);
typedef int (*f_iconv_close)(iconv_t cd);
typedef size_t (*f_iconv)(iconv_t cd char **inbuf size_t *inbytesleft char **outbuf size_t *outbytesleft);
typedef int* (*f_errno)(void);
typedef int (*f_mbtowc)(csconv_t *cv const uchar *buf int bufsize ushort *wbuf int *wbufsize);
typedef int (*f_wctomb)(csconv_t *cv ushort *wbuf int wbufsize uchar *buf int bufsize);
typedef int (*f_mblen)(csconv_t *cv const uchar *buf int bufsize);
typedef int (*f_flush)(csconv_t *cv uchar *buf int bufsize);

#define COMPAT_IN   1
#define COMPAT_OUT  2

/* unicode mapping for compatibility with other conversion table. */
struct compat_t {
    uint in;
    uint out;
    uint flag;
};

struct csconv_t {
    int codepage;
    int flags;
    f_mbtowc mbtowc;
    f_wctomb wctomb;
    f_mblen mblen;
    f_flush flush;
    DWORD mode;
    compat_t *compat;
};

struct rec_iconv_t {
    iconv_t cd;
    f_iconv_close iconv_close;
    f_iconv iconv;
    f_errno _errno;
    csconv_t from;
    csconv_t to;
#if defined(USE_LIBICONV_DLL)
    HMODULE hlibiconv;
#endif
};

static int win_iconv_open(rec_iconv_t *cd const char *tocode const char *fromcode);
static int win_iconv_close(iconv_t cd);
static size_t win_iconv(iconv_t cd char **inbuf size_t *inbytesleft char **outbuf size_t *outbytesleft);

static int load_mlang();
static int make_csconv(const char *name csconv_t *cv);
static int name_to_codepage(const char *name);
static uint utf16_to_ucs4(const ushort *wbuf);
static void ucs4_to_utf16(uint wc ushort *wbuf int *wbufsize);
static int mbtowc_flags(int codepage);
static int must_use_null_usedd

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件   22808440  2015-03-18 15:58  zxing\thirdparty\lib\zxinglib.lib

     文件   23013488  2015-03-20 10:35  zxing\thirdparty\lib\zxinglib_.lib

     文件         68  2015-01-20 04:16  zxing\thirdparty\zxing\bigint\.gitignore

     文件      11670  2015-01-20 04:16  zxing\thirdparty\zxing\bigint\BigInteger.cc

     文件       6904  2015-01-20 04:16  zxing\thirdparty\zxing\bigint\BigInteger.hh

     文件       1830  2015-01-20 04:16  zxing\thirdparty\zxing\bigint\BigIntegerAlgorithms.cc

     文件        826  2015-01-20 04:16  zxing\thirdparty\zxing\bigint\BigIntegerAlgorithms.hh

     文件        242  2015-01-20 04:16  zxing\thirdparty\zxing\bigint\BigIntegerLibrary.hh

     文件       1515  2015-01-20 04:16  zxing\thirdparty\zxing\bigint\BigIntegerUtils.cc

     文件       2571  2015-01-20 04:16  zxing\thirdparty\zxing\bigint\BigIntegerUtils.hh

     文件      22110  2015-01-20 04:16  zxing\thirdparty\zxing\bigint\BigUnsigned.cc

     文件      14754  2015-01-20 04:16  zxing\thirdparty\zxing\bigint\BigUnsigned.hh

     文件       4249  2015-01-20 04:16  zxing\thirdparty\zxing\bigint\BigUnsignedInAbase.cc

     文件       4120  2015-01-20 04:16  zxing\thirdparty\zxing\bigint\BigUnsignedInAbase.hh

     文件       9060  2015-01-20 04:16  zxing\thirdparty\zxing\bigint\ChangeLog

     文件       2290  2015-01-20 04:16  zxing\thirdparty\zxing\bigint\Makefile

     文件       4708  2015-01-20 04:16  zxing\thirdparty\zxing\bigint\NumberlikeArray.hh

     文件       3367  2015-01-20 04:16  zxing\thirdparty\zxing\bigint\README

     文件        358  2015-01-20 04:16  zxing\thirdparty\zxing\win32\zxing\iconv.h

     文件       7728  2015-01-20 04:16  zxing\thirdparty\zxing\win32\zxing\stdint.h

     文件      60636  2015-01-20 04:16  zxing\thirdparty\zxing\win32\zxing\win_iconv.c

     文件       1619  2015-01-20 04:16  zxing\thirdparty\zxing\zxing\aztec\AztecDetectorResult.cpp

     文件       1357  2015-01-20 04:16  zxing\thirdparty\zxing\zxing\aztec\AztecDetectorResult.h

     文件       2077  2015-01-20 04:16  zxing\thirdparty\zxing\zxing\aztec\AztecReader.cpp

     文件       1314  2015-01-20 04:16  zxing\thirdparty\zxing\zxing\aztec\AztecReader.h

     文件      14070  2015-01-20 04:16  zxing\thirdparty\zxing\zxing\aztec\decoder\Decoder.cpp

     文件       1834  2015-01-20 04:16  zxing\thirdparty\zxing\zxing\aztec\decoder\Decoder.h

     文件      18759  2015-01-20 04:16  zxing\thirdparty\zxing\zxing\aztec\detector\Detector.cpp

     文件       2871  2015-01-20 04:16  zxing\thirdparty\zxing\zxing\aztec\detector\Detector.h

     文件       1072  2015-01-20 04:16  zxing\thirdparty\zxing\zxing\BarcodeFormat.cpp

............此处省略282个文件信息

评论

共有 条评论