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:
-rw-r--r--release/plugins/sequence/blur.c3
-rw-r--r--source/blender/imbuf/intern/rectop.c2
-rw-r--r--source/blender/imbuf/intern/scaling.c3
-rw-r--r--source/blender/src/drawseq.c10
-rw-r--r--source/blender/src/seqeffects.c54
5 files changed, 60 insertions, 12 deletions
diff --git a/release/plugins/sequence/blur.c b/release/plugins/sequence/blur.c
index 975a0c8df93..9687d04e066 100644
--- a/release/plugins/sequence/blur.c
+++ b/release/plugins/sequence/blur.c
@@ -115,7 +115,7 @@ void blurbuf(struct ImBuf *ibuf, int nr, Cast *cast)
}
if(tbuf->x<4 || tbuf->y<4) break;
}
-
+
/* enlarge */
for(i=0; i<nr; i++) {
ttbuf = double_x(tbuf);
@@ -137,6 +137,7 @@ void blurbuf(struct ImBuf *ibuf, int nr, Cast *cast)
if(cast->gamma != 1.0) gamwarp(tbuf, 1.0 / cast->gamma);
+ /* Very bad code warning! This fails badly with float-buffers!!! */
freeN(ibuf->rect);
ibuf->rect= tbuf->rect;
freeN(tbuf);
diff --git a/source/blender/imbuf/intern/rectop.c b/source/blender/imbuf/intern/rectop.c
index c764d06b500..1b806b8fa1f 100644
--- a/source/blender/imbuf/intern/rectop.c
+++ b/source/blender/imbuf/intern/rectop.c
@@ -51,7 +51,7 @@ void IMB_rectcpy(struct ImBuf *dbuf, struct ImBuf *sbuf, int destx,
if (dbuf == NULL) return;
- if (sbuf->rect_float) do_float = 1;
+ if (sbuf && sbuf->rect_float && dbuf->rect_float) do_float = 1;
if (destx < 0){
srcx -= destx ;
diff --git a/source/blender/imbuf/intern/scaling.c b/source/blender/imbuf/intern/scaling.c
index a21e5c7b592..be391fad69d 100644
--- a/source/blender/imbuf/intern/scaling.c
+++ b/source/blender/imbuf/intern/scaling.c
@@ -849,7 +849,7 @@ static struct ImBuf *scaleupy(struct ImBuf *ibuf, int newy)
_newrectf = MEM_mallocN(newy * ibuf->x * sizeof(float) * 4, "scaleupyf");
if (_newrectf==NULL) return(ibuf);
}
-
+
add = (ibuf->y - 1.001) / (newy - 1.0);
skipx = 4 * ibuf->x;
@@ -919,7 +919,6 @@ static struct ImBuf *scaleupy(struct ImBuf *ibuf, int newy)
ibuf->mall |= IB_rectfloat;
ibuf->rect_float = _newrectf;
}
-
ibuf->y = newy;
return(ibuf);
}
diff --git a/source/blender/src/drawseq.c b/source/blender/src/drawseq.c
index 017b602c4f4..07ad3e1fd2e 100644
--- a/source/blender/src/drawseq.c
+++ b/source/blender/src/drawseq.c
@@ -114,7 +114,8 @@ static char *give_seqname(Sequence *seq)
else if(seq->type==SEQ_WIPE) return "Wipe";
else if(seq->type==SEQ_GLOW) return "Glow";
else if(seq->type==SEQ_PLUGIN) {
- if(seq->plugin && seq->plugin->doit) return seq->plugin->pname;
+ if(!(seq->flag & SEQ_EFFECT_NOT_LOADED) &&
+ seq->plugin && seq->plugin->doit) return seq->plugin->pname;
return "Plugin";
}
else return "Effect";
@@ -556,10 +557,13 @@ static void draw_seq_text(Sequence *seq, float x1, float x2, float y1, float y2)
sprintf(str, "%d | %s%s", seq->len, seq->strip->dir, seq->strip->stripdata->name);
}
else if(seq->type & SEQ_EFFECT) {
+ int can_float = (seq->type != SEQ_PLUGIN)
+ || (seq->plugin && seq->plugin->version >= 4);
+
if(seq->seq3!=seq->seq2 && seq->seq1!=seq->seq3)
- sprintf(str, "%d | %s: %d>%d (use %d)", seq->len, give_seqname(seq), seq->seq1->machine, seq->seq2->machine, seq->seq3->machine);
+ sprintf(str, "%d | %s: %d>%d (use %d)%s", seq->len, give_seqname(seq), seq->seq1->machine, seq->seq2->machine, seq->seq3->machine, can_float ? "" : " No float, upgrade plugin!");
else
- sprintf(str, "%d | %s: %d>%d", seq->len, give_seqname(seq), seq->seq1->machine, seq->seq2->machine);
+ sprintf(str, "%d | %s: %d>%d%s", seq->len, give_seqname(seq), seq->seq1->machine, seq->seq2->machine, can_float ? "" : " No float, upgrade plugin!");
}
else if (seq->type == SEQ_RAM_SOUND) {
sprintf(str, "%d | %s", seq->len, seq->strip->stripdata->name);
diff --git a/source/blender/src/seqeffects.c b/source/blender/src/seqeffects.c
index 5464a2a188a..493e43cfc33 100644
--- a/source/blender/src/seqeffects.c
+++ b/source/blender/src/seqeffects.c
@@ -104,7 +104,8 @@ static void open_plugin_seq(PluginSeq *pis, const char *seqname)
if (version != 0) {
pis->version= version();
- if (pis->version==2 || pis->version==3) {
+ if (pis->version==2 || pis->version==3
+ || pis->version==4) {
int (*info_func)(PluginInfo *);
PluginInfo *info= (PluginInfo*) MEM_mallocN(sizeof(PluginInfo), "plugin_info");;
@@ -220,7 +221,11 @@ static void do_plugin_effect(Sequence * seq,int cfra,
struct ImBuf *ibuf3, struct ImBuf *out)
{
char *cp;
-
+ int float_rendering;
+ int use_temp_bufs = 0; /* Are needed since blur.c (and maybe some other
+ old plugins) do very bad stuff
+ with imbuf-internals */
+
if(seq->plugin && seq->plugin->doit) {
if(seq->plugin->cfra)
*(seq->plugin->cfra)= frame_to_float(cfra);
@@ -235,6 +240,34 @@ static void do_plugin_effect(Sequence * seq,int cfra,
= seq->plugin->instance_private_data;
}
+ float_rendering = (out->rect_float != NULL);
+
+ if (seq->plugin->version<=3 && float_rendering) {
+ use_temp_bufs = 1;
+
+ if (ibuf1) {
+ ibuf1 = IMB_dupImBuf(ibuf1);
+ IMB_rect_from_float(ibuf1);
+ imb_freerectfloatImBuf(ibuf1);
+ ibuf1->flags &= ~IB_rectfloat;
+ }
+ if (ibuf2) {
+ ibuf2 = IMB_dupImBuf(ibuf2);
+ IMB_rect_from_float(ibuf2);
+ imb_freerectfloatImBuf(ibuf2);
+ ibuf2->flags &= ~IB_rectfloat;
+ }
+ if (ibuf3) {
+ ibuf3 = IMB_dupImBuf(ibuf3);
+ IMB_rect_from_float(ibuf3);
+ imb_freerectfloatImBuf(ibuf3);
+ ibuf3->flags &= ~IB_rectfloat;
+ }
+ if (!out->rect) imb_addrectImBuf(out);
+ imb_freerectfloatImBuf(out);
+ out->flags &= ~IB_rectfloat;
+ }
+
if (seq->plugin->version<=2) {
if(ibuf1) IMB_convert_rgba_to_abgr(ibuf1);
if(ibuf2) IMB_convert_rgba_to_abgr(ibuf2);
@@ -246,11 +279,22 @@ static void do_plugin_effect(Sequence * seq,int cfra,
ibuf1, ibuf2, out, ibuf3);
if (seq->plugin->version<=2) {
- if(ibuf1) IMB_convert_rgba_to_abgr(ibuf1);
- if(ibuf2) IMB_convert_rgba_to_abgr(ibuf2);
- if(ibuf3) IMB_convert_rgba_to_abgr(ibuf3);
+ if (!use_temp_bufs) {
+ if(ibuf1) IMB_convert_rgba_to_abgr(ibuf1);
+ if(ibuf2) IMB_convert_rgba_to_abgr(ibuf2);
+ if(ibuf3) IMB_convert_rgba_to_abgr(ibuf3);
+ }
IMB_convert_rgba_to_abgr(out);
}
+ if (seq->plugin->version<=3 && float_rendering) {
+ IMB_float_from_rect(out);
+ }
+
+ if (use_temp_bufs) {
+ if (ibuf1) IMB_freeImBuf(ibuf1);
+ if (ibuf2) IMB_freeImBuf(ibuf2);
+ if (ibuf3) IMB_freeImBuf(ibuf3);
+ }
}
}