HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RU_LevelsFunc Class Reference

#include <RU_PixelFunctions.h>

+ Inheritance diagram for RU_LevelsFunc:

Public Member Functions

 RU_LevelsFunc (float effect, float global_in_range_min, float global_in_range_max, float global_out_range_min, float global_out_range_max, float global_gamma, float comp_in_range_min[4], float comp_in_range_max[4], float comp_out_range_min[4], float comp_out_range_max[4], float comp_gamma[4])
 
 RU_LevelsFunc (float effect, float global_in_range_min, float global_in_range_max, float global_out_range_min, float global_out_range_max, float global_gamma, float comp_in_range_min, float comp_in_range_max, float comp_out_range_min, float comp_out_range_max, float comp_gamma)
 
- Public Member Functions inherited from RU_GammaFunc
 RU_GammaFunc (float g)
 
 RU_GammaFunc (float r, float g, float b, float w)
 
- Public Member Functions inherited from RU_PixelFunction
 RU_PixelFunction ()
 
virtual ~RU_PixelFunction ()
 
void setScope (bool *scope)
 
bool isScoped (int i) const
 
const bool * getScope () const
 
bool isPartialScope () const
 
bool isComponentDependent () const
 
bool areAllComponentsNeeded () const
 
void buildPixelEngine ()
 
void buildVectorEngine ()
 
void buildShaderEngine (UT_ComputeGPU *gpgpu)
 
float processValue (float val, int comp) const
 
void processValues (float **vals) const
 
const char * getShaderCode () const
 
const char * getFunctionCode () const
 
const char * getLocals () const
 
bool usesNumCompsGlobal () const
 
void setNext (RU_PixelFunction *next)
 
RU_PixelFunctionnext () const
 
void setNumComps (int comps)
 

Protected Member Functions

float safeLevels (float val, int)
 
virtual RUPixelFunc getPixelFunction () const
 
virtual void getPixelShader (UT_String &frag_shader)
 
- Protected Member Functions inherited from RU_GammaFunc
virtual bool eachComponentDifferent () const
 
- Protected Member Functions inherited from RU_PixelFunction
virtual bool needAllComponents () const
 
virtual RUVectorFunc getVectorFunction () const
 
void addConstant (const char *name, UT_GPUType type, int vectorsize, const void *data, int array_size=1)
 
void addLocal (const char *name, UT_GPUType type, int vectorsize)
 
void addArray (const char *name, UT_GPUType type, int vectorsize, int width, int height, const void *data)
 
void addArray (const char *name, UT_GPUType type, int vectorsize, int width, int height, const void *data1, const void *data2, const void *data3, const void *data4)
 
void addFunction (const char *function_name, const char *code)
 
void usesGlobal (const char *name)
 
int getFunctionIndex () const
 
int getNumComps () const
 

Static Protected Member Functions

static float fastLevels (RU_PixelFunction *pf, float val, int)
 for the usual case, MAdd, gamma, MAdd, gamma More...
 
static float safeLevels (RU_PixelFunction *pf, float val, int)
 handles degenerate input level ranges More...
 
static void colourMap (float const effect, const float from_min, const float from_max, const float to_min, const float to_max, float &factor, float &addend)
 
- Static Protected Member Functions inherited from RU_GammaFunc
static float gamma (RU_PixelFunction *pf, float val, int)
 
static float gamma (float val, float g)
 
- Static Protected Member Functions inherited from RU_PixelFunction
static float defaultPixelFunction (RU_PixelFunction *func, float val, int comp)
 
static void defaultVectorFunction (RU_PixelFunction *func, float **vals, const bool *scope)
 

Protected Attributes

float myGlobalGamma
 
float myGlobalFactor
 
float myGlobalAddend
 
float myFactor [4]
 
float myAddend [4]
 
float myGlobalInRangeMin
 
float myGlobalInRangeMax
 
float myGlobalOutRangeMin
 
float myGlobalOutRangeMax
 
float myCompInRangeMin [4]
 
float myCompInRangeMax [4]
 
float myCompOutRangeMin [4]
 
float myCompOutRangeMax [4]
 
