DirectOuput Framework R2
DirectOutput framework R2 for virtual pinball cabinets
Go to:
Overview 
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros Pages
AnalogAlphaMatrixBitmapEffect.cs
Go to the documentation of this file.
1 using DirectOutput.General.BitmapHandling;
2 using DirectOutput.Cab.Toys.Layer;
3 using DirectOutput.General.Analog;
4 
5 namespace DirectOutput.FX.MatrixFX
6 {
10  public class AnalogAlphaMatrixBitmapEffect : MatrixBitmapEffectBase<AnalogAlpha>
11  {
12 
19  public override AnalogAlpha GetEffectValue(int TriggerValue, PixelData Pixel)
20  {
21 
22  return new AnalogAlpha() { Value = (Pixel.Red + Pixel.Green + Pixel.Blue) / 3, Alpha = (int)((float)Pixel.Alpha * TriggerValue / 255) };
23 
24  }
25  }
26 }