Kanzi 3.9.10
kanzi::MaskEffect2D Class Reference

Use MaskEffect2D to apply a mask to 2D nodes. More...

#include <kanzi/core.ui/effect/mask_effect2d.hpp>

Inheritance diagram for kanzi::MaskEffect2D:
[legend]

Public Types

enum class  Channel {
  Alpha , Red , Green , Blue ,
  Luminance
}
 Defines the mask texture channels that you can use as the mask. More...
 
enum class  HorizontalAlignment {
  Left , Right , Center , Stretch ,
  Count
}
 Defines the horizontal alignment modes. More...
 
enum class  Stretch {
  None , Fill , Uniform , UniformToFill ,
  Repeat , Count
}
 Defines the stretch modes. More...
 
enum class  VerticalAlignment {
  Bottom , Top , Center , Stretch ,
  Count
}
 Defines the vertical alignment modes. More...
 
- Public Types inherited from kanzi::PropertyObject
typedef PropertyStorageContainer::const_iterator PropertyStorageConstIterator
 
typedef vector< PropertyStoragePtrPropertyStorageContainer
 
typedef PropertyStorageContainer::iterator PropertyStorageIterator
 
typedef intrusive_ptr< AbstractPropertyTypeDescriptor::PropertyStoragePropertyStoragePtr
 
typedef PropertyStorageContainer::reverse_iterator PropertyStorageReverseIterator
 
- Public Types inherited from kanzi::BindingHostConcept
using BindingHostConceptSharedPtr
 Binding host concept shared pointer type.
 
using BindingRuntimeConstIterator
 Const iterator for binding runtimes.
 
using BindingRuntimeContainer
 Container for binding runtimes.
 
using BindingRuntimeIterator
 Iterator for binding runtimes.
 

Public Member Functions

Channel getChannel () const
 Gets the value of ChannelProperty.
 
float getHeight () const
 Gets the value of HeightProperty.
 
HorizontalAlignment getHorizontalAlignment () const
 Gets the value of HorizontalAlignmentProperty.
 
bool getInvert () const
 Gets the value of InvertProperty.
 
TextureSharedPtr getMask () const
 Gets the value of MaskProperty.
 
Vector2 getOffset () const
 Gets the value of OffsetProperty.
 
Vector2 getScale () const
 Gets the value of ScaleProperty.
 
bool getScreenSpace () const
 Gets the value of ScreenSpaceProperty.
 
float getStrength () const
 Gets the value of StrengthProperty.
 
Stretch getStretch () const
 Gets the value of StretchProperty.
 
VerticalAlignment getVerticalAlignment () const
 Gets the value of VerticalAlignmentProperty.
 
float getWidth () const
 Gets the value of WidthProperty.
 
void setChannel (Channel value)
 Sets the value of ChannelProperty.
 
void setHeight (float value)
 Sets the value of HeightProperty.
 
void setHorizontalAlignment (HorizontalAlignment value)
 Sets the value of HorizontalAlignmentProperty.
 
void setInvert (bool value)
 Sets the value of InvertProperty.
 
void setMask (TextureSharedPtr value)
 Sets the value of MaskProperty.
 
void setOffset (Vector2 value)
 Sets the value of OffsetProperty.
 
void setScale (Vector2 value)
 Sets the value of ScaleProperty.
 
void setScreenSpace (bool value)
 Sets the value of ScreenSpaceProperty.
 
void setStrength (float value)
 Sets the value of StrengthProperty.
 
void setStretch (Stretch value)
 Sets the value of StretchProperty.
 
void setVerticalAlignment (VerticalAlignment value)
 Sets the value of VerticalAlignmentProperty.
 
void setWidth (float value)
 Sets the value of WidthProperty.
 
- Public Member Functions inherited from kanzi::NodeEffect2D
void attach (Node *node)
 Attaches the node effect.
 
BindingLookupContextPtr createLookupContext (NodeEffect2DSharedPtr templateRoot)
 Creates a lookup context for a given effect.
 
NodeEffectRenderer2DUniquePtr createRenderer ()
 Creates a renderer instance.
 
void detach ()
 Detaches the node effect.
 
unsigned int getEffectPaddingChangeCounter () const
 Gets the effect quad padding change counter.
 
Vector4 getEffectQuadPadding () const
 Gets the effect quad padding.
 
Vector2 getEffectQuadPaddingOffset () const
 Gets the effect quad offset relative relative to the top-left corner of the node.
 
Vector2 getEffectQuadPaddingSize () const
 Gets the effect quad padding size.
 
bool getEnabled () const
 Gets the value of EnabledProperty.
 
NodegetHostNode () const
 Gets the node that hosts the effect.
 
NodeEffect2DgetParent () const
 Gets the parent of a node effect.
 
NodeEffectRenderer2DgetRendererInstance () const
 Gets a pointer to NodeEffectRenderer2D instance or null pointer if none exists.
 
NodeEffect2DSharedPtr getTemplateRoot () const
 Gets the template root of this node effect.
 
bool isAlphaRequired () const
 Indicates whether the effect requires alpha channel for the result.
 
bool isAttached () const
 Returns whether a node effect is attached to a node.
 
bool isAttaching () const
 Returns whether a node effect is attaching to a node.
 
