WIP
DirectOutput framework for virtual pinball cabinets WIP
Go to:
Overview 
AnalogAlphaMatrixValueEffect.cs
Go to the documentation of this file.
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 
8 
9 namespace DirectOutput.FX.MatrixFX
10 {
15  {
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 }
The namespace DirectOutput.Cab.Toys contains all toy related classes.
int Value
The analog value (0-255).
Definition: AnalogAlpha.cs:16
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
Base class for effects setting all elements a specified area of a matrix toy to the same specific val...
override AnalogAlpha GetEffectValue(int TriggerValue)
Gets the effect value by mixinging Active and InactiveValue based on the TriggerValue.
The namespace DirectOutput.Cab contains all cabinet related classes like the Cabinet class itself...
Definition: Cab.cs:16
Sets the spefied area of matrix to the specified values depending on the trigger value.
Namespace for objects dealing with layers
The namespace DirectOutput.General contains classes for general use.