ri2c was broken

Oops, im_ri2c() was totally broken :-(
This commit is contained in:
John Cupitt 2011-02-28 12:16:43 +00:00
parent 3e112602f2
commit 05ab548636
2 changed files with 11 additions and 8 deletions

View File

@ -33,6 +33,7 @@
- removed man pages, we are all gtk-doc now - removed man pages, we are all gtk-doc now
- im_jpeg2vips() ignores weird APP1 chunks - im_jpeg2vips() ignores weird APP1 chunks
- im_add() for int/uint was broken - im_add() for int/uint was broken
- im_ri2c() was broken
30/11/10 started 7.24.0 30/11/10 started 7.24.0
- bump for new stable - bump for new stable

View File

@ -11,6 +11,8 @@
* - better upcasting * - better upcasting
* - gtkdoc * - gtkdoc
* - cleanups * - cleanups
* 28/2/11
* - oop heh argh was broken, added to test suite
*/ */
/* /*
@ -60,8 +62,8 @@
TYPE *q0 = (TYPE *) q; \ TYPE *q0 = (TYPE *) q; \
\ \
for( x = 0; x < len; x++ ) { \ for( x = 0; x < len; x++ ) { \
q0[0] = *p1++; \ q0[0] = p1[x]; \
q0[1] = *p2++; \ q0[1] = p2[x]; \
\ \
q0 += 2; \ q0 += 2; \
} \ } \
@ -70,17 +72,17 @@
/* Join two buffers to make a complex. /* Join two buffers to make a complex.
*/ */
static void static void
join_buffer( PEL **p, PEL *q, int n, IMAGE *im ) join_buffer( PEL **p, PEL *q, int n, IMAGE *out )
{ {
int x; int x;
int len = n * im->Bands; int len = n * out->Bands;
switch( im->BandFmt ) { switch( out->BandFmt ) {
case IM_BANDFMT_FLOAT: case IM_BANDFMT_COMPLEX:
JOIN( float ); JOIN( float );
break; break;
case IM_BANDFMT_DOUBLE: case IM_BANDFMT_DPCOMPLEX:
JOIN( double ); JOIN( double );
break; break;
@ -146,7 +148,7 @@ im_ri2c( IMAGE *in1, IMAGE *in2, IMAGE *out )
if( im_cp_descv( out, t[2], t[3], NULL ) ) if( im_cp_descv( out, t[2], t[3], NULL ) )
return( -1 ); return( -1 );
out->BandFmt = fmt == IM_BANDFMT_DOUBLE ? out->BandFmt = (fmt == IM_BANDFMT_DOUBLE) ?
IM_BANDFMT_DPCOMPLEX : IM_BANDFMT_COMPLEX; IM_BANDFMT_DPCOMPLEX : IM_BANDFMT_COMPLEX;
if( im_wrapmany( t + 2, out, (im_wrapmany_fn) join_buffer, out, NULL ) ) if( im_wrapmany( t + 2, out, (im_wrapmany_fn) join_buffer, out, NULL ) )