diff options
author | Peter Schlaile <peter@schlaile.de> | 2006-03-07 23:01:12 +0300 |
---|---|---|
committer | Peter Schlaile <peter@schlaile.de> | 2006-03-07 23:01:12 +0300 |
commit | 327d413eb3c0c4cf07b71903eaa27e784be172c3 (patch) | |
tree | 9563098700eaa9f038dd476541ba71adf9d50e16 /source/blender/imbuf/intern/divers.c | |
parent | 9ce587e2117dcb2340d75c4bfa2b6e3c1135254c (diff) |
this patch features several cleanups and bugfixes for the sequencer:
- blur works again (this was a serious bug in gamwarp...)
- seperates all sequence effects into a seperate file with a clean interface
- thereby fixing some obscure segfaults
- seperates the scope views into a seperate file
- adds float support to all effects and scope views
- removes a bad level call to open_plugin_seq
- FFMPEG seeking improved a lot.
- FFMPEG compiles with debian sarge version cleanly
- Makes hdaudio seek and resample code really work
Diffstat (limited to 'source/blender/imbuf/intern/divers.c')
-rw-r--r-- | source/blender/imbuf/intern/divers.c | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/source/blender/imbuf/intern/divers.c b/source/blender/imbuf/intern/divers.c index 2fc80f6ddcb..c0018d0b336 100644 --- a/source/blender/imbuf/intern/divers.c +++ b/source/blender/imbuf/intern/divers.c @@ -141,25 +141,32 @@ void IMB_interlace(struct ImBuf *ibuf) void IMB_gamwarp(struct ImBuf *ibuf, double gamma) { uchar gam[256]; - int i, do_float=0; - uchar *rect = (uchar *) ibuf->rect; - float *rectf = ibuf->rect_float; + int i; + uchar *rect; + float *rectf; if (ibuf == 0) return; - if (ibuf->rect == 0) return; - if (ibuf->rect != NULL) do_float = 1; if (gamma == 1.0) return; + rect = (uchar *) ibuf->rect; + rectf = ibuf->rect_float; + gamma = 1.0 / gamma; - for (i = 255 ; i >= 0 ; i--) gam[i] = (255.0 * pow(i / 255.0 , - gamma)) + 0.5; - rect = (uchar *) ibuf->rect; - for (i = ibuf->x * ibuf->y ; i>0 ; i--, rect+=4){ - rect[0] = gam[rect[0]]; - rect[1] = gam[rect[1]]; - rect[2] = gam[rect[2]]; - if (do_float) { + if (rect) { + for (i = 255 ; i >= 0 ; i--) + gam[i] = (255.0 * pow(i / 255.0 , + gamma)) + 0.5; + + for (i = ibuf->x * ibuf->y ; i>0 ; i--, rect+=4){ + rect[0] = gam[rect[0]]; + rect[1] = gam[rect[1]]; + rect[2] = gam[rect[2]]; + } + } + + if (rectf) { + for (i = ibuf->x * ibuf->y ; i>0 ; i--, rectf+=4){ rectf[0] = pow(rectf[0] / 255.0, gamma); rectf[1] = pow(rectf[1] / 255.0, gamma); rectf[2] = pow(rectf[2] / 255.0, gamma); |