summaryrefslogtreecommitdiff
path: root/indra/integration_tests/llimage_libtest
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2014-01-03 14:19:29 -0800
committerMerov Linden <merov@lindenlab.com>2014-01-03 14:19:29 -0800
commit1b5fb662927ac84606cf767c8c9ec350e82b656f (patch)
tree9a0afe54bfa84d390f88be17da841f156b9e0a52 /indra/integration_tests/llimage_libtest
parentd28b92744ee0d4a19a5587585998e5c351f6d300 (diff)
ACME-1236 : WIP : Added the vignette mode. Can be applied to colorCorrect and color Transform. Added new -v argument to llimage_libtest
Diffstat (limited to 'indra/integration_tests/llimage_libtest')
-rwxr-xr-xindra/integration_tests/llimage_libtest/llimage_libtest.cpp47
1 files changed, 46 insertions, 1 deletions
diff --git a/indra/integration_tests/llimage_libtest/llimage_libtest.cpp b/indra/integration_tests/llimage_libtest/llimage_libtest.cpp
index 4d32282a0d..45e60f64e6 100755
--- a/indra/integration_tests/llimage_libtest/llimage_libtest.cpp
+++ b/indra/integration_tests/llimage_libtest/llimage_libtest.cpp
@@ -97,6 +97,10 @@ static const char USAGE[] = "\n"
" - 'darken' substracts <param> light to the image (<param> between 0 and 255).\n"
" - 'linearize' optimizes the contrast using the brightness histogram. <param> is the fraction (between 0.0 and 1.0) of discarded tail of the histogram.\n"
" - 'posterize' redistributes the colors between <param> classes per channel (<param> between 2 and 255).\n"
+" -v, --vignette <name> [<feather>]\n"
+" Apply a circular central vignette <name> to the filter using the optional <feather> value. Admissible names:\n"
+" - 'blend' : the filter is applied with full intensity in the center and blends with the image to the periphery.\n"
+" - 'fade' : the filter is applied with full intensity in the center and fades to black to the periphery.\n"
" -log, --logmetrics <metric>\n"
" Log performance data for <metric>. Results in <metric>.slp\n"
" Note: so far, only ImageCompressionTester has been tested.\n"
@@ -366,6 +370,8 @@ int main(int argc, char** argv)
bool reversible = false;
std::string filter_name = "";
double filter_param = 0.0;
+ std::string vignette_name = "";
+ double vignette_param = 1.0;
// Init whatever is necessary
ll_init_apr();
@@ -568,7 +574,36 @@ int main(int argc, char** argv)
}
}
}
- else if (!strcmp(argv[arg], "--analyzeperformance") || !strcmp(argv[arg], "-a"))
+ else if (!strcmp(argv[arg], "--vignette") || !strcmp(argv[arg], "-v"))
+ {
+ // '--vignette' needs to be specified with a named vignette argument
+ if ((arg + 1) < argc)
+ {
+ vignette_name = argv[arg+1];
+ }
+ if (((arg + 1) >= argc) || (vignette_name[0] == '-'))
+ {
+ // We don't have an argument left in the arg list or the next argument is another option
+ std::cout << "No --vignette argument given, no vignette will be applied to filters" << std::endl;
+ }
+ else
+ {
+ arg += 1; // Skip that arg now we know it's a valid vignette name
+ if ((arg + 1) == argc) // Break out of the loop if we reach the end of the arg list
+ break;
+ // --vignette can also have an optional parameter
+ std::string value_str;
+ value_str = argv[arg+1]; // Check the next arg
+ if (value_str[0] != '-') // If it's not another argument, it's a vignette parameter value
+ {
+ vignette_param = atof(value_str.c_str());
+ arg += 1; // Skip that arg now we used it as a valid vignette param
+ 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;
}
@@ -614,6 +649,16 @@ int main(int argc, char** argv)
continue;
}
+ // Set the vignette if any
+ if (vignette_name == "blend")
+ {
+ raw_image->setVignette(VIGNETTE_MODE_BLEND,(float)(vignette_param));
+ }
+ else if (vignette_name == "fade")
+ {
+ raw_image->setVignette(VIGNETTE_MODE_FADE,(float)(vignette_param));
+ }
+
// Apply filter if any
if (filter_name == "sepia")
{