Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Revision as of 17:25, 5 July 2014 by Loukt (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

MunchScream Filter Recipe (Nokia Imaging SDK)

From Wiki
Jump to: navigation, search

This recipe creates a cool wavy distortion on the image, using filters from the Nokia Imaging SDK

WP Metro Icon WP8.png
Article Metadata
Tested with
SDK: Windows Phone 8.0 SDK
Devices(s): Nokia Lumia 920
Compatibility
Platform(s):
Windows Phone 8
Dependencies: Nokia Imaging SDK 1.2
Article
Created: Loukt (05 Jul 2014)
Last edited: Loukt (05 Jul 2014)

Contents

Introduction

This article shows how to create a MunchScream Filter using the Nokia Imaging SDK built-in filters. the name of the filter is inspired from The Scream art by Edvard Munch.

We start by applying a WrapFilter with a LongFace WrapEffect then we apply a simple WrapEffect to get the waves and we finish by adding a PaintFilter.


MunchScream Filter

Source code

The code for creating the effect, the source, renderer and target is described in #How to use the filter and Core concepts (Nokia Developer Library). The fragment below shows only the "recipe-specific" code for adding the filters to the List<IFilter>.

                var filters = new List<IFilter>();
filters.Add(new WarpFilter(WarpEffect.LongFaced, 0.8));
filters.Add(new WarpFilter());
filters.Add(new PaintFilter());

How to use the filter

This recipe uses only filters based on IFilter. These are combined by simply adding them to an IFilter list, which is then passed to a FilterEffect along with the source. The code fragment below shows the general strategy (this is explained in more detail in Nokia Developer SDK - Core concepts).

var filters = new List<IFilter>();
 
filters.Add(new WarpFilter(WarpEffect.LongFaced, 0.8));
filters.Add(new WarpFilter());
filters.Add(new PaintFilter());
 
using (var source = new StreamImageSource(stream))
using (var filterEffect = new FilterEffect(source) { Filters = filters })
using (var renderer = new WriteableBitmapRenderer(filterEffect, writeableBitmap))
{
await renderer.RenderAsync();
}

Testing the filter

The easiest way to test the recipes is to add them to the Test Apps for Viewing Custom Filters (Nokia Imaging SDK) (a fork of the Real Time Filter Demo).


Performance

This section lists the approximate frame rate range (in frames-per-second) obtained by using the recipe in the Test framework.

Device FPS (Frames Per Second)
Lumia 925 5-6 FPS
Lumia 920 5-6 FPS

Gallery

More information

This article format was based on |Filter Recipe Article QuickStart (Nokia Imaging SDK) by Rob.Kachmar.
Inspired from Edvard Munch Art : The Scream

This page was last modified on 5 July 2014, at 17:25.
338 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×