ldmirror(3)

LIBRARY ROUTINE
ldmirror - 1D Create Mirror of Data. Points added to the left of the first data point.

LIBRARY CALL
#include "vinclude.h"
int
ldmirror ( image, arith_type, process_dir )
int             arith_type, process_dir;
struct xvimage  *image;

INPUT

image
    (struct xvimage) - the input/output xvimage structure

arith_type
    (int) - flag indicating whether to perform complex conjugate or scalar mirror on complex data

process_dir
    (int) - direction of data processing: DSP_VECTOR or DSP_BAND.

OUTPUT

image
    (struct xvimage) - the input/output xvimage structure. Since image is used for both the input and the output, be careful not to overwrite important data.

MODIFICATIONS

Jeremy Worley 19 Feb 1992 09:39 MST
    added explicit declaration of dunload_vector().

DESCRIPTION
ldmirror generates a mirror data file by extending the data points to the left of the first data point. The first point of the input file (center point of output file) is the only point that is not duplicated.

The number of points in the output file will be two times the number of points in the input file minus 1. ldmirror can operate on VFF_TYP_FLOAT (real) and VFF_TYP_COMPLEX data. If the data is complex, vector arithmetic or scalar arithmetic can be chosen. If vector arithmetic is chosen (arith_type = 1), the mirrored complex data is the complex conjugate of the original data. If scalar is chosen (arith_type = 0), the mirrored data is a direct copy of the original data.

If process_dir = DSP_VECTOR, the mirror is done in the vector direction (ie, number of bands in output file will be greater than the number of bands in the input image). When the process direction is down vectors, data is mirrored in the following way: if one pixel of a 3 band image has values 1, 2, and 3, the values of that pixel in the resulting 5 band image will be 3, 2, 1, 2, 3. Exception: If the input file is single band, the resulting mirrored data will be single band with (rows*col)-1 points.

If process_dir = DSP_BAND, the mirror is done for each band, therefore, the resulting output file will have the same number bands as the input image, but the row and col size of the output file will vary. When the process direction is across bands, the size of the resulting output image will NOT be orig_num_rows * orig_num_cols. Therefore, the data must be rearranged. Rearrangement is done according to the following tests:
    If orig_num_rows = 1, output image will be 1 row by num_points columns.

    Else if orig_num_cols = 1, output image will be 1 column by num_points rows.

    Else if num_points is divisible by orig_num_rows, output image will be orig_num_rows by (num_points/orig_num_rows) columns.

    Else if num_points is divisible by orig_num_cols, output image will be orig_num_cols by (num_points/orig_num_cols) rows.

    Else, num_rows = 1, num_cols = num_pts.

ldmirror returns a zero upon failure and a one upon success.

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

RESTRICTIONS
ldmirror output type can be VFF_TYP_FLOAT or VFF_TYPE_COMPLEX only.

AUTHOR
Donna Koechner, Ramiro Jordan

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