From 7c546271bb99a6b0faaaf15480c2be2d79d9f3f2 Mon Sep 17 00:00:00 2001 From: Panayotis Skordos Date: Tue, 2 Jan 1990 18:35:32 +0000 Subject: [PATCH] *** empty log message *** --- v7/src/microcode/fft.c | 7 +++--- v7/src/microcode/image.c | 51 ++++++++++++++++------------------------ 2 files changed, 24 insertions(+), 34 deletions(-) diff --git a/v7/src/microcode/fft.c b/v7/src/microcode/fft.c index c019ddbd9..2a011ea94 100644 --- a/v7/src/microcode/fft.c +++ b/v7/src/microcode/fft.c @@ -1,6 +1,6 @@ /* -*-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 @@ -1619,16 +1619,17 @@ DEFINE_PRIMITIVE ("ARRAY-CZT!", Prim_array_czt, 6,6, 0) 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); diff --git a/v7/src/microcode/image.c b/v7/src/microcode/image.c index ee099fb12..532bf6dc2 100644 --- a/v7/src/microcode/image.c +++ b/v7/src/microcode/image.c @@ -1,6 +1,6 @@ /* -*-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 @@ -590,37 +590,26 @@ C_Image_Periodic_Shift(Array, New_Array, nrows, ncols, ver_shift, hor_shift) /* 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) -- 2.25.1