Introduced a cast(T) method into the ImageUtils template functor to allow code reading images to handle casting from source data to a form that a user can use more conviently
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
namespace osg
|
||||
{
|
||||
|
||||
struct FindRangeOperator
|
||||
struct FindRangeOperator : public CastAndScaleToFloatOperation
|
||||
{
|
||||
FindRangeOperator():
|
||||
_rmin(FLT_MAX),
|
||||
@@ -168,7 +168,7 @@ void _copyRowAndScale(const unsigned char* src, GLenum srcDataType, unsigned cha
|
||||
}
|
||||
}
|
||||
|
||||
struct RecordRowOperator
|
||||
struct RecordRowOperator : public CastAndScaleToFloatOperation
|
||||
{
|
||||
RecordRowOperator(unsigned int num):_colours(num),_pos(0) {}
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ class ReaderWriterDICOM : public osgDB::ReaderWriter
|
||||
tile->setVolumeTechnique(new osgVolume::RayTracedTechnique());
|
||||
|
||||
osg::ref_ptr<osgVolume::ImageLayer> layer= new osgVolume::ImageLayer(result.getImage());
|
||||
layer->rescaleToZeroToOneRange();
|
||||
//layer->rescaleToZeroToOneRange();
|
||||
|
||||
osgVolume::SwitchProperty* sp = new osgVolume::SwitchProperty;
|
||||
sp->setActiveProperty(0);
|
||||
|
||||
@@ -491,7 +491,7 @@ osg::Image* osgVolume::createNormalMapTexture(osg::Image* image_3d)
|
||||
//
|
||||
// applyTransferFunction
|
||||
//
|
||||
struct ApplyTransferFunctionOperator
|
||||
struct ApplyTransferFunctionOperator : public osg::CastAndScaleToFloatOperation
|
||||
{
|
||||
ApplyTransferFunctionOperator(osg::TransferFunction1D* tf, unsigned char* data):
|
||||
_tf(tf),
|
||||
|
||||
Reference in New Issue
Block a user