summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2014-02-06 16:25:12 -0800
committerMerov Linden <merov@lindenlab.com>2014-02-06 16:25:12 -0800
commit8ad37cec70be671809f317bbc558eed1b59be595 (patch)
tree9a9e71686893f11ad10b354bdbfce6da20cdeb12 /indra
parentb6fbc02f85efd32d55f26dd97c74da69a1a8c1d2 (diff)
ACME-1278 : Allow angle to be used in 2D screen filter
Diffstat (limited to 'indra')
-rwxr-xr-xindra/llimage/llimagefilter.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/indra/llimage/llimagefilter.cpp b/indra/llimage/llimagefilter.cpp
index 8f7e340d16..8bd7416f6a 100755
--- a/indra/llimage/llimagefilter.cpp
+++ b/indra/llimage/llimagefilter.cpp
@@ -510,15 +510,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);