1 #ifndef DALI_TOOLKIT_INTERNAL_SPREAD_FILTER_H
2 #define DALI_TOOLKIT_INTERNAL_SPREAD_FILTER_H
5 * Copyright (c) 2019 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.
22 #include <dali/public-api/render-tasks/render-task.h>
25 #include "image-filter.h"
37 * A spread/thicken filter. Expands an image into transparent areas.
39 class SpreadFilter : public ImageFilter
50 virtual ~SpreadFilter();
53 * Set the amount of spread in pixels.
54 * @param[in] spread The amount of spread
56 void SetSpread( float spread );
58 public: // From ImageFilter
59 /// @copydoc Dali::Toolkit::Internal::ImageFilter::Enable
60 virtual void Enable();
62 /// @copydoc Dali::Toolkit::Internal::ImageFilter::Disable
63 virtual void Disable();
65 /// @copydoc Dali::Toolkit::Internal::ImageFilter::Refresh
66 virtual void Refresh();
68 /// @copydoc Dali::Toolkit::Internal::ImageFilter::SetSize
69 virtual void SetSize( const Vector2& size );
74 * Setup render tasks for blur
76 void CreateRenderTasks();
79 SpreadFilter( const SpreadFilter& );
80 SpreadFilter& operator=( const SpreadFilter& );
82 private: // Attributes
84 // To perform horizontal spread from mInputTexture to mFrameBufferForHorz
85 RenderTask mRenderTaskForHorz;
87 FrameBuffer mFrameBufferForHorz;
89 // To perform vertical spread from mFrameBufferForHorz to mOutputFrameBuffer
90 RenderTask mRenderTaskForVert;
94 }; // class SpreadFilter
96 } // namespace Internal
98 } // namespace Toolkit
102 #endif // DALI_TOOLKIT_INTERNAL_SPREAD_FILTER_H