diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-02-23 19:19:06 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-02-23 19:19:31 +0300 |
commit | 67fcf5256d81ce7e80ab1f4c75fb81b43e634301 (patch) | |
tree | afa1976d12e6b36d98d46e11fa94ad0516b0578e /source/blender/imbuf/intern/scaling.c | |
parent | 97422ea64ff0d0f017c51394a9239fc43041e2f6 (diff) |
Move allocation of imbuf from array to allocimbuf.
Skip allocation of temporary imbuf
Diffstat (limited to 'source/blender/imbuf/intern/scaling.c')
-rw-r--r-- | source/blender/imbuf/intern/scaling.c | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/source/blender/imbuf/intern/scaling.c b/source/blender/imbuf/intern/scaling.c index f7504210573..2601fe62c2f 100644 --- a/source/blender/imbuf/intern/scaling.c +++ b/source/blender/imbuf/intern/scaling.c @@ -1545,34 +1545,6 @@ struct ImBuf *IMB_scaleImBuf(struct ImBuf *ibuf, unsigned int newx, unsigned int return(ibuf); } -struct ImBuf *IMB_allocFromBuffer(const unsigned int *rect, const float *frect, - unsigned int w, unsigned int h) -{ - ImBuf *ibuf = NULL; - ImBuf *tmpibuf = IMB_allocImBuf(w, h, 32, 0); - - if (frect) { - /* allocate new image buffer and set the temporary buffer float buffer correctly */ - ibuf = IMB_allocImBuf(w, h, 32, IB_rectfloat); - tmpibuf->rect_float = (float *)frect; - - IMB_rectcpy(ibuf, tmpibuf, 0, 0, 0, 0, w, h); - } - else if (rect) { - ibuf = IMB_allocImBuf(w, h, 32, IB_rect); - tmpibuf->rect = (unsigned int *)rect; - - IMB_rectcpy(ibuf, tmpibuf, 0, 0, 0, 0, w, h); - } - - /* important, else we clean the source image imbufs! */ - tmpibuf->rect_float = NULL; - tmpibuf->rect = NULL; - IMB_freeImBuf(tmpibuf); - - return ibuf; -} - struct imbufRGBA { float r, g, b, a; }; |