Gamedev Framework (gf)  0.5.0
A C++11 framework for 2D games
Public Types | Public Member Functions | List of all members
gf::ColorBlindEffect Class Reference

Simulation of color blindness. More...

#include <gf/Effects.h>

Inheritance diagram for gf::ColorBlindEffect:
Inheritance graph
[legend]

Public Types

enum  Type {
  Normal,
  Protanopia,
  Protanomaly,
  Deuteranopia,
  Deuteranomaly,
  Tritanopia,
  Tritanomaly,
  Achromatopsia,
  Achromatomaly
}
 Type of color blindness. More...
 
- Public Types inherited from gf::Shader
enum  Type {
  Vertex,
  Fragment
}
 Type of shaders. More...
 

Public Member Functions

 ColorBlindEffect (Type type=Normal)
 Constructor. More...
 
void setType (Type type)
 Change the type of color blindness. More...
 
- Public Member Functions inherited from gf::ColorMatrixEffect
 ColorMatrixEffect ()
 Default constructor. More...
 
void setColorMatrix (const Matrix4f &mat)
 Set the color matrix. More...
 
- Public Member Functions inherited from gf::Shader
 Shader ()
 Default constructor. More...
 
 ~Shader ()
 Destructor. More...
 
 Shader (const Shader &)=delete
 Deleted copy constructor. More...
 
Shaderoperator= (const Shader &)=delete
 Deleted copy assignment. More...
 
bool loadFromFile (const Path &filename, Type type)
 Load the vertex of fragment shader from a file. More...
 
bool loadFromFile (const Path &vertexShaderFilename, const Path &fragmentShaderFilename)
 Load both the vertex and fragment shaders from files. More...
 
bool loadFromMemory (StringRef shader, Type type)
 Load the vertex or fragment shader from a source code in memory. More...
 
bool loadFromMemory (StringRef vertexShader, StringRef fragmentShader)
 Load both the vertex and fragment shaders from source codes in memory. More...
 
bool loadFromStream (InputStream &stream, Type type)
 Load the vertex or fragment shader from a custom stream. More...
 
bool loadFromStream (InputStream &vertexShaderStream, InputStream &fragmentShaderStream)
 Load both the vertex and fragment shaders from custom streams. More...
 
void setUniform (StringRef name, float val)
 Specify value for a float uniform. More...
 
void setUniform (StringRef name, int val)
 Specify value for a int uniform. More...
 
void setUniform (StringRef name, const Vector2f &vec)
 Specify value for a vec2 uniform. More...
 
void setUniform (StringRef name, const Vector3f &vec)
 Specify value for a vec3 uniform. More...
 
void setUniform (StringRef name, const Vector4f &vec)
 Specify value for a vec4 uniform. More...
 
void setUniform (StringRef name, const Matrix3f &mat)
 Specify value for a mat3 uniform. More...
 
void setUniform (StringRef name, const Matrix4f &mat)
 Specify value for a mat4 uniform. More...
 
void setUniform (StringRef name, const BareTexture &tex)
 Specify a texture for a sampler2D uniform. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from gf::Shader
static void bind (const Shader *shader)
 Bind a shader for rendering. More...
 

Detailed Description

Simulation of color blindness.

Color blindness is a deficiency of the vision that affects a significant percentage of the population.

This effect simulate different types of color blindness.

Member Enumeration Documentation

◆ Type

Type of color blindness.

Enumerator
Normal 

Normal vision.

Protanopia 

Protanopia (red dichromacy, 1% of males affected)

Protanomaly 

Protanomaly (red trichromacy, 1% of males affected)

Deuteranopia 

Deuteranopia (green dichromacy, 1% of males affected)

Deuteranomaly 

Deuteranomaly (green trichromacy, 6% of males affected)

Tritanopia 

Tritanopia (blue dichromacy, rare)

Tritanomaly 

Tritanomaly (blue trichromacy, very rare)

Achromatopsia 

Achromatopsia (rod monochromacy, very rare)

Achromatomaly 

Achromatomaly (blue cone monochromacy, very rare)

Constructor & Destructor Documentation

◆ ColorBlindEffect()

gf::ColorBlindEffect::ColorBlindEffect ( Type  type = Normal)

Constructor.

Parameters
typeThe type of color blindness

Member Function Documentation

◆ setType()

void gf::ColorBlindEffect::setType ( Type  type)

Change the type of color blindness.

Parameters
typeThe type of color blindness