galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
galaxy::graphics::GammaCorrection Class Referencefinal

GammaCorrection effect. More...

#include <GammaCorrection.hpp>

+ Inheritance diagram for galaxy::graphics::GammaCorrection:
+ Collaboration diagram for galaxy::graphics::GammaCorrection:

Public Member Functions

 GammaCorrection (const int width, const int height)
 Argument constructor.
 
virtual ~GammaCorrection ()=default
 Destructor.
 
void resize (const int width, const int height) override
 Resize framebuffers.
 
unsigned int render (const unsigned int input) override
 Render effect to input texture.
 
void set_gamma (const float gamma_mod)
 Set gamma modifier.
 
float get_gamma () const
 Get gamma modifier.
 
bool is_enabled () override
 Is this effect enabled?
 
- Public Member Functions inherited from galaxy::graphics::PostEffect
virtual ~PostEffect ()=default
 Destructor.
 

Private Member Functions

 GammaCorrection ()=delete
 Constructor.
 

Private Attributes

Shader m_shader
 Shader for post processing effect.
 
RenderTexture m_fb
 Framebuffer to render effect to.
 
float m_gamma
 Amount to adjust gamma by.
 

Additional Inherited Members

- Protected Member Functions inherited from galaxy::graphics::PostEffect
 PostEffect ()=default
 Constructor.
 
 PostEffect (const PostEffect &)=default
 Copy constructor.
 
 PostEffect (PostEffect &&)=default
 Move constructor.
 
PostEffectoperator= (const PostEffect &)=default
 Copy assignment operator.
 
PostEffectoperator= (PostEffect &&)=default
 Move assignment operator.
 

Detailed Description

GammaCorrection effect.

Run after Anti-Aliasing.

Definition at line 24 of file GammaCorrection.hpp.

Constructor & Destructor Documentation

◆ GammaCorrection() [1/2]

galaxy::graphics::GammaCorrection::GammaCorrection ( const int width,
const int height )

Argument constructor.

Parameters
widthWidth of internal framebuffer.
heightHeight of internal framebuffer.

Definition at line 83 of file GammaCorrection.cpp.

+ Here is the call graph for this function:

◆ ~GammaCorrection()

virtual galaxy::graphics::GammaCorrection::~GammaCorrection ( )
virtualdefault

Destructor.

◆ GammaCorrection() [2/2]

galaxy::graphics::GammaCorrection::GammaCorrection ( )
privatedelete

Constructor.

Member Function Documentation

◆ resize()

void galaxy::graphics::GammaCorrection::resize ( const int width,
const int height )
overridevirtual

Resize framebuffers.

Parameters
widthNew width of internal framebuffer.
heightNew height of internal framebuffer.

Implements galaxy::graphics::PostEffect.

Definition at line 96 of file GammaCorrection.cpp.

+ Here is the call graph for this function:

◆ render()

unsigned int galaxy::graphics::GammaCorrection::render ( const unsigned int input)
nodiscardoverridevirtual

Render effect to input texture.

Parameters
inputInput texture from previous effect or window framebuffer.
Returns
Returns output texture for next effect or final framebuffer.

Implements galaxy::graphics::PostEffect.

Definition at line 101 of file GammaCorrection.cpp.

+ Here is the call graph for this function:

◆ set_gamma()

void galaxy::graphics::GammaCorrection::set_gamma ( const float gamma_mod)

Set gamma modifier.

Parameters
gamma_modYou will need to lookup or tinker with value. The value will be used in the formula: 1.0 / amount. 0 defaults to 1.0.

Definition at line 113 of file GammaCorrection.cpp.

+ Here is the call graph for this function:

◆ get_gamma()

float galaxy::graphics::GammaCorrection::get_gamma ( ) const
nodiscard

Get gamma modifier.

Returns
Float.

Definition at line 125 of file GammaCorrection.cpp.

◆ is_enabled()

bool galaxy::graphics::GammaCorrection::is_enabled ( )
nodiscardoverridevirtual

Is this effect enabled?

Returns
True if effect is enabled. Otherwise false.

Implements galaxy::graphics::PostEffect.

Definition at line 130 of file GammaCorrection.cpp.

Member Data Documentation

◆ m_shader

Shader galaxy::graphics::GammaCorrection::m_shader
private

Shader for post processing effect.

Definition at line 91 of file GammaCorrection.hpp.

◆ m_fb

RenderTexture galaxy::graphics::GammaCorrection::m_fb
private

Framebuffer to render effect to.

Definition at line 96 of file GammaCorrection.hpp.

◆ m_gamma

float galaxy::graphics::GammaCorrection::m_gamma
private

Amount to adjust gamma by.

Definition at line 101 of file GammaCorrection.hpp.


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