Reading QR code
In this example we will use the ZXing library for QR code reading.
Getting ready
Please download the Cinder ZXing block from GitHub and unpack it to the blocks
folder: https://github.com/dawidgorny/Cinder-ZXing
How to do it…
We will now create a QR code reader:
Add a header search path to the build settings of your project:
$(CINDER_PATH)/blocks/zxing/include
Add a path from the precompiled ZXing library to the build settings of your project:
$(CINDER_PATH)/blocks/zxing/lib/macosx/libzxing.a
. For a debug configuration, use$(CINDER_PATH)/blocks/zxing/lib/macosx/libzxing_d.a
.Add Cinder ZXing block files to your project structure as follows:
Add the
libiconv.dylib
library to theLink Binary With Libraries
list:Add the necessary header files:
#include "cinder/gl/Texture.h" #include "cinder/Surface.h" #include "cinder/Capture.h" #include <zxing/qrcode/QRCodeReader.h> #include <zxing/common/GlobalHistogramBinarizer.h> #include <zxing/Exception.h> #include <zxing/DecodeHints...