|
byte | R |
|
byte | G |
|
byte | B |
|
byte | A |
|
◆ RGBAPixel() [1/2]
BrawlLib.Imaging.RGBAPixel.RGBAPixel |
( |
byte |
r, |
|
|
byte |
g, |
|
|
byte |
b, |
|
|
byte |
a |
|
) |
| |
|
inline |
375 {
380 }
byte R
Definition: PixelTypes.cs:330
byte G
Definition: PixelTypes.cs:330
byte A
Definition: PixelTypes.cs:330
byte B
Definition: PixelTypes.cs:330
◆ RGBAPixel() [2/2]
BrawlLib.Imaging.RGBAPixel.RGBAPixel |
( |
uint |
u | ) |
|
|
inline |
383 {
384 string temp = u.ToString("X8");
385 R = Convert.ToByte(temp.Substring(0, 2), 16);
386 G = Convert.ToByte(temp.Substring(2, 2), 16);
387 B = Convert.ToByte(temp.Substring(4, 2), 16);
388 A = Convert.ToByte(temp.Substring(6, 2), 16);
389 }
◆ Compare()
519 {
520 int v1 = *(int*) &p1;
521 int v2 = *(int*) &p2;
522
523 if (v1 > v2)
524 {
525 return 1;
526 }
527
528 if (v1 < v2)
529 {
530 return -1;
531 }
532
533 return 1;
534 }
◆ CompareTo()
int BrawlLib.Imaging.RGBAPixel.CompareTo |
( |
object |
obj | ) |
|
|
inline |
446 {
447 if (obj is RGBAPixel)
448 {
449 RGBAPixel o = (RGBAPixel) obj;
451 {
452 return 1;
453 }
454
456 {
457 return -1;
458 }
459
461 {
462 return 1;
463 }
464
466 {
467 return -1;
468 }
469
471 {
472 return 1;
473 }
474
476 {
477 return -1;
478 }
479
481 {
482 return 1;
483 }
484
486 {
487 return -1;
488 }
489
490 return 0;
491 }
492
493 return 1;
494 }
◆ Equals()
override bool BrawlLib.Imaging.RGBAPixel.Equals |
( |
object |
obj | ) |
|
|
inline |
436 {
437 if (obj is RGBAPixel)
438 {
439 return this == (RGBAPixel) obj;
440 }
441
442 return false;
443 }
◆ GetHashCode()
override int BrawlLib.Imaging.RGBAPixel.GetHashCode |
( |
| ) |
|
|
inline |
428 {
429 fixed (RGBAPixel* p = &this)
430 {
431 return *(int*) p;
432 }
433 }
◆ operator ARGBPixel()
338 {
339 return new ARGBPixel {
A = p.A,
B = p.B,
G = p.G,
R = p.R};
340 }
◆ operator Color()
static BrawlLib.Imaging.RGBAPixel.operator Color |
( |
RGBAPixel |
p | ) |
|
|
inlineexplicitstatic |
343 {
344 ARGBPixel a = p;
345 return Color.FromArgb((int) a);
346 }
◆ operator RGBAPixel() [1/3]
333 {
335 }
RGBAPixel(byte r, byte g, byte b, byte a)
Definition: PixelTypes.cs:374
◆ operator RGBAPixel() [2/3]
static implicit BrawlLib.Imaging.RGBAPixel.operator RGBAPixel |
( |
uint |
u | ) |
|
|
inlinestatic |
◆ operator RGBAPixel() [3/3]
349 {
350 return new RGBAPixel((
byte) (p.
_x * 255.0f), (
byte) (p.
_y * 255.0f), (
byte) (p.
_z * 255.0f),
351 (
byte) (p.
_w * 255.0f));
352 }
float _x
Definition: Vector4.cs:13
float _z
Definition: Vector4.cs:13
float _y
Definition: Vector4.cs:13
float _w
Definition: Vector4.cs:13
◆ operator uint()
static implicit BrawlLib.Imaging.RGBAPixel.operator uint |
( |
RGBAPixel |
p | ) |
|
|
inlinestatic |
370 {
371 return BitConverter.ToUInt32(new byte[] {p.R, p.G, p.B, p.A}, 0);
372 }
◆ operator Vector3()
360 {
361 return new Vector3(p.R / 255.0f, p.G / 255.0f, p.B / 255.0f);
362 }
Definition: Vector3.cs:40
◆ operator Vector4()
355 {
356 return new Vector4(p.R / 255.0f, p.G / 255.0f, p.B / 255.0f, p.A / 255.0f);
357 }
Definition: Vector4.cs:12
◆ operator!=()
514 {
515 return *(int*) &p1 != *(int*) &p2;
516 }
◆ operator&()
497 {
498 return new RGBAPixel((
byte) (p1.R & p2.R), (
byte) (p1.G & p2.G), (
byte) (p1.B & p2.B),
499 (byte) (p1.A & p2.A));
500 }
◆ operator==()
509 {
510 return *(int*) &p1 == *(int*) &p2;
511 }
◆ operator|()
503 {
504 return new RGBAPixel((
byte) (p1.R | p2.R), (
byte) (p1.G | p2.G), (
byte) (p1.B | p2.B),
505 (byte) (p1.A | p2.A));
506 }
◆ Parse()
static RGBAPixel BrawlLib.Imaging.RGBAPixel.Parse |
( |
string |
s | ) |
|
|
inlinestatic |
549 {
551 byte* ptr = (byte*) &p;
552 for (int i = 0; i < 8; i += 2)
553 {
554 *ptr++ = s.Length >= i + 2
555 ? byte.Parse(s.Substring(i, 2), System.Globalization.NumberStyles.HexNumber)
556 : (byte) (i == 6 ? 0xFF : 0);
557 }
558
559 return p;
560 }
◆ ToString()
override string BrawlLib.Imaging.RGBAPixel.ToString |
( |
| ) |
|
|
inline |
422 {
423
424 return $"R:{R} G:{G} B:{B} A:{A}";
425 }
byte BrawlLib.Imaging.RGBAPixel.A |
byte BrawlLib.Imaging.RGBAPixel.B |
◆ ColorFactor
const float BrawlLib.Imaging.RGBAPixel.ColorFactor = 1.0f / 255.0f |
|
static |
byte BrawlLib.Imaging.RGBAPixel.G |
byte BrawlLib.Imaging.RGBAPixel.R |
◆ Address
VoidPtr BrawlLib.Imaging.RGBAPixel.Address |
|
get |
538 {
539 get
540 {
541 fixed (void* p = &this)
542 {
543 return p;
544 }
545 }
546 }
◆ Alpha
byte BrawlLib.Imaging.RGBAPixel.Alpha |
|
getset |
◆ Blue
byte BrawlLib.Imaging.RGBAPixel.Blue |
|
getset |
◆ Green
byte BrawlLib.Imaging.RGBAPixel.Green |
|
getset |
◆ Red
byte BrawlLib.Imaging.RGBAPixel.Red |
|
getset |
The documentation for this struct was generated from the following file:
- BrawlLib/Imaging/PixelTypes.cs