Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
Float16Color.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreTypes.h"
6#include "Math/Color.h"
7#include "Math/Float16.h"
8
9/**
10 * RGBA Color made up of FFloat16
11 */
13{
14public:
15
20
21 /* Get as a pointer to four half floats */
22 uint16 * GetFourHalves() { return (uint16 *)this; }
23 const uint16 * GetFourHalves() const { return (const uint16 *)this; }
24
25 const FLinearColor GetFloats() const;
26
27 /** Default constructor */
29
30 /** Copy constructor. */
31 FFloat16Color(const FFloat16Color& Src);
32
33 /** Constructor from a linear color. */
34 FFloat16Color(const FLinearColor& Src);
35
36 /** assignment operator */
38
39 /**
40 * Checks whether two colors are identical.
41 *
42 * @param Src The other color.
43 * @return true if the two colors are identical, otherwise false.
44 */
45 bool operator==(const FFloat16Color& Src) const;
46};
47
48
50
51
53{
54 R = Src.R;
55 G = Src.G;
56 B = Src.B;
57 A = Src.A;
58}
59
60
62{
63 FPlatformMath::VectorStoreHalf( GetFourHalves(), (const float *)&Src );
64}
65
66
68{
69 FLinearColor Ret;
70 FPlatformMath::VectorLoadHalf( (float *)&Ret, GetFourHalves() );
71 return Ret;
72}
73
74
76{
77 R = Src.R;
78 G = Src.G;
79 B = Src.B;
80 A = Src.A;
81 return *this;
82}
83
85{
86 return (
87 (R == Src.R) &&
88 (G == Src.G) &&
89 (B == Src.B) &&
90 (A == Src.A)
91 );
92}
#define FORCEINLINE
Definition Platform.h:644
FFloat16Color(const FFloat16Color &Src)
const uint16 * GetFourHalves() const
bool operator==(const FFloat16Color &Src) const
const FLinearColor GetFloats() const
uint16 * GetFourHalves()
FFloat16Color(const FLinearColor &Src)
FFloat16Color & operator=(const FFloat16Color &Src)
FFloat16 & operator=(const FFloat16 &FP16Value)
Definition Float16.h:147