OROCHI
 
Loading...
Searching...
No Matches
GxColor.inl
Go to the documentation of this file.
1//===========================================================================
10//===========================================================================
11
12GX_CORE_NAMESPACE_BEGIN()
13
14//===========================================================================
15// GxColor
16//===========================================================================
17//---------------------------------------------------------------------------
18// コンストラクタ
23//---------------------------------------------------------------------------
24GX_FORCE_INLINE GxColor::GxColor(u32 red, u32 green, u32 blue, u32 alpha)
25#if GX_COLOR_RGB_SWAP
26 : _blue(blue)
27 , _green(green)
28 , _red(red)
29#else //GX_COLOR_RGB_SWAP
30 : _red(red)
31 , _green(green)
32 , _blue(blue)
33#endif // !GX_COLOR_RGB_SWAP
34 , _alpha(alpha)
35{
36}
37
38//---------------------------------------------------------------------------
39// コンストラクタ
42//---------------------------------------------------------------------------
43GX_FORCE_INLINE GxColor::GxColor(const GxColor color, u32 alpha)
44#if GX_COLOR_RGB_SWAP
45 : _blue(color._blue)
46 , _green(color._green)
47 , _red(color._red)
48#else //GX_COLOR_RGB_SWAP
49 : _red(color._red)
50 , _green(color._green)
51 , _blue(color._blue)
52#endif // !GX_COLOR_RGB_SWAP
53 , _alpha(alpha)
54{
55}
56
57//---------------------------------------------------------------------------
58// コンストラクタ
60//---------------------------------------------------------------------------
61GX_FORCE_INLINE GxColor::GxColor(const GxColorHDR& color)
62#if GX_COLOR_RGB_SWAP
63 : _blue(GxMath::getClamp(static_cast<u32>(color._blue * 255), static_cast<u32>(0), static_cast<u32>(255)))
64 , _green(GxMath::getClamp(static_cast<u32>(color._green * 255), static_cast<u32>(0), static_cast<u32>(255)))
65 , _red(GxMath::getClamp(static_cast<u32>(color._red * 255), static_cast<u32>(0), static_cast<u32>(255)))
66#else //GX_COLOR_RGB_SWAP
67 : _red(GxMath::getClamp(static_cast<u32>(color._red * 255), static_cast<u32>(0), static_cast<u32>(255)))
68 , _green(GxMath::getClamp(static_cast<u32>(color._green * 255), static_cast<u32>(0), static_cast<u32>(255)))
69 , _blue(GxMath::getClamp(static_cast<u32>(color._blue * 255), static_cast<u32>(0), static_cast<u32>(255)))
70#endif // !GX_COLOR_RGB_SWAP
71 , _alpha(GxMath::getClamp(static_cast<u32>(color._alpha * 255), static_cast<u32>(0), static_cast<u32>(255)))
72{
73}
74
75//---------------------------------------------------------------------------
76// コピーコンストラクタ
78//---------------------------------------------------------------------------
79GX_FORCE_INLINE GxColor::GxColor(const GxColor& color)
80: _color(color._color)
81{
82}
83
84//---------------------------------------------------------------------------
85// 代入
88//---------------------------------------------------------------------------
89GX_FORCE_INLINE GxColor& GxColor::operator = (const GxColor color)
90{
91 _color = color._color;
92 return *this;
93}
94
95//---------------------------------------------------------------------------
96// スカラ加算代入
99//---------------------------------------------------------------------------
100GX_FORCE_INLINE GxColor& GxColor::operator += (u32 scalar)
101{
102 addScalar(scalar);
103 return *this;
104}
105
106//---------------------------------------------------------------------------
107// スカラ減算代入
110//---------------------------------------------------------------------------
111GX_FORCE_INLINE GxColor& GxColor::operator -= (u32 scalar)
112{
113 subScalar(scalar);
114 return *this;
115}
116
117//---------------------------------------------------------------------------
118// スカラ乗算代入
121//---------------------------------------------------------------------------
122GX_FORCE_INLINE GxColor& GxColor::operator *= (f32 scalar)
123{
124 mulScalar(scalar);
125 return *this;
126}
127
128//---------------------------------------------------------------------------
129// スカラ除算代入
132//---------------------------------------------------------------------------
133GX_FORCE_INLINE GxColor& GxColor::operator /= (f32 scalar)
134{
135 divScalar(scalar);
136 return *this;
137}
138
139//---------------------------------------------------------------------------
140// カラー加算代入
143//---------------------------------------------------------------------------
144GX_FORCE_INLINE GxColor& GxColor::operator += (const GxColor color)
145{
146 addColor(color);
147 return *this;
148}
149
150//---------------------------------------------------------------------------
151// カラー減算代入
154//---------------------------------------------------------------------------
155GX_FORCE_INLINE GxColor& GxColor::operator -= (const GxColor color)
156{
157 subColor(color);
158 return *this;
159}
160
161//---------------------------------------------------------------------------
162// カラー乗算代入
165//---------------------------------------------------------------------------
166GX_FORCE_INLINE GxColor& GxColor::operator *= (const GxColor color)
167{
168 mulColor(color);
169 return *this;
170}
171
172//---------------------------------------------------------------------------
173// スカラ加算
177//---------------------------------------------------------------------------
178GX_FORCE_INLINE const GxColor operator + (const GxColor color, u32 scalar)
179{
180 GxColor result;
181 return GxColor::getAddScalar(result, color, scalar);
182}
183
184//---------------------------------------------------------------------------
185// スカラ減算
189//---------------------------------------------------------------------------
190GX_FORCE_INLINE const GxColor operator - (const GxColor color, u32 scalar)
191{
192 GxColor result;
193 return GxColor::getSubScalar(result, color, scalar);
194}
195
196//---------------------------------------------------------------------------
197// スカラ乗算
201//---------------------------------------------------------------------------
202GX_FORCE_INLINE const GxColor operator * (const GxColor color, f32 scalar)
203{
204 GxColor result;
205 return GxColor::getMulScalar(result, color, scalar);
206}
207
208//---------------------------------------------------------------------------
209// スカラ乗算
213//---------------------------------------------------------------------------
214GX_FORCE_INLINE const GxColor operator * (f32 scalar, const GxColor color)
215{
216 GxColor result;
217 return GxColor::getMulScalar(result, color, scalar);
218}
219
220//---------------------------------------------------------------------------
221// スカラ除算
225//---------------------------------------------------------------------------
226GX_FORCE_INLINE const GxColor operator / (const GxColor color, f32 scalar)
227{
228 GxColor result;
229 return GxColor::getDivScalar(result, color, scalar);
230}
231
232//---------------------------------------------------------------------------
233// カラー加算
237//---------------------------------------------------------------------------
238GX_FORCE_INLINE const GxColor operator + (const GxColor color0, const GxColor color1)
239{
240 GxColor result;
241 return GxColor::getAddColor(result, color0, color1);
242}
243
244//---------------------------------------------------------------------------
245// カラー減算
249//---------------------------------------------------------------------------
250GX_FORCE_INLINE const GxColor operator - (const GxColor color0, const GxColor color1)
251{
252 GxColor result;
253 return GxColor::getSubColor(result, color0, color1);
254}
255
256//---------------------------------------------------------------------------
257// カラー乗算
261//---------------------------------------------------------------------------
262GX_FORCE_INLINE const GxColor operator * (const GxColor color0, const GxColor color1)
263{
264 GxColor result;
265 return GxColor::getMulColor(result, color0, color1);
266}
267
268//---------------------------------------------------------------------------
269// 一致
273//---------------------------------------------------------------------------
274GX_FORCE_INLINE b32 operator == (const GxColor color0, const GxColor color1)
275{
276 return color0._color == color1._color;
277}
278
279//---------------------------------------------------------------------------
280// 不一致
284//---------------------------------------------------------------------------
285GX_FORCE_INLINE b32 operator != (const GxColor color0, const GxColor color1)
286{
287 return color0._color != color1._color;
288}
289
290//---------------------------------------------------------------------------
291// スカラ加算を取得
296//---------------------------------------------------------------------------
297GX_FORCE_INLINE const GxColor& GxColor::getAddScalar(GxColor& dst, const GxColor color, u32 scalar)
298{
299 u32 a0 = color._color & MASK_ALPHA;
300#if GX_COLOR_RGB_SWAP
301 u32 c0 = color._color;
302#else //GX_COLOR_RGB_SWAP
303 u32 c0 = color._color >> 8;
304#endif // !GX_COLOR_RGB_SWAP
305 u32 c1 = (scalar << 16) + (scalar << 8) + scalar;
306
307 u32 c = (((c0 & c1) << 1) + ((c0 ^ c1) & 0x00FEFEFE)) & 0x01010100;
308 c = ((c >> 8) + 0x007F7F7F) ^ 0x007F7F7F;
309
310#if GX_COLOR_RGB_SWAP
311 dst._color = (c0 + c1 - c) | c | a0;
312#else //GX_COLOR_RGB_SWAP
313 dst._color = (((c0 + c1 - c) | c) << 8) | a0;
314#endif // !GX_COLOR_RGB_SWAP
315
316 return dst;
317}
318
319//---------------------------------------------------------------------------
320// スカラ減算を取得
325//---------------------------------------------------------------------------
326GX_FORCE_INLINE const GxColor& GxColor::getSubScalar(GxColor& dst, const GxColor color, u32 scalar)
327{
328 u32 a0 = color._color & MASK_ALPHA;
329#if GX_COLOR_RGB_SWAP
330 u32 c0 = color._color;
331#else //GX_COLOR_RGB_SWAP
332 u32 c0 = color._color >> 8;
333#endif // !GX_COLOR_RGB_SWAP
334 u32 c1 = (scalar << 16) + (scalar << 8) + scalar;
335
336 u32 c = (((~c0 & c1) << 1) + ((~c0 ^ c1) & 0x00FEFEFE)) & 0x01010100;
337 c = ((c >> 8) + 0x007F7F7F) ^ 0x007F7F7F;
338
339#if GX_COLOR_RGB_SWAP
340 dst._color = (c0 | c) - (c1 | c) | a0;
341#else //GX_COLOR_RGB_SWAP
342 dst._color = (((c0 | c) - (c1 | c)) << 8) | a0;
343#endif // !GX_COLOR_RGB_SWAP
344
345 return dst;
346}
347
348//---------------------------------------------------------------------------
349// スカラ乗算を取得
354//---------------------------------------------------------------------------
355GX_FORCE_INLINE const GxColor& GxColor::getMulScalar(GxColor& dst, const GxColor color, f32 scalar)
356{
357 dst._red = GxMath::getMax(GxMath::getMin(static_cast<u32>(color._red * scalar), static_cast<u32>(255)), static_cast<u32>(0));
358 dst._green = GxMath::getMax(GxMath::getMin(static_cast<u32>(color._green * scalar), static_cast<u32>(255)), static_cast<u32>(0));
359 dst._blue = GxMath::getMax(GxMath::getMin(static_cast<u32>(color._blue * scalar), static_cast<u32>(255)), static_cast<u32>(0));
360 dst._alpha = color._alpha;
361
362 return dst;
363}
364
365//---------------------------------------------------------------------------
366// スカラ除算を取得
371//---------------------------------------------------------------------------
372GX_FORCE_INLINE const GxColor& GxColor::getDivScalar(GxColor& dst, const GxColor color, f32 scalar)
373{
374 f32 invScalar = 1.0f / scalar;
375
376 dst._red = GxMath::getMax(GxMath::getMin(static_cast<u32>(color._red * invScalar), static_cast<u32>(255)), static_cast<u32>(0));
377 dst._green = GxMath::getMax(GxMath::getMin(static_cast<u32>(color._green * invScalar), static_cast<u32>(255)), static_cast<u32>(0));
378 dst._blue = GxMath::getMax(GxMath::getMin(static_cast<u32>(color._blue * invScalar), static_cast<u32>(255)), static_cast<u32>(0));
379 dst._alpha = color._alpha;
380
381 return dst;
382}
383
384//---------------------------------------------------------------------------
385// カラー加算を取得
390//---------------------------------------------------------------------------
391GX_FORCE_INLINE const GxColor& GxColor::getAddColor(GxColor& dst, const GxColor color0, const GxColor color1)
392{
393 u32 a0 = color0._color & MASK_ALPHA;
394#if GX_COLOR_RGB_SWAP
395 u32 c0 = color0._color;
396 u32 c1 = color1._color;
397#else //GX_COLOR_RGB_SWAP
398 u32 c0 = color0._color >> 8;
399 u32 c1 = color1._color >> 8;
400#endif // !GX_COLOR_RGB_SWAP
401
402 u32 c = (((c0 & c1) << 1) + ((c0 ^ c1) & 0x00FEFEFE)) & 0x01010100;
403 c = ((c >> 8) + 0x007F7F7F) ^ 0x007F7F7F;
404
405#if GX_COLOR_RGB_SWAP
406 dst._color = (c0 + c1 - c) | c | a0;
407#else //GX_COLOR_RGB_SWAP
408 dst._color = (((c0 + c1 - c) | c) << 8) | a0;
409#endif // !GX_COLOR_RGB_SWAP
410
411 return dst;
412}
413
414//---------------------------------------------------------------------------
415// カラー減算を取得
420//---------------------------------------------------------------------------
421GX_FORCE_INLINE const GxColor& GxColor::getSubColor(GxColor& dst, const GxColor color0, const GxColor color1)
422{
423 u32 a0 = color0._color & MASK_ALPHA;
424#if GX_COLOR_RGB_SWAP
425 u32 c0 = color0._color;
426 u32 c1 = color1._color;
427#else //GX_COLOR_RGB_SWAP
428 u32 c0 = color0._color >> 8;
429 u32 c1 = color1._color >> 8;
430#endif // !GX_COLOR_RGB_SWAP
431
432 u32 c = (((~c0 & c1) << 1) + ((~c0 ^ c1) & 0x00FEFEFE)) & 0x01010100;
433 c = ((c >> 8) + 0x007F7F7F) ^ 0x007F7F7F;
434
435#if GX_COLOR_RGB_SWAP
436 dst._color = (c0 | c) - (c1 | c) | a0;
437#else //GX_COLOR_RGB_SWAP
438 dst._color = (((c0 | c) - (c1 | c)) << 8) | a0;
439#endif // !GX_COLOR_RGB_SWAP
440
441 return dst;
442}
443
444//---------------------------------------------------------------------------
445// カラー乗算を取得
450//---------------------------------------------------------------------------
451GX_FORCE_INLINE const GxColor& GxColor::getMulColor(GxColor& dst, const GxColor color0, const GxColor color1)
452{
453 dst._red = (color0._red * color1._red + 255) >> 8;
454 dst._green = (color0._green * color1._green + 255) >> 8;
455 dst._blue = (color0._blue * color1._blue + 255) >> 8;
456 dst._alpha = (color0._alpha * color1._alpha + 255) >> 8;
457
458 return dst;
459}
460
461//---------------------------------------------------------------------------
462// 補間値を取得(互換用)
467//---------------------------------------------------------------------------
468GX_FORCE_INLINE GxColor GxColor::getLerp(const GxColor color0, const GxColor color1, f32 t)
469{
470 GxColor result;
471 u32 ut1 = static_cast<u32>(256 * t);
472 u32 ut0 = 256 - ut1;
473
474 u32 c00 = color0._color & 0x00FF00FF;
475 u32 c01 = (color0._color & 0xFF00FF00) >> 8;
476 u32 c10 = color1._color & 0x00FF00FF;
477 u32 c11 = (color1._color & 0xFF00FF00) >> 8;
478
479 c00 = ((c00 * ut0 + c10 * ut1) & 0xFF00FF00) >> 8;
480 c01 = (c01 * ut0 + c11 * ut1) & 0xFF00FF00;
481
482 result._color = c00 | c01;
483 return result;
484}
485
486//---------------------------------------------------------------------------
487// 補間値を取得
493//---------------------------------------------------------------------------
494GX_FORCE_INLINE const GxColor& GxColor::getLerp(GxColor& dst, const GxColor color0, const GxColor color1, f32 t)
495{
496 u32 ut1 = static_cast<u32>(256 * t);
497 u32 ut0 = 256 - ut1;
498
499 u32 c00 = color0._color & 0x00FF00FF;
500 u32 c01 = (color0._color & 0xFF00FF00) >> 8;
501 u32 c10 = color1._color & 0x00FF00FF;
502 u32 c11 = (color1._color & 0xFF00FF00) >> 8;
503
504 c00 = ((c00 * ut0 + c10 * ut1) & 0xFF00FF00) >> 8;
505 c01 = (c01 * ut0 + c11 * ut1) & 0xFF00FF00;
506
507 dst._color = c00 | c01;
508 return dst;
509}
510
511//---------------------------------------------------------------------------
512// スカラ加算
515//---------------------------------------------------------------------------
516GX_FORCE_INLINE const GxColor& GxColor::addScalar(u32 scalar)
517{
518 u32 a0 = _color & MASK_ALPHA;
519#if GX_COLOR_RGB_SWAP
520 u32 c0 = _color;
521#else //GX_COLOR_RGB_SWAP
522 u32 c0 = _color >> 8;
523#endif // !GX_COLOR_RGB_SWAP
524 u32 c1 = (scalar << 16) + (scalar << 8) + scalar;
525
526 u32 c = (((c0 & c1) << 1) + ((c0 ^ c1) & 0x00FEFEFE)) & 0x01010100;
527 c = ((c >> 8) + 0x007F7F7F) ^ 0x007F7F7F;
528
529#if GX_COLOR_RGB_SWAP
530 _color = (c0 + c1 - c) | c | a0;
531#else //GX_COLOR_RGB_SWAP
532 _color = (((c0 + c1 - c) | c) << 8) | a0;
533#endif // !GX_COLOR_RGB_SWAP
534
535 return *this;
536}
537
538//---------------------------------------------------------------------------
539// スカラ減算
542//---------------------------------------------------------------------------
543GX_FORCE_INLINE const GxColor& GxColor::subScalar(u32 scalar)
544{
545 u32 a0 = _color & MASK_ALPHA;
546#if GX_COLOR_RGB_SWAP
547 u32 c0 = _color;
548#else //GX_COLOR_RGB_SWAP
549 u32 c0 = _color >> 8;
550#endif // !GX_COLOR_RGB_SWAP
551 u32 c1 = (scalar << 16) + (scalar << 8) + scalar;
552
553 u32 c = (((~c0 & c1) << 1) + ((~c0 ^ c1) & 0x00FEFEFE)) & 0x01010100;
554 c = ((c >> 8) + 0x007F7F7F) ^ 0x007F7F7F;
555
556#if GX_COLOR_RGB_SWAP
557 _color = (c0 | c) - (c1 | c) | a0;
558#else //GX_COLOR_RGB_SWAP
559 _color = (((c0 | c) - (c1 | c)) << 8) | a0;
560#endif // !GX_COLOR_RGB_SWAP
561
562 return *this;
563}
564
565//---------------------------------------------------------------------------
566// スカラ乗算
569//---------------------------------------------------------------------------
570GX_FORCE_INLINE const GxColor& GxColor::mulScalar(f32 scalar)
571{
572 _red = GxMath::getMax(GxMath::getMin(static_cast<u32>(_red * scalar), static_cast<u32>(255)), static_cast<u32>(0));
573 _green = GxMath::getMax(GxMath::getMin(static_cast<u32>(_green * scalar), static_cast<u32>(255)), static_cast<u32>(0));
574 _blue = GxMath::getMax(GxMath::getMin(static_cast<u32>(_blue * scalar), static_cast<u32>(255)), static_cast<u32>(0));
575
576 return *this;
577}
578
579//---------------------------------------------------------------------------
580// スカラ除算
583//---------------------------------------------------------------------------
584GX_FORCE_INLINE const GxColor& GxColor::divScalar(f32 scalar)
585{
586 f32 invScalar = 1.0f / scalar;
587
588 _red = GxMath::getMax(GxMath::getMin(static_cast<u32>(_red * invScalar), static_cast<u32>(255)), static_cast<u32>(0));
589 _green = GxMath::getMax(GxMath::getMin(static_cast<u32>(_green * invScalar), static_cast<u32>(255)), static_cast<u32>(0));
590 _blue = GxMath::getMax(GxMath::getMin(static_cast<u32>(_blue * invScalar), static_cast<u32>(255)), static_cast<u32>(0));
591
592 return *this;
593}
594
595//---------------------------------------------------------------------------
596// カラー加算
599//---------------------------------------------------------------------------
600GX_FORCE_INLINE const GxColor& GxColor::addColor(const GxColor color)
601{
602 u32 a0 = _color & MASK_ALPHA;
603#if GX_COLOR_RGB_SWAP
604 u32 c0 = _color;
605 u32 c1 = color._color;
606#else //GX_COLOR_RGB_SWAP
607 u32 c0 = _color >> 8;
608 u32 c1 = color._color >> 8;
609#endif // !GX_COLOR_RGB_SWAP
610
611 u32 c = (((c0 & c1) << 1) + ((c0 ^ c1) & 0x00FEFEFE)) & 0x01010100;
612 c = ((c >> 8) + 0x007F7F7F) ^ 0x007F7F7F;
613
614#if GX_COLOR_RGB_SWAP
615 _color = (c0 + c1 - c) | c | a0;
616#else //GX_COLOR_RGB_SWAP
617 _color = (((c0 + c1 - c) | c) << 8) | a0;
618#endif // !GX_COLOR_RGB_SWAP
619
620 return *this;
621}
622
623//---------------------------------------------------------------------------
624// カラー減算
627//---------------------------------------------------------------------------
628GX_FORCE_INLINE const GxColor& GxColor::subColor(const GxColor color)
629{
630 u32 a0 = _color & MASK_ALPHA;
631#if GX_COLOR_RGB_SWAP
632 u32 c0 = _color;
633 u32 c1 = color._color;
634#else //GX_COLOR_RGB_SWAP
635 u32 c0 = _color >> 8;
636 u32 c1 = color._color >> 8;
637#endif // !GX_COLOR_RGB_SWAP
638
639 u32 c = (((~c0 & c1) << 1) + ((~c0 ^ c1) & 0x00FEFEFE)) & 0x01010100;
640 c = ((c >> 8) + 0x007F7F7F) ^ 0x007F7F7F;
641
642#if GX_COLOR_RGB_SWAP
643 _color = (c0 | c) - (c1 | c) | a0;
644#else //GX_COLOR_RGB_SWAP
645 _color = (((c0 | c) - (c1 | c)) << 8) | a0;
646#endif // !GX_COLOR_RGB_SWAP
647
648 return *this;
649}
650
651//---------------------------------------------------------------------------
652// カラー乗算
655//---------------------------------------------------------------------------
656GX_FORCE_INLINE const GxColor& GxColor::mulColor(const GxColor color)
657{
658 _red = (_red * color._red + 255) >> 8;
659 _green = (_green * color._green + 255) >> 8;
660 _blue = (_blue * color._blue + 255) >> 8;
661 _alpha = (_alpha * color._alpha + 255) >> 8;
662
663 return *this;
664}
665
666//---------------------------------------------------------------------------
667// PS3メモリ配置の色をWindowsメモリ配置の色に変換
671//---------------------------------------------------------------------------
672GX_FORCE_INLINE GxColor GxColor::convertPs3ToWindows(const GxColor ps3Color)
673{
674 // windowsメモリ配置では ARGB
675 // ps3 メモリ配置では RGBA
676 GxColor windowsColor;
677
678#if GX_BIG_ENDIAN
679 // ビッグエンディアンでは RGBA -> ARGB
680 windowsColor._color = (ps3Color._color << 24) // A
681 | (ps3Color._color >> 8); // RGB
682#else
683 // リトルエンディアンでは ABGR -> ARGB
684 windowsColor._color = (ps3Color._color & 0xFF00FF00) // A G
685 | ((ps3Color._color & 0x000000FF) << 16) // R
686 | ((ps3Color._color & 0x00FF0000) >> 16); // B
687#endif //GX_LITTLE_ENDIAN
688
689 return windowsColor;
690}
691
692//---------------------------------------------------------------------------
693// Windowsメモリ配置の色をPS3メモリ配置の色に変換
697//---------------------------------------------------------------------------
698GX_FORCE_INLINE GxColor GxColor::convertWindowsToPs3(const GxColor windowsColor)
699{
700 // windowsメモリ配置では ARGB
701 // ps3 メモリ配置では RGBA
702 GxColor ps3Color;
703
704#if GX_BIG_ENDIAN
705 // ビッグエンディアンでは ARGB -> RGBA
706 ps3Color._color = (windowsColor._color >> 24) // A
707 | (windowsColor._color << 8); // RGB
708#else
709 // リトルエンディアンでは ARGB -> ABGR
710 ps3Color._color = (windowsColor._color & 0xFF00FF00) // A G
711 | ((windowsColor._color & 0x000000FF) << 16) // B
712 | ((windowsColor._color & 0x00FF0000) >> 16); // R
713#endif //GX_LITTLE_ENDIAN
714
715 return ps3Color;
716}
717
718//===========================================================================
719// GxColorHDR
720//===========================================================================
721//---------------------------------------------------------------------------
722// コンストラクタ
727//---------------------------------------------------------------------------
728GX_FORCE_INLINE GxColorHDR::GxColorHDR(f32 red, f32 green, f32 blue, f32 alpha)
729: _red(red)
730, _green(green)
731, _blue(blue)
732, _alpha(alpha)
733{
734}
735
736//---------------------------------------------------------------------------
737// コンストラクタ
739//---------------------------------------------------------------------------
740GX_FORCE_INLINE GxColorHDR::GxColorHDR(const GxColor color)
741: _red(color._red / 255.0f)
742, _green(color._green / 255.0f)
743, _blue(color._blue / 255.0f)
744, _alpha(color._alpha / 255.0f)
745{
746}
747
748//---------------------------------------------------------------------------
749// コピーコンストラクタ
751//---------------------------------------------------------------------------
752GX_FORCE_INLINE GxColorHDR::GxColorHDR(const GxColorHDR& color)
753: _red(color._red)
754, _green(color._green)
755, _blue(color._blue)
756, _alpha(color._alpha)
757{
758}
759
760//---------------------------------------------------------------------------
761// 代入
764//---------------------------------------------------------------------------
765GX_FORCE_INLINE GxColorHDR& GxColorHDR::operator = (const GxColorHDR& color)
766{
767 _red = color._red;
768 _green = color._green;
769 _blue = color._blue;
770 _alpha = color._alpha;
771 return *this;
772}
773
774//---------------------------------------------------------------------------
775// スカラ加算代入
778//---------------------------------------------------------------------------
779GX_FORCE_INLINE GxColorHDR& GxColorHDR::operator += (f32 scalar)
780{
781 addScalar(scalar);
782 return *this;
783}
784
785//---------------------------------------------------------------------------
786// スカラ減算代入
789//---------------------------------------------------------------------------
790GX_FORCE_INLINE GxColorHDR& GxColorHDR::operator -= (f32 scalar)
791{
792 subScalar(scalar);
793 return *this;
794}
795
796//---------------------------------------------------------------------------
797// スカラ乗算代入
800//---------------------------------------------------------------------------
801GX_FORCE_INLINE GxColorHDR& GxColorHDR::operator *= (f32 scalar)
802{
803 mulScalar(scalar);
804 return *this;
805}
806
807//---------------------------------------------------------------------------
808// スカラ除算代入
811//---------------------------------------------------------------------------
812GX_FORCE_INLINE GxColorHDR& GxColorHDR::operator /= (f32 scalar)
813{
814 divScalar(scalar);
815 return *this;
816}
817
818//---------------------------------------------------------------------------
819// カラー加算代入
822//---------------------------------------------------------------------------
823GX_FORCE_INLINE GxColorHDR& GxColorHDR::operator += (const GxColorHDR& color)
824{
825 addColor(color);
826 return *this;
827}
828
829//---------------------------------------------------------------------------
830// カラー減算代入
833//---------------------------------------------------------------------------
834GX_FORCE_INLINE GxColorHDR& GxColorHDR::operator -= (const GxColorHDR& color)
835{
836 subColor(color);
837 return *this;
838}
839
840//---------------------------------------------------------------------------
841// カラー乗算代入
844//---------------------------------------------------------------------------
845GX_FORCE_INLINE GxColorHDR& GxColorHDR::operator *= (const GxColorHDR& color)
846{
847 mulColor(color);
848 return *this;
849}
850
851//---------------------------------------------------------------------------
852// スカラ加算
856//---------------------------------------------------------------------------
857GX_FORCE_INLINE const GxColorHDR operator + (const GxColorHDR& color, f32 scalar)
858{
859 GxColorHDR result;
860 return GxColorHDR::getAddScalar(result, color, scalar);
861}
862
863//---------------------------------------------------------------------------
864// スカラ減算
868//---------------------------------------------------------------------------
869GX_FORCE_INLINE const GxColorHDR operator - (const GxColorHDR& color, f32 scalar)
870{
871 GxColorHDR result;
872 return GxColorHDR::getSubScalar(result, color, scalar);
873}
874
875//---------------------------------------------------------------------------
876// スカラ乗算
880//---------------------------------------------------------------------------
881GX_FORCE_INLINE const GxColorHDR operator * (const GxColorHDR& color, f32 scalar)
882{
883 GxColorHDR result;
884 return GxColorHDR::getMulScalar(result, color, scalar);
885}
886
887//---------------------------------------------------------------------------
888// スカラ乗算
892//---------------------------------------------------------------------------
893GX_FORCE_INLINE const GxColorHDR operator * (f32 scalar, const GxColorHDR& color)
894{
895 GxColorHDR result;
896 return GxColorHDR::getMulScalar(result, color, scalar);
897}
898
899//---------------------------------------------------------------------------
900// スカラ除算
904//---------------------------------------------------------------------------
905GX_FORCE_INLINE const GxColorHDR operator / (const GxColorHDR& color, f32 scalar)
906{
907 GxColorHDR result;
908 return GxColorHDR::getDivScalar(result, color, scalar);
909}
910
911//---------------------------------------------------------------------------
912// カラー加算
916//---------------------------------------------------------------------------
917GX_FORCE_INLINE const GxColorHDR operator + (const GxColorHDR& color0, const GxColorHDR& color1)
918{
919 GxColorHDR result;
920 return GxColorHDR::getAddColor(result, color0, color1);
921}
922
923//---------------------------------------------------------------------------
924// カラー減算
928//---------------------------------------------------------------------------
929GX_FORCE_INLINE const GxColorHDR operator - (const GxColorHDR& color0, const GxColorHDR& color1)
930{
931 GxColorHDR result;
932 return GxColorHDR::getSubColor(result, color0, color1);
933}
934
935//---------------------------------------------------------------------------
936// カラー乗算
940//---------------------------------------------------------------------------
941GX_FORCE_INLINE const GxColorHDR operator * (const GxColorHDR& color0, const GxColorHDR& color1)
942{
943 GxColorHDR result;
944 return GxColorHDR::getMulColor(result, color0, color1);
945}
946
947//---------------------------------------------------------------------------
948// 一致
952//---------------------------------------------------------------------------
953GX_FORCE_INLINE b32 operator == (const GxColorHDR& color0, const GxColorHDR& color1)
954{
955 return (color0._red == color1._red) && (color0._green == color1._green) && (color0._blue == color1._blue) && (color0._alpha == color1._alpha);
956}
957
958//---------------------------------------------------------------------------
959// 不一致
963//---------------------------------------------------------------------------
964GX_FORCE_INLINE b32 operator != (const GxColorHDR& color0, const GxColorHDR& color1)
965{
966 return (color0._red != color1._red) || (color0._green != color1._green) || (color0._blue != color1._blue) || (color0._alpha != color1._alpha);
967}
968
969//---------------------------------------------------------------------------
970// スカラ加算を取得
975//---------------------------------------------------------------------------
976GX_FORCE_INLINE const GxColorHDR& GxColorHDR::getAddScalar(GxColorHDR& dst, const GxColorHDR& color, f32 scalar)
977{
978 dst._red = color._red + scalar;
979 dst._green = color._green + scalar;
980 dst._blue = color._blue + scalar;
981 dst._alpha = color._alpha;
982
983 return dst;
984}
985
986//---------------------------------------------------------------------------
987// スカラ減算を取得
992//---------------------------------------------------------------------------
993GX_FORCE_INLINE const GxColorHDR& GxColorHDR::getSubScalar(GxColorHDR& dst, const GxColorHDR& color, f32 scalar)
994{
995 dst._red = color._red - scalar;
996 dst._green = color._green - scalar;
997 dst._blue = color._blue - scalar;
998 dst._alpha = color._alpha;
999
1000 return dst;
1001}
1002
1003//---------------------------------------------------------------------------
1004// スカラ乗算を取得
1009//---------------------------------------------------------------------------
1010GX_FORCE_INLINE const GxColorHDR& GxColorHDR::getMulScalar(GxColorHDR& dst, const GxColorHDR& color, f32 scalar)
1011{
1012 dst._red = color._red * scalar;
1013 dst._green = color._green * scalar;
1014 dst._blue = color._blue * scalar;
1015 dst._alpha = color._alpha;
1016
1017 return dst;
1018}
1019
1020//---------------------------------------------------------------------------
1021// スカラ除算を取得
1026//---------------------------------------------------------------------------
1027GX_FORCE_INLINE const GxColorHDR& GxColorHDR::getDivScalar(GxColorHDR& dst, const GxColorHDR& color, f32 scalar)
1028{
1029 f32 invScalar = 1.0f / scalar;
1030
1031 dst._red = color._red * invScalar;
1032 dst._green = color._green * invScalar;
1033 dst._blue = color._blue * invScalar;
1034 dst._alpha = color._alpha;
1035
1036 return dst;
1037}
1038
1039//---------------------------------------------------------------------------
1040// カラー加算を取得
1045//---------------------------------------------------------------------------
1046GX_FORCE_INLINE const GxColorHDR& GxColorHDR::getAddColor(GxColorHDR& dst, const GxColorHDR& color0, const GxColorHDR& color1)
1047{
1048 dst._red = color0._red + color1._red;
1049 dst._green = color0._green + color1._green;
1050 dst._blue = color0._blue + color1._blue;
1051 dst._alpha = color0._alpha;
1052
1053 return dst;
1054}
1055
1056//---------------------------------------------------------------------------
1057// カラー減算を取得
1062//---------------------------------------------------------------------------
1063GX_FORCE_INLINE const GxColorHDR& GxColorHDR::getSubColor(GxColorHDR& dst, const GxColorHDR& color0, const GxColorHDR& color1)
1064{
1065 dst._red = color0._red - color1._red;
1066 dst._green = color0._green - color1._green;
1067 dst._blue = color0._blue - color1._blue;
1068 dst._alpha = color0._alpha;
1069
1070 return dst;
1071}
1072
1073//---------------------------------------------------------------------------
1074// カラー乗算を取得
1079//---------------------------------------------------------------------------
1080GX_FORCE_INLINE const GxColorHDR& GxColorHDR::getMulColor(GxColorHDR& dst, const GxColorHDR& color0, const GxColorHDR& color1)
1081{
1082 dst._red = color0._red * color1._red;
1083 dst._green = color0._green * color1._green;
1084 dst._blue = color0._blue * color1._blue;
1085 dst._alpha = color0._alpha * color1._alpha;
1086
1087 return dst;
1088}
1089
1090//---------------------------------------------------------------------------
1091// 補間値を取得
1097//---------------------------------------------------------------------------
1098GX_FORCE_INLINE const GxColorHDR& GxColorHDR::getLerp(GxColorHDR& dst, const GxColorHDR& color0, const GxColorHDR& color1, f32 t)
1099{
1100 dst._red = color0._red + (color1._red - color0._red ) * t;
1101 dst._green = color0._green + (color1._green - color0._green ) * t;
1102 dst._blue = color0._blue + (color1._blue - color0._blue ) * t;
1103 dst._alpha = color0._alpha + (color1._alpha - color0._alpha ) * t;
1104
1105 return dst;
1106}
1107
1108//---------------------------------------------------------------------------
1109// スカラ加算
1112//---------------------------------------------------------------------------
1113GX_FORCE_INLINE const GxColorHDR& GxColorHDR::addScalar(f32 scalar)
1114{
1115 _red += scalar;
1116 _green += scalar;
1117 _blue += scalar;
1118
1119 return *this;
1120}
1121
1122//---------------------------------------------------------------------------
1123// スカラ減算
1126//---------------------------------------------------------------------------
1127GX_FORCE_INLINE const GxColorHDR& GxColorHDR::subScalar(f32 scalar)
1128{
1129 _red -= scalar;
1130 _green -= scalar;
1131 _blue -= scalar;
1132
1133 return *this;
1134}
1135
1136//---------------------------------------------------------------------------
1137// スカラ乗算
1140//---------------------------------------------------------------------------
1141GX_FORCE_INLINE const GxColorHDR& GxColorHDR::mulScalar(f32 scalar)
1142{
1143 _red *= scalar;
1144 _green *= scalar;
1145 _blue *= scalar;
1146
1147 return *this;
1148}
1149
1150//---------------------------------------------------------------------------
1151// スカラ除算
1154//---------------------------------------------------------------------------
1155GX_FORCE_INLINE const GxColorHDR& GxColorHDR::divScalar(f32 scalar)
1156{
1157 f32 invScalar = 1.0f / scalar;
1158
1159 _red *= invScalar;
1160 _green *= invScalar;
1161 _blue *= invScalar;
1162
1163 return *this;
1164}
1165
1166//---------------------------------------------------------------------------
1167// カラー加算
1170//---------------------------------------------------------------------------
1171GX_FORCE_INLINE const GxColorHDR& GxColorHDR::addColor(const GxColorHDR& color)
1172{
1173 _red += color._red;
1174 _green += color._green;
1175 _blue += color._blue;
1176
1177 return *this;
1178}
1179
1180//---------------------------------------------------------------------------
1181// カラー減算
1184//---------------------------------------------------------------------------
1185GX_FORCE_INLINE const GxColorHDR& GxColorHDR::subColor(const GxColorHDR& color)
1186{
1187 _red -= color._red;
1188 _green -= color._green;
1189 _blue -= color._blue;
1190
1191 return *this;
1192}
1193
1194//---------------------------------------------------------------------------
1195// カラー乗算
1198//---------------------------------------------------------------------------
1199GX_FORCE_INLINE const GxColorHDR& GxColorHDR::mulColor(const GxColorHDR& color)
1200{
1201 _red *= color._red;
1202 _green *= color._green;
1203 _blue *= color._blue;
1204 _alpha *= color._alpha;
1205
1206 return *this;
1207}
1208
1209//===========================================================================
1210// GxColorHSV
1211//===========================================================================
1212//---------------------------------------------------------------------------
1213// コンストラクタ
1218//---------------------------------------------------------------------------
1219GX_FORCE_INLINE GxColorHSV::GxColorHSV(f32 hue, f32 saturation, f32 value, f32 alpha)
1220: _hue(hue)
1221, _saturation(saturation)
1222, _value(value)
1223, _alpha(alpha)
1224{
1225}
1226
1227//---------------------------------------------------------------------------
1228// コンストラクタ
1230//---------------------------------------------------------------------------
1231GX_FORCE_INLINE GxColorHSV::GxColorHSV(const GxColorHDR& color)
1232{
1233 setRgb(color);
1234}
1235
1236//---------------------------------------------------------------------------
1237// コピーコンストラクタ
1239//---------------------------------------------------------------------------
1240GX_FORCE_INLINE GxColorHSV::GxColorHSV(const GxColorHSV& color)
1241: _hue(color._hue)
1242, _saturation(color._saturation)
1243, _value(color._value)
1244, _alpha(color._alpha)
1245{
1246}
1247
1248//---------------------------------------------------------------------------
1249// 代入
1252//---------------------------------------------------------------------------
1253GX_FORCE_INLINE GxColorHSV& GxColorHSV::operator = (const GxColorHSV& color)
1254{
1255 _hue = color._hue;
1256 _saturation = color._saturation;
1257 _value = color._value;
1258 _alpha = color._alpha;
1259 return *this;
1260}
1261
1262//---------------------------------------------------------------------------
1263// 一致
1267//---------------------------------------------------------------------------
1268GX_FORCE_INLINE b32 operator == (const GxColorHSV& color0, const GxColorHSV& color1)
1269{
1270 return (color0._hue == color1._hue) && (color0._saturation == color1._saturation) && (color0._value == color1._value) && (color0._alpha == color1._alpha);
1271}
1272
1273//---------------------------------------------------------------------------
1274// 不一致
1278//---------------------------------------------------------------------------
1279GX_FORCE_INLINE b32 operator != (const GxColorHSV& color0, const GxColorHSV& color1)
1280{
1281 return (color0._hue != color1._hue) || (color0._saturation != color1._saturation) || (color0._value != color1._value) || (color0._alpha != color1._alpha);
1282}
1283
1284//---------------------------------------------------------------------------
1285// RGBを設定
1287//---------------------------------------------------------------------------
1288GX_FORCE_INLINE void GxColorHSV::setRgb(const GxColorHDR& color)
1289{
1290 rgb2hsv(color, *this);
1291}
1292
1293//---------------------------------------------------------------------------
1294// RGBを取得
1297//---------------------------------------------------------------------------
1298GX_FORCE_INLINE GxColorHDR GxColorHSV::getRgb(void) const
1299{
1300 GxColorHDR rgb;
1301 hsv2rgb(*this, rgb);
1302
1303 return rgb;
1304}
1305
1306//---------------------------------------------------------------------------
1307// 反転色(色相だけ)を取得
1311//---------------------------------------------------------------------------
1312GX_FORCE_INLINE const GxColorHSV& GxColorHSV::getInvertHue(GxColorHSV& dst, const GxColorHSV& color)
1313{
1314 dst._hue = color._hue + 180.0f;
1315 dst._saturation = color._saturation;
1316 dst._value = color._value;
1317 dst._alpha = color._alpha;
1318
1319 if (360.0f < dst._hue)
1320 {
1321 dst._hue -= 360.0f;
1322 }
1323 return dst;
1324}
1325
1326GX_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
static GX_FORCE_INLINE T getClamp(const T value, const T min, const T max)
最小値・最大値で切り落とす
Definition GxMath.h:170
static GX_FORCE_INLINE T getMax(const T value0, const T value1)
大きいほうを取得
Definition GxMath.h:174
static GX_FORCE_INLINE T getMin(const T value0, const T value1)
小さいほうを取得
Definition GxMath.h:172
色(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
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
GX_FORCE_INLINE GxColorHDR & operator*=(f32 scalar)
スカラ乗算代入
Definition GxColor.inl:801
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
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
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
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
f32 _hue
色相(0.0f~360.0f)
Definition GxColor.h:441
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
Definition GxColor.h:21
static GX_FORCE_INLINE const GxColor & getDivScalar(GxColor &dst, const GxColor color, f32 scalar)
スカラ除算を取得
Definition GxColor.inl:372
static GX_FORCE_INLINE GxColor convertWindowsToPs3(const GxColor windowsColor)
Windowsメモリ配置の色をPS3メモリ配置の色に変換
Definition GxColor.inl:698
GX_FORCE_INLINE GxColor & operator/=(f32 scalar)
スカラ除算代入
Definition GxColor.inl:133
GX_FORCE_INLINE GxColor & operator*=(f32 scalar)
スカラ乗算代入
Definition GxColor.inl:122
GX_FORCE_INLINE const GxColor & addColor(const GxColor color)
カラー加算
Definition GxColor.inl:600
static GX_FORCE_INLINE const GxColor & getAddScalar(GxColor &dst, const GxColor color, u32 scalar)
スカラ加算を取得
Definition GxColor.inl:297
static GX_FORCE_INLINE const GxColor & getSubScalar(GxColor &dst, const GxColor color, u32 scalar)
スカラ減算を取得
Definition GxColor.inl:326
u32 _green
Definition GxColor.h:226
GX_FORCE_INLINE const GxColor & addScalar(u32 scalar)
スカラ加算
Definition GxColor.inl:516
static GX_FORCE_INLINE const GxColor & getSubColor(GxColor &dst, const GxColor color0, const GxColor color1)
カラー減算を取得
Definition GxColor.inl:421
static GX_FORCE_INLINE const GxColor & getMulColor(GxColor &dst, const GxColor color0, const GxColor color1)
カラー乗算を取得
Definition GxColor.inl:451
u32 _red
Definition GxColor.h:225
GX_FORCE_INLINE GxColor & operator=(const GxColor color)
代入
Definition GxColor.inl:89
u32 _blue
Definition GxColor.h:227
GX_FORCE_INLINE const GxColor & divScalar(f32 scalar)
スカラ除算
Definition GxColor.inl:584
u32 _alpha
アルファ
Definition GxColor.h:228
GX_FORCE_INLINE const GxColor & subScalar(u32 scalar)
スカラ減算
Definition GxColor.inl:543
GX_FORCE_INLINE const GxColor & mulScalar(f32 scalar)
スカラ乗算
Definition GxColor.inl:570
GX_FORCE_INLINE GxColor & operator+=(u32 scalar)
スカラ加算代入
Definition GxColor.inl:100
static GX_FORCE_INLINE GxColor convertPs3ToWindows(const GxColor ps3Color)
PS3メモリ配置の色をWindowsメモリ配置の色に変換
Definition GxColor.inl:672
static GX_FORCE_INLINE const GxColor & getMulScalar(GxColor &dst, const GxColor color, f32 scalar)
スカラ乗算を取得
Definition GxColor.inl:355
GxColor(void)
デフォルトコンストラクタ
Definition GxColor.h:76
static GX_FORCE_INLINE GxColor getLerp(const GxColor color0, const GxColor color1, f32 t)
補間値を取得(互換用)
Definition GxColor.inl:468
static GX_FORCE_INLINE const GxColor & getAddColor(GxColor &dst, const GxColor color0, const GxColor color1)
カラー加算を取得
Definition GxColor.inl:391
GX_FORCE_INLINE GxColor & operator-=(u32 scalar)
スカラ減算代入
Definition GxColor.inl:111
GX_FORCE_INLINE const GxColor & mulColor(const GxColor color)
カラー乗算
Definition GxColor.inl:656
GX_FORCE_INLINE const GxColor & subColor(const GxColor color)
カラー減算
Definition GxColor.inl:628
32bitブーリアン
Definition GxDefine.h:173