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
AnalogAlphaMatrixBitmapAnimationEffect.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 using DirectOutput.General.BitmapHandling;
6 using DirectOutput.General;
7 using DirectOutput.Cab.Toys.Layer;
8 using DirectOutput.General.Analog;
9 
10 namespace DirectOutput.FX.MatrixFX
11 {
12  public class AnalogAlphaMatrixBitmapAnimationEffect : MatrixBitmapAnimationEffectBase<AnalogAlpha>
13  {
20  protected override AnalogAlpha GetEffectValue(int TriggerValue, PixelData Pixel)
21  {
22  return new AnalogAlpha() { Value = (Pixel.Red + Pixel.Green + Pixel.Blue) / 3, Alpha = (int)((float)Pixel.Alpha * TriggerValue / 255) };
23 
24  }
25 
26  }
27 }