Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2015-02-23 18:30:37 +0300
committerAntony Riakiotakis <kalast@gmail.com>2015-02-23 18:30:37 +0300
commit1940cf5a0b24d5d4e4b21b495fd84433d68483da (patch)
tree46a11fa887b54bd57c515847cdaec6356d2fac64 /source/blender/imbuf
parent041f706506da3962e6c03fcf2a4227afd678dca0 (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')
-rw-r--r--source/blender/imbuf/IMB_imbuf.h7
-rw-r--r--source/blender/imbuf/intern/scaling.c19
2 files changed, 10 insertions, 16 deletions
diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h
index 27cb9347aa9..299918a47a5 100644
--- a/source/blender/imbuf/IMB_imbuf.h
+++ b/source/blender/imbuf/IMB_imbuf.h
@@ -353,12 +353,11 @@ struct ImBuf *IMB_onehalf(struct ImBuf *ibuf1);
struct ImBuf *IMB_scaleImBuf(struct ImBuf *ibuf, unsigned int newx, unsigned int newy);
/**
- * Scales an array of pixels and returns the result to a new ImBuf
+ * Create a copy of a pixel buffer and wrap it to a new ImBuf
* \attention Defined in scaling.c
*/
-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);
/**
*
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! */