diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-02-23 18:30:37 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-02-23 18:30:37 +0300 |
commit | 1940cf5a0b24d5d4e4b21b495fd84433d68483da (patch) | |
tree | 46a11fa887b54bd57c515847cdaec6356d2fac64 /source/blender/imbuf/intern/scaling.c | |
parent | 041f706506da3962e6c03fcf2a4227afd678dca0 (diff) |
After discussion on irc change new function to only allocate from a
buffer only. scaling can be done separately
Diffstat (limited to 'source/blender/imbuf/intern/scaling.c')
-rw-r--r-- | source/blender/imbuf/intern/scaling.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/source/blender/imbuf/intern/scaling.c b/source/blender/imbuf/intern/scaling.c index f2731e5decf..f7504210573 100644 --- a/source/blender/imbuf/intern/scaling.c +++ b/source/blender/imbuf/intern/scaling.c @@ -1545,29 +1545,24 @@ struct ImBuf *IMB_scaleImBuf(struct ImBuf *ibuf, unsigned int newx, unsigned int return(ibuf); } -struct ImBuf *IMB_scaleArray(const unsigned int *rect, const float *frect, - unsigned int oldw, unsigned int oldh, - unsigned int neww, unsigned int newh) +struct ImBuf *IMB_allocFromBuffer(const unsigned int *rect, const float *frect, + unsigned int w, unsigned int h) { ImBuf *ibuf = NULL; - ImBuf *tmpibuf = IMB_allocImBuf(oldw, oldh, 32, 0); + 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(oldw, oldh, 32, IB_rectfloat); + ibuf = IMB_allocImBuf(w, h, 32, IB_rectfloat); tmpibuf->rect_float = (float *)frect; - IMB_rectcpy(ibuf, tmpibuf, 0, 0, 0, 0, oldw, oldh); - - IMB_scaleImBuf(ibuf, neww, newh); + IMB_rectcpy(ibuf, tmpibuf, 0, 0, 0, 0, w, h); } else if (rect) { - ibuf = IMB_allocImBuf(oldw, oldh, 32, IB_rect); + ibuf = IMB_allocImBuf(w, h, 32, IB_rect); tmpibuf->rect = (unsigned int *)rect; - IMB_rectcpy(ibuf, tmpibuf, 0, 0, 0, 0, oldw, oldh); - - IMB_scaleImBuf(ibuf, neww, newh); + IMB_rectcpy(ibuf, tmpibuf, 0, 0, 0, 0, w, h); } /* important, else we clean the source image imbufs! */ |