sfdm is a library which targets to provide a fast, accurate and easy to use datamatrix code reader.
There are three implementations to choose from:
A code reader based on ZXing, a code reader based on libdmtx and a combination of both.
#include <sfdm/sfdm.hpp>
#include <iostream>
sfdm::ImageView view{image.width, image.height, image.data};
sfdm::ZXingCodeReader reader;
sfdm::DecodeResult result = reader.decode(view);
std::cout << result.text << '\n';#include <sfdm/sfdm.hpp>
#include <iostream>
sfdm::ImageView view{image.width, image.height, image.data};
sfdm::LibdmtxCodeReader reader;
sfdm::DecodeResult result = reader.decode(view);
std::cout << result.text << '\n';#include <sfdm/sfdm.hpp>
#include <iostream>
sfdm::ImageView view{image.width, image.height, image.data};
sfdm::LibdmtxZXingCombinedCodeReader reader;
sfdm::DecodeResult result = reader.decode(view);
std::cout << result.text << '\n';The sfdm library needs ZXing or libdmtx or both as dependency. The recommended way is to build dependencies with conan. The conan file is provided here.
Change directory into root of this repository.
In order to build the sfdm library without conan use the following (dependencies must be present):
cmake -B build -S .
cmake --build buildTo build the sfdm library with conan use the following:
cmake --preset=conan-<build_type>
cmake --build --preset=conan-<build_type>