Include required header files directly rather than through dali.h
[platform/core/uifw/dali-toolkit.git] / optional / dali-toolkit / internal / filters / spread-filter.h
1 #ifndef __DALI_TOOLKIT_INTERNAL_SPREAD_FILTER_H__
2 #define __DALI_TOOLKIT_INTERNAL_SPREAD_FILTER_H__
3
4 /*
5  * Copyright (c) 2014 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/actors/camera-actor.h>
23 #include <dali/public-api/actors/image-actor.h>
24 #include <dali/public-api/render-tasks/render-task.h>
25 #include <dali/public-api/shader-effects/shader-effect.h>
26
27 // INTERNAL INCLUDES
28 #include "image-filter.h"
29
30 namespace Dali
31 {
32
33 namespace Toolkit
34 {
35
36 namespace Internal
37 {
38
39 /**
40  * A spread/thicken filter. Expands an image into transparent areas.
41  */
42 class SpreadFilter : public ImageFilter
43 {
44 public:
45   /**
46    * Default constructor
47    */
48   SpreadFilter();
49
50   /**
51    * Destructor
52    */
53   virtual ~SpreadFilter();
54
55   /**
56    * Set the amount of spread in pixels.
57    * @param[in] spread The amount of spread
58    */
59   void SetSpread( float spread );
60
61 public: // From ImageFilter
62   /// @copydoc Dali::Toolkit::Internal::ImageFilter::Enable
63   virtual void Enable();
64
65   /// @copydoc Dali::Toolkit::Internal::ImageFilter::Disable
66   virtual void Disable();
67
68   /// @copydoc Dali::Toolkit::Internal::ImageFilter::Refresh
69   virtual void Refresh();
70
71 private:
72   /**
73    * Setup position and parameters for camera
74    */
75   void SetupCamera();
76
77   /**
78    * Setup render tasks for blur
79    */
80   void CreateRenderTasks();
81
82 private:
83   SpreadFilter( const SpreadFilter& );
84   SpreadFilter& operator=( const SpreadFilter& );
85
86 private: // Attributes
87   int              mSpread;
88   CameraActor      mCameraActor;
89
90   // To perform horizontal spread from mInputImage to mImageForHorz
91   RenderTask       mRenderTaskForHorz;
92   ImageActor       mActorForInput;
93   FrameBufferImage mImageForHorz;
94   ShaderEffect     mShaderForHorz;
95
96   // To perform vertical spread from mImageForHorz to mOutputImage
97   RenderTask       mRenderTaskForVert;
98   ImageActor       mActorForHorz;
99   ShaderEffect     mShaderForVert;
100 }; // class SpreadFilter
101
102 } // namespace Internal
103
104 } // namespace Toolkit
105
106 } // namespace Dali
107
108 #endif // __DALI_TOOLKIT_INTERNAL_SPREAD_FILTER_H__
109