X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Factors%2Fimage-actor-impl.h;h=a9e2f6fac67dcde1f9808bafdf42e4beba7d5168;hb=8b0b50bb14b39e34a119c573cad63fd03c96b09a;hp=d89970c1ff46e1d333cbec914c6024ce4d4a4440;hpb=1f2225607eeb5dd96fa7e282abf0d6a470a7693b;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/actors/image-actor-impl.h b/dali/internal/event/actors/image-actor-impl.h index d89970c..a9e2f6f 100644 --- a/dali/internal/event/actors/image-actor-impl.h +++ b/dali/internal/event/actors/image-actor-impl.h @@ -21,10 +21,12 @@ // INTERNAL INCLUDES #include #include +#include +#include #include -#include -#include +#include #include +#include #include namespace Dali @@ -48,11 +50,10 @@ class Image; * mImageAttachment's member object. The first one points to the Image object that is going to * be displayed next, the second one to the Image that is currently being displayed. */ -class ImageActor : public RenderableActor +class ImageActor : public Actor { public: - typedef Dali::ImageActor::Style Style; typedef Dali::ImageActor::PixelArea PixelArea; /** @@ -76,12 +77,7 @@ public: * Retrieve the image rendered by the actor's attachment. * @return smart pointer to the image or an empty one if no image is assigned */ - ImagePtr GetImage(); - - /** - * @copydoc Dali::ImageActor::SetToNaturalSize() - */ - void SetToNaturalSize(); + ImagePtr GetImage() const; /** * @copydoc Dali::ImageActor::SetPixelArea() @@ -106,78 +102,175 @@ public: /** * @copydoc Dali::ImageActor::SetStyle() */ - void SetStyle( Style style ); + void SetStyle( Dali::ImageActor::Style style ); /** * @copydoc Dali::ImageActor::GetStyle() */ - Style GetStyle() const; + Dali::ImageActor::Style GetStyle() const; /** - * @copydoc Dali::ImageActor::SetNinePatchBorder + * @copydoc Dali::ImageActor::SetNinePatchBorder() */ - void SetNinePatchBorder( const Vector4& border, bool inPixels = false ); + void SetNinePatchBorder( const Vector4& border ); /** - * @copydoc Dali::ImageActor::GetNinePatchBorder + * @copydoc Dali::ImageActor::GetNinePatchBorder() */ Vector4 GetNinePatchBorder() const; /** - * Retrieve the attachment which renders the image. - * @return The attachment. + * @copydoc Dali::RenderableActor::SetSortModifier() + */ + void SetSortModifier(float modifier); + + /** + * @copydoc Dali::RenderableActor::GetSortModifier() + */ + float GetSortModifier() const; + + /** + * @copydoc Dali::RenderableActor::SetCullFace() + */ + void SetCullFace(CullFaceMode mode); + + /** + * @copydoc Dali::RenderableActor::GetCullFace() + */ + CullFaceMode GetCullFace() const; + + /** + * @copydoc Dali::RenderableActor::SetBlendMode() */ - ImageAttachment& GetImageAttachment(); + void SetBlendMode( BlendingMode::Type mode ); -public: // Default property extensions from ProxyObject + /** + * @copydoc Dali::RenderableActor::GetBlendMode() + */ + BlendingMode::Type GetBlendMode() const; + + /** + * @copydoc Dali::RenderableActor::SetBlendFunc() + */ + void SetBlendFunc( BlendingFactor::Type srcFactorRgba, BlendingFactor::Type destFactorRgba ); /** - * @copydoc Dali::Internal::ProxyObject::GetDefaultPropertyCount() + * @copydoc Dali::RenderableActor::SetBlendFunc() + */ + void SetBlendFunc( BlendingFactor::Type srcFactorRgb, BlendingFactor::Type destFactorRgb, + BlendingFactor::Type srcFactorAlpha, BlendingFactor::Type destFactorAlpha ); + + /** + * @copydoc Dali::RenderableActor::GetBlendFunc() + */ + void GetBlendFunc( BlendingFactor::Type& srcFactorRgb, BlendingFactor::Type& destFactorRgb, + BlendingFactor::Type& srcFactorAlpha, BlendingFactor::Type& destFactorAlpha ) const; + + /** + * @copydoc Dali::RenderableActor::SetBlendEquation() + */ + void SetBlendEquation( BlendingEquation::Type equationRgba ); + + /** + * @copydoc Dali::RenderableActor::SetBlendEquation() + */ + void SetBlendEquation( BlendingEquation::Type equationRgb, BlendingEquation::Type equationAlpha ); + + /** + * @copydoc Dali::RenderableActor::GetBlendEquation() + */ + void GetBlendEquation( BlendingEquation::Type& equationRgb, BlendingEquation::Type& equationAlpha ) const; + + /** + * @copydoc Dali::RenderableActor::SetBlendColor() + */ + void SetBlendColor( const Vector4& color ); + + /** + * @copydoc Dali::RenderableActor::GetBlendColor() + */ + const Vector4& GetBlendColor() const; + + /** + * @copydoc Dali::RenderableActor::SetFilterMode() + */ + void SetFilterMode( FilterMode::Type minFilter, FilterMode::Type magFilter ); + + /** + * @copydoc Dali::RenderableActor::GetFilterMode() + */ + void GetFilterMode( FilterMode::Type& minFilter, FilterMode::Type& magFilter ) const; + + /** + * @brief Allows this ImageActor to respond to the eventa that the shader effect's effect texture has been changed + */ + void EffectImageUpdated(); + +public: + /** + * @copydoc Actor::SetShaderEffect + */ + virtual void SetShaderEffect(ShaderEffect& effect); + + /** + * @copydoc Actor::GetShaderEffect + */ + virtual ShaderEffectPtr GetShaderEffect() const; + + /** + * @copydoc Actor::RemoveShaderEffect + */ + virtual void RemoveShaderEffect(); + +public: // Default property extensions from Object + + /** + * @copydoc Dali::Internal::Object::GetDefaultPropertyCount() */ virtual unsigned int GetDefaultPropertyCount() const; /** - * @copydoc Dali::Internal::ProxyObject::GetDefaultPropertyIndices() + * @copydoc Dali::Internal::Object::GetDefaultPropertyIndices() */ virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const; /** - * @copydoc Dali::Internal::ProxyObject::GetDefaultPropertyName() + * @copydoc Dali::Internal::Object::GetDefaultPropertyName() */ - virtual const std::string& GetDefaultPropertyName(Property::Index index) const; + virtual const char* GetDefaultPropertyName(Property::Index index) const; /** - * @copydoc Dali::Internal::ProxyObject::GetDefaultPropertyIndex() + * @copydoc Dali::Internal::Object::GetDefaultPropertyIndex() */ virtual Property::Index GetDefaultPropertyIndex(const std::string& name) const; /** - * @copydoc Dali::Internal::ProxyObject::IsDefaultPropertyWritable() + * @copydoc Dali::Internal::Object::IsDefaultPropertyWritable() */ virtual bool IsDefaultPropertyWritable(Property::Index index) const; /** - * @copydoc Dali::Internal::ProxyObject::IsDefaultPropertyAnimatable() + * @copydoc Dali::Internal::Object::IsDefaultPropertyAnimatable() */ virtual bool IsDefaultPropertyAnimatable(Property::Index index) const; /** - * @copydoc Dali::Internal::ProxyObject::IsDefaultPropertyAConstraintInput() + * @copydoc Dali::Internal::Object::IsDefaultPropertyAConstraintInput() */ virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const; /** - * @copydoc Dali::Internal::ProxyObject::GetDefaultPropertyType() + * @copydoc Dali::Internal::Object::GetDefaultPropertyType() */ virtual Property::Type GetDefaultPropertyType(Property::Index index) const; /** - * @copydoc Dali::Internal::ProxyObject::SetDefaultProperty() + * @copydoc Dali::Internal::Object::SetDefaultProperty() */ virtual void SetDefaultProperty(Property::Index index, const Property::Value& propertyValue); /** - * @copydoc Dali::Internal::ProxyObject::GetDefaultProperty() + * @copydoc Dali::Internal::Object::GetDefaultProperty() */ virtual Property::Value GetDefaultProperty( Property::Index index ) const; @@ -188,13 +281,6 @@ public: // From Actor */ virtual Vector3 GetNaturalSize() const; -private: // From RenderableActor - - /** - * @copydoc RenderableActor::GetRenderableAttachment - */ - virtual RenderableAttachment& GetRenderableAttachment() const; - protected: /** @@ -210,11 +296,6 @@ protected: private: /** - * Helper to set the actor to the image's natural size - */ - void SetNaturalSize(); - - /** * Calculate the natural size of this image actor * * @return Return the natural size as a Vector2 @@ -222,37 +303,30 @@ private: Vector2 CalculateNaturalSize() const; /** - * From Actor. - * This is called after SizeSet() has been called. + * Update the grid geometry. */ - virtual void OnSizeSet( const Vector3& targetSize ); + void UpdateGeometry(); /** - * @copydoc Actor::OnSizeAnimation( Animation& animation, const Vector3& targetSize ) + * Update the texture rect uniform */ - virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize); - - /** - * From Actor; used to trigger fade-in animations. - */ - virtual void OnStageConnectionInternal(); - - /** - * From Actor; used to notify Image. - */ - virtual void OnStageDisconnectionInternal(); + void UpdateTexureRect(); private: - ImageAttachmentPtr mImageAttachment; ///< Used to display the image (holds a pointer to currently showed Image) - - // flags, compressed to bitfield (uses only 1 byte) - bool mUsingNaturalSize:1; ///< True only when the actor is using - bool mInternalSetSize:1; ///< True whilst setting size internally, false at all other times - - static bool mFirstInstance ; - static DefaultPropertyLookup* mDefaultImageActorPropertyLookup; ///< Default properties - + ShaderEffectPtr mShaderEffect; ///< Optional referenced shader effect + RendererPtr mRenderer; ///< The renderer used to render the image + PixelArea mPixelArea; ///< The pixel area of the image to render + Vector4 mBlendColor; ///< The blend color for this ImageActor + Vector4 mNinePatchBorder; ///< Nine-patch not supported, but this is used to store what is set so it can be returned for backwards compatibility. + Uint16Pair mGridSize; ///< The geometry grid size + int mRendererIndex; ///< The index location of mRenderer + size_t mTextureIndex; ///< The texture index for this ImageActor's texture + size_t mEffectTextureIndex; ///< The texture index for this ImageActor's effect texture + FilterMode::Type mMinFilter; ///< The minification filter currently set + FilterMode::Type mMagFilter; ///< The magnification filter currently set + Dali::ImageActor::Style mStyle; ///< The style set by SetStyle. Not used internally, only used to store what is set so it can be returned for backwards compatibility. + bool mIsPixelAreaSet; ///< Flag indicating if the pixel area has been set }; } // namespace Internal