diff options
author | Ton Roosendaal <ton@blender.org> | 2006-01-11 21:39:19 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2006-01-11 21:39:19 +0300 |
commit | b92fa4151645d50e40faa8f4aaea4b7f6149947c (patch) | |
tree | 31f1ebdeddf646042713fff9490e0e53c75ab67e /source/blender/imbuf/intern/filter.c | |
parent | ebe728d8b5ad6399f790406e41717ea4ea5842e9 (diff) |
Orange: more float buffer support;
- Image textures use float colors now, when present. Works for mipmap too,
and for AO skycolor (probes)
- Backbuffer option uses float buffers too. Note that rendering OSA will
resample the backbuffer, filtering it... will need to be solved with the
new composit stage
- LMB sampling in image window now shows float color too
+ bugfix in imbuf, filtering for float buffers had an error.
Diffstat (limited to 'source/blender/imbuf/intern/filter.c')
-rw-r--r-- | source/blender/imbuf/intern/filter.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/source/blender/imbuf/intern/filter.c b/source/blender/imbuf/intern/filter.c index 9e62a9edfb5..810e012761b 100644 --- a/source/blender/imbuf/intern/filter.c +++ b/source/blender/imbuf/intern/filter.c @@ -67,20 +67,19 @@ static void filtrow(unsigned char *point, int x) static void filtrowf(float *point, int x) { - float c1,c2,c3,error; + float c1,c2,c3; if (x>1){ c1 = c2 = *point; - error = 2; for(x--;x>0;x--){ c3 = point[4]; - c1 += (c2 * 2) + c3 + error; - *point = c1 / 4.0; + c1 += (c2 * 2) + c3; + *point = 0.25f*c1; point += 4; c1=c2; c2=c3; } - *point = (c1 + (c2 * 2) + c2 + error) / 4.0; + *point = 0.25f*(c1 + (c2 * 2) + c2); } } @@ -111,22 +110,21 @@ static void filtcolum(unsigned char *point, int y, int skip) static void filtcolumf(float *point, int y, int skip) { - float c1,c2,c3,error, *point2; + float c1,c2,c3, *point2; if (y>1){ c1 = c2 = *point; point2 = point; - error = 2; for(y--;y>0;y--){ point2 += skip; c3 = *point2; - c1 += (c2 * 2) + c3 +error; - *point = c1 / 4; + c1 += (c2 * 2) + c3; + *point = 0.25f*c1; point=point2; c1=c2; c2=c3; } - *point = (c1 + (c2 * 2) + c2 + error) / 4; + *point = 0.25f*(c1 + (c2 * 2) + c2); } } |