X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fdevel-api%2Fcontrols%2Feffects-view%2Feffects-view.h;h=60df47311e9ff4a9cce82d8767de19d5e0516362;hb=90168515fb4b80ff64c068769420c0235a225d71;hp=2255e1f3dc12620cf538d96f1c2ae8855ffbdef0;hpb=f58b8383147de70affa1e3949cf1c6757d705d3c;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/devel-api/controls/effects-view/effects-view.h b/dali-toolkit/devel-api/controls/effects-view/effects-view.h index 2255e1f..60df473 100644 --- a/dali-toolkit/devel-api/controls/effects-view/effects-view.h +++ b/dali-toolkit/devel-api/controls/effects-view/effects-view.h @@ -1,8 +1,8 @@ -#ifndef __DALI_TOOLKIT_EFFECTS_VIEW_H__ -#define __DALI_TOOLKIT_EFFECTS_VIEW_H__ +#ifndef DALI_TOOLKIT_EFFECTS_VIEW_H +#define DALI_TOOLKIT_EFFECTS_VIEW_H /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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,58 +19,47 @@ */ // EXTERNAL INCLUDES -#include +#include // INTERNAL INCLUDES #include namespace Dali { - namespace Toolkit { - namespace Internal DALI_INTERNAL { - class EffectsView; -} // namespace Internal +} // namespace DALI_INTERNAL /** * EffectsView: Applies an effect to a tree of actors * * Example usage: Applying an emboss effect * ... - * EffectsView effectsView = EffectsView::New(); + * EffectsView effectsView = EffectsView::New( Toolkit::EffectsView::EMBOSS ); * * // set position and format - * effectsView.SetParentOrigin( ParentOrigin::CENTER ); - * effectsView.SetSize( Vector2( width, height) ); + * effectsView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + * effectsView.SetProperty( Actor::Property::SIZE, Vector2( width, height) ); * effectsView.SetPixelFormat( Pixel::RGBA8888 ); * * // set effect type and properties - * effectsView.SetType( Toolkit::EffectsView::EMBOSS ); * effectsView.SetProperty( effectsView.GetEffectSizePropertyIndex(), static_cast< float >( shadowSize ) ); * effectsView.SetProperty( effectsView.GetEffectOffsetPropertyIndex(), Vector3( shadowDistance.x, shadowDistance.y, 0.0f ) ); * effectsView.SetProperty( effectsView.GetEffectColorPropertyIndex(), shadowColor ); * - * // Render result to an offscreen - * effectsView.SetOutputImage( image ); - * * // Render once * effectsView.SetRefreshOnDemand( true ); * * // optionally set a clear color * effectsView.SetBackgroundColor( Vector4( 0.0f, 0.0f, 0.0f, 0.0f ) ); - * - * // start effect processing - * effectsView.Enable(); */ -class DALI_IMPORT_API EffectsView : public Control +class DALI_TOOLKIT_API EffectsView : public Control { public: - enum EffectType { DROP_SHADOW, @@ -78,12 +67,41 @@ public: INVALID_TYPE }; -public: + /** + * @brief The start and end property ranges for this control. + */ + enum PropertyRange + { + PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1, ///< @SINCE_1_0.0 + PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000, ///< Reserve property indices @SINCE_1_0.0 + + ANIMATABLE_PROPERTY_START_INDEX = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX, ///< @SINCE_1_1.18 + ANIMATABLE_PROPERTY_END_INDEX = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX + 1000 ///< Reserve animatable property indices, @SINCE_1_1.18 + }; /** + * @brief An enumeration of properties belonging to the EffectsView class. + */ + struct Property + { + enum + { + // Event side properties + EFFECT_SIZE = PROPERTY_START_INDEX, ///< name "effectSize", type INTEGER + + // Animatable properties + EFFECT_OFFSET = ANIMATABLE_PROPERTY_START_INDEX, ///< name "effectOffset", type VECTOR3 + EFFECT_COLOR, ///< name "effectColor", type VECTOR4 + }; + }; + +public: + /** * Create an EffectsView object with default configuration + * @param[in] type The type of effect to be performed by the EffectView. + * A member of the EffectType enumeration. */ - static EffectsView New(); + static EffectsView New(EffectType type); /** * Create an uninitialized EffectsView. Only derived versions can be instantiated. @@ -94,12 +112,12 @@ public: /** * Copy constructor. */ - EffectsView( const EffectsView& handle ); + EffectsView(const EffectsView& handle); /** * Assignment operator. */ - EffectsView& operator=( const EffectsView& rhs ); + EffectsView& operator=(const EffectsView& rhs); /** * Downcast an Object handle to EffectsView. If handle points to a EffectsView the @@ -107,7 +125,7 @@ public: * @param[in] handle Handle to an object * @return handle to a EffectsView or an uninitialized handle */ - static EffectsView DownCast( BaseHandle handle ); + static EffectsView DownCast(BaseHandle handle); /** * @brief Destructor @@ -117,14 +135,6 @@ public: ~EffectsView(); public: - - /** - * Set the effect type - * @param[in] type The type of effect to be performed by the EffectView. - * A member of the EffectType enumeration. - */ - void SetType( EffectType type ); - /** * Get the effect type * @return The type of effect performed by the EffectView. A member of the EffectType enumeration. @@ -132,16 +142,6 @@ public: EffectType GetType() const; /** - * Enable the effect - */ - void Enable(); - - /** - * Disable the effect - */ - void Disable(); - - /** * Refresh/Redraw the effect */ void Refresh(); @@ -151,75 +151,38 @@ public: * @param[in] onDemand Set true to enable on demand rendering, call Refresh() whenever a render is required. * Set false to render each frame. (EffectsView refresh mode is set to continuous by default). */ - void SetRefreshOnDemand( bool onDemand ); + void SetRefreshOnDemand(bool onDemand); - /** + /** * Set the pixel format for the output * @param[in] pixelFormat The pixel format for the output */ - void SetPixelFormat( Pixel::Format pixelFormat ); - - /** - * Set the FrameBufferImage that will receive the final output of the EffectsView. - * @param[in] image User supplied FrameBufferImage that will receive the final output of the EffectsView. - */ - void SetOutputImage( FrameBufferImage image ); - - /** - * Get the FrameBufferImage that holds the final output of the EffectsView. - * @return The FrameBufferImage that holds the final output of the EffectsView. - */ - FrameBufferImage GetOutputImage(); - - /** - * Get the property index to the effect size - * @return The property index to the effect size - */ - Dali::Property::Index GetEffectSizePropertyIndex() const; - - /** - * Get the property index to the effect strength - * @return The property index to the effect strength - */ - Dali::Property::Index GetEffectStrengthPropertyIndex() const; - - /** - * Get the property index to the Vector3 specifying the effect offset (eg drop shadow offset) - * @return The property index to the Vector3 specifying the effect offset - */ - Dali::Property::Index GetEffectOffsetPropertyIndex() const; - - /** - * Get the property index to the effect color (eg shadow color) - * @return The property index to the effect color - */ - Dali::Property::Index GetEffectColorPropertyIndex() const; + void SetPixelFormat(Pixel::Format pixelFormat); - /** + /** * Set background color for the view. The background will be filled with this color. * @param[in] color The background color. */ - void SetBackgroundColor( const Vector4& color ); + void SetBackgroundColor(const Vector4& color); - /** + /** * Get the background color. * @return The background color. */ - Vector4 GetBackgroundColor() const; + Vector4 GetBackgroundColor() const; public: // Not intended for application developers - /** * Creates a handle using the Toolkit::Internal implementation. * @param[in] implementation The Control implementation. */ - DALI_INTERNAL EffectsView( Internal::EffectsView& implementation ); + DALI_INTERNAL EffectsView(Internal::EffectsView& implementation); /** * Allows the creation of this Control from an Internal::CustomActor pointer. * @param[in] internal A pointer to the internal CustomActor. */ - explicit DALI_INTERNAL EffectsView( Dali::Internal::CustomActor* internal ); + explicit DALI_INTERNAL EffectsView(Dali::Internal::CustomActor* internal); }; // class EffectsView @@ -227,4 +190,4 @@ public: // Not intended for application developers } // namespace Dali -#endif // __DALI_TOOLKIT_EFFECTS_VIEW_H__ +#endif // DALI_TOOLKIT_EFFECTS_VIEW_H