Skip to content

Commit dc5afad

Browse files
authored
Add YUV color struct and conversion methods
Added YUV struct for color representation and updated Color class methods to include YUV conversion.
1 parent 9e73cc9 commit dc5afad

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

PopLib/graphics/color.hpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ namespace PopLib
1212
struct RGBA
1313
{
1414
unsigned char r, g, b, a;
15+
};
16+
struct YUV //add YUV color components based off of ITU standard reccomendations BT.601 & BT.709. This will most likely be a conversion set.
17+
{
18+
unsigned char y, u, v;
19+
20+
1521
};
1622
#pragma pack(pop)
1723

@@ -22,7 +28,7 @@ class Color
2228
int mGreen;
2329
int mBlue;
2430
int mAlpha;
25-
31+
2632
static Color Black;
2733
static Color White;
2834

@@ -40,9 +46,9 @@ class Color
4046
int GetGreen() const;
4147
int GetBlue() const;
4248
int GetAlpha() const;
43-
ulong ToInt() const;
49+
ulong ToRGBAInt() const;
4450
RGBA ToBGRA() const;
45-
51+
YUV ToYUV() const;
4652
int &operator[](int theIdx);
4753
int operator[](int theIdx) const;
4854
};

0 commit comments

Comments
 (0)