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 Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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.
24 #include <dali/dali.h>
25 #include "image-filter.h"
37 * A two pass blur filter, pass one performs a horizontal blur and pass two performs a
38 * vertical blur on the result of pass one.
40 class BlurTwoPassFilter : public ImageFilter
51 virtual ~BlurTwoPassFilter();
53 public: // From ImageFilter
54 /// @copydoc Dali::Toolkit::Internal::ImageFilter::Enable
55 virtual void Enable();
57 /// @copydoc Dali::Toolkit::Internal::ImageFilter::Disable
58 virtual void Disable();
60 /// @copydoc Dali::Toolkit::Internal::ImageFilter::Refresh
61 virtual void Refresh();
64 * Get the property index that controls the strength of the blur applied to the image. Useful for animating this property.
65 * This property represents a value in the range [0.0 - 1.0] where 0.0 is no blur and 1.0 is full blur.
67 Property::Index GetBlurStrengthPropertyIndex() const {return mBlurStrengthPropertyIndex;}
70 * Retrieve the constrainable object to animate or constrain the blur strength property
71 * @return the constrainable object which blend the output image according to the blur strength
73 Constrainable GetHandleForAnimateBlurStrength();
77 * Setup position and parameters for camera
82 * Setup render tasks for blur
84 void CreateRenderTasks();
87 BlurTwoPassFilter( const BlurTwoPassFilter& );
88 BlurTwoPassFilter& operator=( const BlurTwoPassFilter& );
90 private: // Attributes
92 CameraActor mCameraForBlur;
94 // To perform horizontal blur from mInputImage to mImageForHorz
95 RenderTask mRenderTaskForHorz;
96 ImageActor mActorForInput;
97 FrameBufferImage mImageForHorz;
98 ShaderEffect mShaderForHorz;
100 // To perform vertical blur from mImageForHorz to mOutputImage
101 RenderTask mRenderTaskForVert;
102 ImageActor mActorForHorz;
103 ShaderEffect mShaderForVert;
104 FrameBufferImage mBlurredImage;
106 // To blend the blurred image and input image according to the blur strength
107 RenderTask mRenderTaskForBlending;
108 ImageActor mActorForBlending;
109 Actor mRootActorForBlending;
110 ShaderEffect mShaderForBlending;
111 Property::Index mBlurStrengthPropertyIndex;
113 }; // class BlurTwoPassFilter
115 } // namespace Internal
117 } // namespace Toolkit
121 #endif // __DALI_TOOLKIT_INTERNAL_BLUR_TWO_PASS_FILTER_H__