arsa  2.7
Public Member Functions | List of all members
irr::scene::SVertexColorGammaManipulator Class Reference

Vertex manipulator which adjusts the brightness by a gamma operation. More...

#include <SVertexManipulator.h>

Inheritance diagram for irr::scene::SVertexColorGammaManipulator:
irr::scene::IVertexManipulator

Public Member Functions

 SVertexColorGammaManipulator (f32 gamma)
 
void operator() (video::S3DVertex &vertex) const
 

Detailed Description

Vertex manipulator which adjusts the brightness by a gamma operation.

A value over one increases brightness, one below darkens the colors.

Definition at line 126 of file SVertexManipulator.h.

Constructor & Destructor Documentation

◆ SVertexColorGammaManipulator()

irr::scene::SVertexColorGammaManipulator::SVertexColorGammaManipulator ( f32  gamma)
inline

Definition at line 129 of file SVertexManipulator.h.

129  : Gamma(1.f)
130  {
131  if (gamma != 0.f)
132  Gamma = 1.f/gamma;
133  }
GLfloat f

Member Function Documentation

◆ operator()()

void irr::scene::SVertexColorGammaManipulator::operator() ( video::S3DVertex vertex) const
inline

Definition at line 134 of file SVertexManipulator.h.

135  {
136  vertex.Color.setRed(core::clamp(core::round32(powf((f32)(vertex.Color.getRed()),Gamma)), 0, 255));
137  vertex.Color.setGreen(core::clamp(core::round32(powf((f32)(vertex.Color.getGreen()),Gamma)), 0, 255));
138  vertex.Color.setBlue(core::clamp(core::round32(powf((f32)(vertex.Color.getBlue()),Gamma)), 0, 255));
139  }
REALINLINE s32 round32(f32 x)
Definition: irrMath.h:657
float f32
32 bit floating point variable.
Definition: irrTypes.h:108
const T clamp(const T &value, const T &low, const T &high)
clamps a value between low and high
Definition: irrMath.h:167

The documentation for this class was generated from the following file: