UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
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
13{
14public:
15
20
21 /* Get as a pointer to four half floats */
23 {
24 return (uint16 *)this;
25 }
26 [[nodiscard]] const uint16 * GetFourHalves() const
27 {
28 return (const uint16 *)this;
29 }
30
31 [[nodiscard]] const FLinearColor GetFloats() const;
32
35
38
40 [[nodiscard]] FFloat16Color(const FLinearColor& Src);
41
44
51 [[nodiscard]] bool operator==(const FFloat16Color& Src) const;
52};
53
54
56
57
59{
60 R = Src.R;
61 G = Src.G;
62 B = Src.B;
63 A = Src.A;
64}
65
66
68{
69 FPlatformMath::VectorStoreHalf( GetFourHalves(), (const float *)&Src );
70}
71
72
74{
75 FLinearColor Ret;
76 FPlatformMath::VectorLoadHalf( (float *)&Ret, GetFourHalves() );
77 return Ret;
78}
79
80
82{
83 R = Src.R;
84 G = Src.G;
85 B = Src.B;
86 A = Src.A;
87 return *this;
88}
89
90inline bool FFloat16Color::operator==(const FFloat16Color& Src) const
91{
92 return (
93 (R == Src.R) &&
94 (G == Src.G) &&
95 (B == Src.B) &&
96 (A == Src.A)
97 );
98}
#define UE_FORCEINLINE_HINT
Definition Platform.h:723
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
uint16_t uint16
Definition binka_ue_file_header.h:7
Definition Float16Color.h:13
const uint16 * GetFourHalves() const
Definition Float16Color.h:26
const FLinearColor GetFloats() const
Definition Float16Color.h:73
bool operator==(const FFloat16Color &Src) const
Definition Float16Color.h:90
FFloat16 A
Definition Float16Color.h:19
FFloat16 R
Definition Float16Color.h:16
FFloat16Color()
Definition Float16Color.h:55
FFloat16Color & operator=(const FFloat16Color &Src)
Definition Float16Color.h:81
FFloat16 G
Definition Float16Color.h:17
FFloat16 B
Definition Float16Color.h:18
uint16 * GetFourHalves()
Definition Float16Color.h:22
Definition Float16.h:34
Definition Color.h:48