bool isDetached () const
 Returns whether a node effect is detached from a node.
 
bool isDetaching () const
 Returns whether a node effect is detaching from a node.
 
bool isRenderingRequired ()
 Indicates whether the effect requires rendering.
 
ObjectSharedPtr lookupObject (string_view relativePath)
 Lookup for an object from the effect.
 
template<typename T >
shared_ptr< TlookupObject (string_view relativePath)
 Lookup a relative object of a given type.
 
void setEffectPaddingChangeCounter (unsigned int value)
 Sets the effect quad padding change counter.
 
void setEnabled (bool value)
 Sets the value of EnabledProperty.
 
void setParent (NodeEffect2D *parent)
 Sets the parent of a node effect.
 
void setTemplateRoot (NodeEffect2DSharedPtr templateRoot)
 Sets the template root for this node effect.
 
void unregisterEffectRenderer (NodeEffectRenderer2D *effectRenderer)
 Unregister effect renderer.
 
 ~NodeEffect2D ()
 
- Public Member Functions inherited from kanzi::Resource
virtual unsigned int getCPUMemoryUsage () const
 Function for getting the memory usage of a resource.
 
const string & getName () const
 Gets the resource name.
 
const string & getUrl () const
 Gets the resource URL.
 
bool isKeepAlive () const
 Tells if the resource has keep alive flag set.
 
void reload ()
 
void reloadFromFile (string_view filePath)
 
void reloadFromKzb (KzbFile &kzbFile, ReadOnlyMemoryFile &file, KzbMemoryParser &parser)
 
void setKeepAlive (bool keepAlive)
 Sets the keep alive flag.
 
void setUrl (string_view url)
 Sets the resource URL.
 
 ~Resource () override
 Destructor.
 
- Public Member Functions inherited from kanzi::Object
AppliedStyleEntrySharedPtr applyObjectStyle (kanzi::StyleSharedPtr style)
 Applies a style to an object.
 
void applyObjectStyles ()
 Apply all styles for an object node.
 
DomaingetDomain () const
 Returns the domain the object belongs to.
 
const MetaclassgetDynamicMetaclass () const override
 Returns the metaclass of the dynamic type of the object.
 
MainLoopSchedulergetMainLoopScheduler () const
 Returns the MainLoopScheduler instance of the associated Domain.
 
detail::MessageDispatcher * getMessageDispatcher () const
 Returns the message dispatcher of the object.
 
ResourceManagergetResourceManager () const
 Returns the resource manager of the object.
 
ScriptingContextSharedPtr getScriptingContext () const
 Gets the scripting context of the object.
 
 Object (Domain *domain)
 
void setScriptingContext (ScriptingContextSharedPtr context)
 Sets the scripting context of the object.
 
void unapplyObjectStyle (AppliedStyleEntrySharedPtr appliedStyleEntry)
 
void unapplyObjectStyles ()
 Unapplies and removes all applied styles.
 
 ~Object () override
 
- Public Member Functions inherited from kanzi::MetaObject
bool isTypeOf (const Metaclass *objectType) const
 Determines if the type of this object is the given type or derived from it.
 
virtual ~MetaObject ()
 
- Public Member Functions inherited from kanzi::PropertyObject
template<typename DataType >
void addPropertyModifier (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::ModifierCallback callback, void *owner)
 
template<typename DataType >
void addPropertyModifierWithoutNotifyingHandlers (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::ModifierCallback callback, void *owner)
 Adds a property modifier without notifying handlers.
 
template<typename DataType >
void addPropertyNotificationHandler (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::NotificationCallback callback, void *owner)
 
template<typename DataType >
void addPropertyValueSource (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::TypedValueSource *valueSource, PropertyValuePrecedence precedence, AbstractPropertyTypeDescriptor::ValueSourceOwner *owner)
 
template<typename DataType >
void addPropertyValueSource (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::TypedValueSource *valueSource, PropertyValuePrecedence precedence, void *ownerPointer)
 
PropertyStorageContainer::iterator beginPropertyStorage ()
 Returns the begin iterator to the internal property storage container.
 
PropertyStorageContainer::const_iterator beginPropertyStorage () const
 Returns the begin iterator to the internal property storage container.
 
void clearPropertyFlag (AbstractPropertyType propertyType, uint32_t flag)
 
void copyLocalValue (const PropertyObject &other, AbstractPropertyType propertyType)
 Copies local value of single property from another object.
 
void copyLocalValues (const PropertyObject &other)
 Copies all local values from another object.
 
PropertyStorageContainer::iterator endPropertyStorage ()
 Returns the end iterator to the internal property storage container.
 
PropertyStorageContainer::const_iterator endPropertyStorage () const
 Returns the end iterator to the internal property storage container.
 
template<typename DataType >
PropertyType< DataType >::Traits::ReturnType getAbstractProperty (AbstractPropertyType abstractPropertyType) const
 
template<typename DataType >
PropertyType< DataType >::Traits::ReturnType getAbstractPropertyBase (AbstractPropertyType abstractPropertyType) const
 
template<typename DataType >
optional< typename PropertyType< DataType >::Traits::ReturnType > getOptionalAbstractProperty (AbstractPropertyType abstractPropertyType) const
 
