summaryrefslogtreecommitdiff
path: root/indra/integration_tests/llimage_libtest
diff options
context:
space:
mode:
Diffstat (limited to 'indra/integration_tests/llimage_libtest')
-rw-r--r--indra/integration_tests/llimage_libtest/1970colorize.xml41
-rwxr-xr-xindra/integration_tests/llimage_libtest/CMakeLists.txt3
-rwxr-xr-xindra/integration_tests/llimage_libtest/brighten.xml11
-rw-r--r--indra/integration_tests/llimage_libtest/colorize.xml20
-rw-r--r--indra/integration_tests/llimage_libtest/contrast.xml18
-rwxr-xr-xindra/integration_tests/llimage_libtest/darken.xml11
-rw-r--r--indra/integration_tests/llimage_libtest/gamma.xml18
-rw-r--r--indra/integration_tests/llimage_libtest/grayscale.xml14
-rw-r--r--indra/integration_tests/llimage_libtest/horizontalscreen.xml25
-rwxr-xr-xindra/integration_tests/llimage_libtest/linearize.xml11
-rwxr-xr-xindra/integration_tests/llimage_libtest/llimage_libtest.cpp39
-rwxr-xr-xindra/integration_tests/llimage_libtest/newsscreen.xml25
-rwxr-xr-xindra/integration_tests/llimage_libtest/posterize.xml18
-rw-r--r--indra/integration_tests/llimage_libtest/rotatecolors180.xml8
-rw-r--r--indra/integration_tests/llimage_libtest/saturate.xml8
-rw-r--r--indra/integration_tests/llimage_libtest/sepia.xml14
-rw-r--r--indra/integration_tests/llimage_libtest/slantedscreen.xml25
-rw-r--r--indra/integration_tests/llimage_libtest/spotlight.xml45
-rw-r--r--indra/integration_tests/llimage_libtest/verticalscreen.xml25
-rwxr-xr-xindra/integration_tests/llimage_libtest/video.xml23
20 files changed, 399 insertions, 3 deletions
diff --git a/indra/integration_tests/llimage_libtest/1970colorize.xml b/indra/integration_tests/llimage_libtest/1970colorize.xml
new file mode 100644
index 0000000000..0dab2489a0
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/1970colorize.xml
@@ -0,0 +1,41 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.1</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>contrast</string>
+ <real>0.8</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>0.5</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ </array>
+ <array>
+ <string>blend</string>
+ <real>10.0</real>
+ <real>0.0</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>0.1</real>
+ <real>0.1</real>
+ <real>0.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/CMakeLists.txt b/indra/integration_tests/llimage_libtest/CMakeLists.txt
index 36a7d38bb7..8a83ac498f 100755
--- a/indra/integration_tests/llimage_libtest/CMakeLists.txt
+++ b/indra/integration_tests/llimage_libtest/CMakeLists.txt
@@ -7,6 +7,7 @@ project (llimage_libtest)
include(00-Common)
include(LLCommon)
include(LLImage)
+include(LLMath)
include(LLImageJ2COJ)
include(LLKDU)
include(LLVFS)
@@ -15,6 +16,7 @@ include_directories(
${LLCOMMON_INCLUDE_DIRS}
${LLVFS_INCLUDE_DIRS}
${LLIMAGE_INCLUDE_DIRS}
+ ${LLMATH_INCLUDE_DIRS}
)
include_directories(SYSTEM
${LLCOMMON_SYSTEM_INCLUDE_DIRS}
@@ -64,6 +66,7 @@ endif (DARWIN)
target_link_libraries(llimage_libtest
${LLCOMMON_LIBRARIES}
${LLVFS_LIBRARIES}
+ ${LLMATH_LIBRARIES}
${LLIMAGE_LIBRARIES}
${LLKDU_LIBRARIES}
${KDU_LIBRARY}
diff --git a/indra/integration_tests/llimage_libtest/brighten.xml b/indra/integration_tests/llimage_libtest/brighten.xml
new file mode 100755
index 0000000000..d17b96d2d7
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/brighten.xml
@@ -0,0 +1,11 @@
+<llsd>
+ <array>
+ <array>
+ <string>brighten</string>
+ <real>50.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/colorize.xml b/indra/integration_tests/llimage_libtest/colorize.xml
new file mode 100644
index 0000000000..18c6cd3425
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/colorize.xml
@@ -0,0 +1,20 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>0.2</real>
+ <real>0.0</real>
+ <real>0.2</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/contrast.xml b/indra/integration_tests/llimage_libtest/contrast.xml
new file mode 100644
index 0000000000..8dcdd1a9a9
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/contrast.xml
@@ -0,0 +1,18 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>contrast</string>
+ <real>1.5</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/darken.xml b/indra/integration_tests/llimage_libtest/darken.xml
new file mode 100755
index 0000000000..8d110452e9
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/darken.xml
@@ -0,0 +1,11 @@
+<llsd>
+ <array>
+ <array>
+ <string>darken</string>
+ <real>50.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/gamma.xml b/indra/integration_tests/llimage_libtest/gamma.xml
new file mode 100644
index 0000000000..7505a03027
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/gamma.xml
@@ -0,0 +1,18 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>gamma</string>
+ <real>1.5</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/grayscale.xml b/indra/integration_tests/llimage_libtest/grayscale.xml
new file mode 100644
index 0000000000..984312c4fd
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/grayscale.xml
@@ -0,0 +1,14 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>grayscale</string>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/horizontalscreen.xml b/indra/integration_tests/llimage_libtest/horizontalscreen.xml
new file mode 100644
index 0000000000..ddff4d1977
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/horizontalscreen.xml
@@ -0,0 +1,25 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.1</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>grayscale</string>
+ </array>
+ <array>
+ <string>blend</string>
+ <real>0.0</real>
+ <real>0.0</real>
+ </array>
+ <array>
+ <string>screen</string>
+ <string>line</string>
+ <real>5.0</real>
+ <real>0.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/linearize.xml b/indra/integration_tests/llimage_libtest/linearize.xml
new file mode 100755
index 0000000000..23d0290e07
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/linearize.xml
@@ -0,0 +1,11 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.1</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/llimage_libtest.cpp b/indra/integration_tests/llimage_libtest/llimage_libtest.cpp
index 034c816742..d3373a61f2 100755
--- a/indra/integration_tests/llimage_libtest/llimage_libtest.cpp
+++ b/indra/integration_tests/llimage_libtest/llimage_libtest.cpp
@@ -32,6 +32,7 @@
// Linden library includes
#include "llimage.h"
+#include "llimagefilter.h"
#include "llimagejpeg.h"
#include "llimagepng.h"
#include "llimagebmp.h"
@@ -39,6 +40,8 @@
#include "llimagej2c.h"
#include "lldir.h"
#include "lldiriterator.h"
+#include "v4coloru.h"
+#include "llsdserialize.h"
// system libraries
#include <iostream>
@@ -83,6 +86,8 @@ static const char USAGE[] = "\n"
" -rev, --reversible\n"
" Set the compression to be lossless (reversible in j2c parlance).\n"
" Only valid for output j2c images.\n"
+" -f, --filter <file>\n"
+" Apply the filter <file> to the input images.\n"
" -log, --logmetrics <metric>\n"
" Log performance data for <metric>. Results in <metric>.slp\n"
" Note: so far, only ImageCompressionTester has been tested.\n"
@@ -99,7 +104,7 @@ static bool sAllDone = false;
// Create an empty formatted image instance of the correct type from the filename
LLPointer<LLImageFormatted> create_image(const std::string &filename)
{
- std::string exten = gDirUtilp->getExtension(filename);
+ std::string exten = gDirUtilp->getExtension(filename);
LLPointer<LLImageFormatted> image = LLImageFormatted::createFromExtension(exten);
return image;
}
@@ -350,6 +355,7 @@ int main(int argc, char** argv)
int blocks_size = -1;
int levels = 0;
bool reversible = false;
+ std::string filter_name = "";
// Init whatever is necessary
ll_init_apr();
@@ -523,7 +529,26 @@ int main(int argc, char** argv)
break;
}
}
- else if (!strcmp(argv[arg], "--analyzeperformance") || !strcmp(argv[arg], "-a"))
+ else if (!strcmp(argv[arg], "--filter") || !strcmp(argv[arg], "-f"))
+ {
+ // '--filter' needs to be specified with a named filter argument
+ if ((arg + 1) < argc)
+ {
+ filter_name = argv[arg+1];
+ }
+ if (((arg + 1) >= argc) || (filter_name[0] == '-'))
+ {
+ // We don't have an argument left in the arg list or the next argument is another option
+ std::cout << "No --filter argument given, no filter will be applied" << std::endl;
+ }
+ else
+ {
+ arg += 1; // Skip that arg now we know it's a valid test name
+ if ((arg + 1) == argc) // Break out of the loop if we reach the end of the arg list
+ break;
+ }
+ }
+ else if (!strcmp(argv[arg], "--analyzeperformance") || !strcmp(argv[arg], "-a"))
{
analyze_performance = true;
}
@@ -568,7 +593,15 @@ int main(int argc, char** argv)
std::cout << "Error: Image " << *in_file << " could not be loaded" << std::endl;
continue;
}
-
+
+ if (filter_name != "")
+ {
+ // We're interpreting the filter as a filter file name
+ LLImageFilter filter;
+ filter.loadFromFile(filter_name);
+ filter.executeFilter(raw_image);
+ }
+
// Save file
if (out_file != out_end)
{
diff --git a/indra/integration_tests/llimage_libtest/newsscreen.xml b/indra/integration_tests/llimage_libtest/newsscreen.xml
new file mode 100755
index 0000000000..8247c34500
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/newsscreen.xml
@@ -0,0 +1,25 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.1</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>grayscale</string>
+ </array>
+ <array>
+ <string>blend</string>
+ <real>0.0</real>
+ <real>0.0</real>
+ </array>
+ <array>
+ <string>screen</string>
+ <string>2Dsine</string>
+ <real>5.0</real>
+ <real>0.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/posterize.xml b/indra/integration_tests/llimage_libtest/posterize.xml
new file mode 100755
index 0000000000..f026278f9e
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/posterize.xml
@@ -0,0 +1,18 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>posterize</string>
+ <real>10.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/rotatecolors180.xml b/indra/integration_tests/llimage_libtest/rotatecolors180.xml
new file mode 100644
index 0000000000..e25029720f
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/rotatecolors180.xml
@@ -0,0 +1,8 @@
+<llsd>
+ <array>
+ <array>
+ <string>rotate</string>
+ <real>180.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/saturate.xml b/indra/integration_tests/llimage_libtest/saturate.xml
new file mode 100644
index 0000000000..b77f07a037
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/saturate.xml
@@ -0,0 +1,8 @@
+<llsd>
+ <array>
+ <array>
+ <string>saturate</string>
+ <real>3.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/sepia.xml b/indra/integration_tests/llimage_libtest/sepia.xml
new file mode 100644
index 0000000000..0304ead015
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/sepia.xml
@@ -0,0 +1,14 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>sepia</string>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/slantedscreen.xml b/indra/integration_tests/llimage_libtest/slantedscreen.xml
new file mode 100644
index 0000000000..63ad01d51d
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/slantedscreen.xml
@@ -0,0 +1,25 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.1</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>grayscale</string>
+ </array>
+ <array>
+ <string>blend</string>
+ <real>0.0</real>
+ <real>0.0</real>
+ </array>
+ <array>
+ <string>screen</string>
+ <string>line</string>
+ <real>5.0</real>
+ <real>45.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/spotlight.xml b/indra/integration_tests/llimage_libtest/spotlight.xml
new file mode 100644
index 0000000000..203130bdee
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/spotlight.xml
@@ -0,0 +1,45 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.1</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>contrast</string>
+ <real>0.8</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>saturate</string>
+ <real>1.5</real>
+ </array>
+ <array>
+ <string>fade</string>
+ <real>1.0</real>
+ <real>0.25</real>
+ </array>
+ <array>
+ <string>saturate</string>
+ <real>0.8</real>
+ </array>
+ <array>
+ <string>contrast</string>
+ <real>1.1</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>brighten</string>
+ <real>30</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/verticalscreen.xml b/indra/integration_tests/llimage_libtest/verticalscreen.xml
new file mode 100644
index 0000000000..71e48df656
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/verticalscreen.xml
@@ -0,0 +1,25 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.1</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>grayscale</string>
+ </array>
+ <array>
+ <string>blend</string>
+ <real>0.0</real>
+ <real>0.0</real>
+ </array>
+ <array>
+ <string>screen</string>
+ <string>line</string>
+ <real>5.0</real>
+ <real>90.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/video.xml b/indra/integration_tests/llimage_libtest/video.xml
new file mode 100755
index 0000000000..8b10687ef5
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/video.xml
@@ -0,0 +1,23 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.01</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>lines</string>
+ <real>10.0</real>
+ <real>0.0</real>
+ </array>
+ <array>
+ <string>brighten</string>
+ <real>100.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </array>
+</llsd>