|
byte | B |
|
byte | G |
|
byte | R |
|
byte | A |
|
◆ ARGBPixel() [1/3]
BrawlLib.Imaging.ARGBPixel.ARGBPixel |
( |
byte |
a, |
|
|
byte |
r, |
|
|
byte |
g, |
|
|
byte |
b |
|
) |
| |
|
inline |
23 {
28 }
byte B
Definition: PixelTypes.cs:20
byte A
Definition: PixelTypes.cs:20
byte G
Definition: PixelTypes.cs:20
byte R
Definition: PixelTypes.cs:20
◆ ARGBPixel() [2/3]
BrawlLib.Imaging.ARGBPixel.ARGBPixel |
( |
byte |
intensity | ) |
|
|
inline |
◆ ARGBPixel() [3/3]
BrawlLib.Imaging.ARGBPixel.ARGBPixel |
( |
SerializationInfo |
info, |
|
|
StreamingContext |
context |
|
) |
| |
|
inline |
39 {
40 B = info.GetByte(
"B");
41 G = info.GetByte(
"G");
42 R = info.GetByte(
"R");
43 A = info.GetByte(
"A");
44 }
◆ DistanceTo() [1/2]
int BrawlLib.Imaging.ARGBPixel.DistanceTo |
( |
ARGBPixel |
p | ) |
|
|
inline |
60 {
62 int dist = val * val;
64 dist += val * val;
66 dist += val * val;
68 return dist + val;
69 }
◆ DistanceTo() [2/2]
int BrawlLib.Imaging.ARGBPixel.DistanceTo |
( |
Color |
c | ) |
|
|
inline |
47 {
49 int dist = val * val;
51 dist += val * val;
53 dist += val * val;
55 dist += val * val;
56 return dist;
57 }
◆ Equals()
override bool BrawlLib.Imaging.ARGBPixel.Equals |
( |
object |
obj | ) |
|
|
inline |
177 {
178 if (obj is ARGBPixel)
179 {
180 return (ARGBPixel) obj == this;
181 }
182
183 return false;
184 }
◆ GetHashCode()
override int BrawlLib.Imaging.ARGBPixel.GetHashCode |
( |
| ) |
|
|
inline |
172 {
173 return (int) this;
174 }
◆ GetObjectData()
void BrawlLib.Imaging.ARGBPixel.GetObjectData |
( |
SerializationInfo |
info, |
|
|
StreamingContext |
context |
|
) |
| |
|
inline |
204 {
205 info.AddValue(
"B",
B);
206 info.AddValue(
"G",
G);
207 info.AddValue(
"R",
R);
208 info.AddValue(
"A",
A);
209 }
◆ Greyscale()
int BrawlLib.Imaging.ARGBPixel.Greyscale |
( |
| ) |
|
|
inline |
82 {
83 return (
R +
G +
B) / 3;
84 }
◆ IsGreyscale()
bool BrawlLib.Imaging.ARGBPixel.IsGreyscale |
( |
| ) |
|
|
inline |
77 {
78 return R ==
G &&
G ==
B;
79 }
◆ Luminance()
float BrawlLib.Imaging.ARGBPixel.Luminance |
( |
| ) |
|
|
inline |
72 {
73 return 0.299f *
R + 0.587f *
G + 0.114f *
B;
74 }
◆ Max()
132 {
133 return new ARGBPixel(Math.Max(
A, p.A), Math.Max(
R, p.R), Math.Max(
G, p.G), Math.Max(
B, p.B));
134 }
ARGBPixel(byte a, byte r, byte g, byte b)
Definition: PixelTypes.cs:22
◆ Min()
127 {
128 return new ARGBPixel(Math.Min(
A, p.A), Math.Min(
R, p.R), Math.Min(
G, p.G), Math.Min(
B, p.B));
129 }
◆ operator ARGBPixel() [1/3]
static BrawlLib.Imaging.ARGBPixel.operator ARGBPixel |
( |
Color |
val | ) |
|
|
inlineexplicitstatic |
107 {
108 return (ARGBPixel) val.ToArgb();
109 }
◆ operator ARGBPixel() [2/3]
static BrawlLib.Imaging.ARGBPixel.operator ARGBPixel |
( |
int |
val | ) |
|
|
inlineexplicitstatic |
◆ operator ARGBPixel() [3/3]
static BrawlLib.Imaging.ARGBPixel.operator ARGBPixel |
( |
uint |
val | ) |
|
|
inlineexplicitstatic |
◆ operator Color()
static BrawlLib.Imaging.ARGBPixel.operator Color |
( |
ARGBPixel |
p | ) |
|
|
inlineexplicitstatic |
112 {
113 return Color.FromArgb((int) p);
114 }
◆ operator int()
static BrawlLib.Imaging.ARGBPixel.operator int |
( |
ARGBPixel |
p | ) |
|
|
inlineexplicitstatic |
92 {
93 return *(int*) &p;
94 }
◆ operator uint()
static BrawlLib.Imaging.ARGBPixel.operator uint |
( |
ARGBPixel |
p | ) |
|
|
inlineexplicitstatic |
102 {
103 return *(uint*) &p;
104 }
◆ operator Vector3()
117 {
118 return new Vector3(p.R * ColorFactor, p.G * ColorFactor, p.B * ColorFactor);
119 }
Definition: Vector3.cs:40
◆ operator Vector4()
122 {
123 return new Vector4(p.R * ColorFactor, p.G * ColorFactor, p.B * ColorFactor, p.A * ColorFactor);
124 }
Definition: Vector4.cs:12
◆ operator!=()
142 {
143 return *(uint*) &p1 != *(uint*) &p2;
144 }
◆ operator==()
137 {
138 return *(uint*) &p1 == *(uint*) &p2;
139 }
◆ ToARGBColorCode()
string BrawlLib.Imaging.ARGBPixel.ToARGBColorCode |
( |
| ) |
|
|
inline |
162 {
163 return $"{A:X2}{R:X2}{G:X2}{B:X2}";
164 }
◆ ToHexString()
string BrawlLib.Imaging.ARGBPixel.ToHexString |
( |
| ) |
|
|
inline |
152 {
153 return $"A:{A:X2} R:{R:X2} G:{G:X2} B:{B:X2}";
154 }
◆ ToPaddedString()
string BrawlLib.Imaging.ARGBPixel.ToPaddedString |
( |
| ) |
|
|
inline |
157 {
158 return $"A:{A,3} R:{R,3} G:{G,3} B:{B,3}";
159 }
◆ ToRGBAColorCode()
string BrawlLib.Imaging.ARGBPixel.ToRGBAColorCode |
( |
| ) |
|
|
inline |
167 {
168 return $"{R:X2}{G:X2}{B:X2}{A:X2}";
169 }
◆ ToString()
override string BrawlLib.Imaging.ARGBPixel.ToString |
( |
| ) |
|
|
inline |
147 {
148 return $"A:{A} R:{R} G:{G} B:{B}";
149 }
byte BrawlLib.Imaging.ARGBPixel.A |
byte BrawlLib.Imaging.ARGBPixel.B |
byte BrawlLib.Imaging.ARGBPixel.G |
byte BrawlLib.Imaging.ARGBPixel.R |
The documentation for this struct was generated from the following file:
- BrawlLib/Imaging/PixelTypes.cs