2 // Open Service Platform
3 // Copyright (c) 2013 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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 #include "FUixVision_ImageObjectImpl.h"
20 namespace Tizen { namespace Uix { namespace Vision
23 _ImageObjectImpl::_ImageObjectImpl(void)
27 __pRectangleList = new Tizen::Base::Collection::ArrayListT<Tizen::Graphics::FloatPoint>();
28 __pMatrix = new Tizen::Graphics::FloatMatrix4();
31 _ImageObjectImpl::~_ImageObjectImpl(void)
33 delete __pRectangleList;
38 _ImageObjectImpl::GetId(void) const
40 return __ImageRecognitionInfo.index();
44 _ImageObjectImpl::GetFeatureId(void) const
46 return __ImageRecognitionInfo.typeId();
49 const Tizen::Graphics::FloatMatrix4*
50 _ImageObjectImpl::GetTransformMatrix(void) const
52 memcpy(__pMatrix->matrix, __ImageRecognitionInfo.transform(), 16 * sizeof(float));
57 _ImageObjectImpl::GetAspect(void) const
59 return __ImageRecognitionInfo.aspect();
63 _ImageObjectImpl::SetSariPointer(const sari2::ImageRecognitionInfo& sari)
65 __ImageRecognitionInfo = sari;
68 const Tizen::Base::Collection::ArrayListT<Tizen::Graphics::FloatPoint>*
69 _ImageObjectImpl::GetRectangle(void) const
71 __pRectangleList->RemoveAll();
72 static float coordinates[8] = {0.f};
73 __ImageRecognitionInfo.rectangle(coordinates);
75 for (int i = 0; i < 4; ++i)
76 __pRectangleList->Add(Tizen::Graphics::FloatPoint(coordinates[2 * i], coordinates[(2 * i) + 1]));
78 return __pRectangleList;
82 _ImageObjectImpl::GetInstance(ImageObject* pImageObject)
84 return pImageObject->__pImageObjectImpl;
87 const _ImageObjectImpl*
88 _ImageObjectImpl::GetInstance(const ImageObject* pImageObject)
90 return pImageObject->__pImageObjectImpl;
94 _ImageObjectImpl::ReleaseImageObject(ImageObject* pImageObject)
100 _ImageObjectImpl::ReleaseImageObjectArray(ImageObject* pImageObject)
102 delete[] pImageObject;
106 _ImageObjectImpl::CreateImageObjectStorageN(const unsigned int size)
108 ImageObject* objectStorage = new ImageObject[size];
109 return objectStorage;
113 _ImageObjectImpl::CreateImageObjectN()
115 ImageObject* object = new ImageObject;
119 } } } //Tizen::Uix::Vision