WIP
DirectOutput framework for virtual pinball cabinets WIP
Go to:
Overview 
AnalogAlphaMatrixFlickerEffect.cs
Go to the documentation of this file.
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
7 
8 namespace DirectOutput.FX.MatrixFX
9 {
14  {
15  private const int RefreshIntervalMs = 30;
16 
17  private AnalogAlpha _ActiveValue = new AnalogAlpha(0xff, 0xff);
18 
26  public AnalogAlpha ActiveValue
27  {
28  get { return _ActiveValue; }
29  set { _ActiveValue = value; }
30  }
31 
32  private AnalogAlpha _InactiveValue = new AnalogAlpha(0, 0);
33 
41  public AnalogAlpha InactiveValue
42  {
43  get { return _InactiveValue; }
44  set { _InactiveValue = value; }
45  }
46 
47 
53  protected override AnalogAlpha GetEffectValue(int TriggerValue)
54  {
55  AnalogAlpha D = new AnalogAlpha();
56 
57  int V = TriggerValue.Limit(0, 255);
58  D.Value = InactiveValue.Value + (int)((float)(ActiveValue.Value - InactiveValue.Value) * V / 255).Limit(0, 255);
59  D.Alpha = InactiveValue.Alpha + (int)((float)(ActiveValue.Alpha - InactiveValue.Alpha) * V / 255).Limit(0, 255);
60  return D;
61  }
62 
63  }
64 }
The namespace DirectOutput.Cab.Toys contains all toy related classes.
int Value
The analog value (0-255).
Definition: AnalogAlpha.cs:16
Does create random flickering with a defineable density, durations and value within the spefied area ...
Object containing a analog value (0-255) and a alpha value (0-255).
Definition: AnalogAlpha.cs:11
override AnalogAlpha GetEffectValue(int TriggerValue)
Gets the effect value by mixinging Active and InactiveValue based on the TriggerValue.
int Alpha
The alpha value (0-255).
Definition: AnalogAlpha.cs:20
The namespace DirectOutput.Cab contains all cabinet related classes like the Cabinet class itself...
Definition: Cab.cs:16
Namespace for objects dealing with layers
Does create random flickering with a defineable density, durations and value within the spefied area ...
The namespace DirectOutput.General contains classes for general use.