Git Product home page Git Product logo

zxing-cpp's Introduction

Build Status

ZXing-C++

ZXing-C++ ("zebra crossing") is an open-source, multi-format linear/matrix barcode image processing library implemented in C++.

It was originally ported from the Java ZXing Library but has been developed further and now includes many improvements in terms of quality and performance. It can both read and write barcodes in a number of formats.

Features

  • In pure C++17, no third-party dependencies (for the library)
  • Stateless, thread-safe readers/scanners and writers/generators
  • Wrappers/Bindings for:

Supported Formats

Linear product Linear industrial Matrix
UPC-A Code 39 QR Code
UPC-E Code 93 Micro QR Code
EAN-8 Code 128 Aztec
EAN-13 Codabar DataMatrix
DataBar DataBar Exanded PDF417
ITF MaxiCode (partial)

[Note: DataBar used to be called RSS. DataBar, MaxiCode and Micro QR Code are not supported for writing.]

Getting Started

To read barcodes:

As an example, have a look at ZXingReader.cpp.

  1. Load your image into memory (3rd-party library required).
  2. Call ReadBarcodes() from ReadBarcode.h, the simplest API to get a list of Result objects.

To write barcodes:

As an example, have a look at ZXingWriter.cpp.

  1. Create a MultiFormatWriter instance with the format you want to generate. Set encoding and margins if needed.
  2. Call encode() with text content and the image size. This returns a BitMatrix which is a binary image of the barcode where true == visual black and false == visual white.
  3. Convert the bit matrix to your native image format. See also the ToMatrix<T>(BitMatrix&) helper function.

Web Demos

[Note: those live demos are not necessarily fully up-to-date at all times.]

Build Instructions

These are the generic instructions to build the library on Windows/macOS/Linux. For details on how to build the individual wrappers, follow the links above.

  1. Make sure CMake version 3.14 or newer is installed.
  2. Make sure a C++17 compliant compiler is installed (minimum VS 2019 16.8 / gcc 7 / clang 5).
  3. See the cmake BUILD_... options to enable the testing code, python wrapper, etc.
git clone https://github.com/zxing-cpp/zxing-cpp.git --single-branch --depth 1
cmake -S zxing-cpp -B zxing-cpp.release -DCMAKE_BUILD_TYPE=Release
cmake --build zxing-cpp.release -j8

[Note: binary packages are available for/as vcpkg, conan, mingw and a bunch of linux distributions.]

zxing-cpp's People

Contributors

axxel avatar huycn avatar gitlost avatar markusfisch avatar vkrause avatar pabs3 avatar musicinmybrain avatar parallaxe avatar duanqn avatar dabrain34 avatar tcoyvwac avatar urishab avatar corbers avatar enzo-simone avatar moodyhunter avatar marxin avatar marcoffee avatar hartcw avatar ducksoft avatar tanius avatar neycyanshi avatar simonschmeisser avatar tailsu avatar timrae avatar adamf88 avatar benys avatar hbaocr avatar sidepelican avatar ptc-brainer avatar seed93 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.