3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 #ifndef QRCODERECOGNIZER_H
19 #define QRCODERECOGNIZER_H
21 #include "QRCodeRecognitionInfo.h"
26 /// \brief Class that provides utilities for QR code localization and recognition
27 class QRCodeRecognizer
31 /// \brief Setup input video-frame width and height
33 /// Must be called once before calling processFrame.
34 /// \param [in] width - frame width in pixels that is reported by video-capture device
35 /// \param [in] height - frame height in pixels that is reported by video-capture device
36 /// \return true on success, false on error
37 bool setFrameSize(unsigned int width, unsigned int height);
39 /// \brief Process external buffer with captured frame image
40 /// \param [in] raw - pointer to buffer with intensity (grayscale8) data. Buffer size must not be less than it set with setFrameSize
42 /// \return true on success, false on error
43 bool processFrame(const unsigned char* raw);
45 /// \brief Returns focusing ROI
46 /// \param[out] roi - float array for ROI in form {top_left_x, top_left_y, bottom_right_x, bottom_right_y}
47 /// \return true on success, false on error
48 bool getROI(float* roi);
50 /// \brief Setting scene transformation
51 /// \param [in] left transformation matrix 4x4
52 /// \param [in] right transformation matrix 4x4
53 /// Default matrix is identity
54 void setSceneTransform(const float* left, const float* right);
56 /// Updates information about objects on scene.
57 /// \return Pointer on first element of the array of structures that holds
58 /// information about qr code objects.
59 const QRCodeRecognitionInfo* objectsBegin();
60 /// \return Pointer on the end of the array of structures that holds
61 /// information about qr code objects.
62 const QRCodeRecognitionInfo* objectsEnd();
64 /// \brief Initialize the reader
65 /// \return true on success, false on error
67 /// \brief Dispose of the reader
68 /// \return true on success, false on error
71 QRCodeRecognizer(void);
72 ~QRCodeRecognizer(void);
75 QRCodeRecognizer(const QRCodeRecognizer& in);
76 QRCodeRecognizer& operator=(const QRCodeRecognizer& in);
77 class QRCodeRecognizerImpl;
78 /// \brief Implementation bridge
79 QRCodeRecognizerImpl* mImpl;
84 #endif // QRCODERECOGNIZER_H