ldinsert(3)

LIBRARY ROUTINE
ldinsert - Inserts 1-D format file into another 1-D file.

LIBRARY CALL
#include "vinclude.h"
int
ldinsert(img1, img2, s_img, s_img_flg, start, append_flg, process_dir)
struct xvimage  *img1,          /* input/output image */
                *img2,          /* image to be inserted into img1 */
                *s_img;         /* starting point file for inserting */
int             s_img_flg,      /* flag for starting point file */
                start,          /* insert point */
                append_flg,     /* flag set to one if appending to end */
                process_dir;    /* direction of processing 0=vect, 1= band */

INPUT

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

*img2
    (struct xvimage) - pointer to the input xvimage structure to be inserted

*s_img
    (struct xvimage) - pointer to the starting insert value input image (int)

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

start
    (int) - constant starting insert value

append_flg
    (int) - flag set to 1 if img2 vectors are to be appended to end of img1 vectors.

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

OUTPUT

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

MODIFICATIONS
Thu Jun 7 20:47:20 MDT 1990 Donna Koechner - updated to ghostwriter
Audit Done 04-OCT-90 Donna Koechner

DESCRIPTION
ldinsert inserts 1-dimensional vector(s) from the input data file (img2) into the vector(s) in file img1. The position(s) where the vector(s) are inserted are determined by the start, s_img, or append_flg parameters.

img1 & img2
    Input and output files - (struct xvimage)
    The two input files must be of the same data type and have the same number of vectors. The input files must be of dimension = 0, have implicit location types, and be of data storage type VFF_TYP_FLOAT or VFF_TYP_COMPLEX. The map types of the 2 input files are not checked, and, if different, the output file assumes the map type of file i1. The output file will contain the same number of vectors as are in the input files, and the data storage type will be the same as that of the input files. The vector dimension of the output file will be the sum of the dimensions of the two input files.

Specification of Insertion Points:
start (int), s_img (struct xvimage), s_img_flg (int), append_flg (int)

Three mutually exclusive options are available for specifying the position where the vectors in file img2 are to be inserted into the img1 vectors: start (int), s_img (file), and append_flg (logical).

start
    The starting point (start) parameter specifies a constant offset into the img1 data set(s) where the first point of the img2 data set(s) is to be inserted. The default value is 0 (the first point of the img1 data). The start value is overridden if either s_img_flg or append_flg is TRUE.

s_img & s_img_flg
    The s_img parameter specifies a file which contains the starting point of each vector independently. This file must be of type int and have the same number of points as there are vectors in the input files. The s_img file will be used ONLY if s_img_flg = TRUE. Use of s_img is overridden if append_flg is TRUE.

append_flg
    The third method of specifying the insertion point is the append_flg parameter. This option is checked first, and therefore overrides the start and s_img options. When append_flg = TRUE, ldinsert appends the signal(s) contained in file img2 to the end of the signal(s) in img1. The insert file, s_img, must be of type VFF_TYP_4_BYTE.

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
dinsert(1), intro(3), vipl(3), verror(3), vutils(3)

RESTRICTIONS
Ldinsert works only on implicit data of type VFF_TYP_COMPLEX and VFF_TYP_FLOAT.

AUTHOR
Donna Koechner

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