Commit cd8203c4 authored by Mathias Goldau's avatar Mathias Goldau

[STYLE #42]

parent c3867660
...@@ -127,14 +127,14 @@ osg::ref_ptr< osg::Texture2D > WHistogram2D::getTexture() ...@@ -127,14 +127,14 @@ osg::ref_ptr< osg::Texture2D > WHistogram2D::getTexture()
size_t imageHeight = m_buckets[1]; size_t imageHeight = m_buckets[1];
//get max bin for scaling //get max bin for scaling
size_t maxCount = 0; float maxCount = 0;
for( int j = 0; j < imageHeight; j++) for( size_t j = 0; j < imageHeight; ++j )
{ {
for (int i = 0; i < imageWidth; i++) for( size_t i = 0; i < imageWidth; ++i )
{ {
if(m_bins(i, j) > maxCount) if( m_bins( i, j ) > maxCount )
{ {
maxCount = m_bins(i, j); maxCount = static_cast< float >( m_bins( i, j ) );
} }
} }
} }
...@@ -143,11 +143,11 @@ osg::ref_ptr< osg::Texture2D > WHistogram2D::getTexture() ...@@ -143,11 +143,11 @@ osg::ref_ptr< osg::Texture2D > WHistogram2D::getTexture()
image->setInternalTextureFormat( GL_RED ); image->setInternalTextureFormat( GL_RED );
float* data = reinterpret_cast< float* >( image->data() ); float* data = reinterpret_cast< float* >( image->data() );
for( int j = 0; j < imageHeight; j++) for( size_t j = 0; j < imageHeight; ++j )
{ {
for (int i = 0; i < imageWidth; i++) for( size_t i = 0; i < imageWidth; ++i )
{ {
data[i + j * imageWidth] = (float)m_bins(i, j) / (float)maxCount; data[i + j * imageWidth] = static_cast< float >( m_bins( i, j ) ) / maxCount;
} }
} }
return new osg::Texture2D( image ); return new osg::Texture2D( image );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment