Fix flora license version
[platform/framework/native/vision.git] / src / ImageRecognitionInfo.h
index f650777..66a3ba9 100644 (file)
@@ -1,26 +1,27 @@
-/**
- * Copyright (c) 2011~2012 Samsung Electronics, Inc.
- * All rights reserved.
- *
- * This software is the confidential and proprietary information
- * of Samsung Electronics, Inc. ("Confidential Information"). You
- * shall not disclose such Confidential Information and shall use
- * it only in accordance with the terms of the license agreement
- * you entered into with Samsung Electronics.
- *
- * @file   ReferenceImageInfo.h
- * @author Fedir Zubach (f.zubach@samsung.com)
- * @author Samsung Ukraine Research Center / Interactive Lab
- * @date   9 November 2012
- */
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.1 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
 
 #ifndef IMAGERECOGNITIONINFO_H_
 #define IMAGERECOGNITIONINFO_H_
 
 namespace sari2
 {
-
 class ImageFeatureManager;
+class Database;
 
 /// Holds all required information about one object on scene.
 class ImageRecognitionInfo
@@ -50,7 +51,15 @@ public:
     /// \return OpenGL transformation matrix for object position.
     inline const float* transform(void) const { return mTransform; }
 
-    inline const float aspect(void) const {return mAspect; }
+    inline const float aspect(void) const { int w = imageWidth(); return w > 0 ? imageHeight() / (float) w : 0.f; }
+
+    /// \brief Width of image of corresponding object from the database.
+    /// \return Image width.
+    int imageWidth(void) const;
+
+    /// \brief Height of image of corresponding object from the database.
+    /// \return Image height.
+    int imageHeight(void) const;
 
     /// \brief Calculates homogeneous coordinates of reference image rectangle
     /// verteces projections on current view.
@@ -63,8 +72,7 @@ private:
     int mIndex; ///< Unique ID of object on scene.
     int mTypeId; ///< ID of object type.
     float mTransform[16]; ///< OpenGL transformation matrix for object position.
-    float mAspect; ///< Object's aspect ratio.
-    const float *mLeft, *mRight;
+    const Database*     mDatabase;
 };
 
 }