X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fbloom-view%2Fbloom-view-impl.h;h=06f2e154612640d5bc3d1a2272da86c402c7aa65;hb=b8da2e53925b9abb9fa362560069e8ca4aa62f81;hp=9f6e64badf3ef066954c2da630101afb21daa391;hpb=b97b29c76acefabbae2c0a4e9ecc261bf9dd8036;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/bloom-view/bloom-view-impl.h b/dali-toolkit/internal/controls/bloom-view/bloom-view-impl.h index 9f6e64b..06f2e15 100644 --- a/dali-toolkit/internal/controls/bloom-view/bloom-view-impl.h +++ b/dali-toolkit/internal/controls/bloom-view/bloom-view-impl.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_INTERNAL_BLOOM_VIEW_H /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,28 +19,26 @@ */ // EXTERNAL INCLUDES -#include -#include #include #include +#include +#include +#include // INTERNAL INCLUDES -#include +#include #include +#include #include -#include namespace Dali { - namespace Toolkit { - class BloomView; namespace Internal { - /** * BloomEffect implementation class */ @@ -55,8 +53,7 @@ public: /** * @copydoc Dali::Toolkit::BloomView::BloomView */ - BloomView(const unsigned int numSamples, const float blurBellCurveWidth, const Pixel::Format renderTargetPixelFormat, - const float downsampleWidthScale, const float downsampleHeightScale); + BloomView(const unsigned int numSamples, const float blurBellCurveWidth, const Pixel::Format renderTargetPixelFormat, const float downsampleWidthScale, const float downsampleHeightScale); /** * @copydoc Dali::Toolkit::BloomView::~BloomView @@ -67,32 +64,48 @@ public: * @copydoc Dali::Toolkit::BloomView::New */ static Dali::Toolkit::BloomView New(); - static Dali::Toolkit::BloomView New( const unsigned int numSamples, const float blurBellCurveWidth, const Pixel::Format renderTargetPixelFormat, - const float downsampleWidthScale, const float downsampleHeightScale); - void Activate(); - void Deactivate(); - - Property::Index GetBloomThresholdPropertyIndex() const {return mBloomThresholdPropertyIndex;} - Property::Index GetBlurStrengthPropertyIndex() const {return mBlurStrengthPropertyIndex;} - Property::Index GetBloomIntensityPropertyIndex() const {return mBloomIntensityPropertyIndex;} - Property::Index GetBloomSaturationPropertyIndex() const {return mBloomSaturationPropertyIndex;} - Property::Index GetImageIntensityPropertyIndex() const {return mImageIntensityPropertyIndex;} - Property::Index GetImageSaturationPropertyIndex() const {return mImageSaturationPropertyIndex;} + static Dali::Toolkit::BloomView New(const unsigned int numSamples, const float blurBellCurveWidth, const Pixel::Format renderTargetPixelFormat, const float downsampleWidthScale, const float downsampleHeightScale); + void Activate(); + void Deactivate(); + + Property::Index GetBloomThresholdPropertyIndex() const + { + return mBloomThresholdPropertyIndex; + } + Property::Index GetBlurStrengthPropertyIndex() const + { + return mBlurStrengthPropertyIndex; + } + Property::Index GetBloomIntensityPropertyIndex() const + { + return mBloomIntensityPropertyIndex; + } + Property::Index GetBloomSaturationPropertyIndex() const + { + return mBloomSaturationPropertyIndex; + } + Property::Index GetImageIntensityPropertyIndex() const + { + return mImageIntensityPropertyIndex; + } + Property::Index GetImageSaturationPropertyIndex() const + { + return mImageSaturationPropertyIndex; + } private: - - virtual void OnInitialize(); - virtual void OnSizeSet(const Vector3& targetSize); + void OnInitialize() override; + void OnSizeSet(const Vector3& targetSize) override; /** * @copydoc Control::OnChildAdd() */ - virtual void OnChildAdd( Actor& child ); + void OnChildAdd(Actor& child) override; /** * @copydoc Control::OnChildRemove() */ - virtual void OnChildRemove( Actor& child ); + void OnChildRemove(Actor& child) override; void AllocateResources(); void CreateRenderTasks(); @@ -100,11 +113,10 @@ private: void SetupProperties(); - ///////////////////////////////////////////////////////////// - unsigned int mBlurNumSamples; // number of blur samples in each of horiz/vert directions - float mBlurBellCurveWidth; // constant used when calculating the gaussian weights - Pixel::Format mPixelFormat; // pixel format used by render targets + unsigned int mBlurNumSamples; // number of blur samples in each of horiz/vert directions + float mBlurBellCurveWidth; // constant used when calculating the gaussian weights + Pixel::Format mPixelFormat; // pixel format used by render targets ///////////////////////////////////////////////////////////// // downsampling is used for the separated blur passes to get increased blur with the same number of samples and also to make rendering quicker @@ -113,7 +125,6 @@ private: float mDownsampledWidth; float mDownsampledHeight; - ///////////////////////////////////////////////////////////// // for checking if we need to reallocate render targets Vector2 mTargetSize; @@ -132,14 +143,14 @@ private: ///////////////////////////////////////////////////////////// // for rendering all user added children to offscreen target - FrameBufferImage mRenderTargetForRenderingChildren; - RenderTask mRenderChildrenTask; + FrameBuffer mRenderTargetForRenderingChildren; + RenderTask mRenderChildrenTask; ///////////////////////////////////////////////////////////// // for extracting bright parts of image to an offscreen target - FrameBufferImage mBloomExtractTarget; // for rendering bright parts of image into separate texture, also used as target for gaussian blur - RenderTask mBloomExtractTask; - Toolkit::ImageView mBloomExtractImageView; + FrameBuffer mBloomExtractTarget; // for rendering bright parts of image into separate texture, also used as target for gaussian blur + RenderTask mBloomExtractTask; + Actor mBloomExtractActor; ///////////////////////////////////////////////////////////// // for blurring extracted bloom @@ -149,12 +160,12 @@ private: // for compositing bloom and children renders to offscreen target RenderTask mCompositeTask; - Toolkit::ImageView mCompositeImageView; + Actor mCompositeActor; ///////////////////////////////////////////////////////////// // for holding blurred result - FrameBufferImage mOutputRenderTarget; - Toolkit::ImageView mTargetImageView; + FrameBuffer mOutputRenderTarget; + Actor mTargetActor; ///////////////////////////////////////////////////////////// // Properties for setting by user, e.g. by animations @@ -165,28 +176,27 @@ private: Property::Index mImageIntensityPropertyIndex; Property::Index mImageSaturationPropertyIndex; - bool mActivated:1; + bool mActivated : 1; private: - // Undefined copy constructor. - BloomView( const BloomView& ); + BloomView(const BloomView&); // Undefined assignment operator. - BloomView& operator=( const BloomView& ); + BloomView& operator=(const BloomView&); }; } // namespace Internal // Helpers for public-api forwarding methods -inline Toolkit::Internal::BloomView& GetImpl( Toolkit::BloomView& obj ) +inline Toolkit::Internal::BloomView& GetImpl(Toolkit::BloomView& obj) { DALI_ASSERT_ALWAYS(obj); Dali::RefObject& handle = obj.GetImplementation(); return static_cast(handle); } -inline const Toolkit::Internal::BloomView& GetImpl( const Toolkit::BloomView& obj ) +inline const Toolkit::Internal::BloomView& GetImpl(const Toolkit::BloomView& obj) { DALI_ASSERT_ALWAYS(obj); const Dali::RefObject& handle = obj.GetImplementation();