Ignore:
Timestamp:
Dec 22, 2014, 7:18:59 AM (5 years ago)
Author:
ldelgass
Message:

Merge serveral changes from trunk. Does not include threading, world space
changes, etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nanovis/branches/1.1/ReaderCommon.cpp

    r4889 r4904  
    6464
    6565/**
     66 * \brief Normalize data to [0,1] based on vmin,vmax range
     67 *
     68 * \param data Float array of unnormalized data, will be normalized on return
     69 * \param count Number of elts in array
     70 * \param vmin Minimum value in data array
     71 * \param vmax Maximum value in data array
     72 */
     73void
     74nv::normalizeVector(float *data, int count, double vmin, double vmax)
     75{
     76    for (int p = 0; p < count; p++) {
     77        int i = p * 4;
     78        data[i  ] = data[i]/vmax;
     79        data[i+1] = data[i+1]/(2.0 * vmax) + 0.5;
     80        data[i+2] = data[i+2]/(2.0 * vmax) + 0.5;
     81        data[i+3] = data[i+3]/(2.0 * vmax) + 0.5;
     82    }
     83}
     84
     85/**
    6686 * \brief Compute Sobel filtered gradients for a 3D volume
    6787 *
Note: See TracChangeset for help on using the changeset viewer.