
vexpwarp(1)                  Khoros                   vexpwarp(1)

PROGRAM
     vexpwarp - Perform geometric transformation (warp) using
     symbolic expression

SYNTAX
     vexpwarp

     -i             input image

     -o             output image

                           -------------------------------

     -xmap          X map function
                                        -OR-

     -ix            X map function file
                           -------------------------------

                           -------------------------------

     -ymap          Y map function
                                        -OR-

     -iy            Y map function file
                           -------------------------------

     [-x]           x coordinate of center-of-action

     [-y]           y coordinate of center-of-action

     [-V]           Gives the version for vexpwarp

     [-U]           Gives the usage for vexpwarp

     [-P]           Prompts for command line options

     [-A [file1]]   Creates the answer file called vexpwarp.ans
                    or file1

     [-a [file1]]   Uses vexpwarp.ans or file1 as the answer file

DESCRIPTION
     vexpwarp is used to alter the spatial properties of an image
     by performing a transformation in which the old coordinates
     of a pixel are mapped to a new location by a pair of sym-
     bolic expressions.  The old coordinates, (x,y) are related
     to the new coordinates (x',y') by the symbolic expressions
     supplied as map functions. These expressions are evaluated
     usint the xvexpr(3) library, which is also used by cantata
     to perform mathematical operations.  An example of a set of
     mappings is:
            x' = { 4.0*(x#2+y#2)-1/y }
            y' = { exp(-((y-15)#2)/300) }

     where the symbols inside the curly braces are retreived from
     the map files.  These files can be create using vi(1), for
     example.

     The output image is formed by mapping each individual rec-
     tangular region in the input image (composed of four neigh-
     boring pixels) through the mapping functions and onto the
     output plane in the form of a polygon. The polygon is filled
     onto the output plane using scan-line bilinear interpola-
     tion.  Note that it is possible to distort the mapping so
     severely that the input rectangle can be mapped onto a tri-
     angle, line, point, twisted hourglass, etc.  All of these
     cases are resolved except  for the hourglass case.  Also
     note that it may be possible to map into a space that you
     cannot get back from (i.e. the above functions have no
     inverses).

     The point called the center-of-action is the point that is
     specified as the origin of the spatial coordinates prior to
     applying the transform.  The output plane is then shifted so
     that its origin lies at that same specified point.  The end
     result is like specifying what point to put under a magnify-
     ing glass.

     As a final note, look out for mappings that will take nega-
     tive distances and make them positive Since the input plane
     is scanned left to right, and top to bottom, it is possible
     to overwrite part of the output plane with one or more
     regions of the input plane!  The result in this case depends
     on which part was looked at first by the scanning loop. No
     answer is right, so you get one of the many approximations.

     vexpwarp can take a long time to run...

REQUIRED ARGUMENTS
     -i     type: infile
            desc: input image

     -o     type: outfile
            desc: output image

     ***   These arguments are MUTUALLY EXCLUSIVE   ***
            You MUST provide ONE AND ONLY ONE of:

     -xmap  type: string
            desc: X map function

     -ix    type: infile
            desc: X map function file

     Default argument of mutually exclusive group: -xmap x

     ********

     ***   These arguments are MUTUALLY EXCLUSIVE   ***
            You MUST provide ONE AND ONLY ONE of:

     -ymap  type: string
            desc: Y map function

     -iy    type: infile
            desc: Y map function file

     Default argument of mutually exclusive group: -ymap y

     ********

OPTIONAL ARGUMENTS
     -x     type: float
            desc: x coordinate of center-of-action
            default: 0
            bounds: no range checking

     -y     type: float
            desc: y coordinate of center-of-action
            default: 0
            bounds: no range checking

EXAMPLES
     vexpwarp -i1 feath.xv -ix xfunc.asc -i3 yfunc.asc -o
     warped.xv

     warps "feath.xv" according to the functions in "xfunc.asc"
     and "yfunc.asc".

SEE ALSO
     intro(1), verror(3), vgparms(3), vutils(3), lvexpwarp(3)
     vwarp(1), vrotate(1), vresize(1), vpolyco(1), xvexpr(3)

RESTRICTIONS
     vexpwarp will not work on images of type BIT,DOUBLE, COM-
     PLEX, or DCOMPLEX data type.  vexpwarp does not work on
     explicit location data.

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

Khoros                    Release: 1.0                          1

