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

Vertex manipulator which adjusts the contrast by the given factor. More...

#include <SVertexManipulator.h>

Inheritance diagram for irr::scene::SVertexColorContrastManipulator:
irr::scene::IVertexManipulator

Public Member Functions

 SVertexColorContrastManipulator (f32 factor)
 
void operator() (video::S3DVertex &vertex) const
 

Detailed Description

Vertex manipulator which adjusts the contrast by the given factor.

Factors over 1 increase contrast, below 1 reduce it.

Definition at line 94 of file SVertexManipulator.h.

Constructor & Destructor Documentation

◆ SVertexColorContrastManipulator()

irr::scene::SVertexColorContrastManipulator::SVertexColorContrastManipulator ( f32  factor)
inline

Definition at line 97 of file SVertexManipulator.h.

97 : Factor(factor) {}

Member Function Documentation

◆ operator()()

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

Definition at line 98 of file SVertexManipulator.h.

99  {
100  vertex.Color.setRed(core::clamp(core::round32((vertex.Color.getRed()-128)*Factor)+128, 0, 255));
101  vertex.Color.setGreen(core::clamp(core::round32((vertex.Color.getGreen()-128)*Factor)+128, 0, 255));
102  vertex.Color.setBlue(core::clamp(core::round32((vertex.Color.getBlue()-128)*Factor)+128, 0, 255));
103  }
REALINLINE s32 round32(f32 x)
Definition: irrMath.h:657
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: