17
USING THE NOKIA IMAGING SDK LUMIA APP LABS #15 Berthier Lemieux Technology Wizard

LUMIA APP LAB #15: USING THE NOKIA IMAGING SDK

Embed Size (px)

DESCRIPTION

The Nokia Imaging SDK is a code library that helps developers work efficiently with images captured and stored by phones running Microsoft Windows Phone 8. In this Lumia App Labs webinar, we demonstrate the basics of working with the SDK. We provide a product overview and show you how to download the SDK and set up your development environment. We also demonstrate practical ways to apply effects and filters in your imaging apps; share tips and tricks to help you optimise app performance; and provide links to resources that you can use to make the most of your imaging-app projects. For detailed documentation on the Nokia Imaging SDK, see http://developer.nokia.com/Resources/Library/Lumia/#!nokia-imaging-sdk.html For more details about developing for Nokia Lumia smartphones visit http://www.developer.nokia.com/windowsphone Check out details of the other Lumia App Labs, including the future schedule, here: http://www.developer.nokia.com/Develop/Windows_Phone/Learn/

Citation preview

Page 1: LUMIA APP LAB #15: USING THE NOKIA IMAGING SDK

USING THE NOKIA IMAGING SDK

LUMIA APP LABS #15

Berthier Lemieux Technology Wizard

Page 2: LUMIA APP LAB #15: USING THE NOKIA IMAGING SDK

Experts in imaging algorithms Acquired by Nokia, 24 July 2012 Their technology drives:

Nokia Smart Camera Nokia Cinemagraph Nokia Creative studio

SCALADO

Page 3: LUMIA APP LAB #15: USING THE NOKIA IMAGING SDK

Really fast preview of any region of the image

Complete set of base filters and effects (52 filters). Combine them to generate more complex ones Highest performance and low memory consumption through RAJPEG technology (>15 patents) Cropping and JPEG compression parameter control

NOKIA IMAGING SDK

Page 4: LUMIA APP LAB #15: USING THE NOKIA IMAGING SDK

Filter Effects, simple illustration

of basics

Example projects Real-time Filter

Demo, live viewfinder stream

processing

Filter Explorer, complex illustration

of various usage scenarios

Page 5: LUMIA APP LAB #15: USING THE NOKIA IMAGING SDK

Apps developed with the SDK can be used on any Windows Phone 8, including non-Nokia, devices

The library is a WinPRT library. Routines are available via a C# interface as well as a C/C++ interface

Nokia Imaging SDK License Agreement: Free to use, attribution

GOOD TO KNOW

Page 6: LUMIA APP LAB #15: USING THE NOKIA IMAGING SDK

List of filters and effects I

Page 7: LUMIA APP LAB #15: USING THE NOKIA IMAGING SDK

List of filters and effects II

Page 8: LUMIA APP LAB #15: USING THE NOKIA IMAGING SDK

List of filters and effects III

Page 9: LUMIA APP LAB #15: USING THE NOKIA IMAGING SDK

• Step 1: Include Nokia Imaging SDK Libraries into your project • Step 2 : Create EditingSession • Step 3 : Create and add filters to EditingSession • Step 4 : Use asynchronous methods RenderToImageAsync or

RenderToJpegAsync to produce the final processed image

General overview of required steps

Page 10: LUMIA APP LAB #15: USING THE NOKIA IMAGING SDK

• Use NuGet to install the SDK libraries. • Finalise the installation by :

• Making sure that in the Project’s Configuration Manager, only the X86 and ARM platforms are listed. The Any CPU platform should be removed

• Save your project in Visual Studio • With an external editor (notepad, for example), edit the .csproj file to support both X86 and ARM

platforms. In the <HintPath> elements, replace “X86” by “$(Platform)”.

Step 1: Nokia Imaging SDK Libraries

Page 11: LUMIA APP LAB #15: USING THE NOKIA IMAGING SDK

Language Compiled to Runs in a virtual machine ?

Processor architecture dependant?

Managed code

C#, VB Intermediate Language (MSIL)

Yes (CLR) No

Native code C++ Machine language No Yes

PROCESSOR ARCHITECTURES Target Processor

architecture type

Emulator X86

Phone ARM

You don’t need to know/understand this to use the SDK! Consider this as FYI.

Page 12: LUMIA APP LAB #15: USING THE NOKIA IMAGING SDK

• Create an Imaging SDK EditingSession using a compressed or uncompressed image:

Step 2: Create EditingSession

EditingSession session = new EditingSession(jpegData);

• From a WriteableBitmap: EditingSession session = new EditingSession(sourceBitmap);

• From a JPEG in a IBuffer:

EditingSession session = await CreateEditingSessionAsync(stream);

• From a Stream (from PhotoChooserTask):

Page 13: LUMIA APP LAB #15: USING THE NOKIA IMAGING SDK

• Use FilterFactory to create filters and effects • Use EditingSession methods to add filters and effects:

Step 3: Create and add filters and effects

session.AddFilter(FilterFactory.CreateCartoonFilter(true)); session.AddFilter(FilterFactory.CreateFogFilter());

• You can also use FilterGroup to add several filters and effects in one call

Page 14: LUMIA APP LAB #15: USING THE NOKIA IMAGING SDK

You can render the processed image to:

• A XAML Image control: await session.RenderToImageAsync(FilteredImage);

• A WriteableBitmap : await session.RenderToWriteableBitmapAsync(FilteredBitmap);

• An IBuffer :

IBuffer jpegOut = await session.RenderToJpegAsync();

Step 4: Produce final processed image

Page 15: LUMIA APP LAB #15: USING THE NOKIA IMAGING SDK

You found an error in the SDK, have suggestions, need help? Nokia Imaging discussion board: http:/ /nokia.ly/DiBoImg

You have developped an app with the SDK? We’d love to hear about it . Tell us by sending a mail at [email protected]

Documentation and code samples • Imaging in the Lumia Developer’s Library: http:/ /nokia.ly/WP_lib_img • Nokia Imaging SDK: http:/ /www.developer.nokia.com/ imaging

RESOURCES

Page 16: LUMIA APP LAB #15: USING THE NOKIA IMAGING SDK

THANK YOU!

Page 17: LUMIA APP LAB #15: USING THE NOKIA IMAGING SDK

NOKIA IMAGING WIKI COMPETITION 2013Q3 Write a great tutorial, guide or an article with code which shows how to use the Nokia Imaging SDK or Camera and any other Windows Phone APIs related to imaging in useful, imaginative and innovative ways and/or provide the best feedback on the Nokia Imaging SDK.

developer.nokia.com/Community/Wiki/