13GX_CORE_NAMESPACE_BEGIN()
60 static constexpr u32 MASK_RED = 0x00FF0000;
61 static constexpr u32 MASK_BLUE = 0x000000FF;
63 static constexpr u32 MASK_RED = 0x000000FF;
64 static constexpr u32 MASK_BLUE = 0x00FF0000;
66 static constexpr u32 MASK_GREEN = 0x0000FF00;
67 static constexpr u32 MASK_ALPHA = 0xFF000000;
78 GX_FORCE_INLINE
GxColor(u32 red, u32 green, u32 blue, u32 alpha = 255);
96 GX_FORCE_INLINE
GxColor& operator += (u32 scalar);
98 GX_FORCE_INLINE
GxColor& operator -= (u32 scalar);
100 GX_FORCE_INLINE
GxColor& operator *= (f32 scalar);
102 GX_FORCE_INLINE
GxColor& operator /= (f32 scalar);
137 constexpr void getPropertyRed(
void*
const pValue)
const { *
static_cast<u8*
>(pValue) = _red; }
139 constexpr void setPropertyRed(
const void*
const pValue) { _red = *
static_cast<u8*
>(
const_cast<void*
>(pValue)); }
141 constexpr void getPropertyGreen(
void*
const pValue)
const { *
static_cast<u8*
>(pValue) = _green; }
143 constexpr void setPropertyGreen(
const void*
const pValue) { _green = *
static_cast<u8*
>(
const_cast<void*
>(pValue)); }
145 constexpr void getPropertyBlue(
void*
const pValue)
const { *
static_cast<u8*
>(pValue) = _blue; }
147 constexpr void setPropertyBlue(
const void*
const pValue) { _blue = *
static_cast<u8*
>(
const_cast<void*
>(pValue)); }
149 constexpr void getPropertyAlpha(
void*
const pValue)
const { *
static_cast<u8*
>(pValue) = _alpha; }
151 constexpr void setPropertyAlpha(
const void*
const pValue) { _alpha = *
static_cast<u8*
>(
const_cast<void*
>(pValue)); }
154 GX_FORCE_INLINE
GxColor getInvert(
void)
const {
GxColor color; color._color = _color ^ (MASK_RED | MASK_GREEN | MASK_BLUE);
return color; }
156 constexpr f32
getLuminance(
void)
const {
return 0.29891f *
static_cast<f32
>(_red) + 0.58661f *
static_cast<f32
>(_green) + 0.11448f *
static_cast<f32
>(_blue); }
184 GX_FORCE_INLINE
const GxColor& addScalar(u32 scalar);
186 GX_FORCE_INLINE
const GxColor& subScalar(u32 scalar);
188 GX_FORCE_INLINE
const GxColor& mulScalar(f32 scalar);
190 GX_FORCE_INLINE
const GxColor& divScalar(f32 scalar);
199 static GxColor createColor(GX_CSTR
string);
201 static GxColor createColor(u32 value);
204 static GX_FORCE_INLINE
GxColor convertPs3ToWindows(
const GxColor ps3Color);
207 static GX_FORCE_INLINE
GxColor convertWindowsToPs3(
const GxColor windowsColor);
258 GX_FORCE_INLINE
GxColorHDR(f32 red, f32 green, f32 blue, f32 alpha = 1.0f);
390 GX_FORCE_INLINE
GxColorHSV(f32 hue, f32 saturation, f32 value, f32 alpha = 1.0f);
449GX_CORE_NAMESPACE_END()
GX_FORCE_INLINE const GxColor operator*(const GxColor color, f32 scalar)
Definition GxColor.inl:202
GX_FORCE_INLINE b32 operator==(const GxColor color0, const GxColor color1)
Definition GxColor.inl:274
GX_FORCE_INLINE const GxColor operator/(const GxColor color, f32 scalar)
Definition GxColor.inl:226
GX_FORCE_INLINE const GxColor operator+(const GxColor color, u32 scalar)
Definition GxColor.inl:178
GX_FORCE_INLINE b32 operator!=(const GxColor color0, const GxColor color1)
Definition GxColor.inl:285
GX_FORCE_INLINE const GxColor operator-(const GxColor color, u32 scalar)
Definition GxColor.inl:190
色(HDR)
Definition GxColor.h:241
static GX_FORCE_INLINE const GxColorHDR & getDivScalar(GxColorHDR &dst, const GxColorHDR &color, f32 scalar)
スカラ除算を取得
Definition GxColor.inl:1027
GX_FORCE_INLINE const GxColorHDR & subColor(const GxColorHDR &color)
カラー減算
Definition GxColor.inl:1185
static GX_FORCE_INLINE const GxColorHDR & getSubScalar(GxColorHDR &dst, const GxColorHDR &color, f32 scalar)
スカラ減算を取得
Definition GxColor.inl:993
friend GX_FORCE_INLINE const GxColorHDR operator*(const GxColorHDR &color, f32 scalar)
スカラ乗算
Definition GxColor.inl:881
static GX_FORCE_INLINE const GxColorHDR & getSubColor(GxColorHDR &dst, const GxColorHDR &color0, const GxColorHDR &color1)
カラー減算を取得
Definition GxColor.inl:1063
GX_FORCE_INLINE const GxColorHDR & mulScalar(f32 scalar)
スカラ乗算
Definition GxColor.inl:1141
GX_FORCE_INLINE GxColorHDR & operator-=(f32 scalar)
スカラ減算代入
Definition GxColor.inl:790
GX_FORCE_INLINE const GxColorHDR & addColor(const GxColorHDR &color)
カラー加算
Definition GxColor.inl:1171
GX_FORCE_INLINE GxColorHDR & operator/=(f32 scalar)
スカラ除算代入
Definition GxColor.inl:812
friend GX_FORCE_INLINE b32 operator!=(const GxColorHDR &color0, const GxColorHDR &color1)
不一致
Definition GxColor.inl:964
friend GX_FORCE_INLINE b32 operator==(const GxColorHDR &color0, const GxColorHDR &color1)
一致
Definition GxColor.inl:953
GX_FORCE_INLINE GxColorHDR & operator*=(f32 scalar)
スカラ乗算代入
Definition GxColor.inl:801
constexpr f32 getLuminance(void) const
輝度を取得
Definition GxColor.h:315
GX_FORCE_INLINE const GxColorHDR & divScalar(f32 scalar)
スカラ除算
Definition GxColor.inl:1155
GX_FORCE_INLINE GxColorHDR & operator=(const GxColorHDR &color)
代入
Definition GxColor.inl:765
static GX_FORCE_INLINE const GxColorHDR & getAddColor(GxColorHDR &dst, const GxColorHDR &color0, const GxColorHDR &color1)
カラー加算を取得
Definition GxColor.inl:1046
static GX_FORCE_INLINE const GxColorHDR & getAddScalar(GxColorHDR &dst, const GxColorHDR &color, f32 scalar)
スカラ加算を取得
Definition GxColor.inl:976
f32 _green
緑(0.0f~1.0f)
Definition GxColor.h:362
f32 _blue
青(0.0f~1.0f)
Definition GxColor.h:363
friend GX_FORCE_INLINE const GxColorHDR operator/(const GxColorHDR &color, f32 scalar)
スカラ除算
Definition GxColor.inl:905
static GX_FORCE_INLINE const GxColorHDR & getLerp(GxColorHDR &dst, const GxColorHDR &color0, const GxColorHDR &color1, f32 t)
補間値を取得
Definition GxColor.inl:1098
GX_FORCE_INLINE const GxColorHDR & addScalar(f32 scalar)
スカラ加算
Definition GxColor.inl:1113
GxColorHDR(void)
デフォルトコンストラクタ
Definition GxColor.h:256
f32 _red
赤(0.0f~1.0f)
Definition GxColor.h:361
friend GX_FORCE_INLINE const GxColorHDR operator+(const GxColorHDR &color, f32 scalar)
スカラ加算
Definition GxColor.inl:857
GX_FORCE_INLINE const GxColorHDR & subScalar(f32 scalar)
スカラ減算
Definition GxColor.inl:1127
static GX_FORCE_INLINE const GxColorHDR & getMulScalar(GxColorHDR &dst, const GxColorHDR &color, f32 scalar)
スカラ乗算を取得
Definition GxColor.inl:1010
f32 _alpha
不透明度(0.0f~1.0f)
Definition GxColor.h:364
friend GX_FORCE_INLINE const GxColorHDR operator-(const GxColorHDR &color, f32 scalar)
スカラ減算
Definition GxColor.inl:869
GX_FORCE_INLINE const GxColorHDR & mulColor(const GxColorHDR &color)
カラー乗算
Definition GxColor.inl:1199
static GX_FORCE_INLINE const GxColorHDR & getMulColor(GxColorHDR &dst, const GxColorHDR &color0, const GxColorHDR &color1)
カラー乗算を取得
Definition GxColor.inl:1080
GX_FORCE_INLINE GxColorHDR & operator+=(f32 scalar)
スカラ加算代入
Definition GxColor.inl:779
色(HSV)
Definition GxColor.h:373
GX_FORCE_INLINE void setRgb(const GxColorHDR &color)
RGBを設定
Definition GxColor.inl:1288
f32 _value
明度(0.0f~1.0f)
Definition GxColor.h:443
GxColorHSV(void)
デフォルトコンストラクタ
Definition GxColor.h:388
GX_FORCE_INLINE GxColorHSV & operator=(const GxColorHSV &color)
代入
Definition GxColor.inl:1253
static void rgb2hsv(const GxColorHDR &rgb, GxColorHSV &hsv)
RGBをHSVに変換
Definition GxColor.cpp:221
friend GX_FORCE_INLINE b32 operator!=(const GxColorHSV &color0, const GxColorHSV &color1)
不一致
Definition GxColor.inl:1279
f32 _hue
色相(0.0f~360.0f)
Definition GxColor.h:441
friend GX_FORCE_INLINE b32 operator==(const GxColorHSV &color0, const GxColorHSV &color1)
一致
Definition GxColor.inl:1268
static void hsv2rgb(const GxColorHSV &hsv, GxColorHDR &rgb)
HSVをRGBに変換
Definition GxColor.cpp:159
GX_FORCE_INLINE GxColorHDR getRgb(void) const
RGBを取得
Definition GxColor.inl:1298
f32 _alpha
不透明度(0.0f~1.0f)
Definition GxColor.h:444
static GX_FORCE_INLINE const GxColorHSV & getInvertHue(GxColorHSV &dst, const GxColorHSV &color)
反転色(色相だけ)を取得
Definition GxColor.inl:1312
f32 _saturation
彩度(0.0f~1.0f)
Definition GxColor.h:442
constexpr void setPropertyGreen(const void *const pValue)
緑設定
Definition GxColor.h:143
constexpr void getPropertyGreen(void *const pValue) const
緑取得
Definition GxColor.h:141
constexpr void setPropertyBlue(const void *const pValue)
青設定
Definition GxColor.h:147
u32 _green
緑
Definition GxColor.h:226
constexpr void setPropertyAlpha(const void *const pValue)
α設定
Definition GxColor.h:151
constexpr void setPropertyRed(const void *const pValue)
赤設定
Definition GxColor.h:139
u32 _red
赤
Definition GxColor.h:225
u32 _blue
青
Definition GxColor.h:227
constexpr void getPropertyBlue(void *const pValue) const
青取得
Definition GxColor.h:145
u32 _alpha
アルファ
Definition GxColor.h:228
constexpr f32 getLuminance(void) const
輝度を取得
Definition GxColor.h:156
constexpr void getPropertyAlpha(void *const pValue) const
α取得
Definition GxColor.h:149
GX_FORCE_INLINE GxColor getInvert(void) const
反転色(補色)を取得
Definition GxColor.h:154
GxColor(void)
デフォルトコンストラクタ
Definition GxColor.h:76
constexpr void getPropertyRed(void *const pValue) const
赤取得
Definition GxColor.h:137
32bitブーリアン
Definition GxDefine.h:173