Пример #1
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);
        }
        private static async Task RenderEffect(FocusBand focusBand, DepthOfFieldQuality quality, [CallerMemberName] string testName = "")
        {
			using (var source = KnownImages.Nurse.ImageSource)
            using (var effect = new LensTiltDepthOfFieldEffect(source, focusBand, 1.0, 1.0, quality))
            using (var renderer = new JpegRenderer(effect))
            {
                var buffer = await renderer.RenderAsync();

				ImageResults.Instance.SaveToPicturesLibrary(buffer, "LensTiltDepthOfFieldEffectTest_" + testName + ".jpg");
            }
        }