ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ColorGrading.cpp
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
9 
11 
12 namespace cloudViewer {
13 namespace visualization {
14 namespace rendering {
15 
17  : quality_(q), tonemapping_(algorithm) {}
18 
19 void ColorGradingParams::SetQuality(Quality q) { quality_ = q; }
20 
22  tonemapping_ = algorithm;
23 }
24 
25 void ColorGradingParams::SetTemperature(float temperature) {
26  temperature_ = temperature;
27 }
28 
29 void ColorGradingParams::SetTint(float tint) { tint_ = tint; }
30 
31 void ColorGradingParams::SetContrast(float contrast) { contrast_ = contrast; }
32 
33 void ColorGradingParams::SetVibrance(float vibrance) { vibrance_ = vibrance; }
34 
35 void ColorGradingParams::SetSaturation(float saturation) {
36  saturation_ = saturation;
37 }
38 
39 void ColorGradingParams::SetChannelMixer(const Eigen::Vector3f& red,
40  const Eigen::Vector3f& green,
41  const Eigen::Vector3f& blue) {
42  mixer_red_ = red;
43  mixer_green_ = green;
44  mixer_blue_ = blue;
45 }
46 
48  const Eigen::Vector4f& shadows,
49  const Eigen::Vector4f& midtones,
50  const Eigen::Vector4f& highlights,
51  const Eigen::Vector4f& ranges) {
52  shadows_ = shadows;
53  midtones_ = midtones;
54  highlights_ = highlights;
55  ranges_ = ranges;
56 }
57 
58 void ColorGradingParams::SetSlopeOffsetPower(const Eigen::Vector3f& slope,
59  const Eigen::Vector3f& offset,
60  const Eigen::Vector3f& power) {
61  slope_ = slope;
62  offset_ = offset;
63  power_ = power;
64 }
65 
66 void ColorGradingParams::SetCurves(const Eigen::Vector3f& shadow_gamma,
67  const Eigen::Vector3f& midpoint,
68  const Eigen::Vector3f& highlight_scale) {
69  shadow_gamma_ = shadow_gamma;
70  midpoint_ = midpoint;
71  highlight_scale_ = highlight_scale;
72 }
73 
74 } // namespace rendering
75 } // namespace visualization
76 } // namespace cloudViewer
int offset
void SetChannelMixer(const Eigen::Vector3f &red, const Eigen::Vector3f &green, const Eigen::Vector3f &blue)
void SetCurves(const Eigen::Vector3f &shadow_gamma, const Eigen::Vector3f &midpoint, const Eigen::Vector3f &highlight_scale)
void SetShadowMidtoneHighlights(const Eigen::Vector4f &shadows, const Eigen::Vector4f &midtones, const Eigen::Vector4f &highlights, const Eigen::Vector4f &ranges)
Quality
Quality level of color grading operations.
Definition: ColorGrading.h:21
void SetSlopeOffsetPower(const Eigen::Vector3f &slope, const Eigen::Vector3f &offset, const Eigen::Vector3f &power)
ColorGradingParams(Quality q, ToneMapping algorithm)
Generic file read and write utility for python interface.
constexpr Rgb red(MAX, 0, 0)
constexpr Rgb blue(0, 0, MAX)
constexpr Rgb green(0, MAX, 0)