patch for rc20
[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     if (__pImageObjectImpl != null)
34     {
35         delete __pImageObjectImpl;
36         __pImageObjectImpl = null;
37     }
38 }
39
40 int
41 ImageObject::GetId(void) const
42 {
43     if (__pImageObjectImpl)
44     {
45         return __pImageObjectImpl->GetId();
46     }
47     else
48     {
49         return -1;
50     }
51 }
52
53 int
54 ImageObject::GetFeatureId(void) const
55 {
56     if (__pImageObjectImpl)
57     {
58         return __pImageObjectImpl->GetFeatureId();
59     }
60     else
61     {
62         return -1;
63     }
64 }
65
66 const Tizen::Graphics::FloatMatrix4*
67 ImageObject::GetTransformMatrix(void) const
68 {
69     if (__pImageObjectImpl)
70     {
71         return __pImageObjectImpl->GetTransformMatrix();
72     }
73     else
74     {
75         return 0;
76     }
77 }
78
79 const Tizen::Base::Collection::IListT<Tizen::Graphics::FloatPoint>*
80 ImageObject::GetRectangle(void) const
81 {
82     if (__pImageObjectImpl)
83     {
84         return __pImageObjectImpl->GetRectangle();
85     }
86     else
87     {
88         return 0;
89     }
90 }
91
92 bool
93 ImageObject::Equals(const Object& obj) const
94 {
95     return (static_cast<const Object*>(this) == &obj);
96 }
97
98 int
99 ImageObject::GetHashCode(void) const
100 {
101     return (int)__pImageObjectImpl;
102 }
103
104 } } } //Tizen::Uix::Vision
105