diff options
author | prep <prep@lindenlab.com> | 2013-03-11 15:17:13 -0400 |
---|---|---|
committer | prep <prep@lindenlab.com> | 2013-03-11 15:17:13 -0400 |
commit | 8e3b190e919fde84a2189d974208f9d199d4bea6 (patch) | |
tree | 7ab1db96d291260cbad356533607e1bce36ed0a7 /indra/llimage | |
parent | 2ea750ebcad8335aeb0ec77a483831b62d05f643 (diff) | |
parent | e0c9174609e2457fab7fe6d7291c6ebbd030397c (diff) |
merge
Diffstat (limited to 'indra/llimage')
-rw-r--r-- | indra/llimage/CMakeLists.txt | 13 | ||||
-rw-r--r-- | indra/llimage/llimage.cpp | 23 | ||||
-rw-r--r-- | indra/llimage/llimage.h | 5 | ||||
-rw-r--r-- | indra/llimage/llimagetga.cpp | 12 |
4 files changed, 46 insertions, 7 deletions
diff --git a/indra/llimage/CMakeLists.txt b/indra/llimage/CMakeLists.txt index ea8c1a1107..e837b0cac2 100644 --- a/indra/llimage/CMakeLists.txt +++ b/indra/llimage/CMakeLists.txt @@ -7,12 +7,15 @@ include(LLCommon) include(LLImage) include(LLMath) include(LLVFS) +include(LLKDU) +include(LLImageJ2COJ) include(ZLIB) include(LLAddBuildTest) include(Tut) include_directories( ${LLCOMMON_INCLUDE_DIRS} + ${LLCOMMON_SYSTEM_INCLUDE_DIRS} ${LLMATH_INCLUDE_DIRS} ${LLVFS_INCLUDE_DIRS} ${PNG_INCLUDE_DIRS} @@ -56,8 +59,16 @@ list(APPEND llimage_SOURCE_FILES ${llimage_HEADER_FILES}) add_library (llimage ${llimage_SOURCE_FILES}) # Libraries on which this library depends, needed for Linux builds # Sort by high-level to low-level +if (USE_KDU) + target_link_libraries(llimage ${LLKDU_LIBRARIES}) +else (USE_KDU) + target_link_libraries(llimage ${LLIMAGEJ2COJ_LIBRARIES}) +endif (USE_KDU) + target_link_libraries(llimage - llcommon + ${LLVFS_LIBRARIES} + ${LLMATH_LIBRARIES} + ${LLCOMMON_LIBRARIES} ${JPEG_LIBRARIES} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index a88ac148ef..1c25256e95 100644 --- 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 ) { diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h index 6cb1226da0..4fc40ecff7 100644 --- a/indra/llimage/llimage.h +++ b/indra/llimage/llimage.h @@ -226,6 +226,11 @@ public: // Src and dst are same size. Src has 3 components. Dst has 4 components. void copyUnscaled3onto4( LLImageRaw* src ); + // Src and dst are same size. Src has 1 component. Dst has 4 components. + // Alpha component is set to source alpha mask component. + // RGB components are set to fill color. + void copyUnscaledAlphaMask( LLImageRaw* src, const LLColor4U& fill); + // Src and dst can be any size. Src and dst have same number of components. void copyScaled( LLImageRaw* src ); diff --git a/indra/llimage/llimagetga.cpp b/indra/llimage/llimagetga.cpp index 58426d31fa..920ae2891f 100644 --- a/indra/llimage/llimagetga.cpp +++ b/indra/llimage/llimagetga.cpp @@ -132,12 +132,12 @@ BOOL LLImageTGA::updateData() ** FIELD 2 : COLOR MAP TYPE (1 BYTES) ** FIELD 3 : IMAGE TYPE CODE (1 BYTES) ** = 0 NO IMAGE DATA INCLUDED - ** = 1 UNCOMPRESSED, COLOR-MAPPED IMAGE - ** = 2 UNCOMPRESSED, TRUE-COLOR IMAGE - ** = 3 UNCOMPRESSED, BLACK AND WHITE IMAGE - ** = 9 RUN-LENGTH ENCODED COLOR-MAPPED IMAGE - ** = 10 RUN-LENGTH ENCODED TRUE-COLOR IMAGE - ** = 11 RUN-LENGTH ENCODED BLACK AND WHITE IMAGE + ** = (0001) 1 UNCOMPRESSED, COLOR-MAPPED IMAGE + ** = (0010) 2 UNCOMPRESSED, TRUE-COLOR IMAGE + ** = (0011) 3 UNCOMPRESSED, BLACK AND WHITE IMAGE + ** = (1001) 9 RUN-LENGTH ENCODED COLOR-MAPPED IMAGE + ** = (1010) 10 RUN-LENGTH ENCODED TRUE-COLOR IMAGE + ** = (1011) 11 RUN-LENGTH ENCODED BLACK AND WHITE IMAGE ** FIELD 4 : COLOR MAP SPECIFICATION (5 BYTES) ** 4.1 : COLOR MAP ORIGIN (2 BYTES) ** 4.2 : COLOR MAP LENGTH (2 BYTES) |