X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fimage-view%2Fimage-view-impl.h;h=334754b4d63ef1b50f92404a3287a45577fabdf8;hp=e912e4cba83b15d927d1bb6a7c155a0980da81a7;hb=4019119f94f02948f2dc26a8495d44d1143c684a;hpb=93865ae71c4937b0301c7160f9b1496b81c5af3e diff --git a/dali-toolkit/internal/controls/image-view/image-view-impl.h b/dali-toolkit/internal/controls/image-view/image-view-impl.h index e912e4c..334754b 100644 --- a/dali-toolkit/internal/controls/image-view/image-view-impl.h +++ b/dali-toolkit/internal/controls/image-view/image-view-impl.h @@ -1,8 +1,8 @@ -#ifndef __DALI_TOOLKIT_INTERNAL_IMAGE_VIEW_H__ -#define __DALI_TOOLKIT_INTERNAL_IMAGE_VIEW_H__ +#ifndef DALI_TOOLKIT_INTERNAL_IMAGE_VIEW_H +#define DALI_TOOLKIT_INTERNAL_IMAGE_VIEW_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 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,9 +19,10 @@ */ // EXTERNAL INCLUDES -#include +#include // INTERNAL INCLUDES +#include #include #include @@ -37,7 +38,7 @@ namespace Internal { class ImageView : public Control { - protected: +protected: /** * Construct a new ImageView. @@ -57,15 +58,42 @@ public: static Toolkit::ImageView New(); /** - * @copydoc Dali::Toolkit::SetImage( Image image ) + * @copydoc Dali::Toolkit::SetImage */ void SetImage( Image image ); /** - * @copydoc Dali::Toolkit::Image GetImage() const + * @brief Sets this ImageView from an Dali::Property::Map + * + * If the handle is empty, ImageView will display nothing + * @param[in] map The Dali::Property::Map to use for to display. + */ + void SetImage( const Dali::Property::Map& map ); + + /** + * @copydoc Dali::Toolkit::SetImage + */ + void SetImage( const std::string& imageUrl, ImageDimensions size ); + + /** + * @copydoc Dali::Toolkit::GetImage */ Image GetImage() const; + /** + * @brief Set whether the Pre-multiplied Alpha Blending is required + * + * @param[in] preMultipled whether alpha is pre-multiplied. + */ + void EnablePreMultipliedAlpha( bool preMultipled ); + + /** + * @brief Query whether alpha is pre-multiplied. + * + * @return True is alpha is pre-multiplied, false otherwise. + */ + bool IsPreMultipliedAlphaEnabled() const; + // Properties /** * Called when a property of an object of this type is set. @@ -83,17 +111,21 @@ public: */ static Property::Value GetProperty( BaseObject* object, Property::Index propertyIndex ); -private: // From Control - /** - * @copydoc Toolkit::Control::OnRelayout() + * @brief Set the depth index of this image renderer + * + * Renderer with higher depth indices are rendered in front of other visuals with smaller values + * + * @param[in] depthIndex The depth index of this renderer */ - virtual void OnRelayout( const Vector2& size, RelayoutContainer& container ); + void SetDepthIndex( int depthIndex ); + +private: // From Control /** - * @copydoc Toolkit::Control::OnStageConnect() + * @copydoc Toolkit::Control::OnInitialize */ - virtual void OnStageConnection( int depth ); + void OnInitialize(); /** * @copydoc Toolkit::Control::GetNaturalSize @@ -110,22 +142,34 @@ private: // From Control */ virtual float GetWidthForHeight( float height ); + /** + * @copydoc Toolkit::Control::OnRelayout() + */ + virtual void OnRelayout( const Vector2& size, RelayoutContainer& container ); + private: + /** - * Attaches mImage member to the renderer, creating the renderers, samplers, meshes and materials if needed - * - * @pre mImage has been initialised + * @brief Callback for ResourceReadySignal + * param[in] control signal prototype */ - void AttachImage(); + void OnResourceReady( Toolkit::Control control ); + +private: + // Undefined + ImageView( const ImageView& ); + ImageView& operator=( const ImageView& ); private: + Toolkit::Visual::Base mVisual; + + std::string mUrl; ///< the url for the image if the image came from a URL, empty otherwise + Image mImage; ///< the Image if the image came from a Image, null otherwise + Property::Map mPropertyMap; ///< the Property::Map if the image came from a Property::Map, empty otherwise + Property::Map mShaderMap; ///< the Property::Map if the custom shader is set, empty otherwise + ImageDimensions mImageSize; ///< the image size - Sampler mSampler; - Material mMaterial; - Geometry mMesh; - Renderer mRenderer; - Image mImage; - std::string mImageUrl; + bool mImageVisualPaddingSetByTransform :1; //< Flag to indicate Padding was set using a transform. }; } // namespace Internal @@ -149,4 +193,4 @@ inline const Toolkit::Internal::ImageView& GetImpl( const Toolkit::ImageView& ob } // namespace Dali -#endif // __DALI_TOOLKIT_INTERNAL_IMAGE_VIEW_H__ +#endif // DALI_TOOLKIT_INTERNAL_IMAGE_VIEW_H