summaryrefslogtreecommitdiff
path: root/indra/llimage
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llimage')
-rw-r--r--indra/llimage/CMakeLists.txt6
-rw-r--r--indra/llimage/llimage.cpp9
-rw-r--r--indra/llimage/llimage.h1
3 files changed, 13 insertions, 3 deletions
diff --git a/indra/llimage/CMakeLists.txt b/indra/llimage/CMakeLists.txt
index 8883317751..436b8dd1a2 100644
--- a/indra/llimage/CMakeLists.txt
+++ b/indra/llimage/CMakeLists.txt
@@ -9,7 +9,7 @@ include(LLMath)
include(LLFileSystem)
include(LLKDU)
include(LLImageJ2COJ)
-include(ZLIB)
+include(ZLIBNG)
include(LLAddBuildTest)
include(bugsplat)
include(Tut)
@@ -20,7 +20,7 @@ include_directories(
${LLMATH_INCLUDE_DIRS}
${LLFILESYSTEM_INCLUDE_DIRS}
${PNG_INCLUDE_DIRS}
- ${ZLIB_INCLUDE_DIRS}
+ ${ZLIBNG_INCLUDE_DIRS}
)
set(llimage_SOURCE_FILES
@@ -74,7 +74,7 @@ target_link_libraries(llimage
${LLCOMMON_LIBRARIES}
${JPEG_LIBRARIES}
${PNG_LIBRARIES}
- ${ZLIB_LIBRARIES}
+ ${ZLIBNG_LIBRARIES}
)
# Add tests
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp
index 3a3011d99b..186b01d60c 100644
--- a/indra/llimage/llimage.cpp
+++ b/indra/llimage/llimage.cpp
@@ -814,6 +814,15 @@ LLImageRaw::LLImageRaw(U16 width, U16 height, S8 components)
++sRawImageCount;
}
+LLImageRaw::LLImageRaw(const U8* data, U16 width, U16 height, S8 components)
+ : LLImageBase()
+{
+ if (allocateDataSize(width, height, components))
+ {
+ memcpy(getData(), data, width * height * components);
+ }
+}
+
LLImageRaw::LLImageRaw(U8 *data, U16 width, U16 height, S8 components, bool no_copy)
: LLImageBase()
{
diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h
index 460d5e0f5b..9e50fd502b 100644
--- a/indra/llimage/llimage.h
+++ b/indra/llimage/llimage.h
@@ -184,6 +184,7 @@ protected:
public:
LLImageRaw();
LLImageRaw(U16 width, U16 height, S8 components);
+ LLImageRaw(const U8* data, U16 width, U16 height, S8 components);
LLImageRaw(U8 *data, U16 width, U16 height, S8 components, bool no_copy = false);
// Construct using createFromFile (used by tools)
//LLImageRaw(const std::string& filename, bool j2c_lowest_mip_only = false);