1 #ifndef __DALI_TOOLKIT_INTERNAL_BLUR_TWO_PASS_FILTER_H__
2 #define __DALI_TOOLKIT_INTERNAL_BLUR_TWO_PASS_FILTER_H__
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
11 // http://floralicense.org/license/
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.
23 #include <dali/dali.h>
24 #include "image-filter.h"
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.
39 class BlurTwoPassFilter : public ImageFilter
50 virtual ~BlurTwoPassFilter();
52 public: // From ImageFilter
53 /// @copydoc Dali::Toolkit::Internal::ImageFilter::Enable
54 virtual void Enable();
56 /// @copydoc Dali::Toolkit::Internal::ImageFilter::Disable
57 virtual void Disable();
59 /// @copydoc Dali::Toolkit::Internal::ImageFilter::Refresh
60 virtual void Refresh();
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.
66 Property::Index GetBlurStrengthPropertyIndex() const {return mBlurStrengthPropertyIndex;}
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
72 Constrainable GetHandleForAnimateBlurStrength();
76 * Setup position and parameters for camera
81 * Setup render tasks for blur
83 void CreateRenderTasks();
86 BlurTwoPassFilter( const BlurTwoPassFilter& );
87 BlurTwoPassFilter& operator=( const BlurTwoPassFilter& );
89 private: // Attributes
91 CameraActor mCameraForBlur;
93 // To perform horizontal blur from mInputImage to mImageForHorz
94 RenderTask mRenderTaskForHorz;
95 ImageActor mActorForInput;
96 FrameBufferImage mImageForHorz;
97 ShaderEffect mShaderForHorz;
99 // To perform vertical blur from mImageForHorz to mOutputImage
100 RenderTask mRenderTaskForVert;
101 ImageActor mActorForHorz;
102 ShaderEffect mShaderForVert;
103 FrameBufferImage mBlurredImage;
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;
112 }; // class BlurTwoPassFilter
114 } // namespace Internal
116 } // namespace Toolkit
120 #endif // __DALI_TOOLKIT_INTERNAL_BLUR_TWO_PASS_FILTER_H__