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:
authorCampbell Barton <ideasman42@gmail.com>2008-11-20 03:34:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2008-11-20 03:34:24 +0300
commit935ed8a53b8cc45ec1a13f2cab39e32e6a101acd (patch)
tree4f0f19572ecc3a126aab49799dba9e982d4d545b /source
parentf8e56e96bf2be4580dd34c33c6379339642638f0 (diff)
commit yesterday broke scaling in the sequencer (dumb mistake)
also changed 3 if's into a switch statement for selecting the interpolation.
Diffstat (limited to 'source')
-rw-r--r--source/blender/imbuf/intern/imageprocess.c14
-rw-r--r--source/blender/src/seqeffects.c15
2 files changed, 17 insertions, 12 deletions
diff --git a/source/blender/imbuf/intern/imageprocess.c b/source/blender/imbuf/intern/imageprocess.c
index f25872538cf..fe7e26eac2b 100644
--- a/source/blender/imbuf/intern/imageprocess.c
+++ b/source/blender/imbuf/intern/imageprocess.c
@@ -80,16 +80,16 @@ void IMB_convert_rgba_to_abgr(struct ImBuf *ibuf)
}
}
}
-static void pixel_from_buffer(struct ImBuf *ibuf, unsigned char *outI, float *outF, int x, int y)
+static void pixel_from_buffer(struct ImBuf *ibuf, unsigned char **outI, float **outF, int x, int y)
{
int offset = ibuf->x * y * 4 + 4*x;
if (ibuf->rect)
- outI= (unsigned char *)ibuf->rect + offset;
+ *outI= (unsigned char *)ibuf->rect + offset;
if (ibuf->rect_float)
- outF= (float *)ibuf->rect_float + offset;
+ *outF= (float *)ibuf->rect_float + offset;
}
/**************************************************************************
@@ -226,7 +226,7 @@ void bicubic_interpolation(ImBuf *in, ImBuf *out, float u, float v, int xout, in
if (in == NULL || (in->rect == NULL && in->rect_float == NULL)) return;
- pixel_from_buffer(out, outI, outF, xout, yout); /* gcc warns these could be uninitialized, but its ok */
+ pixel_from_buffer(out, &outI, &outF, xout, yout); /* gcc warns these could be uninitialized, but its ok */
bicubic_interpolation_color(in, outI, outF, u, v);
}
@@ -309,7 +309,7 @@ void bilinear_interpolation(ImBuf *in, ImBuf *out, float u, float v, int xout, i
if (in == NULL || (in->rect == NULL && in->rect_float == NULL)) return;
- pixel_from_buffer(out, outI, outF, xout, yout); /* gcc warns these could be uninitialized, but its ok */
+ pixel_from_buffer(out, &outI, &outF, xout, yout); /* gcc warns these could be uninitialized, but its ok */
bilinear_interpolation_color(in, outI, outF, u, v);
}
@@ -370,7 +370,7 @@ void neareast_interpolation(ImBuf *in, ImBuf *out, float x, float y, int xout, i
if (in == NULL || (in->rect == NULL && in->rect_float == NULL)) return;
- pixel_from_buffer(out, outI, outF, xout, yout); /* gcc warns these could be uninitialized, but its ok */
+ pixel_from_buffer(out, &outI, &outF, xout, yout); /* gcc warns these could be uninitialized, but its ok */
neareast_interpolation_color(in, outI, outF, x, y);
-} \ No newline at end of file
+}
diff --git a/source/blender/src/seqeffects.c b/source/blender/src/seqeffects.c
index 05aff70dedf..58554fbfeba 100644
--- a/source/blender/src/seqeffects.c
+++ b/source/blender/src/seqeffects.c
@@ -2007,8 +2007,8 @@ static void do_transform(Sequence * seq,float facf0, int x, int y,
tx = scale->xIni+(xo / 2.0f) + (scale->xFin-(xo / 2.0f) - scale->xIni+(xo / 2.0f)) * facf0;
ty = scale->yIni+(yo / 2.0f) + (scale->yFin-(yo / 2.0f) - scale->yIni+(yo / 2.0f)) * facf0;
}else{
- tx = xo*(scale->xIni/100.0)+(xo / 2.0f) + (xo*(scale->xFin/100.0)-(xo / 2.0f) - xo*(scale->xIni/100.0)+(xo / 2.0f)) * facf0;
- ty = yo*(scale->yIni/100.0)+(yo / 2.0f) + (yo*(scale->yFin/100.0)-(yo / 2.0f) - yo*(scale->yIni/100.0)+(yo / 2.0f)) * facf0;
+ tx = xo*(scale->xIni/100.0f)+(xo / 2.0f) + (xo*(scale->xFin/100.0f)-(xo / 2.0f) - xo*(scale->xIni/100.0f)+(xo / 2.0f)) * facf0;
+ ty = yo*(scale->yIni/100.0f)+(yo / 2.0f) + (yo*(scale->yFin/100.0f)-(yo / 2.0f) - yo*(scale->yIni/100.0f)+(yo / 2.0f)) * facf0;
}
//factor Rotate
@@ -2036,12 +2036,17 @@ static void do_transform(Sequence * seq,float facf0, int x, int y,
ys += (yo / 2.0f);
//interpolate
- if(scale->interpolation==0)
+ switch(scale->interpolation) {
+ case 0:
neareast_interpolation(ibuf1,out, xs,ys,xi,yi);
- if(scale->interpolation==1)
+ break;
+ case 1:
bilinear_interpolation(ibuf1,out, xs,ys,xi,yi);
- if(scale->interpolation==2)
+ break;
+ case 2:
bicubic_interpolation(ibuf1,out, xs,ys,xi,yi);
+ break;
+ }
}
}