HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
gamma.h
Go to the documentation of this file.
1
//
2
// Copyright 2016 Pixar
3
//
4
// Licensed under the terms set forth in the LICENSE.txt file available at
5
// https://openusd.org/license.
6
//
7
#ifndef PXR_BASE_GF_GAMMA_H
8
#define PXR_BASE_GF_GAMMA_H
9
10
#include "
pxr/pxr.h
"
11
#include "
pxr/base/gf/api.h
"
12
13
/// \file gf/gamma.h
14
/// Utilities to map colors between gamma spaces.
15
16
PXR_NAMESPACE_OPEN_SCOPE
17
18
class
GfVec3f
;
19
class
GfVec3d
;
20
class
GfVec4f
;
21
class
GfVec4d
;
22
class
GfVec3h
;
23
class
GfVec4h
;
24
25
/// Return a new vector with each component of \p v raised to the power \p
26
/// gamma
27
GF_API
28
GfVec3f
GfApplyGamma
(
const
GfVec3f
&
v
,
double
gamma);
29
30
/// Return a new vector with each component of \p v raised to the power \p
31
/// gamma
32
GF_API
33
GfVec3d
GfApplyGamma
(
const
GfVec3d
&
v
,
double
gamma);
34
35
/// \copydoc GfApplyGamma(GfVec3d,double)
36
GF_API
37
GfVec3h
GfApplyGamma
(
const
GfVec3h
&
v
,
double
gamma);
38
39
/// Return a new vector with the first three components of \p v raised to the
40
/// power \p gamma and the fourth component unchanged.
41
GF_API
42
GfVec4f
GfApplyGamma
(
const
GfVec4f
&
v
,
double
gamma);
43
44
/// Return a new vector with the first three components of \p v raised to the
45
/// power \p gamma and the fourth component unchanged.
46
GF_API
47
GfVec4d
GfApplyGamma
(
const
GfVec4d
&
v
,
double
gamma);
48
49
/// \copydoc GfApplyGamma(GfVec4h,double)
50
GF_API
51
GfVec4h
GfApplyGamma
(
const
GfVec4h
&
v
,
double
gamma);
52
53
/// Return a new float raised to the power \p gamma
54
GF_API
55
float
GfApplyGamma
(
const
float
&
v
,
double
gamma);
56
57
/// Return a new char raised to the power \p gamma
58
GF_API
59
unsigned
char
GfApplyGamma
(
const
unsigned
char
&
v
,
double
gamma);
60
61
/// Return the system display gamma
62
GF_API
63
double
GfGetDisplayGamma
();
64
65
/// Given a vec, \p v, representing an energy-linear RGB(A) color, return a
66
/// vec of the same type converted to the system's display gamma.
67
GF_API
GfVec3f
GfConvertLinearToDisplay
(
const
GfVec3f
&
v
);
68
GF_API
GfVec3d
GfConvertLinearToDisplay
(
const
GfVec3d
&
v
);
69
GF_API
GfVec3h
GfConvertLinearToDisplay
(
const
GfVec3h
&
v
);
70
GF_API
GfVec4f
GfConvertLinearToDisplay
(
const
GfVec4f
&
v
);
71
GF_API
GfVec4d
GfConvertLinearToDisplay
(
const
GfVec4d
&
v
);
72
GF_API
GfVec4h
GfConvertLinearToDisplay
(
const
GfVec4h
&
v
);
73
GF_API
float
GfConvertLinearToDisplay
(
const
float
&
v
);
74
GF_API
unsigned
char
GfConvertLinearToDisplay
(
const
unsigned
char
&
v
);
75
76
/// Given a vec, \p v, representing an RGB(A) color in the system's display
77
/// gamma space, return an energy-linear vec of the same type.
78
GF_API
GfVec3f
GfConvertDisplayToLinear
(
const
GfVec3f
&
v
);
79
GF_API
GfVec3d
GfConvertDisplayToLinear
(
const
GfVec3d
&
v
);
80
GF_API
GfVec3h
GfConvertDisplayToLinear
(
const
GfVec3h
&
v
);
81
GF_API
GfVec4f
GfConvertDisplayToLinear
(
const
GfVec4f
&
v
);
82
GF_API
GfVec4d
GfConvertDisplayToLinear
(
const
GfVec4d
&
v
);
83
GF_API
GfVec4h
GfConvertDisplayToLinear
(
const
GfVec4h
&
v
);
84
GF_API
float
GfConvertDisplayToLinear
(
const
float
&
v
);
85
GF_API
unsigned
char
GfConvertDisplayToLinear
(
const
unsigned
char
&
v
);
86
87
PXR_NAMESPACE_CLOSE_SCOPE
88
89
#endif // PXR_BASE_GF_GAMMA_H
api.h
GfConvertDisplayToLinear
GF_API GfVec3f GfConvertDisplayToLinear(const GfVec3f &v)
GfGetDisplayGamma
GF_API double GfGetDisplayGamma()
Return the system display gamma.
v
const GLdouble * v
Definition:
glcorearb.h:837
GfVec3f
Definition:
vec3f.h:45
GfVec4d
Definition:
vec4d.h:45
GfApplyGamma
GF_API GfVec3f GfApplyGamma(const GfVec3f &v, double gamma)
GfVec4h
Definition:
vec4h.h:46
pxr.h
GfVec4f
Definition:
vec4f.h:45
PXR_NAMESPACE_OPEN_SCOPE
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition:
path.h:1425
GfVec3d
Definition:
vec3d.h:45
PXR_NAMESPACE_CLOSE_SCOPE
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition:
pxr.h:74
GfConvertLinearToDisplay
GF_API GfVec3f GfConvertLinearToDisplay(const GfVec3f &v)
GfVec3h
Definition:
vec3h.h:46
GF_API
#define GF_API
Definition:
api.h:23
pxr
base
gf
gamma.h
Generated on Thu Sep 4 2025 02:38:23 for HDK by
1.8.6