*** empty log message ***

This commit is contained in:
Paolo Cignoni cignoni 2008-01-16 16:08:39 +00:00
parent 84d347a660
commit 3704f85a6f
5 changed files with 27 additions and 17 deletions

View File

@ -2,8 +2,8 @@ TEMPLATE = lib
CONFIG += plugin
CONFIG += stl
INCLUDEPATH += ../.. ../../../../sf ../../../../code/lib/glew/include
HEADERS = const_types.h qualitymapper.h qualitymapperdialog.h transferfunction.h ui_qualitymapperdialog.h
SOURCES = qualitymapper.cpp qualitymapperdialog.cpp transferfunction.cpp qualitymapperdialog.cpp \
HEADERS = qualitymapper.h qualitymapperdialog.h transferfunction.h ui_qualitymapperdialog.h util.h
SOURCES = qualitymapper.cpp qualitymapperdialog.cpp transferfunction.cpp qualitymapperdialog.cpp util.cpp\
../../meshlab/filterparameter.cpp
TARGET = qualitymapper
DESTDIR = ../../meshlab/plugins

View File

@ -112,7 +112,8 @@ float TfChannel::getChannelValuef(float x_position)
UINT8 TfChannel::getChannelValueb(float x_position)
{
return (UINT8)(this->getChannelValuef(x_position) * 255.0f);
return (UINT8)relative2AbsoluteVali( this->getChannelValuef(x_position), 255.0f );
// return (UINT8)(this->getChannelValuef(x_position) * 255.0f);
}
@ -120,6 +121,8 @@ UINT8 TfChannel::getChannelValueb(float x_position)
//TRANSFER FUNCTION
TransferFunction::TransferFunction(void)
{
@ -139,19 +142,11 @@ TransferFunction::~TransferFunction(void)
{
}
//returns a relative-absolute x value conversion rounded to closer integer value
int TransferFunction::relative2AbsoluteVal(float relative_val, float max_val)
{ return (int)((relative_val * max_val)+0.5f); }
//returns an absolute-relative x value conversion
float TransferFunction::absolute2RelativeVal(int absolute_val, float max_val)
{ return (float)absolute_val / max_val; }
void TransferFunction::buildColorBand()
{
for (int i=0; i<COLOR_BAND_SIZE; i++)
_color_band[i].SetRGB( _channels[RED_CHANNEL].getChannelValueb(this->absolute2RelativeVal(i)),
_channels[GREEN_CHANNEL].getChannelValueb(this->absolute2RelativeVal(i)),
_channels[BLUE_CHANNEL].getChannelValueb(this->absolute2RelativeVal(i)) );
_color_band[i].SetRGB( _channels[RED_CHANNEL].getChannelValueb( absolute2RelativeValf((float)i) ),
_channels[GREEN_CHANNEL].getChannelValueb( absolute2RelativeValf((float)i) ),
_channels[BLUE_CHANNEL].getChannelValueb( absolute2RelativeValf((float)i) ) );
}

View File

@ -108,9 +108,6 @@ private:
int _channels_order[NUMBER_OF_CHANNELS]; //array used to carry out virtual pivoting indexing
Color4f _color_band[COLOR_BAND_SIZE]; /*rendere color band una classe a se stante??*/
int relative2AbsoluteVal(float relative_val, float max_val=COLOR_BAND_SIZE);
float absolute2RelativeVal(int absolute_val, float max_val=COLOR_BAND_SIZE);
public:
TransferFunction(void);
~TransferFunction(void);

View File

@ -0,0 +1,18 @@
#include "const_types.h"
//returns a relative-absolute x value conversion rounded to closer integer value
int relative2AbsoluteVali(float relative_val, float max_val)
{ return (int)((relative_val * max_val)+0.5f); }
//returns a relative-absolute x value conversion rounded to closer integer value
float relative2AbsoluteValf(float relative_val, float max_val)
{ return (relative_val * max_val); }
//returns an absolute-relative x value conversion
int absolute2RelativeVali(float absolute_val, float max_val)
{ return (int)((absolute_val / max_val)+0.5f); }
//returns an absolute-relative x value conversion
float absolute2RelativeValf(float absolute_val, float max_val)
{ return (float)absolute_val / max_val; }