Upgraded visualization libraries

Major refactoring of color legend framework
Added discrete log color legend
p4#: 18989
This commit is contained in:
Magne Sjaastad
2012-10-02 10:17:52 +02:00
parent 082560b2a5
commit 9c1ce7591e
163 changed files with 8917 additions and 3214 deletions

View File

@@ -109,13 +109,24 @@ void TextureImage::setFromRgb(const UByteArray& rgbData, uint width, uint height
CVF_ASSERT(width > 0 && height > 0);
CVF_ASSERT(rgbData.size() == width*height*3);
m_dataRgba.reserve(width*height*4);
setFromRgb(rgbData.ptr(), width, height);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void TextureImage::setFromRgb(const ubyte* rgbData, uint width, uint height)
{
CVF_ASSERT(rgbData);
CVF_ASSERT(width > 0 && height > 0);
const size_t numPixels = width*height;
m_dataRgba.reserve(4*numPixels);
m_width = width;
m_height = height;
size_t numPixels = rgbData.size()/3;
size_t i;
for (i = 0; i < numPixels; i++)
for (size_t i = 0; i < numPixels; i++)
{
m_dataRgba.add(rgbData[3*i + 0]);
m_dataRgba.add(rgbData[3*i + 1]);