template<typename DataType >
optional< typename PropertyType< DataType >::Traits::ReturnType > getOptionalProperty (const PropertyType< DataType > &propertyType) const
 Evaluates the property value in the same way as the overload above but does not default to the value in property metadata if there are no inputs to the property value.
 
template<typename DataType >
optional< typename PropertyType< DataType >::Traits::ReturnType > getOptionalPropertyBase (const PropertyType< DataType > &propertyType) const
 Returns the current value of a property disregarding modifiers, but does not default to the value in property metadata if there are no inputs to the property value.
 
template<typename DataType >
PropertyType< DataType >::Traits::ReturnType getProperty (const PropertyType< DataType > &propertyType) const
 Returns the current value of a property type.
 
template<typename DataType >
PropertyType< DataType >::Traits::ReturnType getPropertyBase (const PropertyType< DataType > &propertyType) const
 Returns the current value of a property disregarding modifiers.
 
template<typename DataType >
size_t getPropertyNotificationHandlerCount (const PropertyType< DataType > &propertyType) const
 Gets number of current notification handlers for given property type.
 
bool hasBaseValue (AbstractPropertyType propertyType) const
 Evaluates whether there are any inputs into the property value, disregarding modifiers.
 
bool hasLocalValue (AbstractPropertyType propertyType) const
 Evaluates whether there is a local value set for the property.
 
bool hasNonClassValue (AbstractPropertyType propertyType) const
 Evaluates whether there is a value of any precedence higher than class default value set for the property.
 
bool hasValue (AbstractPropertyType propertyType) const
 Evaluates whether there are any inputs into the property value.
 
bool isPropertyFlagSet (AbstractPropertyType propertyType, uint32_t flag) const
 
 PropertyObject ()
 
void removeKzbProperties ()
 Remove all KZB properties.
 
void removeKzbProperties (flat_set< AbstractPropertyType > *keepProperties)
 Remove all KZB properties that are not included in a given set.
 
template<typename DataType >
void removeLocalPropertyValueSource (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::TypedValueSource *valueSource, void *ownerPointer)
 
void removeLocalValue (AbstractPropertyType propertyType)
 Removes the local value associated with the property.
 
template<typename DataType >
void removePropertyModifier (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::ModifierCallback callback, void *owner)
 
template<typename DataType >
void removePropertyNotificationHandler (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::NotificationCallback callback, void *owner)
 
template<typename DataType >
void removePropertyValueSource (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::TypedValueSource *valueSource, void *ownerPointer)
 
template<typename DataType >
void setAbstractProperty (AbstractPropertyType abstractPropertyType, typename PropertyType< DataType >::Traits::ParameterType value)
 
template<typename DataType >
void setProperty (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Traits::ParameterType value)
 Sets the local value of a property type.
 
void setPropertyFlag (AbstractPropertyType propertyType, uint32_t flag)
 
KZ_DEPRECATED void validatePropertyModifiers (AbstractPropertyType propertyType)
 Validates property modifiers and notifies handlers.
 
void validatePropertyModifiersAndNotifyHandlers (AbstractPropertyType propertyType)
 Validates property modifiers and notifies handlers.
 
virtual ~PropertyObject ()
 
- Public Member Functions inherited from kanzi::BindingHostConceptImpl< NodeEffect2D >
void addBindingRuntime (AbstractBindingRuntimeSharedPtr entry, shared_ptr< void > owner)
 Adds an already-created binding runtime to this binding host.
 
BindingRuntimeHandle setBinding (AbstractBindingSharedPtr binding)
 Wrapper for setting a binding with no target.
 
BindingRuntimeHandle setBinding (AbstractBindingSharedPtr binding, AbstractPropertyType propertyType)
 Wrapper for setting a binding.
 
BindingRuntimeHandle setBinding (AbstractBindingSharedPtr binding, AbstractPropertyType propertyType, PropertyField field)
 Wrapper for setting a binding.
 
BindingRuntimeHandle setBinding (AbstractBindingSharedPtr binding, AbstractPropertyType propertyType, PropertyField field, PropertyValuePrecedence precedence)
 Wrapper for setting a binding.
 
BindingRuntimeHandle setBinding (AbstractBindingSharedPtr binding, AbstractPropertyType propertyType, PropertyValuePrecedence precedence)
 Wrapper for setting a binding.
 
BindingRuntimeHandle setBinding (AbstractBindingSharedPtr binding, shared_ptr< NodeEffect2D > templateRoot)
 Sets a binding with no target.
 
BindingRuntimeHandle setBinding (AbstractBindingSharedPtr binding, shared_ptr< NodeEffect2D > templateRoot, AbstractPropertyType propertyType, PropertyField field)
 Wrapper for setting a binding.
 
BindingRuntimeHandle setBinding (AbstractBindingSharedPtr binding, shared_ptr< NodeEffect2D > templateRoot, AbstractPropertyType propertyType, PropertyField field, PropertyValuePrecedence precedence)
 Wrapper for setting a binding.
 
BindingRuntimeHandle setBinding (AbstractBindingSharedPtr binding, shared_ptr< NodeEffect2D > templateRoot, AbstractPropertyType propertyType, PropertyValuePrecedence precedence)
 Wrapper for setting a binding.
 
