Initialize Tizen 2.3
[framework/osp/vision.git] / src / FUixVision_ImageFeatureManagerImpl.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18
19 /**
20  * @file     FUixVision_ImageFeatureManagerImpl.h
21  * @brief    This is the header file for the %Tizen::Uix::_ImageFeatureManagerImpl class.
22  */
23
24 #ifndef _FUIX_VISION_INTERNAL_IMAGE_FEATURE_MANAGER_IMPL_H_
25 #define _FUIX_VISION_INTERNAL_IMAGE_FEATURE_MANAGER_IMPL_H_
26
27 #include <FUixVisionImageFeatureManager.h>
28 #include <FUixVisionImageRecognizer.h>
29 #include "ImageFeatureManager.h"
30 #include <FBase.h>
31
32 namespace Tizen { namespace Uix { namespace Vision
33 {
34
35 class _ImageFeatureManagerImpl
36 {
37 public:
38     _ImageFeatureManagerImpl(void);
39     ~_ImageFeatureManagerImpl(void);
40
41     static        _ImageFeatureManagerImpl* GetInstance(ImageFeatureManager& imageFeatureManager);
42     static const _ImageFeatureManagerImpl* GetInstance(const ImageFeatureManager& imageFeatureManager);
43
44     void InitDB(void);
45     int AddFeature(const Tizen::Base::String& filepath);
46     int AddFeature(const unsigned char* data, int width, int height, const Tizen::Base::String& info);
47     bool DeleteFeature(int index);
48     unsigned int GetTotalNumberOfFeatures(void);
49     result SaveDB(bool optimizeDatabase, const Tizen::Base::String* dbPath = null);
50     bool UpdateDB(void);
51     bool OpenDB(const Tizen::Base::String& dbPath);
52     void ReleaseDB(void);
53     const Tizen::Uix::Vision::ImageFeatureInfo* GetImageFeatureInfo(int);
54
55 private:
56     friend class _ImageRecognizerImpl;
57     _ImageFeatureManagerImpl(const _ImageFeatureManagerImpl&);
58     _ImageFeatureManagerImpl& operator=(const _ImageFeatureManagerImpl&);
59     void UpdateFeatureIndices(void);
60     sari2::ImageFeatureManager*              __imageFeatureManager;
61     Tizen::Base::String                      __path;
62     Tizen::Base::Collection::ArrayListT<int> __indices;
63         bool                                                                     __readOnly;
64     int __minSupportedSize;
65     int __maxSupportedResolution;
66 };
67
68 } } } //Tizen::Uix::Vision
69
70 #endif //_FUIX_VISION_INTERNAL_IMAGE_FEATURE_MANAGER_IMPL_H_