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

Vertex manipulator which adjusts the contrast by the given factor and brightness by a signed amount. More...

#include <SVertexManipulator.h>

Inheritance diagram for irr::scene::SVertexColorContrastBrightnessManipulator:
irr::scene::IVertexManipulator

Public Member Functions

 SVertexColorContrastBrightnessManipulator (f32 factor, s32 amount)
 
void operator() (video::S3DVertex &vertex) const
 

Detailed Description

Vertex manipulator which adjusts the contrast by the given factor and brightness by a signed amount.

Factors over 1 increase contrast, below 1 reduce it. A positive amount increases brightness, a negative one darkens the colors.

Definition at line 110 of file SVertexManipulator.h.

Constructor & Destructor Documentation

◆ SVertexColorContrastBrightnessManipulator()

irr::scene::SVertexColorContrastBrightnessManipulator::SVertexColorContrastBrightnessManipulator ( f32  factor,
s32  amount 
)
inline

Definition at line 113 of file SVertexManipulator.h.

113 : Factor(factor), Amount(amount+128) {}

Member Function Documentation

◆ operator()()

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

Definition at line 114 of file SVertexManipulator.h.

115  {
116  vertex.Color.setRed(core::clamp(core::round32((vertex.Color.getRed()-128)*Factor)+Amount, 0, 255));
117  vertex.Color.setGreen(core::clamp(core::round32((vertex.Color.getGreen()-128)*Factor)+Amount, 0, 255));
118  vertex.Color.setBlue(core::clamp(core::round32((vertex.Color.getBlue()-128)*Factor)+Amount, 0, 255));
119  }
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: