From 3cbd0dfd849a94a789ae70f4bdc176f85cf2ba34 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 6 Jan 2014 14:46:52 -0800 Subject: ACME-1236 : WIP : Make each color correct filter use a per channel alpha argument, tweak Instagram-like test filters for discussion --- .../llimage_libtest/llimage_libtest.cpp | 66 +++++++++++++--------- 1 file changed, 39 insertions(+), 27 deletions(-) (limited to 'indra/integration_tests/llimage_libtest/llimage_libtest.cpp') diff --git a/indra/integration_tests/llimage_libtest/llimage_libtest.cpp b/indra/integration_tests/llimage_libtest/llimage_libtest.cpp index 58d7f53dd1..6045ed321d 100755 --- a/indra/integration_tests/llimage_libtest/llimage_libtest.cpp +++ b/indra/integration_tests/llimage_libtest/llimage_libtest.cpp @@ -687,73 +687,85 @@ int main(int argc, char** argv) } else if (filter_name == "gamma") { - raw_image->filterGamma((float)(filter_param)); + raw_image->filterGamma((float)(filter_param),LLColor3::white); } else if (filter_name == "colorize") { - // For testing, we just colorize in red, modulate by the alpha passed as a parameter - LLColor4U color = LLColor4U::red; - color.setAlpha((U8)(filter_param * 255.0)); - raw_image->filterColorize(color); + // For testing, we just colorize in the red channel, modulate by the alpha passed as a parameter + LLColor3 color(1.0,0.0,0.0); + LLColor3 alpha((F32)(filter_param),0.0,0.0); + raw_image->filterColorize(color,alpha); } else if (filter_name == "contrast") { - raw_image->filterContrast((float)(filter_param)); + raw_image->filterContrast((float)(filter_param),LLColor3::white); } else if (filter_name == "brighten") { - raw_image->filterBrightness((S32)(filter_param)); + raw_image->filterBrightness((S32)(filter_param),LLColor3::white); } else if (filter_name == "darken") { - raw_image->filterBrightness((S32)(-filter_param)); + raw_image->filterBrightness((S32)(-filter_param),LLColor3::white); } else if (filter_name == "linearize") { - raw_image->filterLinearize((float)(filter_param)); + raw_image->filterLinearize((float)(filter_param),LLColor3::white); } else if (filter_name == "posterize") { - raw_image->filterEqualize((S32)(filter_param)); + raw_image->filterEqualize((S32)(filter_param),LLColor3::white); } // Test for some "a la Instagram" filters else if (filter_name == "Lomofi") { raw_image->setVignette(VIGNETTE_MODE_BLEND,4.0,0.0); - raw_image->filterLinearize(0.2); + raw_image->filterLinearize(0.2,LLColor3::white); + raw_image->filterBrightness(20,LLColor3::white); + } + else if (filter_name == "Poprocket") + { + LLColor3 color(1.0,0.0,0.0); + LLColor3 alpha(0.5,0.0,0.0); + raw_image->filterLinearize(0.0,LLColor3::white); + raw_image->filterContrast(0.5,LLColor3::white); + raw_image->setVignette(VIGNETTE_MODE_FADE,4.0,0.5); + raw_image->filterColorize(color,alpha); } else if (filter_name == "Sutro") { - raw_image->filterLinearize(0.2); + raw_image->filterLinearize(0.2,LLColor3::white); raw_image->setVignette(VIGNETTE_MODE_FADE,4.0,0.5); raw_image->filterSepia(); } + else if (filter_name == "Toaster") + { + raw_image->filterContrast(0.8,LLColor3::white); + raw_image->setVignette(VIGNETTE_MODE_FADE,4.0,0.5); + raw_image->filterBrightness(10,LLColor3::white); + //raw_image->filterColorBalance(0.5,1.0,1.0); + } else if (filter_name == "Inkwell") { - raw_image->filterLinearize(0.0); + raw_image->filterLinearize(0.0,LLColor3::white); raw_image->filterGrayScale(); } - else if (filter_name == "Poprocket") + else if (filter_name == "Hefe") { - LLColor4U color = LLColor4U::red; - color.setAlpha((U8)(0.2 * 255.0)); - raw_image->filterLinearize(0.0); + raw_image->filterLinearize(0.0,LLColor3::white); raw_image->setVignette(VIGNETTE_MODE_FADE,4.0,0.5); - raw_image->filterColorize(color); + raw_image->filterContrast(1.5,LLColor3::white); } else if (filter_name == "Gotham") { - raw_image->filterLinearize(0.0); - raw_image->filterColorBalance(1.0,1.0,20.0); + raw_image->filterLinearize(0.0,LLColor3::white); + // Blow out the Blue + LLColor3 color(0.0,0.0,0.0); + LLColor3 alpha(0.0,0.0,1.0); + raw_image->filterColorize(color,alpha); + // Convert to Grayscale raw_image->filterGrayScale(); } - else if (filter_name == "Toaster") - { - raw_image->filterContrast(0.8); - raw_image->setVignette(VIGNETTE_MODE_FADE,4.0,0.5); - raw_image->filterBrightness(10); - raw_image->filterColorBalance(0.5,1.0,1.0); - } // Save file if (out_file != out_end) -- cgit v1.2.3