ldshift(3)

LIBRARY ROUTINE
ldshift - Shifts or rotates 1-D signal(s)

LIBRARY CALL
#include "vinclude.h"
int
ldshift(image, s_img, s_img_flg, s_const, wrap, r_pad, i_pad, process_dir)
struct xvimage  *image,                 /* input/output image */
                *s_img;                 /* shift value image */
int             s_img_flg,              /* set if shift file specified */
                s_const,                /* constant shift value */
                wrap,                   /* wrap flag (wrap is w=TRUE) */
                process_dir;            /* 0=vect proc, 1= band proc */
float           r_pad,                  /* real constant padding value */
                i_pad;                  /* imaginary constant padding value */

INPUT

*image
    (struct xvimage) - pointer to the input/output xvimage structure

*s_img
    (struct xvimage) - pointer to the shift value input image

s_img_flg
    (int) - flag set to 1 if shift value image was specified.

s_const
    (int) - constant shift value

wrap
    (int) - flag set to 1 if wrap (rotate)

r_pad
    (float) - real padding value if wrap != TRUE

i_pad
    (float) - imaginary pad value if wrap != TRUE

process_dir
    (int) - data processing direction. 0 = vector, 1 = band.

OUTPUT

*image
    (struct xvimage) - pointer to the input/output xvimage structure

MODIFICATIONS
Thu Jun 7 22:31:11 MDT 1990 Donna Koechner - updated to ghostwriter
Audit Done 05-OCT-90 Donna Koechner

DESCRIPTION
ldshift shifts or rotates the 1-dimensional signals in the input data file (image) by the specified value(s). If the wrap flag passed in is TRUE, the signal(s) will be rotated. If wrap is FALSE, the signal(s) will be truncated and padded on each end, depending on the direction of shifting. Shifting values can be positive or negative. Positive shift values will cause rotation or shifting to occur from left to right. Negative shift values will cause rotation or shifting to occur from right to left.

Ldshift will shift the 1-dimensional signals in the input data file by the value specified by the s_const parameter, or by the shifting values given in the shift value input file (s_img). The shift value file, s_img, is used only if the s_img_flg is TRUE. If a shift value file is specified, it must contains the same number of points as there are vectors in the input file. There is a one to one correspondence between shift values and vectors, and each vector will be offset by it's correspoinding shift value.

Ldshift works only on VFF_TYP_FLOAT or VFF_TYP_COMPLEX data files, and on VFF_TYP_4_BYTE shift value files.

Input/Output File
    The input file must be of type VFF_TYP_FLOAT or VFF_TYP_COMPLEX. The output file returned will be the same size and type as the input file.

Specification of Shifting Value(s)
    s_img (struct xvimage), s_img_flg (int), and s_const (int)

    Ldshift will shift the 1-dimensional signals in the input data file by the value specified by the s_const parameter, or by the shifting values given in the shift value input file (s_img). The shift value file, s_img, is used ony if the s_img_flg is TRUE.

    Shifting values can be positive or negative. Positive shift values will cause rotation or shifting to occur from left to right. Negative shift values will cause rotation or shifting to occur from right to left.

    If the constant shift value (s_const) is used, all vectors in the data file are shifted or rotated by the same value.

    If a shift value file (s_img) is specified, each vector in the input file will be shifted independently by the values defined in the s_img file. The shift value file must contains the same number of points as there are vectors in the input file. There is a one to one correspondence between shift values and vectors, and each vector will be offset by it's correspoinding shift value. The shift value file must be of type VFF_TYP_4_BYTE.

wrap flag
    If the wrap flag is TRUE, the signal(s) will be wrapped, or rotated. If wrap is FALSE, the signal(s) will be truncated and padded on each end, depending on the direction of shifting.

Real & Imaginary Padding Values
    The real (r_pad) and imaginary (i_pad) padding value parameters specify a constant float value for padding the positions from which the signal has been shifted away.
    Note: If the wrap flag is TRUE, rotation occurs, so the r_pad and i_pad parameters are ignored.

process_dir
    Data can be processed with either band or vector orientation. If process_dir = DSP_VECTOR = 0, the data stored in multiband format will be processed as a set of data sequences, where each sequence corresponds to a pixel location, and the points of each sequence are defined by the bands corresponding to that pixel location. The direction of processing can be changed so that each band is processed as a signal (instead of each vector being a signal) by setting process_dir = DSP_BAND = 1.

SEE ALSO
dshift(1), intro(3), vipl(3), verror(3), vutils(3)

RESTRICTIONS
ldshift works only on VFF_TYP_COMPLEX and VFF_TYP_FLOAT.

The shift value file must be of type VFF_TYP_4_BYTE.

AUTHOR
Donna Koechner

COPYRIGHT
Copyright 1991, University of New Mexico. All rights reserved.