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 GF_GAMMA_H
25 #define GF_GAMMA_H
26 
27 #include "pxr/pxr.h"
28 #include "pxr/base/gf/api.h"
29 
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 
44 GF_API
45 GfVec3f GfApplyGamma(const GfVec3f &v, double gamma);
46 
49 GF_API
50 GfVec3d GfApplyGamma(const GfVec3d &v, double gamma);
51 
53 GF_API
54 GfVec3h GfApplyGamma(const GfVec3h &v, double gamma);
55 
58 GF_API
59 GfVec4f GfApplyGamma(const GfVec4f &v, double gamma);
60 
63 GF_API
64 GfVec4d GfApplyGamma(const GfVec4d &v, double gamma);
65 
67 GF_API
68 GfVec4h GfApplyGamma(const GfVec4h &v, double gamma);
69 
71 GF_API
72 float GfApplyGamma(const float &v, double gamma);
73 
75 GF_API
76 unsigned char GfApplyGamma(const unsigned char &v, double gamma);
77 
79 GF_API
80 double GfGetDisplayGamma();
81 
90 GF_API float GfConvertLinearToDisplay(const float &v);
91 GF_API unsigned char GfConvertLinearToDisplay(const unsigned char &v);
92 
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 // GF_GAMMA_H
GF_API GfVec3f GfConvertDisplayToLinear(const GfVec3f &v)
Given a vec, v, representing an RGB(A) color in the system's display gamma space, return an energy-li...
GF_API double GfGetDisplayGamma()
Return the system display gamma.
Basic type for a vector of 3 float components.
Definition: vec3f.h:63
Basic type for a vector of 4 double components.
Definition: vec4d.h:63
GF_API GfVec3f GfApplyGamma(const GfVec3f &v, double gamma)
Return a new vector with each component of v raised to the power gamma.
Basic type for a vector of 4 GfHalf components.
Definition: vec4h.h:64
Basic type for a vector of 4 float components.
Definition: vec4f.h:63
Basic type for a vector of 3 double components.
Definition: vec3d.h:63
GF_API GfVec3f GfConvertLinearToDisplay(const GfVec3f &v)
Given a vec, v, representing an energy-linear RGB(A) color, return a vec of the same type converted t...
Basic type for a vector of 3 GfHalf components.
Definition: vec3h.h:64