RUPixelFunc myLevelsFunc
 
- Protected Attributes inherited from RU_GammaFunc
float myInvGamma [4]
 
bool myCompSep
 

Detailed Description

Definition at line 615 of file RU_PixelFunctions.h.

Constructor & Destructor Documentation

RU_LevelsFunc::RU_LevelsFunc ( float  effect,
float  global_in_range_min,
float  global_in_range_max,
float  global_out_range_min,
float  global_out_range_max,
float  global_gamma,
float  comp_in_range_min[4],
float  comp_in_range_max[4],
float  comp_out_range_min[4],
float  comp_out_range_max[4],
float  comp_gamma[4] 
)

passing all data down, rather than precomputing MAdds, so that we can correctly handle the degenerate cases of 0-width input ranges.

Parameters
effectframe scope effect, applied by the ctor to the ranges but not the gammas (caller should apply it to the gammas)
RU_LevelsFunc::RU_LevelsFunc ( float  effect,
float  global_in_range_min,
float  global_in_range_max,
float  global_out_range_min,
float  global_out_range_max,
float  global_gamma,
float  comp_in_range_min,
float  comp_in_range_max,
float  comp_out_range_min,
float  comp_out_range_max,
float  comp_gamma 
)

Member Function Documentation

static void RU_LevelsFunc::colourMap ( float const  effect,
const float  from_min,
const float  from_max,
const float  to_min,
const float  to_max,
float &  factor,
float &  addend 
)
staticprotected
static float RU_LevelsFunc::fastLevels ( RU_PixelFunction pf,
float  val,
int   
)
staticprotected

for the usual case, MAdd, gamma, MAdd, gamma

virtual RUPixelFunc RU_LevelsFunc::getPixelFunction ( ) const
inlineprotectedvirtual

Reimplemented from RU_GammaFunc.

Definition at line 653 of file RU_PixelFunctions.h.

virtual void RU_LevelsFunc::getPixelShader ( UT_String frag_shader)
protectedvirtual

Reimplemented from RU_GammaFunc.

static float RU_LevelsFunc::safeLevels ( RU_PixelFunction pf,
float  val,
int   
)
staticprotected

handles degenerate input level ranges

float RU_LevelsFunc::safeLevels ( float  val,
int   
)
protected

Member Data Documentation

float RU_LevelsFunc::myAddend[4]
protected

Definition at line 662 of file RU_PixelFunctions.h.

float RU_LevelsFunc::myCompInRangeMax[4]
protected

Definition at line 670 of file RU_PixelFunctions.h.

float RU_LevelsFunc::myCompInRangeMin[4]
protected

Definition at line 669 of file RU_PixelFunctions.h.

float RU_LevelsFunc::myCompOutRangeMax[4]
protected

Definition at line 672 of file RU_PixelFunctions.h.

float RU_LevelsFunc::myCompOutRangeMin[4]
protected

Definition at line 671 of file RU_PixelFunctions.h.

float RU_LevelsFunc::myFactor[4]
protected

Definition at line 661 of file RU_PixelFunctions.h.

float RU_LevelsFunc::myGlobalAddend
protected

Definition at line 660 of file RU_PixelFunctions.h.

float RU_LevelsFunc::myGlobalFactor
protected

Definition at line 659 of file RU_PixelFunctions.h.

float RU_LevelsFunc::myGlobalGamma
protected

Definition at line 656 of file RU_PixelFunctions.h.

float RU_LevelsFunc::myGlobalInRangeMax
protected

Definition at line 666 of file RU_PixelFunctions.h.

float RU_LevelsFunc::myGlobalInRangeMin
protected

Definition at line 665 of file RU_PixelFunctions.h.

float RU_LevelsFunc::myGlobalOutRangeMax
protected

Definition at line 668 of file RU_PixelFunctions.h.

float RU_LevelsFunc::myGlobalOutRangeMin
protected

Definition at line 667 of file RU_PixelFunctions.h.

RUPixelFunc RU_LevelsFunc::myLevelsFunc
protected

Definition at line 674 of file RU_PixelFunctions.h.


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