diff options
Diffstat (limited to 'indra')
6 files changed, 292 insertions, 6 deletions
diff --git a/indra/integration_tests/llimage_libtest/filters/badtrip.xml b/indra/integration_tests/llimage_libtest/filters/badtrip.xml new file mode 100755 index 0000000000..14ee0baff3 --- /dev/null +++ b/indra/integration_tests/llimage_libtest/filters/badtrip.xml @@ -0,0 +1,36 @@ +<llsd> + <array> + <array> + <string>grayscale</string> + </array> + <array> + <string>linearize</string> + <real>0.1</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> + <string>gradient</string> + </array> + <array> + <string>colorize</string> + <real>0.0</real> + <real>0.0</real> + <real>1.0</real> + <real>0.0</real> + <real>0.0</real> + <real>0.15</real> + </array> + <array> + <string>blur</string> + </array> + </array> +</llsd> diff --git a/indra/integration_tests/llimage_libtest/filters/blowhighlights.xml b/indra/integration_tests/llimage_libtest/filters/blowhighlights.xml new file mode 100644 index 0000000000..2474a1b953 --- /dev/null +++ b/indra/integration_tests/llimage_libtest/filters/blowhighlights.xml @@ -0,0 +1,25 @@ +<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>stencil</string> + <string>uniform</string> + <string>add</string> + <real>0.0</real> + <real>1.0</real> + </array> + <array> + <string>gamma</string> + <real>0.25</real> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + </array> + </array> +</llsd> diff --git a/indra/integration_tests/llimage_libtest/filters/dodgeandburn.xml b/indra/integration_tests/llimage_libtest/filters/dodgeandburn.xml new file mode 100644 index 0000000000..0e2e0ad68c --- /dev/null +++ b/indra/integration_tests/llimage_libtest/filters/dodgeandburn.xml @@ -0,0 +1,47 @@ +<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>stencil</string> + <string>vignette</string> + <string>add</string> + <real>0.0</real> + <real>0.4</real> + <real>0.0</real> + <real>0.0</real> + <real>1.0</real> + <real>2.0</real> + </array> + <array> + <string>contrast</string> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + </array> + <array> + <string>stencil</string> + <string>vignette</string> + <string>add</string> + <real>-0.8</real> + <real>0.0</real> + <real>0.0</real> + <real>0.0</real> + <real>1.0</real> + <real>2.0</real> + </array> + <array> + <string>contrast</string> + <real>1.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/filters/focus.xml b/indra/integration_tests/llimage_libtest/filters/focus.xml new file mode 100644 index 0000000000..d8525fea62 --- /dev/null +++ b/indra/integration_tests/llimage_libtest/filters/focus.xml @@ -0,0 +1,39 @@ +<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>stencil</string> + <string>vignette</string> + <string>blend</string> + <real>0.0</real> + <real>0.4</real> + <real>0.0</real> + <real>0.0</real> + <real>0.5</real> + <real>2.0</real> + </array> + <array> + <string>sharpen</string> + </array> + <array> + <string>stencil</string> + <string>vignette</string> + <string>blend</string> + <real>1.0</real> + <real>0.0</real> + <real>0.0</real> + <real>0.0</real> + <real>0.5</real> + <real>2.0</real> + </array> + <array> + <string>blur</string> + </array> + </array> +</llsd> diff --git a/indra/integration_tests/llimage_libtest/filters/lensflare.xml b/indra/integration_tests/llimage_libtest/filters/lensflare.xml new file mode 100644 index 0000000000..ec8afc8daa --- /dev/null +++ b/indra/integration_tests/llimage_libtest/filters/lensflare.xml @@ -0,0 +1,138 @@ +<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>brighten</string> + <real>0.1</real> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + </array> + <array> + <string>stencil</string> + <string>vignette</string> + <string>add</string> + <real>0.0</real> + <real>0.4</real> + <real>-0.5</real> + <real>0.5</real> + <real>0.15</real> + <real>20.0</real> + </array> + <array> + <string>colorize</string> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + <real>0.15</real> + <real>0.15</real> + <real>0.15</real> + </array> + <array> + <string>stencil</string> + <string>vignette</string> + <string>add</string> + <real>0.0</real> + <real>0.4</real> + <real>-0.5</real> + <real>0.5</real> + <real>0.20</real> + <real>20.0</real> + </array> + <array> + <string>colorize</string> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + <real>0.6</real> + <real>0.0</real> + <real>0.0</real> + </array> + <array> + <string>stencil</string> + <string>vignette</string> + <string>add</string> + <real>0.0</real> + <real>0.5</real> + <real>-0.7</real> + <real>0.7</real> + <real>0.10</real> + <real>20.0</real> + </array> + <array> + <string>colorize</string> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + <real>0.6</real> + <real>0.6</real> + <real>0.0</real> + </array> + <array> + <string>stencil</string> + <string>vignette</string> + <string>add</string> + <real>0.0</real> + <real>0.5</real> + <real>0.5</real> + <real>-0.5</real> + <real>0.10</real> + <real>20.0</real> + </array> + <array> + <string>colorize</string> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + <real>0.7</real> + <real>0.0</real> + <real>0.0</real> + </array> + <array> + <string>stencil</string> + <string>vignette</string> + <string>add</string> + <real>0.0</real> + <real>0.5</real> + <real>0.6</real> + <real>-0.6</real> + <real>0.05</real> + <real>20.0</real> + </array> + <array> + <string>colorize</string> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + <real>0.7</real> + <real>0.0</real> + <real>0.0</real> + </array> + <array> + <string>stencil</string> + <string>vignette</string> + <string>add</string> + <real>0.0</real> + <real>0.5</real> + <real>0.4</real> + <real>-0.4</real> + <real>0.025</real> + <real>20.0</real> + </array> + <array> + <string>colorize</string> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + <real>0.7</real> + <real>0.0</real> + <real>0.0</real> + </array> + </array> +</llsd> diff --git a/indra/llimage/llimagefilter.cpp b/indra/llimage/llimagefilter.cpp index 8f7e340d16..a5b5888bb2 100755 --- a/indra/llimage/llimagefilter.cpp +++ b/indra/llimage/llimagefilter.cpp @@ -76,9 +76,7 @@ LLImageFilter::~LLImageFilter() /* *TODO * Rename stencil to mask - * Test blend modes and name them correctly * 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) * Add gradient coloring as a filter */ @@ -510,15 +508,18 @@ void LLImageFilter::filterScreen(EScreenMode mode, const F32 wave_length, const { // Compute screen value F32 value = 0.0; - F32 d = 0.0; + F32 di = 0.0; + F32 dj = 0.0; switch (mode) { case SCREEN_MODE_2DSINE: - value = (sinf(2*F_PI*i/wave_length_pixels)*sinf(2*F_PI*j/wave_length_pixels)+1.0)*255.0/2.0; + di = cos*i + sin*j; + dj = -sin*i + cos*j; + value = (sinf(2*F_PI*di/wave_length_pixels)*sinf(2*F_PI*dj/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_pixels)+1.0)*255.0/2.0; + dj = sin*i - cos*j; + value = (sinf(2*F_PI*dj/wave_length_pixels)+1.0)*255.0/2.0; break; } U8 dst_value = (dst_data[VRED] >= (U8)(value) ? 255 : 0); |