BindingRuntimeHandle setBindingWithOwner (AbstractBindingSharedPtr binding, shared_ptr< void > owner)
 Wrapper for setting a binding with no target.
 
BindingRuntimeHandle setBindingWithOwner (AbstractBindingSharedPtr binding, shared_ptr< void > owner, AbstractPropertyType propertyType)
 Wrapper for setting a binding with owner.
 
BindingRuntimeHandle setBindingWithOwner (AbstractBindingSharedPtr binding, shared_ptr< void > owner, AbstractPropertyType propertyType, PropertyField field, PropertyValuePrecedence precedence)
 Wrapper for setting a binding with owner.
 
BindingRuntimeHandle setBindingWithOwner (AbstractBindingSharedPtr binding, shared_ptr< void > owner, shared_ptr< NodeEffect2D > templateRoot)
 Sets a binding with no target.
 
BindingRuntimeHandle setBindingWithOwner (AbstractBindingSharedPtr binding, shared_ptr< void > owner, shared_ptr< NodeEffect2D > templateRoot, AbstractPropertyType propertyType, PropertyField field, PropertyValuePrecedence precedence)
 Sets a binding to a certain property.
 
BindingRuntimeHandle setModifierBinding (AbstractBindingSharedPtr binding, AbstractPropertyType propertyType)
 Wrapper for setting a modifier binding.
 
BindingRuntimeHandle setModifierBinding (AbstractBindingSharedPtr binding, AbstractPropertyType propertyType, PropertyField field)
 Wrapper for setting a modifier binding.
 
BindingRuntimeHandle setModifierBinding (AbstractBindingSharedPtr binding, shared_ptr< NodeEffect2D > templateRoot, AbstractPropertyType propertyType, PropertyField field)
 Wrapper for setting a modifier binding.
 
BindingRuntimeHandle setModifierBindingWithOwner (AbstractBindingSharedPtr binding, shared_ptr< void > owner, AbstractPropertyType propertyType)
 Wrapper for setting a modifier binding.
 
BindingRuntimeHandle setModifierBindingWithOwner (AbstractBindingSharedPtr binding, shared_ptr< void > owner, AbstractPropertyType propertyType, PropertyField field)
 Wrapper for setting a modifier binding.
 
BindingRuntimeHandle setModifierBindingWithOwner (AbstractBindingSharedPtr binding, shared_ptr< void > owner, shared_ptr< NodeEffect2D > templateRoot, AbstractPropertyType propertyType, PropertyField field)
 Sets a modifier binding.
 
- Public Member Functions inherited from kanzi::BindingHostConcept
BindingRuntimeConstIterator beginBindingRuntimes () const
 Returns an iterator to the beginning of binding runtimes.
 
BindingRuntimeConstIterator endBindingRuntimes () const
 Returns an iterator to the end of binding runtimes.
 
AbstractBindingRuntimeSharedPtr getBindingRuntime (size_t idx)
 Gets binding by index.
 
size_t getBindingRuntimeCount () const
 Gets the number of binding runtimes added to this node.
 
void removeAllBindings ()
 Removes all binding runtimes.
 
void removeBinding (BindingRuntimeHandle &bindingRuntime)
 Removes a binding runtime added earlier.
 
void removeBindingsWithOwner (shared_ptr< void > owner)
 Removes all binding runtimes with the specified owner.
 

Static Public Member Functions

static MaskEffect2DSharedPtr create (Domain *domain, string_view name)
 Creates a mask effect.
 
static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 
- Static Public Member Functions inherited from kanzi::Object
static const MetaclassgetStaticMetaclass ()
 Returns the metaclass of Object class.
 
static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 Default implementation that returns empty editor info.
 
- Static Public Member Functions inherited from kanzi::MetaObject
static const MetaclassgetStaticMetaclass ()
 Returns the metaclass of Object class.
 
static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 Default implementation that returns empty editor info.
 

Static Public Attributes

static PropertyType< ChannelChannelProperty
 Sets the mask texture channel to use as the input for the mask:
 
static PropertyType< floatHeightProperty
 Overrides the mask texture height in pixels.
 
static PropertyType< HorizontalAlignmentHorizontalAlignmentProperty
 Sets the horizontal alignment of the mask:
 
static PropertyType< boolInvertProperty
 Indicates whether to invert the mask.
 
static PropertyType< ResourceSharedPtrMaskProperty
 Sets the mask texture.
 
static PropertyType< Vector2OffsetProperty
 Sets the mask offset along the X and Y axes in pixels.
 
static PropertyType< Vector2ScaleProperty
 Sets the factor by which to scale the mask.
 
static PropertyType< boolScreenSpaceProperty
 Indicates whether to layout the mask relative to the screen.
 
static PropertyType< floatStrengthProperty
 Sets the strength of the mask effect.
 
static PropertyType< StretchStretchProperty
 Sets the stretch mode of the mask:
 
static PropertyType< VerticalAlignmentVerticalAlignmentProperty
 Sets the vertical alignment of the mask:
 
static PropertyType< floatWidthProperty
 Overrides the mask texture width in pixels.
 
- Static Public Attributes inherited from kanzi::NodeEffect2D
static PropertyType< boolEnabledProperty
 Sets whether the effect is enabled.
 

