zoukankan      html  css  js  c++  java
  • 二维码生成库的使用注意事项 libqrencode

    cmake 修改

    option(WITH_TOOLS "Build utility tools" YES )
    option(WITH_TESTS "Build tests" NO )
    option(WITHOUT_PNG "Disable PNG support" YES) #1.屏蔽PNG
    option(GPROF "Generate extra code to write profile information" OFF)
    option(COVERAGE "Generate extra code to write coverage information" OFF)
    option(ASAN "Use AddressSanitizer" OFF)
    option(BUILD_SHARED_LIBS "Enable build of shared libraries" YES)

    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") #2.动态库

    qrencode 的数据结构 QRcode->data的最后一个bit表示的才是数据,不能直接使用if(QRcode->data)

    /**
    * QRcode class.
    * Symbol data is represented as an array contains width*width uchars.
    * Each uchar represents a module (dot). If the less significant bit of
    * the uchar is 1, the corresponding module is black. The other bits are
    * meaningless for usual applications, but here its specification is described.
    *
    * @verbatim
    MSB 76543210 LSB
    |||||||`- 1=black/0=white
    ||||||`-- 1=ecc/0=data code area
    |||||`--- format information
    ||||`---- version information
    |||`----- timing pattern
    ||`------ alignment pattern
    |`------- finder pattern and separator
    `-------- non-data modules (format, timing, etc.)
    @endverbatim
    */
    typedef struct {
    int version; ///< version of the symbol
    int width; ///< width of the symbol
    unsigned char *data; ///< symbol data
    } QRcode;
    
    

    具体代码见gitee https://gitee.com/layty/libqrencode/blob/master/demo1.c 查看git log

  • 相关阅读:
    [LeetCode] 67. 二进制求和
    [LeetCode] 66. 加一
    [LeetCode] 65. 有效数字
    [LeetCode] 63. 不同路径 II
    [LeetCode] 64. 最小路径和
    [LeetCode] 61. 旋转链表
    [LeetCode] 62. 不同路径
    [LeetCode] 59. 螺旋矩阵 II
    [LeetCode] 60. 第k个排列
    [LeetCode] 58. 最后一个单词的长度
  • 原文地址:https://www.cnblogs.com/zongzi10010/p/13788688.html
Copyright © 2011-2022 走看看