コード例 #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="breakdownItem">Breakdown item to create filter for</param>
        /// <param name="rgbToRGBWConverter">Optional RGB to RGBW converter</param>
        public RGBWColorBreakdownMixingFilter(ColorBreakdownItem breakdownItem, RGBToRGBWConverter rgbToRGBWConverter)
        {
            // Save off the RGB to RGBW converter
            _rgbToRGBWConverter = rgbToRGBWConverter;

            // Configure the RGBW filter
            ConfigureRGBWFilter(breakdownItem);
        }
コード例 #2
0
        private void _CreateOutputs()
        {
            // Initialize the RGB to RGBW converter to null
            // If this converter is null then the logic below will use normal RGB filtering
            RGBToRGBWConverter rgbToRGBWConverter = null;

            // If mixing colors AND
            // the break down contains four colors then...
            if (_data.MixColors &&
                _data.BreakdownItems.Count == 4)
            {
                // Verify the colors are in the expected order
                Debug.Assert(_data.BreakdownItems[0].Color == Color.Red);
                Debug.Assert(_data.BreakdownItems[1].Color == Color.Lime);
                Debug.Assert(_data.BreakdownItems[2].Color == Color.Blue);
                Debug.Assert(_data.BreakdownItems[3].Color == Color.White);

                // Create the RGB to RGBW converter
                rgbToRGBWConverter = new RGBToRGBWConverter();
            }

            // Create the outputs for the specified break down items
            _outputs = _data.BreakdownItems.Select(x => new ColorBreakdownOutput(x, _data.MixColors, rgbToRGBWConverter)).ToArray();
        }
コード例 #3
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="breakdownItem">Breakdown item associated with the output</param>
        /// <param name="mixColors">True when this output is using color mixing</param>
        /// <param name="rgbToRGBWConverter">Optional RGB to RGBW converter</param>
        public ColorBreakdownOutput(ColorBreakdownItem breakdownItem, bool mixColors, RGBToRGBWConverter rgbToRGBWConverter)
        {
            Data = new CommandDataFlowData(CommandLookup8BitEvaluator.CommandLookup[0]);
            if (mixColors)
            {
                // If an RGB to RGBW converter was specified then...
                if (rgbToRGBWConverter != null)
                {
                    // An RGBW mixing filter is needed
                    _filter = new RGBWColorBreakdownMixingFilter(breakdownItem, rgbToRGBWConverter);
                }
                else
                {
                    // Otherwise a normal RGB mixing filter is needed
                    _filter = new RGBColorBreakdownMixingFilter(breakdownItem);
                }
            }
            else
            {
                _filter = new ColorBreakdownFilter(breakdownItem);
            }

            _breakdownItem = breakdownItem;
        }