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:
authorTon Roosendaal <ton@blender.org>2006-12-20 20:57:56 +0300
committerTon Roosendaal <ton@blender.org>2006-12-20 20:57:56 +0300
commit253432bfc7c2a1dae224a03fb3055de19743ec67 (patch)
tree2cea30606f9f29be51d5366ddf0d3747b9649b90 /source/blender/imbuf/intern/filter.c
parent0a0753b409221b66f5003d8c257426043ada227e (diff)
The Big Image refactor!
Please read: http://www.blender3d.org/cms/Imaging.834.0.html Or in short: - adding MultiLayer Image support - recoded entire Image API - better integration of movie/sequence Images Was a whole load of work... went down for a week to do this. So, will need a lot of testing! Will be in irc all evening.
Diffstat (limited to 'source/blender/imbuf/intern/filter.c')
-rw-r--r--source/blender/imbuf/intern/filter.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/source/blender/imbuf/intern/filter.c b/source/blender/imbuf/intern/filter.c
index 343211eb6b0..fd9dac1af2b 100644
--- a/source/blender/imbuf/intern/filter.c
+++ b/source/blender/imbuf/intern/filter.c
@@ -302,3 +302,28 @@ void IMB_filter_extend(struct ImBuf *ibuf)
}
}
+void IMB_makemipmap(ImBuf *ibuf, int use_filter)
+{
+ ImBuf *hbuf= ibuf;
+ int minsize, curmap=0;
+
+ minsize= ibuf->x<ibuf->y?ibuf->x:ibuf->y;
+
+ while(minsize>10 && curmap<IB_MIPMAP_LEVELS) {
+ if(use_filter) {
+ ImBuf *nbuf= IMB_allocImBuf(hbuf->x, hbuf->y, 32, IB_rect, 0);
+ IMB_filterN(nbuf, hbuf);
+ ibuf->mipmap[curmap]= IMB_onehalf(nbuf);
+ IMB_freeImBuf(nbuf);
+ }
+ else {
+ ibuf->mipmap[curmap]= IMB_onehalf(hbuf);
+ }
+ hbuf= ibuf->mipmap[curmap];
+
+ curmap++;
+ minsize= hbuf->x<hbuf->y?hbuf->x:hbuf->y;
+ }
+}
+
+