Scripting: Fix cut&paste typo
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / filters / blur-two-pass-filter.h
1 #ifndef __DALI_TOOLKIT_INTERNAL_BLUR_TWO_PASS_FILTER_H__
2 #define __DALI_TOOLKIT_INTERNAL_BLUR_TWO_PASS_FILTER_H__
3
4 //
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
6 //
7 // Licensed under the Flora License, Version 1.0 (the License);
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 //     http://floralicense.org/license/
12 //
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an AS IS BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
18 //
19
20 // EXTERNAL INCLUDES
21
22 // INTERNAL INCLUDES
23 #include <dali/dali.h>
24 #include "image-filter.h"
25
26 namespace Dali
27 {
28
29 namespace Toolkit
30 {
31
32 namespace Internal
33 {
34
35 /**
36  * A two pass blur filter, pass one performs a horizontal blur and pass two performs a
37  * vertical blur on the result of pass one.
38  */
39 class BlurTwoPassFilter : public ImageFilter
40 {
41 public:
42   /**
43    * Default constructor
44    */
45   BlurTwoPassFilter();
46
47   /**
48    * Destructor
49    */
50   virtual ~BlurTwoPassFilter();
51
52 public: // From ImageFilter
53   /// @copydoc Dali::Toolkit::Internal::ImageFilter::Enable
54   virtual void Enable();
55
56   /// @copydoc Dali::Toolkit::Internal::ImageFilter::Disable
57   virtual void Disable();
58
59   /// @copydoc Dali::Toolkit::Internal::ImageFilter::Refresh
60   virtual void Refresh();
61
62   /**
63    * Get the property index that controls the strength of the blur applied to the image. Useful for animating this property.
64    * This property represents a value in the range [0.0 - 1.0] where 0.0 is no blur and 1.0 is full blur.
65    */
66   Property::Index GetBlurStrengthPropertyIndex() const {return mBlurStrengthPropertyIndex;}
67
68   /**
69    * Retrieve the constrainable object to animate or constrain the blur strength property
70    * @return the constrainable object which blend the output image according to the blur strength
71    */
72   Constrainable GetHandleForAnimateBlurStrength();
73
74 private:
75   /**
76    * Setup position and parameters for camera
77    */
78   void SetupCamera();
79
80   /**
81    * Setup render tasks for blur
82    */
83   void CreateRenderTasks();
84
85 private:
86   BlurTwoPassFilter( const BlurTwoPassFilter& );
87   BlurTwoPassFilter& operator=( const BlurTwoPassFilter& );
88
89 private: // Attributes
90
91   CameraActor      mCameraForBlur;
92
93   // To perform horizontal blur from mInputImage to mImageForHorz
94   RenderTask       mRenderTaskForHorz;
95   ImageActor       mActorForInput;
96   FrameBufferImage mImageForHorz;
97   ShaderEffect     mShaderForHorz;
98
99   // To perform vertical blur from mImageForHorz to mOutputImage
100   RenderTask       mRenderTaskForVert;
101   ImageActor       mActorForHorz;
102   ShaderEffect     mShaderForVert;
103   FrameBufferImage mBlurredImage;
104
105   // To blend the blurred image and input image according to the blur strength
106   RenderTask       mRenderTaskForBlending;
107   ImageActor       mActorForBlending;
108   Actor            mRootActorForBlending;
109   ShaderEffect     mShaderForBlending;
110   Property::Index  mBlurStrengthPropertyIndex;
111
112 }; // class BlurTwoPassFilter
113
114 } // namespace Internal
115
116 } // namespace Toolkit
117
118 } // namespace Dali
119
120 #endif // __DALI_TOOLKIT_INTERNAL_BLUR_TWO_PASS_FILTER_H__
121