mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-18 18:44:39 +00:00
*** empty log message ***
This commit is contained in:
parent
84d347a660
commit
3704f85a6f
@ -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
|
||||
|
||||
@ -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) ) );
|
||||
}
|
||||
@ -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);
|
||||
|
||||
18
src/fgt/edit_quality/util.cpp
Normal file
18
src/fgt/edit_quality/util.cpp
Normal 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; }
|
||||
Loading…
x
Reference in New Issue
Block a user