Protected Member Functions

NodeEffectRenderer2DUniquePtr createRendererOverride () override
 NodeEffect2D::createRendererOverride implementation.
 
void initializeRendererOverride () override
 NodeEffect2D::initializeRendererOverride implementation.
 
 MaskEffect2D (Domain *domain, string_view name)
 Constructor.
 
virtual void onPropertyChanged (AbstractPropertyType propertyType, PropertyNotificationReason reason) override
 PropertyObject::onPropertyChanged implementation.
 
- Protected Member Functions inherited from kanzi::NodeEffect2D
virtual bool isRenderingRequiredOverride ()
 Implementation-dependent check on whether effect rendering is required.
 
virtual ObjectSharedPtr lookupObjectOverride (string_view initialPart, string_view remainingPart)
 Lookup for an object from the effect.
 
 NodeEffect2D (Domain *domain, string_view name)
 Constructor.
 
virtual void onAttached ()
 Called by Kanzi when effect is attached.
 
virtual void onDetached ()
 Called by Kanzi when effect is detached.
 
void onPropertyChanged (AbstractPropertyType propertyType, PropertyNotificationReason reason) override
 PropertyObject::onPropertyChanged implementation.
 
void setAlphaRequired (bool required)
 Sets the framebuffer alpha channel requirements of the effect.
 
void setEffectQuadPadding (float left, float right, float top, float bottom)
 Sets the padding required by the effect around the node bounds during the rendering of the effect.
 
- Protected Member Functions inherited from kanzi::Resource
virtual unsigned int getCPUMemoryUsageOverride () const
 
virtual void reloadFromFileOverride (string_view filePath)
 
virtual void reloadFromKzbOverride (KzbFile &kzbFile, ReadOnlyMemoryFile &file, KzbMemoryParser &parser)
 
virtual void reloadOverride ()
 
 Resource (Domain *domain, string_view name)
 Constructor.
 
- Protected Member Functions inherited from kanzi::Object
void initialize ()
 
void onCopy (const Object &other)
 
- Protected Member Functions inherited from kanzi::MetaObject
void initialize ()
 
 MetaObject ()
 
- Protected Member Functions inherited from kanzi::PropertyObject
AbstractPropertyTypeDescriptor::ValueSourceEntryacquireLocalValueSourceEntry (AbstractPropertyTypeDescriptor &descriptor, PropertyStoragePtr &propertyStorage)
 Acquires a local value source entry that is free for the assignment of a value.
 
AbstractPropertyTypeDescriptor::ModifierStorageacquireModifierStorage (AbstractPropertyTypeDescriptor &descriptor, AbstractPropertyTypeDescriptor::PropertyStorage &propertyStorage)
 
AbstractPropertyTypeDescriptor::NotificationStorageacquireNotificationStorage (AbstractPropertyTypeDescriptor &descriptor)
 
PropertyStoragePtr acquirePropertyStorage (AbstractPropertyTypeDescriptor &descriptor)
 
template<typename DataType >
void addPropertyModifierBase (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::ModifierCallback callback, void *owner, bool notify)
 Adds a property modifier entry to the property modifier stack and validates them.
 
void addPropertyValueSource (AbstractPropertyTypeDescriptor &descriptor, AbstractPropertyTypeDescriptor::ValueSource *valueSource, PropertyValuePrecedence precedence, AbstractPropertyTypeDescriptor::ValueSourceOwner *owner)
 Internally adds a property value source.
 
void addPropertyValueSource (AbstractPropertyTypeDescriptor &descriptor, AbstractPropertyTypeDescriptor::ValueSource *valueSource, PropertyValuePrecedence precedence, void *ownerPointer)
 Internally adds a property value source.
 
AbstractPropertyTypeDescriptor::ValueSourceEntryconstructLocalValueSourceEntry (AbstractPropertyTypeDescriptor &descriptor, AbstractPropertyTypeDescriptor::PropertyStorage &propertyStorage)
 
PropertyStoragePtr constructPropertyStorage (AbstractPropertyTypeDescriptor &descriptor)
 
void copyLocalValue (const AbstractPropertyTypeDescriptor::PropertyStorage &otherPropertyStorage)
 Copy local value from property storage.
 
AbstractPropertyTypeDescriptor::ModifierStoragefindModifierStorage (AbstractPropertyTypeDescriptor &descriptor)
 
AbstractPropertyTypeDescriptor::NotificationStoragefindNotificationStorage (AbstractPropertyTypeDescriptor &descriptor) const
 
AbstractPropertyTypeDescriptor::PropertyStoragefindPropertyStorage (AbstractPropertyTypeDescriptor &descriptor) const
 Gets the property storage for given property type descriptor.
 
PropertyStoragePtr findPropertyStoragePtr (AbstractPropertyTypeDescriptor &descriptor) const
 Gets property storage intrusive pointer which you can use to hold a reference until the end of the operation.
 
AbstractPropertyTypeDescriptorfindPropertyTypeDescriptorByNameAndDataType (string_view name, PropertyDataType dataType) const
 Finds a property type descriptor by name and data type.
 
AbstractPropertyTypeDescriptorfindPropertyTypeDescriptorByQualifiedNameAndDataType (string_view qualifiedName, PropertyDataType dataType) const
 Like findPropertyTypeDescriptorByNameAndDataType, but only searches by matching with qualified names.
 
