Add api for get the internal media player handle of the VideoView
[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) 2019 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
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
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/render-tasks/render-task.h>
23
24 // INTERNAL INCLUDES
25 #include "image-filter.h"
26
27 namespace Dali
28 {
29
30 namespace Toolkit
31 {
32
33 namespace Internal
34 {
35
36 /**
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.
39  */
40 class BlurTwoPassFilter : public ImageFilter
41 {
42 public:
43   /**
44    * Default constructor
45    */
46   BlurTwoPassFilter();
47
48   /**
49    * Destructor
50    */
51   virtual ~BlurTwoPassFilter();
52
53 public: // From ImageFilter
54   /// @copydoc Dali::Toolkit::Internal::ImageFilter::Enable
55   virtual void Enable();
56
57   /// @copydoc Dali::Toolkit::Internal::ImageFilter::Disable
58   virtual void Disable();
59
60   /// @copydoc Dali::Toolkit::Internal::ImageFilter::Refresh
61   virtual void Refresh();
62
63   /// @copydoc Dali::Toolkit::Internal::ImageFilter::SetSize
64   virtual void SetSize( const Vector2& size );
65
66   /**
67    * Get the property index that controls the strength of the blur applied to the image. Useful for animating this property.
68    * This property represents a value in the range [0.0 - 1.0] where 0.0 is no blur and 1.0 is full blur.
69    */
70   Property::Index GetBlurStrengthPropertyIndex() const {return mBlurStrengthPropertyIndex;}
71
72   /**
73    * Retrieve the handle to the object in order to animate or constrain the blur strength property
74    * @return The hadnle to the object which blends the output image according to the blur strength
75    */
76   Handle GetHandleForAnimateBlurStrength();
77
78 private:
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   // To perform horizontal blur from mInputTexture to mFrameBufferForHorz
92   RenderTask         mRenderTaskForHorz;
93   Actor              mActorForInput;
94   FrameBuffer        mFrameBufferForHorz;
95
96   // To perform vertical blur from mFrameBufferForHorz to mOutputFrameBuffer
97   RenderTask         mRenderTaskForVert;
98   Actor              mActorForHorz;
99   FrameBuffer        mBlurredFrameBuffer;
100
101   // To blend the blurred image and input image according to the blur strength
102   RenderTask         mRenderTaskForBlending;
103   Actor              mActorForBlending;
104   Actor              mRootActorForBlending;
105   Property::Index    mBlurStrengthPropertyIndex;
106
107 }; // class BlurTwoPassFilter
108
109 } // namespace Internal
110
111 } // namespace Toolkit
112
113 } // namespace Dali
114
115 #endif // DALI_TOOLKIT_INTERNAL_BLUR_TWO_PASS_FILTER_H
116