diff options
| author | Oz Linden <oz@lindenlab.com> | 2013-05-20 09:08:20 -0400 |
|---|---|---|
| committer | Oz Linden <oz@lindenlab.com> | 2013-05-20 09:08:20 -0400 |
| commit | 72e7269da376d660385f3c66ac2a25a5e50871ea (patch) | |
| tree | 047bd9d1bf99fa8c308c379dd57758050aa5ef51 /indra/llimage/llimage.cpp | |
| parent | 621085d553cccc4238d74886ca44bcefafddd7f1 (diff) | |
| parent | 0ebcb7e3fd1452d42b5ca48139f99a4fd632d235 (diff) | |
merge changes for 3.5.2-release
Diffstat (limited to 'indra/llimage/llimage.cpp')
| -rwxr-xr-x[-rw-r--r--] | indra/llimage/llimage.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index a88ac148ef..1c25256e95 100644..100755 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -640,6 +640,29 @@ void LLImageRaw::compositeUnscaled4onto3( LLImageRaw* src ) } } +void LLImageRaw::copyUnscaledAlphaMask( LLImageRaw* src, const LLColor4U& fill) +{ + LLImageRaw* dst = this; // Just for clarity. + + llassert( 1 == src->getComponents() ); + llassert( 4 == dst->getComponents() ); + llassert( (src->getWidth() == dst->getWidth()) && (src->getHeight() == dst->getHeight()) ); + + S32 pixels = getWidth() * getHeight(); + U8* src_data = src->getData(); + U8* dst_data = dst->getData(); + for ( S32 i = 0; i < pixels; i++ ) + { + dst_data[0] = fill.mV[0]; + dst_data[1] = fill.mV[1]; + dst_data[2] = fill.mV[2]; + dst_data[3] = src_data[0]; + src_data += 1; + dst_data += 4; + } +} + + // Fill the buffer with a constant color void LLImageRaw::fill( const LLColor4U& color ) { |
