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

Vertex manipulator which scales the color values. More...

#include <SVertexManipulator.h>

Inheritance diagram for irr::scene::SVertexColorScaleManipulator:
irr::scene::IVertexManipulator

Public Member Functions

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

Detailed Description

Vertex manipulator which scales the color values.

Can e.g be used for white balance, factor would be 255.f/brightest color.

Definition at line 145 of file SVertexManipulator.h.

Constructor & Destructor Documentation

◆ SVertexColorScaleManipulator()

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

Definition at line 148 of file SVertexManipulator.h.

148 : Factor(factor) {}

Member Function Documentation

◆ operator()()

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

Definition at line 149 of file SVertexManipulator.h.

150  {
151  vertex.Color.setRed(core::clamp(core::round32(vertex.Color.getRed()*Factor), 0, 255));
152  vertex.Color.setGreen(core::clamp(core::round32(vertex.Color.getGreen()*Factor), 0, 255));
153  vertex.Color.setBlue(core::clamp(core::round32(vertex.Color.getBlue()*Factor), 0, 255));
154  }
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: