Share via


SplitToneFilter Class

Applies a given color to pixels with luminance values within a specified range, while retaining some luminance information.
Dn899696.SplitToneFilter(en-us,WIN.10).jpg

Namespace: Lumia.Imaging.Artistic
Assembly: Lumia.Imaging (in Lumia.Imaging.dll) Version: 255.255.255.255

Syntax

public sealed class SplitToneFilter : IFilter, 
    __ISplitToneFilterPublicNonVirtuals
'Declaration
Public NotInheritable Class SplitToneFilter
    Implements IFilter, __ISplitToneFilterPublicNonVirtuals
public ref class SplitToneFilter sealed : IFilter, 
    __ISplitToneFilterPublicNonVirtuals
Lumia.Imaging.Artistic.SplitToneFilter = function();

Type.createClass(
    'Lumia.Imaging.Artistic.SplitToneFilter',
    null,
    Lumia.Imaging.IFilter,
    Lumia.Imaging.Artistic.__ISplitToneFilterPublicNonVirtuals);

Remarks

Several different intervals may be specified, each with a different color associated to it.

Typical usage would be to define a shadow luminance range, and a highlight luminance range, with different colors applied to each range.

Examples

using (var filterEffect = new FilterEffect(source))
{
    // Initialize the filter and add the filter to the FilterEffect collection
    var filter = new SplitToneFilter();

    SplitToneRange[] range = new SplitToneRange[2];

    range[0] = new SplitToneRange(0, 120, new Windows.UI.Color() { R = 208, G = 64, B = 64});
    range[0].LuminanceLow = 2;
    range[0].LuminanceHigh = 160;
    range[1] = new SplitToneRange(135, 255, new Windows.UI.Color() { R = 42, G = 60, B = 255 });
    range[1].LuminanceLow = 130;
    range[1].LuminanceHigh = 255;
    filter.SplitToneRanges = range;

    filterEffect.Filters = new IFilter[] { filter };

    // Create a target where the filtered image will be rendered to
    var target = new WriteableBitmap(width, height);

    // Create a new renderer which outputs WriteableBitmaps
    using (var renderer = new WriteableBitmapRenderer(filterEffect, target))
    {
        // Render the image with the filter(s)
        await renderer.RenderAsync();

        // Set the output image to Image control as a source
        ImageControl.Source = target;
    }

    await SaveEffectAsync(filterEffect, "SplitToneFilter.jpg", outputImageSize);
}

Inheritance Hierarchy

System.Object
  Lumia.Imaging.Artistic.SplitToneFilter

Version Information

Lumia Imaging SDK

Supported in: 2.0

See Also

SplitToneFilter.SplitToneFilter Members

Lumia.Imaging.Artistic Namespace