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