/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/fft.c,v 9.28 1989/12/20 18:03:39 pas Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/fft.c,v 9.29 1990/01/02 18:35:22 pas Rel $
Copyright (c) 1987, 1988, 1989 Massachusetts Institute of Technology
PRIMITIVE_HEADER (6);
phi = (arg_real_number (1)); /* starting point [0,1]*/
- phi = (arg_real_number (2)); /* resolution [0,1] */
+ rho = (arg_real_number (2)); /* resolution [0,1] */
CHECK_ARG (3, ARRAY_P); /* input real */
CHECK_ARG (4, ARRAY_P); /* input imag */
CHECK_ARG (5, ARRAY_P); /* output real */
CHECK_ARG (6, ARRAY_P); /* output imag */
+
a = ARRAY_CONTENTS(ARG_REF(3));
b = ARRAY_CONTENTS(ARG_REF(4));
c = ARRAY_CONTENTS(ARG_REF(5));
d = ARRAY_CONTENTS(ARG_REF(6));
-
+
N = ARRAY_LENGTH(ARG_REF(3)); /* N = input length */
M = ARRAY_LENGTH(ARG_REF(5)); /* M = output length */
if (N!=(ARRAY_LENGTH(ARG_REF(4)))) error_bad_range_arg(3);
/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/image.c,v 9.29 1989/09/20 23:09:13 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/image.c,v 9.30 1990/01/02 18:35:32 pas Exp $
Copyright (c) 1987, 1988, 1989 Massachusetts Institute of Technology
\f
/* Rotations and stuff */
-DEFINE_PRIMITIVE ("IMAGE-TRANSPOSE!", Prim_image_transpose, 1, 1, 0)
-{
- long nrows;
- long ncols;
- REAL * Array;
- PRIMITIVE_HEADER (1);
- {
- SCHEME_OBJECT Parray;
- arg_image (1, (&nrows), (&ncols), (&Parray));
- Array = (ARRAY_CONTENTS (Parray));
- }
- if (nrows == ncols)
- {
- Image_Fast_Transpose (Array, nrows); /* side-effecting ... */
- }
+DEFINE_PRIMITIVE ("IMAGE-TRANSPOSE!", Prim_image_transpose, 4,4, 0)
+{ long rows, cols;
+ REAL *x, *y;
+ PRIMITIVE_HEADER (4);
+ CHECK_ARG (1, FIXNUM_P); /* rows */
+ CHECK_ARG (2, FIXNUM_P); /* cols */
+ CHECK_ARG (3, ARRAY_P); /* image array 1 */
+ CHECK_ARG (4, ARRAY_P); /* image array 2, empty for rows=cols */
+
+ rows = arg_nonnegative_integer(1);
+ cols = arg_nonnegative_integer(2);
+ x = (ARRAY_CONTENTS (ARG_REF(3)));
+ y = (ARRAY_CONTENTS (ARG_REF(4)));
+
+ if (rows==cols) /* square image ==> ignore argument 4 */
+ Image_Fast_Transpose (x, rows);
else
- {
- REAL *New_Array;
- long Length = (nrows * ncols);
- /* making space in scheme heap */
- Primitive_GC_If_Needed (Length * REAL_SIZE);
- New_Array = ((REAL *) Free);
- Image_Transpose (Array, New_Array, nrows, ncols);
- C_Array_Copy (New_Array, Array, Length);
- }
- {
- SCHEME_OBJECT argument = (ARG_REF (1));
- SET_PAIR_CAR (argument, (LONG_TO_UNSIGNED_FIXNUM (ncols)));
- SET_PAIR_CAR ((PAIR_CDR (argument)), (LONG_TO_UNSIGNED_FIXNUM (nrows)));
- PRIMITIVE_RETURN (argument);
- }
+ Image_Transpose (x, y, rows, cols);
+
+ PRIMITIVE_RETURN (UNSPECIFIC);
}
DEFINE_PRIMITIVE ("IMAGE-ROTATE-90CLW!", Prim_image_rotate_90clw, 1, 1, 0)