WIP
DirectOutput framework for virtual pinball cabinets WIP
Go to:
Overview 
AnalogAlphaMatrixShiftEffect.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 {
15  {
16  private const int RefreshIntervalMs = 30;
17 
18  private AnalogAlpha _ActiveValue = new AnalogAlpha(0xff, 0xff);
19 
27  public AnalogAlpha ActiveValue
28  {
29  get { return _ActiveValue; }
30  set { _ActiveValue = value; }
31  }
32 
33  private AnalogAlpha _InactiveValue = new AnalogAlpha(0, 0);
34 
42  public AnalogAlpha InactiveValue
43  {
44  get { return _InactiveValue; }
45  set { _InactiveValue = value; }
46  }
47 
48 
49 
55  protected override AnalogAlpha GetEffectValue(int TriggerValue)
56  {
57  AnalogAlpha D = new AnalogAlpha();
58 
59  int V = TriggerValue.Limit(0, 255);
60  D.Value = InactiveValue.Value + (int)((float)(ActiveValue.Value - InactiveValue.Value) * V / 255).Limit(0, 255);
61  D.Alpha = InactiveValue.Alpha + (int)((float)(ActiveValue.Alpha - InactiveValue.Alpha) * V / 255).Limit(0, 255);
62  return D;
63  }
64 
65 
66  }
67 }
The namespace DirectOutput.Cab.Toys contains all toy related classes.
int Value
The analog value (0-255).
Definition: AnalogAlpha.cs:16
Same kind of effect like the RGBAMatrixShift effect, but for AnalogAlpha elements (just about everyth...
Object containing a analog value (0-255) and a alpha value (0-255).
Definition: AnalogAlpha.cs:11
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
The namespace DirectOutput.General contains classes for general use.
override AnalogAlpha GetEffectValue(int TriggerValue)
Gets the effect Value by mixinging Active and InactiveValue based on the TriggerValue.
Base class for effects shift values through a matrix of elements.