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 Apache License, Version 2.0 (the "Apache License")
5
// with the following modification; you may not use this file except in
6
// compliance with the Apache License and the following modification to it:
7
// Section 6. Trademarks. is deleted and replaced with:
8
//
9
// 6. Trademarks. This License does not grant permission to use the trade
10
// names, trademarks, service marks, or product names of the Licensor
11
// and its affiliates, except as required to comply with Section 4(c) of
12
// the License and to reproduce the content of the NOTICE file.
13
//
14
// You may obtain a copy of the Apache License at
15
//
16
// http://www.apache.org/licenses/LICENSE-2.0
17
//
18
// Unless required by applicable law or agreed to in writing, software
19
// distributed under the Apache License with the above modification is
20
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21
// KIND, either express or implied. See the Apache License for the specific
22
// language governing permissions and limitations under the Apache License.
23
//
24
#ifndef PXR_BASE_GF_GAMMA_H
25
#define PXR_BASE_GF_GAMMA_H
26
27
#include "
pxr/pxr.h
"
28
#include "
pxr/base/gf/api.h
"
29
30
/// \file gf/gamma.h
31
/// Utilities to map colors between gamma spaces.
32
33
PXR_NAMESPACE_OPEN_SCOPE
34
35
class
GfVec3f
;
36
class
GfVec3d
;
37
class
GfVec4f
;
38
class
GfVec4d
;
39
class
GfVec3h
;
40
class
GfVec4h
;
41
42
/// Return a new vector with each component of \p v raised to the power \p
43
/// gamma
44
GF_API
45
GfVec3f
GfApplyGamma
(
const
GfVec3f
&
v
,
double
gamma);
46
47
/// Return a new vector with each component of \p v raised to the power \p
48
/// gamma
49
GF_API
50
GfVec3d
GfApplyGamma
(
const
GfVec3d
&
v
,
double
gamma);
51
52
/// \copydoc GfApplyGamma(GfVec3d,double)
53
GF_API
54
GfVec3h
GfApplyGamma
(
const
GfVec3h
&
v
,
double
gamma);
55
56
/// Return a new vector with the first three components of \p v raised to the
57
/// power \p gamma and the fourth component unchanged.
58
GF_API
59
GfVec4f
GfApplyGamma
(
const
GfVec4f
&
v
,
double
gamma);
60
61
/// Return a new vector with the first three components of \p v raised to the
62
/// power \p gamma and the fourth component unchanged.
63
GF_API
64
GfVec4d
GfApplyGamma
(
const
GfVec4d
&
v
,
double
gamma);
65
66
/// \copydoc GfApplyGamma(GfVec4h,double)
67
GF_API
68
GfVec4h
GfApplyGamma
(
const
GfVec4h
&
v
,
double
gamma);
69
70
/// Return a new float raised to the power \p gamma
71
GF_API
72
float
GfApplyGamma
(
const
float
&
v
,
double
gamma);
73
74
/// Return a new char raised to the power \p gamma
75
GF_API
76
unsigned
char
GfApplyGamma
(
const
unsigned
char
&
v
,
double
gamma);
77
78
/// Return the system display gamma
79
GF_API
80
double
GfGetDisplayGamma
();
81
82
/// Given a vec, \p v, representing an energy-linear RGB(A) color, return a
83
/// vec of the same type converted to the system's display gamma.
84
GF_API
GfVec3f
GfConvertLinearToDisplay
(
const
GfVec3f
&
v
);
85
GF_API
GfVec3d
GfConvertLinearToDisplay
(
const
GfVec3d
&
v
);
86
GF_API
GfVec3h
GfConvertLinearToDisplay
(
const
GfVec3h
&
v
);
87
GF_API
GfVec4f
GfConvertLinearToDisplay
(
const
GfVec4f
&
v
);
88
GF_API
GfVec4d
GfConvertLinearToDisplay
(
const
GfVec4d
&
v
);
89
GF_API
GfVec4h
GfConvertLinearToDisplay
(
const
GfVec4h
&
v
);
90
GF_API
float
GfConvertLinearToDisplay
(
const
float
&
v
);
91
GF_API
unsigned
char
GfConvertLinearToDisplay
(
const
unsigned
char
&
v
);
92
93
/// Given a vec, \p v, representing an RGB(A) color in the system's display
94
/// gamma space, return an energy-linear vec of the same type.
95
GF_API
GfVec3f
GfConvertDisplayToLinear
(
const
GfVec3f
&
v
);
96
GF_API
GfVec3d
GfConvertDisplayToLinear
(
const
GfVec3d
&
v
);
97
GF_API
GfVec3h
GfConvertDisplayToLinear
(
const
GfVec3h
&
v
);
98
GF_API
GfVec4f
GfConvertDisplayToLinear
(
const
GfVec4f
&
v
);
99
GF_API
GfVec4d
GfConvertDisplayToLinear
(
const
GfVec4d
&
v
);
100
GF_API
GfVec4h
GfConvertDisplayToLinear
(
const
GfVec4h
&
v
);
101
GF_API
float
GfConvertDisplayToLinear
(
const
float
&
v
);
102
GF_API
unsigned
char
GfConvertDisplayToLinear
(
const
unsigned
char
&
v
);
103
104
PXR_NAMESPACE_CLOSE_SCOPE
105
106
#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:62
GfVec4d
Definition:
vec4d.h:62
GfApplyGamma
GF_API GfVec3f GfApplyGamma(const GfVec3f &v, double gamma)
GfVec4h
Definition:
vec4h.h:63
pxr.h
GfVec4f
Definition:
vec4f.h:62
PXR_NAMESPACE_OPEN_SCOPE
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition:
path.h:1432
GfVec3d
Definition:
vec3d.h:62
PXR_NAMESPACE_CLOSE_SCOPE
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition:
pxr.h:91
GfConvertLinearToDisplay
GF_API GfVec3f GfConvertLinearToDisplay(const GfVec3f &v)
GfVec3h
Definition:
vec3h.h:63
GF_API
#define GF_API
Definition:
api.h:40
pxr
base
gf
gamma.h
Generated on Sat Mar 29 2025 02:43:54 for HDK by
1.8.6