AbstractPropertyTypeDescriptorfindPropertyTypeDescriptorByUnqualifiedNameAndDataType (string_view unqualifiedName, PropertyDataType dataType) const
 Like findPropertyTypeDescriptorByNameAndDataType, but only searches by matching with unqualified names.
 
AbstractPropertyTypeDescriptor::ValueSourcegetClassValueSource (AbstractPropertyTypeDescriptor &descriptor) const
 
AbstractPropertyTypeDescriptor::ValueSourcegetFinalValueSource (AbstractPropertyTypeDescriptor &descriptor) const
 
AbstractPropertyTypeDescriptor::ValueSourcegetNonClassValueSource (AbstractPropertyTypeDescriptor &descriptor) const
 
AbstractPropertyTypeDescriptor::ValueSourcegetTopValueSource (AbstractPropertyTypeDescriptor &descriptor) const
 Gets the top-level value source for a given property descriptor.
 
virtual void notifyPropertyHandlers (PropertyStoragePtr &storagePtr, PropertyNotificationReason reason)
 Notifies all property handlers on a property storage.
 
void onCopy (const PropertyObject &other)
 
void removeLocalValue (AbstractPropertyTypeDescriptor &descriptor, PropertyStoragePtr &propertyStorage)
 Removes a local value from the given property storage.
 
void removePropertyValueSource (AbstractPropertyTypeDescriptor &descriptor, AbstractPropertyTypeDescriptor::ValueSource *valueSource, void *owner)
 Removes a property value source.
 
void validatePropertyModifiers (PropertyStoragePtr &propertyStorage)
 Validates property modifiers without notifying handlers.
 
void validatePropertyModifiersAndNotifyHandlers (PropertyStoragePtr &propertyStorage)
 Validates property modifiers and notifies handlers.
 
- Protected Member Functions inherited from kanzi::BindingHostConceptImpl< NodeEffect2D >
NodeEffect2DgetThisObject ()
 Internal accessor for the Curiously Recurring Template Pattern.
 
const NodeEffect2DgetThisObject () const
 Internal accessor for the Curiously Recurring Template Pattern.
 
- Protected Member Functions inherited from kanzi::BindingHostConcept
void attachBindings ()
 Attach all bindings stored in this object.
 
void detachBindings ()
 Detach bindings.
 

Additional Inherited Members

- Protected Types inherited from kanzi::Object
typedef vector< AppliedStyleEntrySharedPtrAppliedStyleContainer
 Applied style container.
 
- Protected Attributes inherited from kanzi::Object
AppliedStyleContainer m_appliedStyles
 Listing of applied styles applied to this object.
 
- Protected Attributes inherited from kanzi::BindingHostConcept
BindingRuntimeContainer m_bindingRuntimes
 Bindings in this object.
 

Detailed Description

Use MaskEffect2D to apply a mask to 2D nodes.

Examples

To create a mask effect:

// Create an effect template for the MaskEffect2D effect prefab.
NodeEffectTemplate2DSharedPtr maskEffectTemplate =
NodeEffectTemplate2D::create(MaskEffect2D::getStaticMetaclass()->getName(), "MaskEffect");
// Create a node effect prefab from the effect template.
NodeEffectPrefab2DSharedPtr maskEffectPrefab =
NodeEffectPrefab2D::create(getDomain(), "MaskEffect prefab", maskEffectTemplate);

To set the mask effect properties:

// Create an effect template.
NodeEffectTemplate2DSharedPtr maskEffectTemplate =
NodeEffectTemplate2D::create(MaskEffect2D::getStaticMetaclass()->getName(), "MaskEffect");
// Set the value of the MaskProperty in the template.
// The MaskProperty defines the mask texture which you must set before you can use the mask effect.
TextureSharedPtr maskTexture = acquireMaskTexture(getDomain());
maskEffectTemplate->addPropertyValue(MaskEffect2D::MaskProperty, Variant(maskTexture));
// Create a mask effect prefab.
NodeEffectPrefab2DSharedPtr maskEffectPrefab =
NodeEffectPrefab2D::create(getDomain(), "MaskEffect prefab", maskEffectTemplate);
// Assign the mask effect to a 2D node.
node2d->setEffectPrefab(maskEffectPrefab);
// Get the node-specific effect instance created from the assigned prefab.
MaskEffect2DSharedPtr maskEffect = dynamic_pointer_cast<MaskEffect2D>(node2d->getEffect());
// Set the mask stretch mode to uniform.
maskEffect->setStretch(MaskEffect2D::Stretch::Uniform);
See also
NodeEffect2D, NodeEffectPrefab2D, NodeEffectTemplate2D, MaskEffectRenderer2D
Since
Kanzi 3.9.0

Member Enumeration Documentation

◆ VerticalAlignment

Defines the vertical alignment modes.

Enumerator
Bottom 

Aligns the bottom edge of the mask with the bottom edge of the node.

Top 

Aligns the top edge of the mask with the top edge of the node.

Center 

Centers the mask vertically in the node.

Stretch 

Stretches the mask vertically to fit the node from the top edge to the bottom edge.

Count 

