e2a1de304ab78b4653e357cfd9b5244545a2d2e0
[framework/osp/vision.git] / src / FUixVisionImageObject.cpp
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 #include <FUixVisionImageObject.h>
19 #include "FUixVision_ImageObjectImpl.h"
20
21 namespace Tizen { namespace Uix { namespace Vision
22 {
23
24 ImageObject::ImageObject()
25     : __pImageObjectImpl(0)
26 {
27     std::unique_ptr<_ImageObjectImpl> pImageObjectImpl (new (std::nothrow) _ImageObjectImpl);
28     __pImageObjectImpl = pImageObjectImpl.release();
29 }
30
31 ImageObject::~ImageObject()
32 {
33 }
34
35 int
36 ImageObject::GetId(void) const
37 {
38     if (__pImageObjectImpl)
39     {
40         return __pImageObjectImpl->GetId();
41     }
42     else
43     {
44         return -1;
45     }
46 }
47
48 int
49 ImageObject::GetFeatureId(void) const
50 {
51     if (__pImageObjectImpl)
52     {
53         return __pImageObjectImpl->GetFeatureId();
54     }
55     else
56     {
57         return -1;
58     }
59 }
60
61 const Tizen::Graphics::FloatMatrix4*
62 ImageObject::GetTransformMatrix(void) const
63 {
64     if (__pImageObjectImpl)
65     {
66         return __pImageObjectImpl->GetTransformMatrix();
67     }
68     else
69     {
70         return 0;
71     }
72 }
73
74 const Tizen::Base::Collection::IListT<Tizen::Graphics::FloatPoint>*
75 ImageObject::GetRectangle(void) const
76 {
77     if (__pImageObjectImpl)
78     {
79         return __pImageObjectImpl->GetRectangle();
80     }
81     else
82     {
83         return 0;
84     }
85 }
86
87 bool
88 ImageObject::Equals(const Object& obj) const
89 {
90     return (static_cast<const Object*>(this) == &obj);
91 }
92
93 int
94 ImageObject::GetHashCode(void) const
95 {
96     return (int)__pImageObjectImpl;
97 }
98
99 } } } //Tizen::Uix::Vision
100