Пример #1
0
        private static async Task RenderEffect(FocusBand focusBand, DepthOfFieldQuality quality, [CallerMemberName] string testName = "")
        {
            using (var source = await KnownImages.Nurse.GetImageSourceAsync())
                using (var effect = new LensTiltDepthOfFieldEffect(source, focusBand, 1.0, 1.0, quality))
                    using (var renderer = new JpegRenderer(effect))
                    {
                        var buffer = await renderer.RenderAsync();

                        await FileUtilities.SaveToPicturesLibraryAsync(buffer, "LensTiltDepthOfFieldEffectTest_" + testName + ".jpg");
                    }
        }
Пример #2
0
        protected override MaybeTask <IImageProvider> GetEffectInternalAsync(IImageProvider source, Windows.Foundation.Size sourceSize, Windows.Foundation.Size renderSize)
        {
            if (m_effectEffect == null)
            {
                m_focus = new FocusBand(new Point(0.5, 0.3), new Point(0.5, 0.4));

                m_effectEffect = new LensTiltDepthOfFieldEffect(source, m_focus, 1.0, 1.0, DepthOfFieldQuality.Preview);
            }
            else if (m_effectEffect.Source != source)
            {
                m_effectEffect.Source = source;
            }

            return(new MaybeTask <IImageProvider>(m_effectEffect));
        }