The number of vertical alignment modes.

◆ HorizontalAlignment

Defines the horizontal alignment modes.

Enumerator
Left 

Aligns the left edge of the mask with the left edge of the node.

Right 

Aligns the right edge of the mask with the right edge of the node.

Center 

Centers the mask horizontally in the node.

Stretch 

Stretches the mask horizontally to fit the node from the left edge to the right edge.

Count 

The number of horizontal alignment modes.

◆ Stretch

Defines the stretch modes.

Enumerator
None 

Does not stretch the mask.

Fill 

Stretches the mask to fill the node.

Uniform 

Stretches the mask using uniform scaling to fill the node in either vertical or horizontal direction, whichever requires smaller scale.

UniformToFill 

Stretches the mask using uniform scaling to fill the node in either vertical or horizontal direction, whichever requires larger scale.

Repeat 

Does not stretch the mask, and allows the mask to repeat outside of its area based on the mask texture wrap mode.

Count 

The number of stretch modes.

◆ Channel

Defines the mask texture channels that you can use as the mask.

Enumerator
Alpha 

Uses the alpha channel as the mask.

Red 

Uses the red color channel as the mask.

Green 

Uses the green color channel as the mask.

Blue 

Uses the blue color channel as the mask.

Luminance 

Uses the luminance calculated from the red, green, and blue color channels as the mask.

Constructor & Destructor Documentation

◆ MaskEffect2D()

kanzi::MaskEffect2D::MaskEffect2D ( Domain * domain,
string_view name )
explicitprotected

Constructor.

Parameters
domainDomain to use.
nameResource name.

Member Function Documentation

◆ getMask()

TextureSharedPtr kanzi::MaskEffect2D::getMask ( ) const
inline

Gets the value of MaskProperty.

See also
setMask()

◆ setMask()

void kanzi::MaskEffect2D::setMask ( TextureSharedPtr value)
inline

Sets the value of MaskProperty.

See also
getMask()

◆ getHeight()

float kanzi::MaskEffect2D::getHeight ( ) const
inline

Gets the value of HeightProperty.

See also
setHeight()

◆ setHeight()

void kanzi::MaskEffect2D::setHeight ( float value)
inline

Sets the value of HeightProperty.

See also
getHeight()

◆ getWidth()

float kanzi::MaskEffect2D::getWidth ( ) const
inline

Gets the value of WidthProperty.

See also
setWidth()

◆ setWidth()

void kanzi::MaskEffect2D::setWidth ( float value)
inline

Sets the value of WidthProperty.

See also
getWidth()

◆ getOffset()

Vector2 kanzi::MaskEffect2D::getOffset ( ) const
inline

Gets the value of OffsetProperty.

See also
setOffset()

◆ setOffset()

void kanzi::MaskEffect2D::setOffset ( Vector2 value)
inline

Sets the value of OffsetProperty.

See also
getOffset()

◆ getScale()

Vector2 kanzi::MaskEffect2D::getScale ( ) const
inline

Gets the value of ScaleProperty.

See also
setScale()

◆ setScale()

void kanzi::MaskEffect2D::setScale ( Vector2 value)
inline

Sets the value of ScaleProperty.

See also
getScale()

◆ getStretch()

Stretch kanzi::MaskEffect2D::getStretch ( ) const
inline

Gets the value of StretchProperty.

See also
setStretch()

◆ setStretch()

void kanzi::MaskEffect2D::setStretch ( Stretch value)
inline

Sets the value of StretchProperty.

See also
getStretch()

◆ getVerticalAlignment()

VerticalAlignment kanzi::MaskEffect2D::getVerticalAlignment ( ) const
inline

◆ setVerticalAlignment()

void kanzi::MaskEffect2D::setVerticalAlignment ( VerticalAlignment value)
inline

◆ getHorizontalAlignment()

HorizontalAlignment kanzi::MaskEffect2D::getHorizontalAlignment ( ) const
inline

◆ setHorizontalAlignment()

void kanzi::MaskEffect2D::setHorizontalAlignment ( HorizontalAlignment value)
inline

◆ getScreenSpace()

bool kanzi::MaskEffect2D::getScreenSpace ( ) const
inline

Gets the value of ScreenSpaceProperty.

See also
setScreenSpace()

◆ setScreenSpace()

void kanzi::MaskEffect2D::setScreenSpace ( bool value)
inline

Sets the value of ScreenSpaceProperty.

See also
getScreenSpace()

◆ getChannel()

Channel kanzi::MaskEffect2D::getChannel ( ) const
inline

Gets the value of ChannelProperty.

See also
setChannel()

◆ setChannel()

void kanzi::MaskEffect2D::setChannel ( Channel value)
inline

Sets the value of ChannelProperty.

See also
getChannel()

◆ getInvert()

bool kanzi::MaskEffect2D::getInvert ( ) const
inline

Gets the value of InvertProperty.

See also
setInvert()

◆ setInvert()

void kanzi::MaskEffect2D::setInvert ( bool value)
inline

Sets the value of InvertProperty.

See also
getInvert()

◆ getStrength()

float kanzi::MaskEffect2D::getStrength ( ) const
inline

Gets the value of StrengthProperty.

See also
setStrength()

◆ setStrength()

