The LITES2 image warping (monplotting) option allows local transformation
(warping) of raster image data or vector map data to fit the other.

The primary command involved is WARP, although there are associated SHOW WARP
and $WARP_xxx system variables. These are documented in the LITES2 Help file,
from which the following extracts are taken:

WARP

  Control transformation (warping) of raster images.
  A typical sequence of commands might be:
  WARP TRANSFORM - specify type of transformation
  WARP CLEAR - clear previously specified points if required
  WARP POINT IMAGE/MAP - specify points (as many as required)
  WARP FIT - calculate a fit
  WARP DELETE/REPLACE - modify points if required, or add more
  WARP FIT - fit again if required
  WARP ON - turn on warping
  WARP MAP/IMAGE - specify whether to warp the vectors or the image
  Use drawing commands to view the warped picture.

  Format:  WARP  subcommand

  Valid in states  INITIAL READY LINE CIRCLE TEXT SYMBOL



  Additional information available:

  CLEAR      DELETE     FIT        IMAGE      MAP        OFF        ON         POINT      REPLACE    TRANSFORM


WARP

  CLEAR

    Delete all warp points.
    Any warp transformation in use, or already fitted, remains active.
    Use WARP OFF to turn off an active transformation.

    Format:  WARP CLEAR



WARP

  DELETE

    Deletes a warp point.
    The point number must be between 1 and the number of points digitised.
    After this command, higher numbered points are re-numbered to fill
    the gap.

    Format:  WARP DELETE n



WARP

  FIT

    Calculate a fit to the current set of warp points.
    The type of fit is specified by the WARP TRANSFORM command.
    The goodness of the fit may be shown by the SHOW WARP command, and
    also appears in the various $WARP... system variables.
    Once fitted, the warp may be activated using the WARP ON command.

    Format:  WARP FIT



WARP

  IMAGE

    Warp the raster image to fit the vector data.
    This can be slower than WARP MAP. Because it causes the image to be
    resampled, a side-effect is that the image may be drawn at arbitrary
    zoom factors.

    Format:  WARP IMAGE



WARP

  MAP

    Warp the vector data to fit the raster image (default).
    This can be faster than WARP IMAGE. As when not warping at all, the
    raster image can only be zoomed to multiples of its original pixel
    size.

    Format:  WARP MAP



WARP

  OFF

    Turn off warping.
    The warp that was active may be turned back on using WARP ON.

    Format:  WARP OFF



WARP

  ON

    Turn on warping.
    If a new warp has been calculated using WARP FIT, then this is activated,
    otherwise the previously active warp is activated.

    Format:  WARP ON



WARP

  POINT

    Specify a data point for fitting a warp.
    If the coordinates are omitted, the current cursor position is used.
    Coordinates are specified in IFF units and identify a position either
    in the vector data (MAP) or the raster data (IMAGE).
    IMAGE and MAP points may be specified in any order - when a fit is
    performed, the first IMAGE point will map to the first MAP point etc.

    Format:  WARP POINT IMAGE  [x y]
    or       WARP POINT MAP    [x y]



WARP

  REPLACE

    Replace a previously specified warp data point.
    The point number must be between 1 and the number of points digitised.
    If the coordinates are omitted, the current cursor position is used.
    Coordinates are specified in IFF units and identify a position either
    in the vector data (MAP) or the raster data (IMAGE).

    Format:  WARP REPLACE IMAGE  n [x y]
    or       WARP REPLACE MAP    n [x y]



WARP

  TRANSFORM

    Specifies the type of warp transformation to be used.
    See the description of the SETUP TRANSFORM for details of the formulae
    used. The LINEAR transformation is just a shift if one point is supplied,
    or a shift plus a rotation with two points.

    Format:  WARP TRANSFORM type

             where type = AFFINE (default)
                        = EXTENDED
                        = LINEAR
                        = ORTHOGONAL
                        = PROJECTIVE



SHOW

  WARP

    Shows details of transformation (warping) of raster images.

    Format:  SHOW WARP



Variables

  System

    $WARP_COEFFS_IMAGE

      DOUBLE    Contains the coefficients for transforming an image
                coordinate to a map coordinate.

      Must be followed by an integer in the range 1 - 8 identifying which
      coefficient is required.



Variables

  System

    $WARP_COEFFS_MAP

      DOUBLE    Contains the coefficients for transforming a map
                coordinate to an image coordinate.

      Must be followed by an integer in the range 1 - 8 identifying which
      coefficient is required.



Variables

  System

    $WARP_DIRTY

      INTEGER   -1 if the warp points have been altered since WARP FIT
                was performed, otherwise 0.



Variables

  System

    $WARP_FITTED

      INTEGER   -1 if WARP FIT has been performed, and WARP ON will activate
                the fit, otherwise 0.



Variables

  System

    $WARP_IMAGE_N

      INTEGER   The number of image control points for warping.



Variables

  System

    $WARP_IMAGE_X

      REAL      The X coordinate of an image control point.

      Must be followed by an integer identifying the control point.



Variables

  System

    $WARP_IMAGE_Y

      REAL      The Y coordinate of an image control point.

      Must be followed by an integer identifying the control point.



Variables

  System

    $WARP_MAP_N

      INTEGER   The number of map control points for warping.



Variables

  System

    $WARP_MAP_X

      REAL      The X coordinate of a map control point.

      Must be followed by an integer identifying the control point.



Variables

  System

    $WARP_MAP_Y

      REAL      The Y coordinate of a map control point.

      Must be followed by an integer identifying the control point.



Variables

  System

    $WARP_MODE

      INTEGER   The current warp mode. 0 if warping is off, 1 if warping
                the image, 2 if warping the map.



Variables

  System

    $WARP_RESIDUAL_X

      REAL      The X residual at a warp control point (transformed map
                coordinate minus image coordinate).

      Must be followed by an integer identifying the control point.



Variables

  System

    $WARP_RESIDUAL_Y

      REAL      The Y residual at a warp control point (transformed map
                coordinate minus image coordinate).

      Must be followed by an integer identifying the control point.



Variables

  System

    $WARP_RMS_X

      REAL      The root mean square X residual at the warp control points
                (calculated at the time the warp was fitted).



Variables

  System

    $WARP_RMS_Y

      REAL      The root mean square Y residual at the warp control points
                (calculated at the time the warp was fitted).



Variables

  System

    $WARP_TRANSFORM

      CHARACTER The name of the current warp transform (LINEAR, HELMERT,
                AFFINE, EXTENDED, or PROJECTIVE).


