From c99e22e6740ebb3e39bc1b85000bd465676e60d1 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 21 Jan 2014 21:17:57 -0800 Subject: ACME-1236 : Make all filters resolution independent, cleanup comments, move example filters to a sub folder in llimage_libtest --- .../llimage_libtest/1970colorize.xml | 41 ------------- indra/integration_tests/llimage_libtest/blur.xml | 7 --- .../integration_tests/llimage_libtest/brighten.xml | 11 ---- .../integration_tests/llimage_libtest/colorize.xml | 24 -------- .../integration_tests/llimage_libtest/contrast.xml | 11 ---- indra/integration_tests/llimage_libtest/darken.xml | 11 ---- indra/integration_tests/llimage_libtest/edges.xml | 24 -------- .../llimage_libtest/filters/1970colorize.xml | 41 +++++++++++++ .../llimage_libtest/filters/blur.xml | 7 +++ .../llimage_libtest/filters/brighten.xml | 11 ++++ .../llimage_libtest/filters/colorize.xml | 24 ++++++++ .../llimage_libtest/filters/contrast.xml | 11 ++++ .../llimage_libtest/filters/darken.xml | 11 ++++ .../llimage_libtest/filters/edges.xml | 24 ++++++++ .../llimage_libtest/filters/gamma.xml | 11 ++++ .../llimage_libtest/filters/grayscale.xml | 14 +++++ .../llimage_libtest/filters/horizontalscreen.xml | 20 +++++++ .../llimage_libtest/filters/linearize.xml | 11 ++++ .../llimage_libtest/filters/newsscreen.xml | 20 +++++++ .../llimage_libtest/filters/posterize.xml | 11 ++++ .../llimage_libtest/filters/rotatecolors180.xml | 8 +++ .../llimage_libtest/filters/saturate.xml | 8 +++ .../llimage_libtest/filters/sepia.xml | 14 +++++ .../llimage_libtest/filters/sharpen.xml | 7 +++ .../llimage_libtest/filters/slantedscreen.xml | 20 +++++++ .../llimage_libtest/filters/spotlight.xml | 45 ++++++++++++++ .../llimage_libtest/filters/stencilgradient.xml | 24 ++++++++ .../llimage_libtest/filters/stencilscanlines.xml | 22 +++++++ .../llimage_libtest/filters/stenciluniform.xml | 20 +++++++ .../llimage_libtest/filters/stencilvignette.xml | 24 ++++++++ .../llimage_libtest/filters/verticalscreen.xml | 20 +++++++ .../llimage_libtest/filters/video.xml | 23 +++++++ indra/integration_tests/llimage_libtest/gamma.xml | 11 ---- .../llimage_libtest/grayscale.xml | 14 ----- .../llimage_libtest/horizontalscreen.xml | 25 -------- .../llimage_libtest/linearize.xml | 11 ---- .../llimage_libtest/newsscreen.xml | 25 -------- .../llimage_libtest/posterize.xml | 18 ------ .../llimage_libtest/rotatecolors180.xml | 8 --- .../integration_tests/llimage_libtest/saturate.xml | 8 --- indra/integration_tests/llimage_libtest/sepia.xml | 14 ----- .../integration_tests/llimage_libtest/sharpen.xml | 7 --- .../llimage_libtest/slantedscreen.xml | 25 -------- .../llimage_libtest/spotlight.xml | 45 -------------- .../llimage_libtest/verticalscreen.xml | 25 -------- indra/integration_tests/llimage_libtest/video.xml | 23 ------- indra/llimage/llimagefilter.cpp | 70 ++++------------------ indra/llimage/llimagefilter.h | 4 +- 48 files changed, 464 insertions(+), 449 deletions(-) delete mode 100644 indra/integration_tests/llimage_libtest/1970colorize.xml delete mode 100644 indra/integration_tests/llimage_libtest/blur.xml delete mode 100755 indra/integration_tests/llimage_libtest/brighten.xml delete mode 100644 indra/integration_tests/llimage_libtest/colorize.xml delete mode 100644 indra/integration_tests/llimage_libtest/contrast.xml delete mode 100755 indra/integration_tests/llimage_libtest/darken.xml delete mode 100644 indra/integration_tests/llimage_libtest/edges.xml create mode 100644 indra/integration_tests/llimage_libtest/filters/1970colorize.xml create mode 100644 indra/integration_tests/llimage_libtest/filters/blur.xml create mode 100755 indra/integration_tests/llimage_libtest/filters/brighten.xml create mode 100644 indra/integration_tests/llimage_libtest/filters/colorize.xml create mode 100644 indra/integration_tests/llimage_libtest/filters/contrast.xml create mode 100755 indra/integration_tests/llimage_libtest/filters/darken.xml create mode 100644 indra/integration_tests/llimage_libtest/filters/edges.xml create mode 100644 indra/integration_tests/llimage_libtest/filters/gamma.xml create mode 100644 indra/integration_tests/llimage_libtest/filters/grayscale.xml create mode 100644 indra/integration_tests/llimage_libtest/filters/horizontalscreen.xml create mode 100755 indra/integration_tests/llimage_libtest/filters/linearize.xml create mode 100755 indra/integration_tests/llimage_libtest/filters/newsscreen.xml create mode 100755 indra/integration_tests/llimage_libtest/filters/posterize.xml create mode 100644 indra/integration_tests/llimage_libtest/filters/rotatecolors180.xml create mode 100644 indra/integration_tests/llimage_libtest/filters/saturate.xml create mode 100644 indra/integration_tests/llimage_libtest/filters/sepia.xml create mode 100644 indra/integration_tests/llimage_libtest/filters/sharpen.xml create mode 100644 indra/integration_tests/llimage_libtest/filters/slantedscreen.xml create mode 100644 indra/integration_tests/llimage_libtest/filters/spotlight.xml create mode 100644 indra/integration_tests/llimage_libtest/filters/stencilgradient.xml create mode 100644 indra/integration_tests/llimage_libtest/filters/stencilscanlines.xml create mode 100644 indra/integration_tests/llimage_libtest/filters/stenciluniform.xml create mode 100644 indra/integration_tests/llimage_libtest/filters/stencilvignette.xml create mode 100644 indra/integration_tests/llimage_libtest/filters/verticalscreen.xml create mode 100755 indra/integration_tests/llimage_libtest/filters/video.xml delete mode 100644 indra/integration_tests/llimage_libtest/gamma.xml delete mode 100644 indra/integration_tests/llimage_libtest/grayscale.xml delete mode 100644 indra/integration_tests/llimage_libtest/horizontalscreen.xml delete mode 100755 indra/integration_tests/llimage_libtest/linearize.xml delete mode 100755 indra/integration_tests/llimage_libtest/newsscreen.xml delete mode 100755 indra/integration_tests/llimage_libtest/posterize.xml delete mode 100644 indra/integration_tests/llimage_libtest/rotatecolors180.xml delete mode 100644 indra/integration_tests/llimage_libtest/saturate.xml delete mode 100644 indra/integration_tests/llimage_libtest/sepia.xml delete mode 100644 indra/integration_tests/llimage_libtest/sharpen.xml delete mode 100644 indra/integration_tests/llimage_libtest/slantedscreen.xml delete mode 100644 indra/integration_tests/llimage_libtest/spotlight.xml delete mode 100644 indra/integration_tests/llimage_libtest/verticalscreen.xml delete mode 100755 indra/integration_tests/llimage_libtest/video.xml (limited to 'indra') diff --git a/indra/integration_tests/llimage_libtest/1970colorize.xml b/indra/integration_tests/llimage_libtest/1970colorize.xml deleted file mode 100644 index 0dab2489a0..0000000000 --- a/indra/integration_tests/llimage_libtest/1970colorize.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - linearize - 0.1 - 1.0 - 1.0 - 1.0 - - - contrast - 0.8 - 1.0 - 1.0 - 1.0 - - - colorize - 1.0 - 1.0 - 1.0 - 0.5 - 0.0 - 0.0 - - - blend - 10.0 - 0.0 - - - colorize - 1.0 - 1.0 - 1.0 - 0.1 - 0.1 - 0.0 - - - diff --git a/indra/integration_tests/llimage_libtest/blur.xml b/indra/integration_tests/llimage_libtest/blur.xml deleted file mode 100644 index addd056855..0000000000 --- a/indra/integration_tests/llimage_libtest/blur.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - blur - - - diff --git a/indra/integration_tests/llimage_libtest/brighten.xml b/indra/integration_tests/llimage_libtest/brighten.xml deleted file mode 100755 index 9b4232229f..0000000000 --- a/indra/integration_tests/llimage_libtest/brighten.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - brighten - 0.5 - 1.0 - 1.0 - 1.0 - - - diff --git a/indra/integration_tests/llimage_libtest/colorize.xml b/indra/integration_tests/llimage_libtest/colorize.xml deleted file mode 100644 index 72e58b0ffe..0000000000 --- a/indra/integration_tests/llimage_libtest/colorize.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - stencil - vignette - blend - 0.0 - 1.0 - 0.0 - 0.0 - 1.0 - 10.0 - - - colorize - 1.0 - 0.0 - 0.0 - 0.5 - 0.5 - 0.0 - - - diff --git a/indra/integration_tests/llimage_libtest/contrast.xml b/indra/integration_tests/llimage_libtest/contrast.xml deleted file mode 100644 index 00746b8a9e..0000000000 --- a/indra/integration_tests/llimage_libtest/contrast.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - contrast - 1.5 - 1.0 - 1.0 - 1.0 - - - diff --git a/indra/integration_tests/llimage_libtest/darken.xml b/indra/integration_tests/llimage_libtest/darken.xml deleted file mode 100755 index 5cec3589b6..0000000000 --- a/indra/integration_tests/llimage_libtest/darken.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - darken - 0.5 - 1.0 - 1.0 - 1.0 - - - diff --git a/indra/integration_tests/llimage_libtest/edges.xml b/indra/integration_tests/llimage_libtest/edges.xml deleted file mode 100644 index a66b81d01e..0000000000 --- a/indra/integration_tests/llimage_libtest/edges.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - gradient - - - blur - - - linearize - 0.0 - 1.0 - 1.0 - 1.0 - - - contrast - 2.0 - 1.0 - 1.0 - 1.0 - - - diff --git a/indra/integration_tests/llimage_libtest/filters/1970colorize.xml b/indra/integration_tests/llimage_libtest/filters/1970colorize.xml new file mode 100644 index 0000000000..0dab2489a0 --- /dev/null +++ b/indra/integration_tests/llimage_libtest/filters/1970colorize.xml @@ -0,0 +1,41 @@ + + + + linearize + 0.1 + 1.0 + 1.0 + 1.0 + + + contrast + 0.8 + 1.0 + 1.0 + 1.0 + + + colorize + 1.0 + 1.0 + 1.0 + 0.5 + 0.0 + 0.0 + + + blend + 10.0 + 0.0 + + + colorize + 1.0 + 1.0 + 1.0 + 0.1 + 0.1 + 0.0 + + + diff --git a/indra/integration_tests/llimage_libtest/filters/blur.xml b/indra/integration_tests/llimage_libtest/filters/blur.xml new file mode 100644 index 0000000000..addd056855 --- /dev/null +++ b/indra/integration_tests/llimage_libtest/filters/blur.xml @@ -0,0 +1,7 @@ + + + + blur + + + diff --git a/indra/integration_tests/llimage_libtest/filters/brighten.xml b/indra/integration_tests/llimage_libtest/filters/brighten.xml new file mode 100755 index 0000000000..9b4232229f --- /dev/null +++ b/indra/integration_tests/llimage_libtest/filters/brighten.xml @@ -0,0 +1,11 @@ + + + + brighten + 0.5 + 1.0 + 1.0 + 1.0 + + + diff --git a/indra/integration_tests/llimage_libtest/filters/colorize.xml b/indra/integration_tests/llimage_libtest/filters/colorize.xml new file mode 100644 index 0000000000..72e58b0ffe --- /dev/null +++ b/indra/integration_tests/llimage_libtest/filters/colorize.xml @@ -0,0 +1,24 @@ + + + + stencil + vignette + blend + 0.0 + 1.0 + 0.0 + 0.0 + 1.0 + 10.0 + + + colorize + 1.0 + 0.0 + 0.0 + 0.5 + 0.5 + 0.0 + + + diff --git a/indra/integration_tests/llimage_libtest/filters/contrast.xml b/indra/integration_tests/llimage_libtest/filters/contrast.xml new file mode 100644 index 0000000000..00746b8a9e --- /dev/null +++ b/indra/integration_tests/llimage_libtest/filters/contrast.xml @@ -0,0 +1,11 @@ + + + + contrast + 1.5 + 1.0 + 1.0 + 1.0 + + + diff --git a/indra/integration_tests/llimage_libtest/filters/darken.xml b/indra/integration_tests/llimage_libtest/filters/darken.xml new file mode 100755 index 0000000000..5cec3589b6 --- /dev/null +++ b/indra/integration_tests/llimage_libtest/filters/darken.xml @@ -0,0 +1,11 @@ + + + + darken + 0.5 + 1.0 + 1.0 + 1.0 + + + diff --git a/indra/integration_tests/llimage_libtest/filters/edges.xml b/indra/integration_tests/llimage_libtest/filters/edges.xml new file mode 100644 index 0000000000..a66b81d01e --- /dev/null +++ b/indra/integration_tests/llimage_libtest/filters/edges.xml @@ -0,0 +1,24 @@ + + + + gradient + + + blur + + + linearize + 0.0 + 1.0 + 1.0 + 1.0 + + + contrast + 2.0 + 1.0 + 1.0 + 1.0 + + + diff --git a/indra/integration_tests/llimage_libtest/filters/gamma.xml b/indra/integration_tests/llimage_libtest/filters/gamma.xml new file mode 100644 index 0000000000..19af09b046 --- /dev/null +++ b/indra/integration_tests/llimage_libtest/filters/gamma.xml @@ -0,0 +1,11 @@ + + + + gamma + 1.7 + 1.0 + 1.0 + 1.0 + + + diff --git a/indra/integration_tests/llimage_libtest/filters/grayscale.xml b/indra/integration_tests/llimage_libtest/filters/grayscale.xml new file mode 100644 index 0000000000..984312c4fd --- /dev/null +++ b/indra/integration_tests/llimage_libtest/filters/grayscale.xml @@ -0,0 +1,14 @@ + + + + linearize + 0.0 + 1.0 + 1.0 + 1.0 + + + grayscale + + + diff --git a/indra/integration_tests/llimage_libtest/filters/horizontalscreen.xml b/indra/integration_tests/llimage_libtest/filters/horizontalscreen.xml new file mode 100644 index 0000000000..21cab70e54 --- /dev/null +++ b/indra/integration_tests/llimage_libtest/filters/horizontalscreen.xml @@ -0,0 +1,20 @@ + + + + linearize + 0.0 + 1.0 + 1.0 + 1.0 + + + grayscale + + + screen + line + 0.015 + 0.0 + + + diff --git a/indra/integration_tests/llimage_libtest/filters/linearize.xml b/indra/integration_tests/llimage_libtest/filters/linearize.xml new file mode 100755 index 0000000000..23d0290e07 --- /dev/null +++ b/indra/integration_tests/llimage_libtest/filters/linearize.xml @@ -0,0 +1,11 @@ + + + + linearize + 0.1 + 1.0 + 1.0 + 1.0 + + + diff --git a/indra/integration_tests/llimage_libtest/filters/newsscreen.xml b/indra/integration_tests/llimage_libtest/filters/newsscreen.xml new file mode 100755 index 0000000000..50ed27c6db --- /dev/null +++ b/indra/integration_tests/llimage_libtest/filters/newsscreen.xml @@ -0,0 +1,20 @@ + + + + linearize + 0.0 + 1.0 + 1.0 + 1.0 + + + grayscale + + + screen + 2Dsine + 0.015 + 0.0 + + + diff --git a/indra/integration_tests/llimage_libtest/filters/posterize.xml b/indra/integration_tests/llimage_libtest/filters/posterize.xml new file mode 100755 index 0000000000..4d03df3c66 --- /dev/null +++ b/indra/integration_tests/llimage_libtest/filters/posterize.xml @@ -0,0 +1,11 @@ + + + + posterize + 10.0 + 1.0 + 1.0 + 1.0 + + + diff --git a/indra/integration_tests/llimage_libtest/filters/rotatecolors180.xml b/indra/integration_tests/llimage_libtest/filters/rotatecolors180.xml new file mode 100644 index 0000000000..e25029720f --- /dev/null +++ b/indra/integration_tests/llimage_libtest/filters/rotatecolors180.xml @@ -0,0 +1,8 @@ + + + + rotate + 180.0 + + + diff --git a/indra/integration_tests/llimage_libtest/filters/saturate.xml b/indra/integration_tests/llimage_libtest/filters/saturate.xml new file mode 100644 index 0000000000..b77f07a037 --- /dev/null +++ b/indra/integration_tests/llimage_libtest/filters/saturate.xml @@ -0,0 +1,8 @@ + + + + saturate + 3.0 + + + diff --git a/indra/integration_tests/llimage_libtest/filters/sepia.xml b/indra/integration_tests/llimage_libtest/filters/sepia.xml new file mode 100644 index 0000000000..0304ead015 --- /dev/null +++ b/indra/integration_tests/llimage_libtest/filters/sepia.xml @@ -0,0 +1,14 @@ + + + + linearize + 0.0 + 1.0 + 1.0 + 1.0 + + + sepia + + + diff --git a/indra/integration_tests/llimage_libtest/filters/sharpen.xml b/indra/integration_tests/llimage_libtest/filters/sharpen.xml new file mode 100644 index 0000000000..6d3f9ae1a2 --- /dev/null +++ b/indra/integration_tests/llimage_libtest/filters/sharpen.xml @@ -0,0 +1,7 @@ + + + + sharpen + + + diff --git a/indra/integration_tests/llimage_libtest/filters/slantedscreen.xml b/indra/integration_tests/llimage_libtest/filters/slantedscreen.xml new file mode 100644 index 0000000000..6cd1a96185 --- /dev/null +++ b/indra/integration_tests/llimage_libtest/filters/slantedscreen.xml @@ -0,0 +1,20 @@ + + + + linearize + 0.0 + 1.0 + 1.0 + 1.0 + + + grayscale + + + screen + line + 0.015 + 45.0 + + + diff --git a/indra/integration_tests/llimage_libtest/filters/spotlight.xml b/indra/integration_tests/llimage_libtest/filters/spotlight.xml new file mode 100644 index 0000000000..203130bdee --- /dev/null +++ b/indra/integration_tests/llimage_libtest/filters/spotlight.xml @@ -0,0 +1,45 @@ + + + + linearize + 0.1 + 1.0 + 1.0 + 1.0 + + + contrast + 0.8 + 1.0 + 1.0 + 1.0 + + + saturate + 1.5 + + + fade + 1.0 + 0.25 + + + saturate + 0.8 + + + contrast + 1.1 + 1.0 + 1.0 + 1.0 + + + brighten + 30 + 1.0 + 1.0 + 1.0 + + + diff --git a/indra/integration_tests/llimage_libtest/filters/stencilgradient.xml b/indra/integration_tests/llimage_libtest/filters/stencilgradient.xml new file mode 100644 index 0000000000..d22809a9bf --- /dev/null +++ b/indra/integration_tests/llimage_libtest/filters/stencilgradient.xml @@ -0,0 +1,24 @@ + + + + stencil + gradient + blend + 0.0 + 1.0 + 0.0 + -1.0 + 0.0 + 1.0 + + + colorize + 1.0 + 0.0 + 0.0 + 1.0 + 1.0 + 1.0 + + + diff --git a/indra/integration_tests/llimage_libtest/filters/stencilscanlines.xml b/indra/integration_tests/llimage_libtest/filters/stencilscanlines.xml new file mode 100644 index 0000000000..3ce428503d --- /dev/null +++ b/indra/integration_tests/llimage_libtest/filters/stencilscanlines.xml @@ -0,0 +1,22 @@ + + + + stencil + scanlines + blend + 0.0 + 0.5 + 0.1 + 45.0 + + + colorize + 1.0 + 0.0 + 0.0 + 1.0 + 1.0 + 1.0 + + + diff --git a/indra/integration_tests/llimage_libtest/filters/stenciluniform.xml b/indra/integration_tests/llimage_libtest/filters/stenciluniform.xml new file mode 100644 index 0000000000..7d72f0ed93 --- /dev/null +++ b/indra/integration_tests/llimage_libtest/filters/stenciluniform.xml @@ -0,0 +1,20 @@ + + + + stencil + uniform + blend + 0.0 + 0.5 + + + colorize + 1.0 + 0.0 + 0.0 + 1.0 + 1.0 + 1.0 + + + diff --git a/indra/integration_tests/llimage_libtest/filters/stencilvignette.xml b/indra/integration_tests/llimage_libtest/filters/stencilvignette.xml new file mode 100644 index 0000000000..d30637fef5 --- /dev/null +++ b/indra/integration_tests/llimage_libtest/filters/stencilvignette.xml @@ -0,0 +1,24 @@ + + + + stencil + vignette + blend + 0.0 + 0.5 + 0.0 + 0.0 + 1.0 + 10.0 + + + colorize + 1.0 + 0.0 + 0.0 + 1.0 + 1.0 + 1.0 + + + diff --git a/indra/integration_tests/llimage_libtest/filters/verticalscreen.xml b/indra/integration_tests/llimage_libtest/filters/verticalscreen.xml new file mode 100644 index 0000000000..0768d1d7e1 --- /dev/null +++ b/indra/integration_tests/llimage_libtest/filters/verticalscreen.xml @@ -0,0 +1,20 @@ + + + + linearize + 0.0 + 1.0 + 1.0 + 1.0 + + + grayscale + + + screen + line + 0.015 + 90.0 + + + diff --git a/indra/integration_tests/llimage_libtest/filters/video.xml b/indra/integration_tests/llimage_libtest/filters/video.xml new file mode 100755 index 0000000000..8b10687ef5 --- /dev/null +++ b/indra/integration_tests/llimage_libtest/filters/video.xml @@ -0,0 +1,23 @@ + + + + linearize + 0.01 + 1.0 + 1.0 + 1.0 + + + lines + 10.0 + 0.0 + + + brighten + 100.0 + 1.0 + 1.0 + 1.0 + + + diff --git a/indra/integration_tests/llimage_libtest/gamma.xml b/indra/integration_tests/llimage_libtest/gamma.xml deleted file mode 100644 index 19af09b046..0000000000 --- a/indra/integration_tests/llimage_libtest/gamma.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - gamma - 1.7 - 1.0 - 1.0 - 1.0 - - - diff --git a/indra/integration_tests/llimage_libtest/grayscale.xml b/indra/integration_tests/llimage_libtest/grayscale.xml deleted file mode 100644 index 984312c4fd..0000000000 --- a/indra/integration_tests/llimage_libtest/grayscale.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - linearize - 0.0 - 1.0 - 1.0 - 1.0 - - - grayscale - - - diff --git a/indra/integration_tests/llimage_libtest/horizontalscreen.xml b/indra/integration_tests/llimage_libtest/horizontalscreen.xml deleted file mode 100644 index ddff4d1977..0000000000 --- a/indra/integration_tests/llimage_libtest/horizontalscreen.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - linearize - 0.1 - 1.0 - 1.0 - 1.0 - - - grayscale - - - blend - 0.0 - 0.0 - - - screen - line - 5.0 - 0.0 - - - diff --git a/indra/integration_tests/llimage_libtest/linearize.xml b/indra/integration_tests/llimage_libtest/linearize.xml deleted file mode 100755 index 23d0290e07..0000000000 --- a/indra/integration_tests/llimage_libtest/linearize.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - linearize - 0.1 - 1.0 - 1.0 - 1.0 - - - diff --git a/indra/integration_tests/llimage_libtest/newsscreen.xml b/indra/integration_tests/llimage_libtest/newsscreen.xml deleted file mode 100755 index 8247c34500..0000000000 --- a/indra/integration_tests/llimage_libtest/newsscreen.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - linearize - 0.1 - 1.0 - 1.0 - 1.0 - - - grayscale - - - blend - 0.0 - 0.0 - - - screen - 2Dsine - 5.0 - 0.0 - - - diff --git a/indra/integration_tests/llimage_libtest/posterize.xml b/indra/integration_tests/llimage_libtest/posterize.xml deleted file mode 100755 index f026278f9e..0000000000 --- a/indra/integration_tests/llimage_libtest/posterize.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - linearize - 0.0 - 1.0 - 1.0 - 1.0 - - - posterize - 10.0 - 1.0 - 1.0 - 1.0 - - - diff --git a/indra/integration_tests/llimage_libtest/rotatecolors180.xml b/indra/integration_tests/llimage_libtest/rotatecolors180.xml deleted file mode 100644 index e25029720f..0000000000 --- a/indra/integration_tests/llimage_libtest/rotatecolors180.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - rotate - 180.0 - - - diff --git a/indra/integration_tests/llimage_libtest/saturate.xml b/indra/integration_tests/llimage_libtest/saturate.xml deleted file mode 100644 index b77f07a037..0000000000 --- a/indra/integration_tests/llimage_libtest/saturate.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - saturate - 3.0 - - - diff --git a/indra/integration_tests/llimage_libtest/sepia.xml b/indra/integration_tests/llimage_libtest/sepia.xml deleted file mode 100644 index 0304ead015..0000000000 --- a/indra/integration_tests/llimage_libtest/sepia.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - linearize - 0.0 - 1.0 - 1.0 - 1.0 - - - sepia - - - diff --git a/indra/integration_tests/llimage_libtest/sharpen.xml b/indra/integration_tests/llimage_libtest/sharpen.xml deleted file mode 100644 index 6d3f9ae1a2..0000000000 --- a/indra/integration_tests/llimage_libtest/sharpen.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - sharpen - - - diff --git a/indra/integration_tests/llimage_libtest/slantedscreen.xml b/indra/integration_tests/llimage_libtest/slantedscreen.xml deleted file mode 100644 index 63ad01d51d..0000000000 --- a/indra/integration_tests/llimage_libtest/slantedscreen.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - linearize - 0.1 - 1.0 - 1.0 - 1.0 - - - grayscale - - - blend - 0.0 - 0.0 - - - screen - line - 5.0 - 45.0 - - - diff --git a/indra/integration_tests/llimage_libtest/spotlight.xml b/indra/integration_tests/llimage_libtest/spotlight.xml deleted file mode 100644 index 203130bdee..0000000000 --- a/indra/integration_tests/llimage_libtest/spotlight.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - linearize - 0.1 - 1.0 - 1.0 - 1.0 - - - contrast - 0.8 - 1.0 - 1.0 - 1.0 - - - saturate - 1.5 - - - fade - 1.0 - 0.25 - - - saturate - 0.8 - - - contrast - 1.1 - 1.0 - 1.0 - 1.0 - - - brighten - 30 - 1.0 - 1.0 - 1.0 - - - diff --git a/indra/integration_tests/llimage_libtest/verticalscreen.xml b/indra/integration_tests/llimage_libtest/verticalscreen.xml deleted file mode 100644 index 71e48df656..0000000000 --- a/indra/integration_tests/llimage_libtest/verticalscreen.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - linearize - 0.1 - 1.0 - 1.0 - 1.0 - - - grayscale - - - blend - 0.0 - 0.0 - - - screen - line - 5.0 - 90.0 - - - diff --git a/indra/integration_tests/llimage_libtest/video.xml b/indra/integration_tests/llimage_libtest/video.xml deleted file mode 100755 index 8b10687ef5..0000000000 --- a/indra/integration_tests/llimage_libtest/video.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - linearize - 0.01 - 1.0 - 1.0 - 1.0 - - - lines - 10.0 - 0.0 - - - brighten - 100.0 - 1.0 - 1.0 - 1.0 - - - diff --git a/indra/llimage/llimagefilter.cpp b/indra/llimage/llimagefilter.cpp index c02679e04f..4c6dd2faee 100755 --- a/indra/llimage/llimagefilter.cpp +++ b/indra/llimage/llimagefilter.cpp @@ -1,6 +1,6 @@ /** * @file llimagefilter.cpp - * @brief Simple Image Filtering. + * @brief Simple Image Filtering. See https://wiki.lindenlab.com/wiki/SL_Viewer_Image_Filters for complete documentation. * * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code @@ -75,42 +75,12 @@ LLImageFilter::~LLImageFilter() /* *TODO - * Test blend modes + * Rename stencil to mask + * Test blend modes and name them correctly + * Suppress old "blend", "fade" and "lines" stencil definition. Change all xml accordingly. * Improve perf: use LUT for alpha blending in uniform case * Improve perf: make sure filter is not called more than necessary in viewer (seems to be called 3 times per change) - * Make filter definition resolution independent (do not use pixel size anywhere) * Add gradient coloring as a filter - - params: - * vignette : center_x, center_y, width, feather - * scan lines : wavelength, angle - * uniform - * gradient : start_x, start_y, end_x, end_y - - * Document all the admissible names in the wiki - - " Apply the filter to the input images using the optional value. Admissible names:\n" - " - 'grayscale' converts to grayscale (no param).\n" - " - 'sepia' converts to sepia (no param).\n" - " - 'saturate' changes color saturation according to : < 1.0 will desaturate, > 1.0 will saturate.\n" - " - 'rotate' rotates the color hue according to (in degree, positive value only).\n" - - " - 'gamma' applies a gamma curve to all channels: > 1.0 will darken, < 1.0 will lighten.\n" - " - 'colorize' applies a colored tint to the image.\n" - " - 'contrast' modifies the contrast according to : > 1.0 will enhance the contrast, <1.0 will flatten it.\n" - " - 'brighten' adds light to the image ( between 0 and 255).\n" - " - 'darken' substracts light to the image ( between 0 and 255).\n" - " - 'linearize' optimizes the contrast using the brightness histogram. is the fraction (between 0.0 and 1.0) of the discarded head and tail of the histogram.\n" - " - 'posterize' redistributes the colors between classes per channel ( between 2 and 255).\n" - - " - 'screen' applies a screening filter to the red channel and output to black and white. This filter assumes that the input image has been converted to grayscale or that the red channel is somewhat meaningful. It takes 3 parameters: a mode, a wave length and an angle. Modes are:\n" - " - '2Dsine' applies a bidirectional (x,y) sine screen. has no influence on that mode.\n" - " - 'line' applies a linear sine screen. is the line generator angle with the horizontal.\n" - " is size between 2 peaks of the sine function in normalized image coordinates." - - " Apply a circular central vignette to the filter using the optional and values. 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" */ //============================================================================ @@ -133,25 +103,6 @@ void LLImageFilter::executeFilter(LLPointer raw_image) //} //std::cout << std::endl; - // Execute the filter described on this line - /* - - stencil - shape uniform / gradient / vignette / scanlines - blend_mode blend /add /dodge / fade - min -1.0 to 1.0 (mandatory though ignored for uniform shape) - max -1.0 to 1.0 (value for uniform) - param1 - param2 - param3 - param4 - - params: - * vignette : center_x, center_y, width, feather : positions between in float (0.0 is center, 1.0 is top), width in float in same unit, feather is a float - * scan lines : wavelength, angle : wavelength in float assuming (height/2 = 1), angle float in degree - * uniform : all parameters ignored - * gradient : start_x, start_y, end_x, end_y : position in float (0.0 is center, 1.0 is top) - */ if (filter_name == "stencil") { // Get the shape of the stencil, that is how the procedural alpha is computed geometrically @@ -279,7 +230,7 @@ void LLImageFilter::executeFilter(LLPointer raw_image) { mode = SCREEN_MODE_LINE; } - filterScreen(mode,(S32)(mFilterData[i][2].asReal()),(F32)(mFilterData[i][3].asReal())); + filterScreen(mode,(F32)(mFilterData[i][2].asReal()),(F32)(mFilterData[i][3].asReal())); } else if (filter_name == "blur") { @@ -445,7 +396,7 @@ void LLImageFilter::convolve(const LLMatrix3 &kernel, bool normalize, bool abs_v // All other lines for (S32 j = 1; j < (height-1); j++) { - // We need to buffer 2 lines. We flip north and current to avoid moving too much memory around + // We need to buffer 2 lines. We flip north and east-west (current) to avoid moving too much memory around if (j % 2) { memcpy( &odd_buffer[0], dst_data, buffer_size ); /* Flawfinder: ignore */ @@ -460,6 +411,7 @@ void LLImageFilter::convolve(const LLMatrix3 &kernel, bool normalize, bool abs_v } // First pixel : set to 0 blendStencil(getStencilAlpha(0,j), dst_data, 0, 0, 0); + dst_data += components; // Set pointers to kernel U8* NW = north_data; U8* N = NW+components; @@ -470,7 +422,6 @@ void LLImageFilter::convolve(const LLMatrix3 &kernel, bool normalize, bool abs_v U8* SW = south_data; U8* S = SW+components; U8* SE = S+components; - dst_data += components; // All other pixels for (S32 i = 1; i < (width-1); i++) { @@ -528,7 +479,7 @@ void LLImageFilter::convolve(const LLMatrix3 &kernel, bool normalize, bool abs_v } } -void LLImageFilter::filterScreen(EScreenMode mode, const S32 wave_length, const F32 angle) +void LLImageFilter::filterScreen(EScreenMode mode, const F32 wave_length, const F32 angle) { const S32 components = mImage->getComponents(); llassert( components >= 1 && components <= 4 ); @@ -536,6 +487,7 @@ void LLImageFilter::filterScreen(EScreenMode mode, const S32 wave_length, const S32 width = mImage->getWidth(); S32 height = mImage->getHeight(); + F32 wave_length_pixels = wave_length * (F32)(height) / 2.0; F32 sin = sinf(angle*DEG_TO_RAD); F32 cos = cosf(angle*DEG_TO_RAD); @@ -550,11 +502,11 @@ void LLImageFilter::filterScreen(EScreenMode mode, const S32 wave_length, const switch (mode) { case SCREEN_MODE_2DSINE: - value = (sinf(2*F_PI*i/wave_length)*sinf(2*F_PI*j/wave_length)+1.0)*255.0/2.0; + value = (sinf(2*F_PI*i/wave_length_pixels)*sinf(2*F_PI*j/wave_length_pixels)+1.0)*255.0/2.0; break; case SCREEN_MODE_LINE: d = sin*i - cos*j; - value = (sinf(2*F_PI*d/wave_length)+1.0)*255.0/2.0; + value = (sinf(2*F_PI*d/wave_length_pixels)+1.0)*255.0/2.0; break; } U8 dst_value = (dst_data[VRED] >= (U8)(value) ? 255 : 0); diff --git a/indra/llimage/llimagefilter.h b/indra/llimage/llimagefilter.h index 3e3be3d88b..e392d3215e 100755 --- a/indra/llimage/llimagefilter.h +++ b/indra/llimage/llimagefilter.h @@ -1,6 +1,6 @@ /** * @file llimagefilter.h - * @brief Simple Image Filtering. + * @brief Simple Image Filtering. See https://wiki.lindenlab.com/wiki/SL_Viewer_Image_Filters for complete documentation. * * $LicenseInfo:firstyear=2000&license=viewerlgpl$ * Second Life Viewer Source Code @@ -89,7 +89,7 @@ private: // Filter Primitives void colorTransform(const LLMatrix3 &transform); void colorCorrect(const U8* lut_red, const U8* lut_green, const U8* lut_blue); - void filterScreen(EScreenMode mode, const S32 wave_length, const F32 angle); + void filterScreen(EScreenMode mode, const F32 wave_length, const F32 angle); void blendStencil(F32 alpha, U8* pixel, U8 red, U8 green, U8 blue); void convolve(const LLMatrix3 &kernel, bool normalize, bool abs_value); -- cgit v1.2.3