UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
CurveLinearColor.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
7#include "Curves/RichCurve.h"
8#include "Curves/CurveBase.h"
9#include "CurveLinearColor.generated.h"
10
12
13USTRUCT(BlueprintType)
15{
17public:
18 UPROPERTY()
19 FRichCurve ColorCurves[4];
20
21 UPROPERTY(EditAnywhere, Category = RuntimeFloatCurve)
22 TObjectPtr<class UCurveLinearColor> ExternalCurve = nullptr;
23
24 ENGINE_API FLinearColor GetLinearColorValue(float InTime) const;
25};
26
27UCLASS(BlueprintType, collapsecategories, hidecategories = (FilePath), MinimalAPI)
29{
31
32
33 UPROPERTY()
34 FRichCurve FloatCurves[4];
35
36 // Begin FCurveOwnerInterface
37 UE_DEPRECATED(5.6, "Use version taking a TAdderReserverRef")
38 ENGINE_API virtual TArray<FRichCurveEditInfoConst> GetCurves() const override;
39 ENGINE_API virtual void GetCurves(TAdderReserverRef<FRichCurveEditInfoConst> Curves) const override;
40 ENGINE_API virtual TArray<FRichCurveEditInfo> GetCurves() override;
41 virtual bool IsLinearColorCurve() const override { return true; }
42
43 // GetLinearColorValue allows RGB > 1 for HDR
44 // if the input curves are LDR (<= 1) then the output is clamped to stay LDR, even if Adjustments would have changed it
45 UFUNCTION(BlueprintCallable, Category="Math|Curves")
46 ENGINE_API virtual FLinearColor GetLinearColorValue(float InTime) const override;
47
48 // GetClampedLinearColorValue always clamps RGB in [0,1] , eg. returns LDR colors
49 UFUNCTION(BlueprintCallable, Category = "Math|Curves")
50 ENGINE_API virtual FLinearColor GetClampedLinearColorValue(float InTime) const override;
51
52 // GetUnadjustedLinearColorValue returns the raw curve values without color adjustments
53 // also does NOT clamp in [0,1] , beware how the RGBA is used, you may want clamping, at least >= 0
54 UFUNCTION(BlueprintCallable, Category = "Math|Curves")
55 ENGINE_API FLinearColor GetUnadjustedLinearColorValue(float InTime) const;
56
57 bool HasAnyAlphaKeys() const override { return FloatCurves[3].GetNumKeys() > 0; }
58
59 ENGINE_API virtual bool IsValidCurve( FRichCurveEditInfo CurveInfo ) override;
60 // End FCurveOwnerInterface
61
63 ENGINE_API bool operator == (const UCurveLinearColor& Curve) const;
64
65public:
66#if WITH_EDITOR
67
68 ENGINE_API virtual void PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent) override;
69
71
73
75
77#endif
78 ENGINE_API virtual void PostLoad() override;
79
80 ENGINE_API virtual void Serialize(FArchive& Ar) override;
81
82public:
83 // Properties for adjusting the color of the gradient
84 UPROPERTY(EditAnywhere, Category="Color", meta = (ClampMin = "0.0", ClampMax = "359.0"))
86
87 UPROPERTY(EditAnywhere, Category = "Color", meta = (ClampMin = "0.0", ClampMax = "1.0"))
89
90 UPROPERTY(EditAnywhere, Category = "Color", meta = (ClampMin = "0.0", ClampMax = "1.0"))
92
93 UPROPERTY(EditAnywhere, Category = "Color", meta = (ClampMin = "0.0", ClampMax = "1.0"))
95
96 UPROPERTY(EditAnywhere, Category = "Color", meta = (ClampMin = "0.0", ClampMax = "1.0"))
98
99 UPROPERTY(EditAnywhere, Category = "Color", meta = (ClampMin = "0.0", ClampMax = "1.0"))
101
102 UPROPERTY(EditAnywhere, Category = "Color", meta = (ClampMin = "0.0", ClampMax = "1.0"))
104
105private:
106
107 // if bClampOver1Always is true, clamping in [0,1] is always done
108 // if bClampOver1Always is false, clamp in [0,1] is still done if the source RGB is in [0,1] , but NOT if source RGB is > 1
109 FLinearColor GetAdjustedColorValue(float InTime, bool bClampOver1Always) const;
110};
111
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
#define USTRUCT(...)
Definition ObjectMacros.h:746
#define GENERATED_USTRUCT_BODY(...)
Definition ObjectMacros.h:767
USkinnedMeshComponent float
Definition SkinnedMeshComponent.h:60
Definition Archive.h:1208
Definition CanvasTypes.h:211
Definition ArrayView.h:139
Definition Array.h:670
Definition CurveBase.h:20
virtual ENGINE_API void OnCurveChanged(const TArray< FRichCurveEditInfo > &ChangedCurveEditInfos) override
Definition CurveBase.cpp:106
Definition CurveLinearColor.h:29
float AdjustVibrance
Definition CurveLinearColor.h:97
float AdjustBrightnessCurve
Definition CurveLinearColor.h:94
float AdjustHue
Definition CurveLinearColor.h:85
float AdjustMaxAlpha
Definition CurveLinearColor.h:103
float AdjustBrightness
Definition CurveLinearColor.h:91
float AdjustSaturation
Definition CurveLinearColor.h:88
float AdjustMinAlpha
Definition CurveLinearColor.h:100
Definition Color.h:48
Definition UnrealType.h:6865
Definition RichCurve.h:470
Definition RichCurve.h:200
virtual int32 GetNumKeys() const final override
Definition RichCurve.h:350
Definition CurveLinearColor.h:15
Definition AdderRef.h:147
Definition ObjectPtr.h:488