Remove the usage of deprecated Button APIS
[platform/core/uifw/dali-demo.git] / examples / motion-blur / motion-blur-example.cpp
1 /*
2  * Copyright (c) 2017 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 #include <sstream>
19 #include <iomanip>
20
21 #include "shared/view.h"
22 #include <dali/dali.h>
23 #include <dali-toolkit/dali-toolkit.h>
24 #include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
25 #include <dali-toolkit/devel-api/shader-effects/motion-blur-effect.h>
26
27 using namespace Dali;
28 using namespace Dali::Toolkit;
29
30
31
32 namespace // unnamed namespace
33 {
34
35 ////////////////////////////////////////////////////
36 //
37 // Demo setup parameters
38 //
39
40 //#define MULTIPLE_MOTION_BLURRED_ACTORS
41 #ifndef MULTIPLE_MOTION_BLURRED_ACTORS
42
43 const float MOTION_BLUR_ACTOR_WIDTH = 256;                                          // actor size on screen
44 const float MOTION_BLUR_ACTOR_HEIGHT = 256;                                         // ""
45
46 #else //#ifndef MULTIPLE_MOTION_BLURRED_ACTORS
47
48 const float MOTION_BLUR_ACTOR_WIDTH = 150;                                          // actor size on screen
49 const float MOTION_BLUR_ACTOR_HEIGHT = 112;                                         // ""
50
51 #endif //#ifndef MULTIPLE_MOTION_BLURRED_ACTORS
52
53
54 const unsigned int MOTION_BLUR_NUM_SAMPLES = 8;
55
56 const int MOTION_BLUR_NUM_ACTOR_IMAGES = 5;
57 const char* MOTION_BLUR_ACTOR_IMAGE1( DEMO_IMAGE_DIR "image-with-border-1.jpg" );
58 const char* MOTION_BLUR_ACTOR_IMAGE2( DEMO_IMAGE_DIR "image-with-border-2.jpg" );
59 const char* MOTION_BLUR_ACTOR_IMAGE3( DEMO_IMAGE_DIR "image-with-border-3.jpg" );
60 const char* MOTION_BLUR_ACTOR_IMAGE4( DEMO_IMAGE_DIR "image-with-border-4.jpg" );
61 const char* MOTION_BLUR_ACTOR_IMAGE5( DEMO_IMAGE_DIR "image-with-border-1.jpg" );
62
63 const char* MOTION_BLUR_ACTOR_IMAGES[] = {
64   MOTION_BLUR_ACTOR_IMAGE1,
65   MOTION_BLUR_ACTOR_IMAGE2,
66   MOTION_BLUR_ACTOR_IMAGE3,
67   MOTION_BLUR_ACTOR_IMAGE4,
68   MOTION_BLUR_ACTOR_IMAGE5,
69 };
70
71 const int NUM_ACTOR_ANIMATIONS = 4;
72 const int NUM_CAMERA_ANIMATIONS = 2;
73
74
75 const char* BACKGROUND_IMAGE_PATH = DEMO_IMAGE_DIR "background-default.png";
76
77 const char* TOOLBAR_IMAGE( DEMO_IMAGE_DIR "top-bar.png" );
78 const char* LAYOUT_IMAGE( DEMO_IMAGE_DIR "icon-change.png" );
79 const char* LAYOUT_IMAGE_SELECTED( DEMO_IMAGE_DIR "icon-change-selected.png" );
80 const char* APPLICATION_TITLE( "Motion Blur" );
81 const char* EFFECTS_OFF_ICON( DEMO_IMAGE_DIR "icon-effects-off.png" );
82 const char* EFFECTS_OFF_ICON_SELECTED( DEMO_IMAGE_DIR "icon-effects-off-selected.png" );
83 const char* EFFECTS_ON_ICON( DEMO_IMAGE_DIR "icon-effects-on.png" );
84 const char* EFFECTS_ON_ICON_SELECTED( DEMO_IMAGE_DIR "icon-effects-on-selected.png" );
85
86 const float UI_MARGIN = 4.0f;                              ///< Screen Margin for placement of UI buttons
87
88 const Vector3 BUTTON_SIZE_CONSTRAINT( 0.24f, 0.09f, 1.0f );
89 const Vector3 BUTTON_TITLE_LABEL_TAP_HERE_SIZE_CONSTRAINT( 0.55f, 0.06f, 1.0f );
90 const Vector3 BUTTON_TITLE_LABEL_INSTRUCTIONS_POPUP_SIZE_CONSTRAINT( 1.0f, 1.0f, 1.0f );
91
92 // move this button down a bit so it is visible on target and not covered up by toolbar
93 const float BUTTON_TITLE_LABEL_Y_OFFSET = 0.05f;
94
95 const float ORIENTATION_DURATION = 0.5f;                  ///< Time to rotate to new orientation.
96
97 /**
98  * @brief Set an image to image view, scaled-down to no more than the dimensions passed in.
99  *
100  * Uses SHRINK_TO_FIT which ensures the resulting image is
101  * smaller than or equal to the specified dimensions while preserving its original aspect ratio.
102  */
103 void SetImageFittedInBox( ImageView& imageView, Property::Map& shaderEffect, const char * const imagePath, int maxWidth, int maxHeight )
104 {
105   Property::Map map;
106   map[Visual::Property::TYPE] = Visual::IMAGE;
107   map[ImageVisual::Property::URL] = imagePath;
108   // Load the image nicely scaled-down to fit within the specified max width and height:
109   map[ImageVisual::Property::DESIRED_WIDTH] = maxWidth;
110   map[ImageVisual::Property::DESIRED_HEIGHT] = maxHeight;
111   map[ImageVisual::Property::FITTING_MODE] = FittingMode::SHRINK_TO_FIT;
112   map[ImageVisual::Property::SAMPLING_MODE] = SamplingMode::BOX_THEN_LINEAR;
113   map.Merge( shaderEffect );
114
115   imageView.SetProperty( ImageView::Property::IMAGE, map );
116 }
117
118 } // unnamed namespace
119
120
121 //
122 class MotionBlurExampleApp : public ConnectionTracker
123 {
124 public:
125
126   /**
127      * DeviceOrientation describes the four different
128      * orientations the device can be in based on accelerometer reports.
129      */
130   enum DeviceOrientation
131   {
132     PORTRAIT = 0,
133     LANDSCAPE = 90,
134     PORTRAIT_INVERSE = 180,
135     LANDSCAPE_INVERSE = 270
136   };
137
138   /**
139    * Constructor
140    * @param application class, stored as reference
141    */
142   MotionBlurExampleApp(Application &app)
143   : mApplication(app),
144     mActorEffectsEnabled(false),
145     mCurrentActorAnimation(0),
146     mCurrentImage(0),
147     mOrientation( PORTRAIT )
148   {
149     // Connect to the Application's Init signal
150     app.InitSignal().Connect(this, &MotionBlurExampleApp::OnInit);
151   }
152
153   ~MotionBlurExampleApp()
154   {
155     // Nothing to do here; everything gets deleted automatically
156   }
157
158   /**
159    * This method gets called once the main loop of application is up and running
160    */
161   void OnInit(Application& app)
162   {
163     // The Init signal is received once (only) during the Application lifetime
164
165     Stage::GetCurrent().KeyEventSignal().Connect(this, &MotionBlurExampleApp::OnKeyEvent);
166
167
168     // Creates a default view with a default tool bar.
169     // The view is added to the stage.
170     mContentLayer = DemoHelper::CreateView( mApplication,
171                                             mView,
172                                             mToolBar,
173                                             BACKGROUND_IMAGE_PATH,
174                                             TOOLBAR_IMAGE,
175                                             APPLICATION_TITLE );
176
177     //Add an effects icon on the right of the title
178     mActorEffectsButton = Toolkit::PushButton::New();
179     mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECTS_OFF_ICON );
180     mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECTS_OFF_ICON_SELECTED );
181     mActorEffectsButton.ClickedSignal().Connect( this, &MotionBlurExampleApp::OnEffectButtonClicked );
182     mToolBar.AddControl( mActorEffectsButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalCenter, DemoHelper::DEFAULT_PLAY_PADDING );
183
184     // Creates a mode button.
185     // Create a effect toggle button. (right of toolbar)
186     Toolkit::PushButton layoutButton = Toolkit::PushButton::New();
187     layoutButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, LAYOUT_IMAGE );
188     layoutButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, LAYOUT_IMAGE_SELECTED );
189     layoutButton.ClickedSignal().Connect( this, &MotionBlurExampleApp::OnLayoutButtonClicked);
190     layoutButton.SetLeaveRequired( true );
191     mToolBar.AddControl( layoutButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
192
193     // Input
194     mTapGestureDetector = TapGestureDetector::New();
195     mTapGestureDetector.Attach( mContentLayer );
196     mTapGestureDetector.DetectedSignal().Connect( this, &MotionBlurExampleApp::OnTap );
197
198     Dali::Window winHandle = app.GetWindow();
199     winHandle.AddAvailableOrientation( Dali::Window::PORTRAIT );
200     winHandle.AddAvailableOrientation( Dali::Window::LANDSCAPE );
201     winHandle.AddAvailableOrientation( Dali::Window::PORTRAIT_INVERSE  );
202     winHandle.AddAvailableOrientation( Dali::Window::LANDSCAPE_INVERSE );
203
204     // set initial orientation
205     unsigned int degrees = 0;
206     Rotate( static_cast< DeviceOrientation >( degrees ) );
207
208
209     ///////////////////////////////////////////////////////
210     //
211     // Motion blurred actor
212     //
213
214     // Scale down actor to fit on very low resolution screens with space to interact:
215     Size stageSize = Stage::GetCurrent().GetSize();
216     mMotionBlurActorSize = Size( std::min( stageSize.x * 0.3f, MOTION_BLUR_ACTOR_WIDTH ), std::min( stageSize.y * 0.3f, MOTION_BLUR_ACTOR_HEIGHT ) );
217     mMotionBlurActorSize = Size( std::min( mMotionBlurActorSize.x, mMotionBlurActorSize.y ), std::min( mMotionBlurActorSize.x, mMotionBlurActorSize.y ) );
218
219     mMotionBlurEffect = CreateMotionBlurEffect();
220     mMotionBlurImageView = ImageView::New();
221     SetImageFittedInBox( mMotionBlurImageView, mMotionBlurEffect, MOTION_BLUR_ACTOR_IMAGE1, mMotionBlurActorSize.x, mMotionBlurActorSize.y );
222     mMotionBlurImageView.SetParentOrigin( ParentOrigin::CENTER );
223     mMotionBlurImageView.SetSize(mMotionBlurActorSize.x, mMotionBlurActorSize.y);
224
225     mContentLayer.Add( mMotionBlurImageView );
226
227     // Create shader used for doing motion blur
228     mMotionBlurEffect = CreateMotionBlurEffect();
229
230     // set actor shader to the blur one
231     Toolkit::SetMotionBlurProperties( mMotionBlurImageView, MOTION_BLUR_NUM_SAMPLES );
232
233
234 #ifdef MULTIPLE_MOTION_BLURRED_ACTORS
235
236     ///////////////////////////////////////////////////////
237     //
238     // Motion blurred actor 2
239     //
240
241     mMotionBlurImageView2 = ImageView::New(image);
242     mMotionBlurImageView2.SetParentOrigin( ParentOrigin::CENTER );
243     mMotionBlurImageView2.SetSize(mMotionBlurActorSize.x, mMotionBlurActorSize.y);
244     mMotionBlurImageView2.SetPosition(mMotionBlurActorSize.x * 1.1f, 0.0f);
245     mMotionBlurImageView.Add( mMotionBlurImageView2 );
246
247     // set actor shader to the blur one
248     Toolkit::SetMotionBlurProperties( mMotionBlurImageView2, MOTION_BLUR_NUM_SAMPLES );
249     mMotionBlurImageView2.SetProperty( Toolkit::ImageView::Property::IMAGE, mMotionBlurEffect );
250
251
252     ///////////////////////////////////////////////////////
253     //
254     // Motion blurred actor 3
255     //
256
257     mMotionBlurImageView3 = ImageView::New(image);
258     mMotionBlurImageView3.SetParentOrigin( ParentOrigin::CENTER );
259     mMotionBlurImageView3.SetSize(mMotionBlurActorSize.x, mMotionBlurActorSize.y);
260     mMotionBlurImageView3.SetPosition(-mMotionBlurActorSize.x * 1.1f, 0.0f);
261     mMotionBlurImageView.Add( mMotionBlurImageView3 );
262
263     // set actor shader to the blur one
264     Toolkit::SetMotionBlurProperties( mMotionBlurImageView3, MOTION_BLUR_NUM_SAMPLES );
265     mMotionBlurImageView3.SetProperty( Toolkit::ImageView::Property::IMAGE, mMotionBlurEffect );
266
267
268     ///////////////////////////////////////////////////////
269     //
270     // Motion blurred actor 4
271     //
272
273     mMotionBlurImageView4 = ImageView::New(image);
274     mMotionBlurImageView4.SetParentOrigin( ParentOrigin::CENTER );
275     mMotionBlurImageView4.SetSize(mMotionBlurActorSize.x, mMotionBlurActorSize.y);
276     mMotionBlurImageView4.SetPosition(0.0f, mMotionBlurActorSize.y * 1.1f);
277     mMotionBlurImageView.Add( mMotionBlurImageView4 );
278
279     // set actor shader to the blur one
280     Toolkit::SetMotionBlurProperties( mMotionBlurImageView4, MOTION_BLUR_NUM_SAMPLES );
281     mMotionBlurImageView4.SetProperty( Toolkit::ImageView::Property::IMAGE, mMotionBlurEffect );
282
283     ///////////////////////////////////////////////////////
284     //
285     // Motion blurred actor 5
286     //
287
288     mMotionBlurImageView5 = ImageView::New(image);
289     mMotionBlurImageView5.SetParentOrigin( ParentOrigin::CENTER );
290     mMotionBlurImageView5.SetSize(mMotionBlurActorSize.x, mMotionBlurActorSize.y);
291     mMotionBlurImageView5.SetPosition(0.0f, -mMotionBlurActorSize.y * 1.1f);
292     mMotionBlurImageView.Add( mMotionBlurImageView5 );
293
294     // set actor shader to the blur one
295     Toolkit::SetMotionBlurProperties( mMotionBlurImageView5, MOTION_BLUR_NUM_SAMPLES );
296     mMotionBlurImageView5.SetProperty( Toolkit::ImageView::Property::IMAGE, mMotionBlurEffect );
297 #endif //#ifdef MULTIPLE_MOTION_BLURRED_ACTORS
298   }
299
300   void Rotate( DeviceOrientation orientation )
301   {
302     // Resize the root actor
303     Vector2 stageSize = Stage::GetCurrent().GetSize();
304     Vector2 targetSize = stageSize;
305     if( orientation == LANDSCAPE ||
306         orientation == LANDSCAPE_INVERSE )
307     {
308       targetSize = Vector2( stageSize.y, stageSize.x );
309     }
310
311     if( mOrientation != orientation )
312     {
313       mOrientation = orientation;
314
315       // check if actor is on stage
316       if( mView.GetParent() )
317       {
318         // has parent so we expect it to be on stage, start animation
319         mRotateAnimation = Animation::New( ORIENTATION_DURATION );
320         mRotateAnimation.AnimateTo( Property( mView, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( -orientation ) ), Vector3::ZAXIS ), AlphaFunction::EASE_OUT );
321         mRotateAnimation.AnimateTo( Property( mView, Actor::Property::SIZE_WIDTH ), targetSize.width );
322         mRotateAnimation.AnimateTo( Property( mView, Actor::Property::SIZE_HEIGHT ), targetSize.height );
323         mRotateAnimation.Play();
324       }
325       else
326       {
327         // set the rotation to match the orientation
328         mView.SetOrientation( Degree( -orientation ), Vector3::ZAXIS );
329         mView.SetSize( targetSize );
330       }
331     }
332     else
333     {
334       // for first time just set size
335       mView.SetSize( targetSize );
336     }
337   }
338
339
340   //////////////////////////////////////////////////////////////
341   //
342   // Actor Animation
343   //
344   //
345
346   // move to point on screen that was tapped
347   void OnTap( Actor actor, const TapGesture& tapGesture )
348   {
349     Vector3 destPos;
350     float originOffsetX, originOffsetY;
351
352     // rotate offset (from top left origin to centre) into actor space
353     Vector2 stageSize = Dali::Stage::GetCurrent().GetSize();
354     actor.ScreenToLocal(originOffsetX, originOffsetY, stageSize.width * 0.5f, stageSize.height * 0.5f);
355
356     // get dest point in local actor space
357     destPos.x = tapGesture.localPoint.x - originOffsetX;
358     destPos.y = tapGesture.localPoint.y - originOffsetY;
359     destPos.z = 0.0f;
360
361     float animDuration = 0.5f;
362     mActorTapMovementAnimation = Animation::New( animDuration );
363     if ( mMotionBlurImageView )
364     {
365       mActorTapMovementAnimation.AnimateTo( Property(mMotionBlurImageView, Actor::Property::POSITION), destPos, AlphaFunction::EASE_IN_OUT_SINE, TimePeriod(animDuration) );
366     }
367     mActorTapMovementAnimation.SetEndAction( Animation::Bake );
368     mActorTapMovementAnimation.Play();
369
370
371     // perform some spinning etc
372     if(mActorEffectsEnabled)
373     {
374       switch(mCurrentActorAnimation)
375       {
376         // spin around y
377         case 0:
378         {
379           float animDuration = 1.0f;
380           mActorAnimation = Animation::New(animDuration);
381           mActorAnimation.AnimateBy( Property( mMotionBlurImageView, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::YAXIS ), AlphaFunction::EASE_IN_OUT );
382           mActorAnimation.SetEndAction( Animation::Bake );
383           mActorAnimation.Play();
384         }
385         break;
386
387         // spin around z
388         case 1:
389         {
390           float animDuration = 1.0f;
391           mActorAnimation = Animation::New(animDuration);
392           mActorAnimation.AnimateBy( Property( mMotionBlurImageView, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::ZAXIS ), AlphaFunction::EASE_IN_OUT );
393           mActorAnimation.SetEndAction( Animation::Bake );
394           mActorAnimation.Play();
395         }
396         break;
397
398         // spin around y and z
399         case 2:
400         {
401           float animDuration = 1.0f;
402           mActorAnimation = Animation::New(animDuration);
403           mActorAnimation.AnimateBy( Property( mMotionBlurImageView, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::YAXIS ), AlphaFunction::EASE_IN_OUT );
404           mActorAnimation.AnimateBy( Property( mMotionBlurImageView, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::ZAXIS ), AlphaFunction::EASE_IN_OUT );
405           mActorAnimation.SetEndAction( Animation::Bake );
406           mActorAnimation.Play();
407         }
408         break;
409
410         // scale
411         case 3:
412         {
413           float animDuration = 1.0f;
414           mActorAnimation = Animation::New(animDuration);
415           mActorAnimation.AnimateBy( Property( mMotionBlurImageView, Actor::Property::SCALE ), Vector3(2.0f, 2.0f, 2.0f), AlphaFunction::BOUNCE, TimePeriod( 0.0f, 1.0f ) );
416           mActorAnimation.SetEndAction( Animation::Bake );
417           mActorAnimation.Play();
418         }
419         break;
420
421         default:
422           break;
423       }
424
425       mCurrentActorAnimation++;
426       if(NUM_ACTOR_ANIMATIONS == mCurrentActorAnimation)
427       {
428         mCurrentActorAnimation = 0;
429       }
430     }
431   }
432
433   void ToggleActorEffects()
434   {
435     if(!mActorEffectsEnabled)
436     {
437       mActorEffectsEnabled = true;
438       mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECTS_ON_ICON );
439       mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECTS_ON_ICON_SELECTED );
440     }
441     else
442     {
443       mActorEffectsEnabled = false;
444       mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECTS_OFF_ICON );
445       mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECTS_OFF_ICON_SELECTED );
446     }
447   }
448
449   //////////////////////////////////////////////////////////////
450   //
451   // Input handlers
452   //
453   //
454
455   bool OnLayoutButtonClicked( Toolkit::Button button )
456   {
457     ChangeImage();
458     return true;
459   }
460
461   bool OnEffectButtonClicked( Toolkit::Button button )
462   {
463     ToggleActorEffects();
464     return true;
465   }
466
467   /**
468    * Main key event handler
469    */
470   void OnKeyEvent(const KeyEvent& event)
471   {
472     if(event.state == KeyEvent::Down)
473     {
474       if( IsKey( event, Dali::DALI_KEY_ESCAPE) || IsKey( event, Dali::DALI_KEY_BACK) )
475       {
476         mApplication.Quit();
477       }
478     }
479   }
480
481   //////////////////////////////////////////////////////////////
482   //
483   // Misc
484   //
485   //
486
487
488   void ChangeImage()
489   {
490     mCurrentImage++;
491     if(MOTION_BLUR_NUM_ACTOR_IMAGES == mCurrentImage)
492     {
493       mCurrentImage = 0;
494     }
495     SetImageFittedInBox( mMotionBlurImageView, mMotionBlurEffect, MOTION_BLUR_ACTOR_IMAGES[mCurrentImage], mMotionBlurActorSize.x, mMotionBlurActorSize.y );
496
497 #ifdef MULTIPLE_MOTION_BLURRED_ACTORS
498     mMotionBlurImageView2.SetImage(blurImage);
499     mMotionBlurImageView3.SetImage(blurImage);
500     mMotionBlurImageView4.SetImage(blurImage);
501     mMotionBlurImageView5.SetImage(blurImage);
502 #endif
503   }
504
505
506 private:
507   Application&               mApplication;            ///< Application instance
508   Toolkit::Control           mView;
509   Toolkit::ToolBar           mToolBar;
510
511   Layer                      mContentLayer;           ///< Content layer (contains actor for this blur demo)
512
513   PushButton                 mActorEffectsButton;     ///< The actor effects toggling Button.
514
515   // Motion blur
516   Property::Map mMotionBlurEffect;
517   ImageView mMotionBlurImageView;
518   Size mMotionBlurActorSize;
519
520 #ifdef MULTIPLE_MOTION_BLURRED_ACTORS
521   ImageView mMotionBlurImageView2;
522   ImageView mMotionBlurImageView3;
523   ImageView mMotionBlurImageView4;
524   ImageView mMotionBlurImageView5;
525 #endif //#ifdef MULTIPLE_MOTION_BLURRED_ACTORS
526
527   // animate actor to position where user taps screen
528   Animation mActorTapMovementAnimation;
529
530   // show different animations to demonstrate blur effect working on an object only movement basis
531   bool mActorEffectsEnabled;
532   Animation mActorAnimation;
533   int mCurrentActorAnimation;
534
535   // offer a selection of images that user can cycle between
536   int mCurrentImage;
537
538   TapGestureDetector mTapGestureDetector;
539
540   DeviceOrientation mOrientation;               ///< Current Device orientation
541   Animation mRotateAnimation;                   ///< Animation for rotating between landscape and portrait.
542 };
543
544 void RunTest(Application& app)
545 {
546   MotionBlurExampleApp test(app);
547
548   app.MainLoop();
549 }
550
551 // Entry point for Linux & Tizen applications
552 //
553 int DALI_EXPORT_API main(int argc, char **argv)
554 {
555   Application app = Application::New(&argc, &argv, DEMO_THEME_PATH);
556
557   RunTest(app);
558
559   return 0;
560 }