Exemplo n.º 1
0
        /// <summary>
        /// Sets the new target color.
        /// </summary>
        /// <param name="newColor">The new color.</param>
        /// <param name="saveSettings">If true, will save the color to the local storage.</param>
        private void SetColor(Color newColor, bool saveSettings = true)
        {
            colorPickerControl.CurrentColor = newColor;
            _settings.TargetColor           = newColor;

            if (colorPickerControl.Visibility == Visibility.Visible)
            {
                colorPickerControl.PreviewColor = newColor;
            }

            byte[] yuv = ImageProcessingUtils.RgbToYuv(newColor.R, newColor.G, newColor.B);

            _photoProcessor.SetTargetYUV(new float[]
            {
                (float)yuv[0],
                (float)yuv[1],
                (float)yuv[2]
            });

            if (saveSettings)
            {
                _settings.Save();
            }

            ApplyEffectAsync();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Sets the new target color.
        /// </summary>
        /// <param name="newColor">The new color.</param>
        /// <param name="saveSettings">If true, will save the color to the local storage.</param>
        private void SetColor(Color newColor, bool saveSettings = true)
        {
            colorPickerControl.CurrentColor = newColor;
            _settings.TargetColor           = newColor;

            if (colorPickerControl.Visibility == Visibility.Visible)
            {
                colorPickerControl.PreviewColor = newColor;
            }

            byte[] yuv = ImageProcessingUtils.RgbToYuv(newColor.R, newColor.G, newColor.B);
            _videoEngine.SetYuv(yuv);

            if (saveSettings)
            {
                _settings.Save();
            }
        }