void kanzi::MaskEffect2D::setStrength ( float value)
inline

Sets the value of StrengthProperty.

See also
getStrength()

◆ makeEditorInfo()

static PropertyTypeEditorInfoSharedPtr kanzi::MaskEffect2D::makeEditorInfo ( )
static

◆ create()

static MaskEffect2DSharedPtr kanzi::MaskEffect2D::create ( Domain * domain,
string_view name )
static

Creates a mask effect.

Parameters
domainDomain to use.
nameResource name.

◆ createRendererOverride()

NodeEffectRenderer2DUniquePtr kanzi::MaskEffect2D::createRendererOverride ( )
overrideprotectedvirtual

◆ initializeRendererOverride()

void kanzi::MaskEffect2D::initializeRendererOverride ( )
overrideprotectedvirtual

◆ onPropertyChanged()

virtual void kanzi::MaskEffect2D::onPropertyChanged ( AbstractPropertyType propertyType,
PropertyNotificationReason reason )
overrideprotectedvirtual

PropertyObject::onPropertyChanged implementation.

Reimplemented from kanzi::PropertyObject.

Member Data Documentation

◆ MaskProperty

PropertyType<ResourceSharedPtr> kanzi::MaskEffect2D::MaskProperty
static

Sets the mask texture.

The default value is no texture.

See also
setMask(), getMask()

◆ HeightProperty

PropertyType<float> kanzi::MaskEffect2D::HeightProperty
static

Overrides the mask texture height in pixels.

See also
setHeight(), getHeight()

◆ WidthProperty

PropertyType<float> kanzi::MaskEffect2D::WidthProperty
static

Overrides the mask texture width in pixels.

See also
setWidth(), getWidth()

◆ OffsetProperty

PropertyType<Vector2> kanzi::MaskEffect2D::OffsetProperty
static

Sets the mask offset along the X and Y axes in pixels.

Kanzi applies the mask offset after stretch, alignment, and scale. The default value is Vector2(0, 0).

See also
setOffset(), getOffset()

◆ ScaleProperty

PropertyType<Vector2> kanzi::MaskEffect2D::ScaleProperty
static

Sets the factor by which to scale the mask.

Kanzi applies the scale after stretch and alignment. The default value is Vector2(1, 1).

See also
setScale(), getScale()

◆ StretchProperty

PropertyType<Stretch> kanzi::MaskEffect2D::StretchProperty
static

Sets the stretch mode of the mask:

  • None disables stretching. This is the default.
  • Fill stretches the mask to fill the node.
  • Uniform stretches the mask using uniform scaling to fill the node in either vertical or horizontal direction, whichever requires smaller scale.
  • UniformToFill stretches the mask using uniform scaling to fill the node in either vertical or horizontal direction, whichever requires larger scale.
See also
setStretch(), getStretch()

◆ VerticalAlignmentProperty

PropertyType<VerticalAlignment> kanzi::MaskEffect2D::VerticalAlignmentProperty
static

Sets the vertical alignment of the mask:

  • Top aligns the top edge of the mask with the top edge of the node. This is the default.
  • Bottom aligns the bottom edge of the mask with the bottom edge of the node.
  • Center aligns the mask vertically to the center of the node.
  • Stretch stretches the mask vertically to fit the node from the top edge to the bottom edge.
See also
setVerticalAlignment(), getVerticalAlignment()

◆ HorizontalAlignmentProperty

PropertyType<HorizontalAlignment> kanzi::MaskEffect2D::HorizontalAlignmentProperty
static

Sets the horizontal alignment of the mask:

  • Left aligns the left edge of the mask with the left edge of the node. This is the default.
  • Right aligns the right edge of the mask with the right edge of the node.
  • Center aligns the mask horizontally to the center of the node.
  • Stretch stretches the mask horizontally to fit the node from the left edge to the right edge.
See also
setHorizontalAlignment(), getHorizontalAlignment()

◆ ScreenSpaceProperty

PropertyType<bool> kanzi::MaskEffect2D::ScreenSpaceProperty
static

Indicates whether to layout the mask relative to the screen.

See also
setScreenSpace(), getScreenSpace()

◆ ChannelProperty

PropertyType<Channel> kanzi::MaskEffect2D::ChannelProperty
static

Sets the mask texture channel to use as the input for the mask:

  • Alpha uses the alpha channel from the texture. This is the default.
  • Red uses the red color channel from the texture.
  • Green uses the green color channel from the texture.
  • Blue uses the blue color channel from the texture.
  • Luminance uses the luminance value calculated from the red, green, and blue color channels.
See also
setChannel(), getChannel()

◆ InvertProperty

PropertyType<bool> kanzi::MaskEffect2D::InvertProperty
static

Indicates whether to invert the mask.

The default value is false.

See also
setInvert(), getInvert()

◆ StrengthProperty

PropertyType<float> kanzi::MaskEffect2D::StrengthProperty
static

Sets the strength of the mask effect.

The range of the property is from 0 to 1 such that:

  • 0 disables the mask effect.
  • 1 applies the mask effect at full strength. This is the default.
  • Any other value between 0 and 1 partially applies the mask as if the non-masked result was blended with the fully masked version.
See also
setStrength(), getStrength()

The documentation for this class was generated from the following file: