X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Finterp.h;h=9310cb3d022a4079a1772fb25c2b20419d6fe4f4;hb=3463a7b90d43d0c99130156733b5aa9207c69890;hp=ee183476925482bb6fd97237b1db5149af66ccb8;hpb=7fd85fb66168f6b518c5f2d73e04036e87faa0e1;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/interp.h b/cinelerra-5.1/cinelerra/interp.h index ee183476..9310cb3d 100644 --- a/cinelerra-5.1/cinelerra/interp.h +++ b/cinelerra-5.1/cinelerra/interp.h @@ -1,3 +1,21 @@ +/* + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published + * by the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + */ + + #ifndef __INTERP__ #define __INTERP__ @@ -64,11 +82,11 @@ static inline float interp_cubic(float dx, float p0, float p1, float p2, float p #define bi_linear_SETUP(typ, components, tx, ty) \ - float dx = (tx)-0.5, dy = (ty)-0.5; \ - int itx = dx, ity = dy, in_comps = (components); \ - if( (dx -= itx) < 0 ) dx += 1; \ - if( (dy -= ity) < 0 ) dy += 1; \ - int c0 = itx+0, c1 = itx+1, r0 = ity+0, r1 = ity+1; \ + const int in_comps = components; \ + float fx = (tx), fy = (ty); \ + int c0 = floorf(fx), r0 = floorf(fy); \ + float dx = fx-c0, dy = fy-r0; \ + int c1 = c0+1, r1 = r0+1; \ typ *r0p = r0>=in_min_y && r0=in_min_y && r1=in_min_y && rp=in_min_y && r0=in_min_y && r1