Plugins/PointSprite/ParaViewPlugin/Qvis/VolumeAttributes.cpp
void
VolumeAttributes::GetTransferFunction(unsigned char *rgba) const
{
    unsigned char rgb[256 * 3];
    unsigned char alphas[256];
    const unsigned char *a_ptr;

    // Figure out the colors
    colorControlPoints.GetColors(rgb, 256);
    // Figure out the opacities
    if(freeformFlag)
        a_ptr = freeformOpacity;
    else
    {
        GetGaussianOpacities(alphas);
        a_ptr = alphas;
    }

    unsigned char *rgb_ptr = rgb;
    unsigned char *rgba_ptr = rgba;
    for(int i = 0; i < 256; ++i)
    {
        // Copy the color
        *rgba_ptr++ = *rgb_ptr++;
        *rgba_ptr++ = *rgb_ptr++;
        *rgba_ptr++ = *rgb_ptr++;
        // Copy the alpha
        *rgba_ptr++ = *a_ptr++;
    }
}
// ****************************************************************************
// Method: VolumeAttributes::GetTransferFunction
//
// Purpose: 
//   This method calculates the transfer function and stores it in the rgba
//   array that is passed in.
//
// Programmer: Brad Whitlock
// Creation:   Tue Aug 21 15:44:34 PST 2001
//
// Modifications:
//   Brad Whitlock, Thu Nov 21 15:05:25 PST 2002
//   GetColors has been moved to ColorControlPointList. I updated this code
//   to take that into account.
//
//   Jeremy Meredith, Thu Oct  2 13:29:40 PDT 2003
//   Made the method const.
//
// ****************************************************************************
:GetTransferFunction
Purpose:
This method calculates the transfer function and stores it in the rgba
array that is passed in.

Brad Whitlock
Creation:   Tue Aug 21 15:44:34 PST 2001

Brad Whitlock, Thu Nov 21 15:05:25 PST 2002
GetColors has been moved to ColorControlPointList. I updated this code
to take that into account.

Jeremy Meredith, Thu Oct  2 13:29:40 PDT 2003
Made the method const.
: GetTransferFunction Purpose : This method calculates the transfer function and stores it in the rgba array that is passed in . Brad Whitlock Creation : Tue Aug 21 15 : 44 : 34 PST 2001 Brad Whitlock Thu Nov 21 15 : 05 : 25 PST 2002 GetColors has been moved to ColorControlPointList . I updated this code to take that into account . Jeremy Meredith Thu Oct 2 13 : 29 : 40 PDT 2003 Made the method const .
void
VolumeAttributes::GetTransferFunction(unsigned char *rgba) const
{
    unsigned char rgb[256 * 3];
    unsigned char alphas[256];
    const unsigned char *a_ptr;
    colorControlPoints.GetColors(rgb, 256);
    if(freeformFlag)
        a_ptr = freeformOpacity;
    else
    {
        GetGaussianOpacities(alphas);
        a_ptr = alphas;
    }
    unsigned char *rgb_ptr = rgb;
    unsigned char *rgba_ptr = rgba;
    for(int i = 0; i < 256; ++i)
    {
        *rgba_ptr++ = *rgb_ptr++;
        *rgba_ptr++ = *rgb_ptr++;
        *rgba_ptr++ = *rgb_ptr++;
        *rgba_ptr++ = *a_ptr++;
    }
}
void VolumeAttributes :: GetTransferFunction ( unsigned char * rgba ) const { unsigned char rgb [ 256 * 3 ] ; unsigned char alphas [ 256 ] ; const unsigned char * a_ptr ; colorControlPoints . GetColors ( rgb , 256 ) ; if ( freeformFlag ) a_ptr = freeformOpacity ; else { GetGaussianOpacities ( alphas ) ; a_ptr = alphas ; } unsigned char * rgb_ptr = rgb ; unsigned char * rgba_ptr = rgba ; for ( int i = 0 ; i < 256 ; ++ i ) { * rgba_ptr ++ = * rgb_ptr ++ ; * rgba_ptr ++ = * rgb_ptr ++ ; * rgba_ptr ++ = * rgb_ptr ++ ; * rgba_ptr ++ = * a_ptr ++ ; } }
Method: VolumeAttributes::GetTransferFunction
Purpose:
This method calculates the transfer function and stores it in the rgba
array that is passed in.
Method : VolumeAttributes :: GetTransferFunction Purpose : This method calculates the transfer function and stores it in the rgba array that is passed in .
// Figure out the colors // Figure out the opacities // Copy the color // Copy the alpha