UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IESLoader.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3
4#pragma once
5
6#include "CoreMinimal.h"
7
8//class Error;
9
10enum class EIESPhotometricType;
11
17{
18public:
20 FIESLoader(const uint8* Buffer, uint32 BufferLength);
21
22 // @return Multiplier as the texture is normalized
23 float ExtractInRGBA16F(TArray<uint8>& OutData);
24
25 bool IsValid() const;
26
27 uint32 GetWidth() const;
28 uint32 GetHeight() const;
29
31 float GetBrightness() const;
32
33 const TCHAR* GetError() const
34 {
35 return Error.IsEmpty() ? nullptr : *Error;
36 }
37
38private:
39
40 TArray<float> HAngles;
41 TArray<float> VAngles;
42 TArray<float> CandelaValues;
43
45 float Brightness;
46
48 float CachedIntegral;
49
51 EIESPhotometricType PhotometricType;
52
53 // will set Error to 0 on success
54 void Load(const uint8* Buffer);
55
56 // 0 if no error, otherwise points to an ASCII error string
57 FString Error;
58
59 float ComputeMax() const;
60
61 // integrate over the unit sphere
62 // @return in Candela
63 float ComputeFullIntegral();
64
65 static float ComputeFilterPos(float Value, const TArray<float>& SortedValues);
66
67 // low level code, only used by InterpolateBilinear
68 // @param X 0..HAngles.size()-1
69 // @param Y 0..VAngles.size()-1
70 float InterpolatePoint(int X, int Y) const;
71
72 // low level code, used by Interpolate2D() and Interpolate1D()
73 // @param fX 0..HAngles.size()-1
74 // @param fY 0..VAngles.size()-1
75 float InterpolateBilinear(float fX, float fY) const;
76
77 // high level code to compute the Candela value for a given direction
78 // @param HAngle n degrees e.g. 0..360
79 // @param VAngle n degrees e.g. 0..180
80 float Interpolate2D(float HAngle, float VAngle) const;
81
82 // like Interpolate2D but also integrates over HAngle
83 // @param VAngle n degrees e.g. 0..180
84 float Interpolate1D(float VAngle) const;
85};
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define X(Name, Desc)
Definition FormatStringSan.h:47
EIESPhotometricType
Definition IESLoader.cpp:21
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition IESLoader.h:17
bool IsValid() const
Definition IESLoader.cpp:357
uint32 GetWidth() const
Definition IESLoader.cpp:347
float ExtractInRGBA16F(TArray< uint8 > &OutData)
Definition IESLoader.cpp:367
uint32 GetHeight() const
Definition IESLoader.cpp:352
const TCHAR * GetError() const
Definition IESLoader.h:33
float GetBrightness() const
Definition IESLoader.cpp:362
Definition Array.h:670