UDocumentation
UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
OpenColorIOWrapper.h
Go to the documentation of this file.
1
// Copyright Epic Games, Inc. All Rights Reserved.
2
3
#pragma once
4
5
#if WITH_OCIO
6
7
#include "
CoreTypes.h
"
8
#include "
Containers/ContainersFwd.h
"
9
#include "
Containers/StaticArray.h
"
10
#include "
Math/Vector.h
"
11
#include "
Templates/PimplPtr.h
"
12
#include "
Templates/UniquePtr.h
"
13
14
#include "
ColorManagement/ColorManagementDefines.h
"
15
16
struct
FImageView
;
17
enum
TextureFilter
:
int
;
18
19
namespace
OpenColorIOWrapper
20
{
22
constexpr
const
TCHAR
*
GetWorkingColorSpaceName
()
23
{
24
return
TEXT
(
"Working Color Space"
);
25
}
26
28
constexpr
const
TCHAR
*
GetShaderFunctionName
()
29
{
30
return
TEXT
(
"OCIOConvert"
);
31
}
32
34
static
constexpr
uint32
Legacy3dEdgeLength
= 65;
35
37
OPENCOLORIOWRAPPER_API
const
TCHAR
* GetVersion();
38
40
OPENCOLORIOWRAPPER_API
uint32
GetVersionHex
();
41
43
OPENCOLORIOWRAPPER_API
void
ClearAllCaches
();
44
}
45
46
50
class
FOpenColorIOWrapperConfig
51
{
52
public
:
53
55
enum
EAddWorkingColorSpaceOption
56
{
57
WCS_None
,
58
// Add the working color space as ACES 2065-1 so that we can target it with an extra conversion from our config if it defines aces_interchange.
59
WCS_AsInterchangeSpace
60
};
61
63
FOpenColorIOWrapperConfig
();
64
71
OPENCOLORIOWRAPPER_API
explicit
FOpenColorIOWrapperConfig
(
FStringView
InFilePath
,
EAddWorkingColorSpaceOption
InOption
=
WCS_None
);
72
73
virtual
~FOpenColorIOWrapperConfig
() =
default
;
74
76
OPENCOLORIOWRAPPER_API
bool
IsValid
()
const
;
77
79
OPENCOLORIOWRAPPER_API
int32
GetNumColorSpaces
()
const
;
80
82
OPENCOLORIOWRAPPER_API
FString
GetColorSpaceName
(
int32
Index
)
const
;
83
85
OPENCOLORIOWRAPPER_API
int32
GetColorSpaceIndex
(
const
TCHAR
*
InColorSpaceName
);
86
88
OPENCOLORIOWRAPPER_API
FString
GetColorSpaceFamilyName
(
const
TCHAR
*
InColorSpaceName
)
const
;
89
91
OPENCOLORIOWRAPPER_API
FString
GetColorSpaceDescription
(
const
TCHAR
*
InColorSpaceName
)
const
;
92
94
OPENCOLORIOWRAPPER_API
int32
GetNumDisplays
()
const
;
95
97
OPENCOLORIOWRAPPER_API
FString GetDisplayName(
int32
Index
)
const
;
98
100
OPENCOLORIOWRAPPER_API
int32
GetNumViews(
const
TCHAR
*
InDisplayName
)
const
;
101
103
OPENCOLORIOWRAPPER_API
FString
GetViewName
(
const
TCHAR
*
InDisplayName
,
int32
Index
)
const
;
104
106
OPENCOLORIOWRAPPER_API
FString
GetDisplayViewTransformName
(
const
TCHAR
*
InDisplayName
,
const
TCHAR
*
InViewName
)
const
;
107
109
OPENCOLORIOWRAPPER_API
FString
GetDisplayViewDescription
(
const
TCHAR
*
InDisplayName
,
const
TCHAR
*
InViewName
)
const
;
110
112
OPENCOLORIOWRAPPER_API
FString
GetDisplayViewTransformDescription
(
const
TCHAR
*
InDisplayName
,
const
TCHAR
*
InViewName
)
const
;
113
115
OPENCOLORIOWRAPPER_API
TMap<FString, FString>
GetCurrentContextStringVars
()
const
;
116
118
OPENCOLORIOWRAPPER_API
FString
GetCacheID
()
const
;
119
121
OPENCOLORIOWRAPPER_API
FString GetDebugString()
const
;
122
123
protected
:
124
125
TPimplPtr<struct FOpenColorIOConfigPimpl, EPimplPtrMode::DeepCopy>
Pimpl;
126
127
friend
class
FOpenColorIOWrapperProcessor
;
128
friend
class
FOpenColorIOWrapperGPUProcessor
;
129
};
130
131
/* Matches FTextureSourceColorSettings in Engine/Texture.h */
132
struct
FOpenColorIOWrapperSourceColorSettings
133
{
135
UE::Color::EEncoding
EncodingOverride =
UE::Color::EEncoding::None
;
136
138
UE::Color::EColorSpace
ColorSpace =
UE::Color::EColorSpace::None
;
139
141
TOptional<TStaticArray<FVector2d, 4>
>
ColorSpaceOverride
= {};
142
144
UE::Color::EChromaticAdaptationMethod
ChromaticAdaptationMethod =
UE::Color::EChromaticAdaptationMethod::None
;
145
};
146
151
class
FOpenColorIOWrapperEngineConfig
:
public
FOpenColorIOWrapperConfig
152
{
153
public
:
157
FOpenColorIOWrapperEngineConfig
();
158
159
FOpenColorIOWrapperEngineConfig
(
FStringView
InFilePath
,
EAddWorkingColorSpaceOption
InOption
=
WCS_None
) =
delete
;
160
};
161
166
class
FOpenColorIOWrapperProcessor
final
167
{
168
public
:
169
173
OPENCOLORIOWRAPPER_API
FOpenColorIOWrapperProcessor
();
174
183
OPENCOLORIOWRAPPER_API
explicit
FOpenColorIOWrapperProcessor
(
184
const
FOpenColorIOWrapperConfig
*
InConfig
,
185
FStringView
InSourceColorSpace
,
186
FStringView
InDestinationColorSpace
,
187
const
TMap<FString, FString>
&
InContextKeyValues
= {}
188
);
189
200
OPENCOLORIOWRAPPER_API
explicit
FOpenColorIOWrapperProcessor
(
201
const
FOpenColorIOWrapperConfig
*
InConfig
,
202
FStringView
InSourceColorSpace
,
203
FStringView
InDisplay
,
204
FStringView
InView
,
205
bool
bInverseDirection
=
false
,
206
const
TMap<FString, FString>
&
InContextKeyValues
= {}
207
);
208
217
OPENCOLORIOWRAPPER_API
explicit
FOpenColorIOWrapperProcessor
(
218
const
FOpenColorIOWrapperConfig
*
InConfig
,
219
FStringView
InNamedTransform
,
220
bool
bInverseDirection
=
false
,
221
const
TMap<FString, FString>
&
InContextKeyValues
= {}
222
);
223
229
OPENCOLORIOWRAPPER_API
static
FOpenColorIOWrapperProcessor
CreateTransformToWorkingColorSpace
(
230
const
FOpenColorIOWrapperSourceColorSettings
&
InSourceColorSettings
231
);
232
234
OPENCOLORIOWRAPPER_API
bool
IsValid
()
const
;
235
237
OPENCOLORIOWRAPPER_API
FString
GetCacheID
()
const
;
238
244
OPENCOLORIOWRAPPER_API
static
FString
GetTransformToWorkingColorSpaceName
(
const
FOpenColorIOWrapperSourceColorSettings
&
InSourceColorSettings
);
245
247
OPENCOLORIOWRAPPER_API
bool
TransformColor
(
FLinearColor
&
InOutColor
)
const
;
248
250
OPENCOLORIOWRAPPER_API
bool
TransformImage
(
const
FImageView
&
InOutImage
)
const
;
251
257
OPENCOLORIOWRAPPER_API
bool
TransformImage
(
const
FImageView
&
SrcImage
,
const
FImageView
&
DestImage
)
const
;
258
259
private
:
260
261
TPimplPtr<struct FOpenColorIOProcessorPimpl, EPimplPtrMode::DeepCopy>
Pimpl;
262
263
friend
class
FOpenColorIOWrapperGPUProcessor
;
264
};
265
269
class
FOpenColorIOWrapperGPUProcessor
final
270
{
271
public
:
272
279
OPENCOLORIOWRAPPER_API
explicit
FOpenColorIOWrapperGPUProcessor
(
280
FOpenColorIOWrapperProcessor
InProcessor
,
281
bool
bUseLegacy
=
false
282
);
283
285
OPENCOLORIOWRAPPER_API
bool
IsValid
()
const
;
286
294
OPENCOLORIOWRAPPER_API
bool
GetShader(FString&
OutShaderCacheID
, FString&
OutShaderCode
)
const
;
295
297
OPENCOLORIOWRAPPER_API
uint32
GetNum3DTextures
()
const
;
298
309
OPENCOLORIOWRAPPER_API
bool
Get3DTexture
(
uint32
InIndex
,
FName
&
OutName
,
uint32
&
OutEdgeLength
,
TextureFilter
&
OutTextureFilter
,
const
float
*& OutData)
const
;
310
312
OPENCOLORIOWRAPPER_API
uint32
GetNumTextures()
const
;
313
326
OPENCOLORIOWRAPPER_API
bool
GetTexture(
uint32
InIndex
,
FName
&
OutName
,
uint32
&
OutWidth
,
uint32
&
OutHeight
,
TextureFilter
&
OutTextureFilter
,
bool
&
bOutRedChannelOnly
,
const
float
*& OutData)
const
;
327
329
OPENCOLORIOWRAPPER_API
FString
GetCacheID
()
const
;
330
331
private
:
332
333
const
FOpenColorIOWrapperProcessor
ParentProcessor
;
334
335
TPimplPtr<struct FOpenColorIOGPUProcessorPimpl, EPimplPtrMode::DeepCopy>
GPUPimpl
;
336
};
337
338
#endif
// WITH_OCIO
EChaosVDManifoldPointFlags::IsValid
@ IsValid
ContainersFwd.h
CoreTypes.h
ColorManagementDefines.h
TEXT
#define TEXT(x)
Definition
Platform.h:1272
TCHAR
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition
Platform.h:1135
int32
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition
Platform.h:1125
Vector.h
StaticCastSharedRef
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition
SharedPointer.h:127
PimplPtr.h
StaticArray.h
TextureFilter
TextureFilter
Definition
TextureDefines.h:485
UniquePtr.h
uint32
uint32_t uint32
Definition
binka_ue_file_header.h:6
FName
Definition
NameTypes.h:617
TMap
Definition
UnrealString.h.inl:34
TStringView< TCHAR >
TestServer.int
int
Definition
TestServer.py:515
UE::Color::EColorSpace
EColorSpace
Definition
ColorManagementDefines.h:46
UE::Color::EColorSpace::None
@ None
UE::Color::EEncoding
EEncoding
Definition
ColorManagementDefines.h:20
UE::Color::EEncoding::None
@ None
UE::Color::EChromaticAdaptationMethod
EChromaticAdaptationMethod
Definition
ColorManagementDefines.h:72
UE::Color::EChromaticAdaptationMethod::None
@ None
Index
U16 Index
Definition
radfft.cpp:71
FImageView
Definition
ImageCore.h:264
FLinearColor
Definition
Color.h:48
TOptional
Definition
Optional.h:131
TPimplPtr
Definition
PimplPtr.h:50
Engine
Source
Runtime
OpenColorIOWrapper
Public
OpenColorIOWrapper.h
Generated by
1.9.8