pixman-image: Added enable-gnuplot config to view filters in gnuplot
authorBill Spitzak <spitzak@gmail.com>
Wed, 31 Aug 2016 05:03:08 +0000 (22:03 -0700)
committerSøren Sandmann Pedersen <soren.sandmann@gmail.com>
Fri, 2 Sep 2016 04:40:11 +0000 (00:40 -0400)
commitd0e6c9f4f65e429058b97d2f947b048b445c17c4
treeae666a353501d29319710c4ac14ae2844e1f24b2
parent375f5ec5c5d2a6cc3586f57e36fdf08a3d0ac4e4
pixman-image: Added enable-gnuplot config to view filters in gnuplot

If enable-gnuplot is configured, then you can pipe the output of a
pixman-using program to gnuplot and get a continuously-updated plot of
the horizontal filter. This works well with demos/scale to test the
filter generation.

The plot is all the different subposition filters shuffled
together. This is misleading in a few cases:

  IMPULSE.BOX - goes up and down as the subfilters have different
                numbers of non-zero samples

  IMPULSE.TRIANGLE - somewhat crooked for the same reason

  1-wide filters - looks triangular, but a 1-wide box would be more
                   accurate

Changes by Søren: Rewrote the pixman-filter.c part to
     - make it generate correct coordinates
     - add a comment on how coordinates are generated
     - in rounding.txt, add a ceil() variant of the first-sample
       formula
     - make the gnuplot output slightly prettier

v7: First time this ability was included

v8: Use config option
    Moved code to the filter generator
    Modified scale demo to not call filter generator a second time.

v10: Only print if successful generation of plots
     Use #ifdef, not #if

v11: small whitespace fixes
v12: output range from -width/2 to width/2 and include y==0, to avoid misleading plots
     for subsample_bits==0 and for box filters which may have no small values.

Signed-off-by: Bill Spitzak <spitzak@gmail.com>
configure.ac
pixman/pixman-filter.c
pixman/rounding.txt