665100b46480cdf658e6f1ab65f20387aec99f98
[platform/core/uifw/dali-toolkit.git] / optional / dali-toolkit / public-api / controls / image-view / masked-image-view.cpp
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // INTERNAL INCLUDES
19 #include <dali-toolkit/public-api/controls/image-view/masked-image-view.h>
20 #include <dali-toolkit/internal/controls/image-view/masked-image-view-impl.h>
21
22 namespace Dali
23 {
24
25 namespace Toolkit
26 {
27
28 const float MaskedImageView::DEFAULT_MAXIMUM_SOURCE_SCALE(3.0f);
29
30 MaskedImageView::MaskedImageView()
31 {
32 }
33
34 MaskedImageView::MaskedImageView( const MaskedImageView& handle )
35 : Control( handle )
36 {
37 }
38
39 MaskedImageView& MaskedImageView::operator=( const MaskedImageView& handle )
40 {
41   if( &handle != this )
42   {
43     Control::operator=( handle );
44   }
45   return *this;
46 }
47
48 MaskedImageView::~MaskedImageView()
49 {
50 }
51
52 MaskedImageView MaskedImageView::New( unsigned int targetWidth,
53                                       unsigned int targetHeight,
54                                       Image sourceImage,
55                                       Image maskImage )
56 {
57   return Internal::MaskedImageView::New( targetWidth, targetHeight, sourceImage, maskImage );
58 }
59
60 MaskedImageView MaskedImageView::DownCast( BaseHandle handle )
61 {
62   return Control::DownCast<MaskedImageView, Internal::MaskedImageView>( handle );
63 }
64
65 void MaskedImageView::SetSourceImage( Image sourceImage )
66 {
67   GetImpl(*this).SetSourceImage( sourceImage );
68 }
69
70 Image MaskedImageView::GetSourceImage()
71 {
72   return GetImpl(*this).GetSourceImage();
73 }
74
75 void MaskedImageView::SetMaskImage( Image sourceImage )
76 {
77   GetImpl(*this).SetMaskImage( sourceImage );
78 }
79
80 Image MaskedImageView::GetMaskImage()
81 {
82   return GetImpl(*this).GetMaskImage();
83 }
84
85 Property::Index MaskedImageView::GetPropertyIndex( MaskedImageView::CustomProperty customProperty ) const
86 {
87   return GetImpl(*this).GetPropertyIndex( customProperty );
88 }
89
90 void MaskedImageView::Pause()
91 {
92   GetImpl(*this).Pause();
93 }
94
95 void MaskedImageView::Resume()
96 {
97   GetImpl(*this).Resume();
98 }
99
100 bool MaskedImageView::IsPaused() const
101 {
102   return GetImpl(*this).IsPaused();
103 }
104
105 void MaskedImageView::SetEditMode( MaskedImageView::EditMode editMode )
106 {
107   GetImpl(*this).SetEditMode( editMode );
108 }
109
110 MaskedImageView::EditMode MaskedImageView::GetEditMode() const
111 {
112   return GetImpl(*this).GetEditMode();
113 }
114
115 void MaskedImageView::SetSourceAspectRatio( float widthOverHeight )
116 {
117   GetImpl(*this).SetSourceAspectRatio( widthOverHeight );
118 }
119
120 float MaskedImageView::GetSourceAspectRatio() const
121 {
122   return GetImpl(*this).GetSourceAspectRatio();
123 }
124
125 void MaskedImageView::SetMaximumSourceScale( float scale )
126 {
127   GetImpl(*this).SetMaximumSourceScale( scale );
128 }
129
130 float MaskedImageView::GetMaximumSourceScale() const
131 {
132   return GetImpl(*this).GetMaximumSourceScale();
133 }
134
135 void MaskedImageView::SetSourceRotation( MaskedImageView::ImageRotation rotation )
136 {
137   GetImpl(*this).SetSourceRotation( rotation );
138 }
139
140 MaskedImageView::ImageRotation MaskedImageView::GetSourceRotation() const
141 {
142   return GetImpl(*this).GetSourceRotation();
143 }
144
145 Dali::RenderTask::RenderTaskSignalV2& MaskedImageView::RenderFinishedSignal()
146 {
147   return GetImpl(*this).RenderFinishedSignal();
148 }
149
150 MaskedImageView::MaskedImageViewSignal& MaskedImageView::MaskFinishedSignal()
151 {
152   return GetImpl(*this).MaskFinishedSignal();
153 }
154
155 MaskedImageView::MaskedImageView(Internal::MaskedImageView& implementation)
156 : Control(implementation)
157 {
158 }
159
160 MaskedImageView::MaskedImageView( Dali::Internal::CustomActor* internal )
161 : Control( internal )
162 {
163   VerifyCustomActorPointer<Internal::MaskedImageView>(internal);
164 }
165
166 } // namespace Toolkit
167
168 } // namespace Dali