window2d

Description

window2d returns weights on a 2-D grid or at query coordinates read from standard input. Query coordinates use bilinear interpolation.

Blendfile rows contain:

<polygonfile> <xfunction>/<yfunction> <rx1>/<rx2>/<ry1>/<ry2>

Polygons must be valid, simple, and strictly xy-monotone, meaning that the vertices should be strictly increasing as opposed to nondecreasing in the usual definition of xy-monotonicity. use -ME or -MB to refine any input polygon to be strictly xy-monotone. BLEND reports the original and final vertex counts when refinement changes the polygon. Use -N with -M to write each modified polygon by inserting _monotone before the file extension, for example south_america_monotone.txt for the monotone South America polygon south_america.txt.

Usage

blend window2d - Generate 2-D blending weights

usage: blend window2d -R<xmin>/<xmax>/<ymin>/<ymax> -I<dx>[/<dy>]
       [-F<xfunction>[/<yfunction>]] [-T<rx1>/<rx2>/<ry1>/<ry2>]
       [-B<blendfile>] [-C<f|l|o|u|a|g|p>] [-M<method>] [-N] [-V[q|e|w|t|i|c|d]]

Generate 2-D blending weights and write three columns: x y weight. If x/y
query coordinates are provided on standard input, weights are returned at those
locations using bilinear interpolation from neighboring grid-point weights. If
no query points are provided, weights are written for the complete -R/-I grid.

REQUIRED ARGUMENTS:

  -R<xmin>/<xmax>/<ymin>/<ymax>, --region=<xmin>/<xmax>/<ymin>/<ymax>
     Specify the full 2-D output domain in user coordinates. The domain must
     satisfy xmin < xmax and ymin < ymax.  If an upper bound does not fall
     exactly on its increment, BLEND adjusts it upward to the next increment
     and reports a warning.

  -I<dx>[/<dy>], --increment=<dx>[/<dy>]
     Specify grid increments in user coordinates. Both increments must be
     positive. If dy is omitted then dy = dx.

OPTIONAL ARGUMENTS:

  -F<xfunction>[/<yfunction>], --function=<xfunction>[/<yfunction>]
     Select the window functions used along x and y for a single support over
     the full -R domain [Default is cosine/cosine]. If yfunction is omitted,
     yfunction = xfunction. Run blend --show-windows to list available window
     functions. This option is ignored when -B is given.

  -T<rx1>/<rx2>/<ry1>/<ry2>, --taper_ratio=<rx1>/<rx2>/<ry1>/<ry2>
     Set beginning and ending taper ratios for x and y. Ratios must be >= 0
     and < 0.5 [Default is 0.2/0.2/0.2/0.2]. This option is ignored for boxcar
     dimensions and when -B is given.

  -B<blendfile>, --blendfile=<blendfile>
     Read one or more xy-monotone polygon supports from <blendfile>. Each
     non-empty, non-comment row must contain exactly three fields:
       <polygonfile> <xfunction>/<yfunction> <rx1>/<rx2>/<ry1>/<ry2>
     where <polygonfile> is a two-column x/y vertex file contained inside -R.
     Lines may contain comments introduced by '#'. Grid points outside all
     blendfile polygons receive weight 0.

  -C<f|l|o|u|a|g|p>, --clobber=<mode>
     Select how overlapping polygon weights from -B are combined [Default is p].
       f  Use the first polygon listed in the blendfile.
       l  Use the lowest weight among overlapping polygons.
       o  Use the last polygon listed in the blendfile.
       u  Use the highest weight among overlapping polygons.
       a  Use the arithmetic average of overlapping weights.
       g  Use the geometric average of overlapping weights.
       p  Use the product of overlapping weights.

  -M<method>, --monotone=<method>
     Here only the 'strictly increasing' monotone condition is allowed.
     Select how non-strict xy-monotone blendfile polygons are converted before
     window assembly. If this option is omitted, polygons that are not strict
     enough for function localization are rejected. -MB is experimental and can
     produce irregular polygons that make function localization awkward.
       E  Use the strict xy-monotone envelope (i.e., convex hull) method.
       B  Use the strict highest-IoU piecewise envelope from both traversal directions,
          sampled on the -R/-I grid.

  -N, --write-monotone
     When -M modifies a polygon, write the modified polygon to a file named
     by inserting _monotone before the file extension, for example
     south_america_monotone.txt. If -N is omitted, modified polygons are used for
     weights but are not written.

  -V[level], --verbose=<level>
     Select verbosity level [w]. Choose among q, e, w, t, i, c, and d:
       q  Quiet; suppress all diagnostic messages.
       e  Error messages only.
       w  Warnings and errors [Default].
       t  Timings, warnings, and errors.
       i  Informational messages, timings, warnings, and errors.
       c  Compatibility messages and all lower verbosity messages.
       d  Debug messages and all lower verbosity messages.

  -?, --help
     Print this usage message and exit.

EXAMPLES:

  blend window2d -R0/10/0/5 -I0.5 -Fcosine/cosine -T0.2/0.2/0.2/0.2
     Generate one 2-D cosine-tapered window over the full domain.

  printf '2.5 1.5\n' | blend window2d -R0/10/0/5 -I1 -Fcosine/cosine
     Query the interpolated weight at x = 2.5, y = 1.5.

  blend window2d -R0/10/0/10 -I0.25 -Bsupports.txt -Ca
     Read multiple polygon supports from supports.txt and average overlaps.