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
path: root/source
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2006-07-05 21:32:49 +0400
committerTon Roosendaal <ton@blender.org>2006-07-05 21:32:49 +0400
commitbe3c3a24b57c1f1d6c8c6fb0eb50047d10df2e1a (patch)
tree814c6d06c38ec40d43cf60f210907f965573c84d /source
parent28f08bd1226e7279cd83bf791940ee49e806577b (diff)
Bugfix #4620
Hurmf, then you bring back old backbuffer, and they want to have fields work on that! OK... here it is. Although using Compositor features will make this much easier and advanced to control. :)
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_image.h3
-rw-r--r--source/blender/blenkernel/intern/image.c8
-rw-r--r--source/blender/render/intern/source/imagetexture.c5
-rw-r--r--source/blender/render/intern/source/pipeline.c10
4 files changed, 23 insertions, 3 deletions
diff --git a/source/blender/blenkernel/BKE_image.h b/source/blender/blenkernel/BKE_image.h
index a18489746bf..8ba0fd73cc4 100644
--- a/source/blender/blenkernel/BKE_image.h
+++ b/source/blender/blenkernel/BKE_image.h
@@ -59,7 +59,8 @@ struct anim *openanim(char * name, int flags);
void ima_ibuf_is_nul(struct Tex *tex, struct Image *ima);
void load_image(struct Image * ima, int flags, char *relabase, int framenum);
void converttopremul(struct ImBuf *ibuf);
-
+void image_de_interlace(struct Image *ima, int odd);
+
void tag_image_time(struct Image *ima);
void free_old_images(void);
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 976b525d841..ddf0daa5f73 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -620,6 +620,14 @@ static void de_interlace_st(struct ImBuf *ibuf) /* standard fields */
ibuf->y /= 2;
}
+void image_de_interlace(Image *ima, int odd)
+{
+ if(odd)
+ de_interlace_st(ima->ibuf);
+ else
+ de_interlace_ng(ima->ibuf);
+}
+
/* important note: all calls here and calls inside can NOT use threadsafe malloc! */
/* this entire function is mutex'ed with the same lock as for mallocs */
void ima_ibuf_is_nul(Tex *tex, Image *ima)
diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c
index 39a5cedea98..b819181606b 100644
--- a/source/blender/render/intern/source/imagetexture.c
+++ b/source/blender/render/intern/source/imagetexture.c
@@ -597,12 +597,17 @@ void image_sample(Image *ima, float fx, float fy, float dx, float dy, float *res
return;
}
+ if( (R.flag & R_SEC_FIELD) && (ima->ibuf->flags & IB_fields) )
+ ima->ibuf->rect+= (ima->ibuf->x*ima->ibuf->y);
+
boxsample(ima->ibuf, fx, fy, fx+dx, fy+dy, &texres, 0, 0);
result[0]= texres.tr;
result[1]= texres.tg;
result[2]= texres.tb;
result[3]= texres.ta;
+ if( (R.flag & R_SEC_FIELD) && (ima->ibuf->flags & IB_fields) )
+ ima->ibuf->rect-= (ima->ibuf->x*ima->ibuf->y);
}
int imagewraposa(Tex *tex, Image *ima, float *texvec, float *dxt, float *dyt, TexResult *texres)
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c
index fed2aa71b75..3c66ec02cdd 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -1463,8 +1463,14 @@ static void load_backbuffer(Render *re)
if(re->backbuf && re->backbuf->ibuf==NULL) {
re->backbuf->ibuf= IMB_loadiffname(re->backbuf->name, IB_rect);
- if(re->backbuf->ibuf==NULL) re->backbuf->ok= 0;
- else re->backbuf->ok= 1;
+ if(re->backbuf->ibuf==NULL)
+ re->backbuf->ok= 0;
+ else {
+ re->backbuf->ok= 1;
+
+ if (re->r.mode & R_FIELDS)
+ image_de_interlace(re->backbuf, re->r.mode & R_ODDFIELD);
+ }
}
if(re->backbuf==NULL || re->backbuf->ok==0) {
// error() doesnt work with render window open