mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-07 06:33:05 -06:00
Performance: Access memory directly instead of using access functions.
This commit is contained in:
parent
7e4c793da5
commit
764f564c0c
@ -217,10 +217,12 @@ void TextureImage::setPixel(uint x, uint y, const Color4ub& clr)
|
||||
CVF_TIGHT_ASSERT(y < m_height);
|
||||
|
||||
const uint idx = 4*(y*m_width + x);
|
||||
m_dataRgba[idx] = clr.r();
|
||||
m_dataRgba[idx + 1] = clr.g();
|
||||
m_dataRgba[idx + 2] = clr.b();
|
||||
m_dataRgba[idx + 3] = clr.a();
|
||||
const ubyte* data = clr.ptr();
|
||||
|
||||
m_dataRgba[idx] = data[0];
|
||||
m_dataRgba[idx + 1] = data[1];
|
||||
m_dataRgba[idx + 2] = data[2];
|
||||
m_dataRgba[idx + 3] = data[3];
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user