Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Data Structures | Functions | Variables
colorcorrection.h File Reference

Go to the source code of this file.

Data Structures

struct  ChannelCorrection
 

Functions

float brightness (float v, float brightness_value)
 
float contrast (float v, float contrast_value)
 Calculate contrast corrected value. More...
 
float gamma (float v, float gamma_value)
 Calculate gamma corrected value. More...
 
float corrected (in ChannelCorrection c, in float v)
 
vec3 color_correction (vec3 color)
 

Variables

ChannelCorrection cc_red
 
ChannelCorrection cc_green
 
ChannelCorrection cc_blue
 
ChannelCorrection cc_all
 

Function Documentation

float brightness ( float  v,
float  brightness_value 
)
33  {
34  return max(v + brightness_value,0.0);
35 }
vec3 color_correction ( vec3  color)
64  {
65  if (cc_all.multiplier == 0.0) {
66  return color;
67  }
68  return clamp(vec3(
69  corrected(cc_all,corrected(cc_red,color.r)),
72  ),vec3(0.0,0.0,0.0),vec3(1.0,1.0,1.0));
73 }
ChannelCorrection cc_red
Definition: colorcorrection.h:28
ChannelCorrection cc_green
Definition: colorcorrection.h:28
float multiplier
Definition: colorcorrection.h:24
ChannelCorrection cc_blue
Definition: colorcorrection.h:28
ChannelCorrection cc_all
Definition: colorcorrection.h:28
float corrected(in ChannelCorrection c, in float v)
Definition: colorcorrection.h:56
float contrast ( float  v,
float  contrast_value 
)

Calculate contrast corrected value.

38  {
39  float _c = (contrast_value <= 0.0) ?
40  contrast_value + 1.0 :
41  (1.0 / (1.0 - contrast_value));
42  return (v - 0.5) * max(_c, 0.0f) + 0.5;
43 }
float corrected ( in ChannelCorrection  c,
in float  v 
)
56  {
57  return brightness(contrast(gamma(v,
58  c.gamma * c.multiplier),
59  c.contrast * c.multiplier),
60  c.brightness * c.multiplier);
61 }
float contrast(float v, float contrast_value)
Calculate contrast corrected value.
Definition: colorcorrection.h:38
float brightness(float v, float brightness_value)
Definition: colorcorrection.h:33
float gamma(float v, float gamma_value)
Calculate gamma corrected value.
Definition: colorcorrection.h:46
float gamma ( float  v,
float  gamma_value 
)

Calculate gamma corrected value.

46  {
47  float g = 0.0;
48  if (gamma_value >= 0.0) {
49  g = 1.0 / (1.0 + gamma_value);
50  } else {
51  g = (1.0 - gamma_value);
52  }
53  return pow(v,g*g*g*g);
54 }

Variable Documentation