DirectOutputR1
DirectOutput framework R1 for virtual pinball cabinets.
Go to:
Overview 
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros Pages
RGBALayer.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.Cab.Color;
6 
7 namespace DirectOutput.Cab.Toys.Layer
8 {
12  public class RGBALayer
13  {
17  public int Red;
21  public int Green;
25  public int Blue;
29  public int Alpha;
30 
38  public void Set(int Red, int Green, int Blue)
39  {
40 
41  this.Red = Red;
42  this.Green = Green;
43  this.Blue = Blue;
44  this.Alpha = (Red + Green + Blue > 0 ? 255 : 0);
45  }
46 
54  public void Set(int Red, int Green, int Blue, int Alpha)
55  {
56  this.Red = Red;
57  this.Green = Green;
58  this.Blue = Blue;
59  this.Alpha = Alpha;
60  }
61 
62 
67  public RGBAColor GetRGBAColor()
68  {
69  return new RGBAColor(Red, Green, Blue, Alpha);
70  }
71 
76  public void Set(RGBAColor RGBA)
77  {
78  Set(RGBA.Red, RGBA.Green, RGBA.Blue, RGBA.Alpha);
79  }
80 
86  public void Set(RGBColor RGB)
87  {
88  Set(RGB.Red, RGB.Green, RGB.Blue);
89  }
90 
94  public RGBALayer() { }
95 
102  public RGBALayer(int Red, int Green, int Blue)
103  {
104  Set(Red, Green, Blue);
105  }
106 
114  public RGBALayer(int Red, int Green, int Blue, int Alpha)
115  {
116  Set(Red, Green, Blue, Alpha);
117  }
118 
123  public RGBALayer(RGBAColor RGBA)
124  {
125  Set(RGBA.Red, RGBA.Green, RGBA.Blue, RGBA.Alpha);
126  }
127 
133  public RGBALayer(RGBColor RGB)
134  {
135  Set(RGB.Red, RGB.Green, RGB.Blue);
136  }
137  }
138 }