protected override void _PreRender(CancellationTokenSource tokenSource = null) { _elementData = new EffectIntents(); if (_data == null) { return; } ICommand command = null; switch (ValueType) { case CustomValueType._8Bit: command = new _8BitCommand(Value8Bit); break; case CustomValueType._16Bit: command = new _16BitCommand(Value16Bit); break; case CustomValueType._32Bit: command = new _32BitCommand(Value32Bit); break; case CustomValueType._64Bit: command = new _64BitCommand(Value64Bit); break; case CustomValueType.Color: command = new ColorCommand(ColorValue); break; case CustomValueType.String: command = new StringCommand(StringValue); break; } CommandValue value = new CommandValue(command); foreach (ElementNode node in TargetNodes) { foreach (var leafNode in node.GetLeafEnumerator()) { if (tokenSource != null && tokenSource.IsCancellationRequested) { return; } IIntent intent = new CommandIntent(value, TimeSpan); _elementData.AddIntentForElement(leafNode.Element.Id, intent, TimeSpan.Zero); } } }
public override void Handle(_64BitCommand obj) { if (CombinatorValue == null) { CombinatorValue = new _32BitCommand(obj.CommandValue); } else { uint value1 = CombinatorValue.CommandValue; uint value2 = (byte)obj.CommandValue; CombinatorValue = new _32BitCommand(Math.Max(value1, value2)); } }
public override void Handle(_32BitCommand obj) { if (CombinatorValue == null) { CombinatorValue = new _8BitCommand(obj.CommandValue); } else { byte value1 = (CombinatorValue as _8BitCommand).CommandValue; byte value2 = (byte)obj.CommandValue; CombinatorValue = new _8BitCommand(Math.Max(value1, value2)); } }
public override void Handle(_32BitCommand obj) { if (CombinatorValue == null) { CombinatorValue = new _16BitCommand(obj.CommandValue); } else { ushort value1 = CombinatorValue.CommandValue; ushort value2 = (ushort)obj.CommandValue; CombinatorValue = new _16BitCommand(Math.Max(value1, value2)); } }
public override void Handle(ColorCommand obj) { if (CombinatorValue == null) { CombinatorValue = new _32BitCommand(ColorValue.GetGrayscaleLevel(obj.CommandValue)); } else { uint value1 = CombinatorValue.CommandValue; uint value2 = ColorValue.GetGrayscaleLevel(obj.CommandValue); CombinatorValue = new _32BitCommand(Math.Max(value1, value2)); } }
virtual public void Handle(_32BitCommand obj) { }
public override void Handle(IIntentState<PositionValue> obj) { EvaluatorValue = new _32BitCommand((uint)(uint.MaxValue * obj.GetValue().Position)); }
public override void Handle(IIntentState<LightingValue> obj) { EvaluatorValue = new _32BitCommand((uint)(uint.MaxValue * obj.GetValue().Intensity)); }
public override void Handle(IIntentState <LightingValue> obj) { EvaluatorValue = new _32BitCommand(obj.GetValue().Intensity); }
public override void Handle(IIntentState <RGBValue> obj) { System.UInt32 level = (System.UInt32)(System.UInt32.MaxValue * obj.GetValue().Intensity); EvaluatorValue = new _32BitCommand(level); }
public override void Handle(_32BitCommand obj) { Command = new _32BitCommand(_reducer.Reduce(obj.CommandValue, ReductionPercentage)); }
public override void Handle(IIntentState <ColorValue> obj) { byte byteLevel = ColorValue.GetGrayscaleLevel(obj.GetValue().Color); EvaluatorValue = new _32BitCommand(byteLevel); }
public void Handle(ColorCommand obj) { EvaluatorValue = new _32BitCommand(ColorValue.GetGrayscaleLevel(obj.CommandValue)); }
public void Handle(_32BitCommand obj) { EvaluatorValue = obj; }
public void Handle(_32BitCommand obj) { EvaluatorValue = new _8BitCommand(obj.CommandValue); }
public override void Handle(IIntentState <IntensityValue> obj) { EvaluatorValue = new _32BitCommand((uint)(uint.MaxValue * obj.GetValue().Intensity)); }
protected override void _PreRender(CancellationTokenSource tokenSource = null) { _elementData = new EffectIntents(); if (_data == null) return; ICommand command = null; switch (ValueType) { case CustomValueType._8Bit: command = new _8BitCommand(Value8Bit); break; case CustomValueType._16Bit: command = new _16BitCommand(Value16Bit); break; case CustomValueType._32Bit: command = new _32BitCommand(Value32Bit); break; case CustomValueType._64Bit: command = new _64BitCommand(Value64Bit); break; case CustomValueType.Color: command = new ColorCommand(ColorValue); break; case CustomValueType.String: command = new StringCommand(StringValue); break; } CommandValue value = new CommandValue(command); foreach (ElementNode node in TargetNodes) { foreach (var leafNode in node.GetLeafEnumerator()) { if (tokenSource != null && tokenSource.IsCancellationRequested) return; IIntent intent = new CommandIntent(value, TimeSpan); _elementData.AddIntentForElement(leafNode.Element.Id, intent, TimeSpan.Zero); } } }
public override void Handle(IIntentState<RGBValue> obj) { System.UInt32 level = (System.UInt32)(System.UInt32.MaxValue * obj.GetValue().Intensity); EvaluatorValue = new _32BitCommand(level); }
public virtual void Handle(_32BitCommand obj) { }