Class OutlineEffect2DMetadata

Defines properties and message types for OutlineEffect2D.

Inherits properties and message types from NodeEffect2DMetadata.

Property Types

See also PropertyType
OutlineEffect2DMetadata.BlendModeProperty

Sets the blend mode to use for rendering the outline.

Color Blending:

  • Additive adds the source pixels to the destination pixels.
  • Multiply multiplies the source and destination pixels.
  • Screen adds the source and destination pixels and subtracts from the result the product of the source and destination.
  • Alpha: Automatic uses premultiplied or non-premultiplied alpha depending on the value of the "Premultiply Alpha" property in the project or an image.
  • Alpha: Non-premultiplied is a legacy mode. For non-premultiplied input use the Alpha: Mixed mode.
  • Alpha: Premultiplied expects premultiplied alpha RGBA in the source pixels and blends the source pixels on top of the destination pixels. This is the default and recommended mode for alpha blending.
  • Alpha: Mixed expects non-premultiplied alpha RGBA in the source pixels, and blends the source pixels with the destination framebuffer.

Alpha Compositing:

  • Opaque disables blending and replaces the destination pixels with the source pixels.
  • Clear sets the destination pixels to transparent black.
  • Exclusive Or draws the non-overlapping source and destination pixels.
  • Source Atop discards those source pixels that do not cover destination pixels and draws the rest of the source pixels over destination pixels.
  • Source In draws those source pixels that cover destination pixels and discards all destination pixels.
  • Source Out draws the source pixels with alpha reduced by the inverse of the destination alpha, and discards all destination pixels.
  • Destination Atop discards those destination pixels that are not covered by source pixels, and draws the rest of the destination pixels over source pixels.
  • Destination In draws only those destination pixels that intersect with the source pixels, and discards all source pixels.
  • Destination Out draws the destination pixels with alpha reduced by the inverse of the source alpha, and discards all source pixels.
  • Destination Over draws the destination pixels over the source pixels.

Advanced Color Blending:

  • Multiply (advanced khr) is similar to the Multiply mode but it screens the alpha.
  • Overlay multiplies dark pixels and screens light pixels.
  • Darken compares the destination and source pixels and selects the darker one.
  • Lighten compares the destination and source pixels and selects the lighter one.
  • Color Burn darkens the destination to reflect the color of the source.
  • Color Dodge lightens the destination to reflect the color of the source.
  • Hard Light multiplies with dark source color and screens with light source color.
  • Soft Light burns with dark source color and dodges with light source color.
  • Difference uses the difference of the source and destination pixels.
  • Exclusion is similar to difference but the result is lower in contrast.
  • HSL Hue uses the hue of the source, and the luminosity and saturation of the destination.
  • HSL Saturation uses the saturation of the source, and the hue and luminosity of the destination.
  • HSL Color uses the hue and saturation of the source, and the luminosity of the destination.
  • HSL Luminosity uses luminosity of the source, and the jue and saturation of the destination.

The advanced color blending modes require the GL_KHR_blend_equation_advanced and GL_KHR_blend_equation_advanced_coherent OpengGL extensions.

OutlineEffect2DMetadata.WidthProperty

Sets the width of the outline in pixels outside the content area. The default value is 4 pixels.

OutlineEffect2DMetadata.ColorProperty

Sets the color of the outline.

OutlineEffect2DMetadata.SoftnessProperty

Sets the softness of the outline. For a sharp outline, set to 0. For a fade-in that takes the complete outline width to reach maximum value, set to 1. The default value is 0.27.

OutlineEffect2DMetadata.InnerWidthProperty

Sets the width of the outline in pixels inside the content area. By default, this property uses the value of the Outline Width property.

OutlineEffect2DMetadata.InnerSoftnessProperty

Sets the softness of the outline relative to its width inside the content area. For a sharp outline, set to 0. For a fade-in that takes the complete outline width to reach maximum value, set to 1. By default, this property uses the value of the Outline Softness property.

OutlineEffect2DMetadata.TextureProperty

Sets the texture to apply to the outline. Kanzi applies to the outline only the top row of pixels from this texture. Set Outline Color to the color with which you want to modulate the colors in this texture.

OutlineEffect2DMetadata.TextureOffsetProperty

Sets the relative starting offset for sampling the outline texture. The default value is 0.0.

OutlineEffect2DMetadata.TextureTilingProperty

Sets the number of times the texture wraps around within the outline area. To repeat a texture, set its Wrap Mode to Repeat. The default value is 1.0

OutlineEffect2DMetadata.ContentMaskProperty

Sets the color that masks color components relevant to the outline calculation. The comparison value is the result of a dot product between the mask and the content RGBA color value. By default Kanzi calculates the outline only from the alpha value.

OutlineEffect2DMetadata.ContentThresholdProperty

Sets the threshold at which the value Kanzi calculates using the content mask is considered valid. When the value calculated from masking the content exceeds this value, that pixel is part of the outlined area.

OutlineEffect2DMetadata.ContentGradientProperty

Sets the gradient along which the content fades out:

  • Start sets the minimum intensity at which the content starts to fade out.
  • Softness sets the difference in intensity it takes for the content to disappear.

For a perfectly smooth gradient, set Start to 0 and Softness to 1. The default value [ 0.0, 0.19 ] makes the content fade out quickly before the outline fade-out starts.

OutlineEffect2DMetadata.InvertContentMaskProperty

Whether to invert the value that Kanzi calculates using content masking.

OutlineEffect2DMetadata.MethodProperty

Sets the method for outline calculation:

  • Box uses box search which potentially consumes less memory but is slower.
  • Two-pass uses two-pass search which potentially consumes more memory but is faster. This the default.

Message Types

See also MessageType

Message Arguments

Message arguments classes define message arguments used for different message types. Each class defines a number of property types - arguments - together with getter and setter functions for them.