Developer Documentation
ACG::ColorTranslator Class Reference

#include <OpenFlipper/libs_required/ACG/GL/ColorTranslator.hh>

Public Member Functions

 ColorTranslator ()
 Default constructor.
 
 ~ColorTranslator ()
 Destructor.
 
void initialize (ACG::GLState *)
 
bool initialized () const
 has it been initialized?
 
Vec4uc index2color (const size_t _idx) const
 index -> color (one buffer)
 
size_t color2index (const Vec4uc _rgba) const
 color -> index (one buffer)
 
size_t max_index () const
 returns maximal convertible index
 

Private Attributes

bool initialized_
 
GLint red_bits_
 
GLint green_bits_
 
GLint blue_bits_
 
GLint alpha_bits_
 
GLuint red_mask_
 
GLuint green_mask_
 
GLuint blue_mask_
 
GLuint alpha_mask_
 
GLuint red_shift_
 
GLuint green_shift_
 
GLuint blue_shift_
 
GLuint alpha_shift_
 
GLuint red_round_
 
GLuint green_round_
 
GLuint blue_round_
 
GLuint alpha_round_
 

Detailed Description

This class can be used to translate colors to integers. Use this e.g. for color index picking, i.e. drawing objects using a color corresponding to an unique index.

Definition at line 75 of file ColorTranslator.hh.

Member Function Documentation

◆ initialize()

void ACG::ColorTranslator::initialize ( ACG::GLState _state)

init (takes current GL context to get the component sizes) Can't use constructor as we might not have a context at this point.

Definition at line 69 of file ColorTranslator.cc.


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