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://www.tizenopensource.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 IMAGERECOGNITIONINFO_H_
19 #define IMAGERECOGNITIONINFO_H_
24 class ImageFeatureManager;
26 /// Holds all required information about one object on scene.
27 class ImageRecognitionInfo
29 friend class ImageRecognizer;
32 /// \brief Default constructor.
33 ImageRecognitionInfo(void);
35 /// \brief Constructor.
37 /// Gives information about image of specified object from database,
38 /// without providing tracking information.
39 /// \param[in] ifm ImageFeatureManager instance (holds image database).
40 /// \param[in] index ID of object in database.
41 ImageRecognitionInfo(const ImageFeatureManager* ifm, int index);
43 ImageRecognitionInfo(const ImageRecognitionInfo&);
44 ~ImageRecognitionInfo(void) {}
45 ImageRecognitionInfo& operator=(const ImageRecognitionInfo&);
47 /// \return Unique ID of object on scene.
48 inline int index(void) const { return mIndex; }
49 /// \return ID of object type.
50 inline int typeId(void) const { return mTypeId; }
51 /// \return OpenGL transformation matrix for object position.
52 inline const float* transform(void) const { return mTransform; }
54 inline const float aspect(void) const {return mAspect; }
56 /// \brief Calculates homogeneous coordinates of reference image rectangle
57 /// verteces projections on current view.
58 /// \param[out] coordinates Buffer of size 8 to store calculation result as
59 /// follows: {x1, y1, x2, y2, x3, y3, x4, y4}.
60 /// \return 'true' on success.
61 bool rectangle(float *coordinates) const;
64 int mIndex; ///< Unique ID of object on scene.
65 int mTypeId; ///< ID of object type.
66 float mTransform[16]; ///< OpenGL transformation matrix for object position.
67 float mAspect; ///< Object's aspect ratio.
68 const float *mLeft, *mRight;
73 #endif // IMAGERECOGNITIONINFO_H_