linuxwacom / xf86-input-wacom

X.Org driver for Wacom devices
356 stars 45 forks source link

Add a tool for pressurecurve debugging #326

Closed whot closed 9 months ago

whot commented 9 months ago

This tool takes (one or multiple) sets of 4 coordinate that represent the second and third point for our pressure curve (first and fourth points are hardcoded to 0/0 and 1/1 like the driver does)

It spits out gnuplot-compatible lines that can be printed for visual debugging. Usage to print the GNOME default curves:

./pressurecurve \
    0 .75 .25 1 \
    0 .5 .5 1  \
    0 .25 .75 1 \
    0 0 1 1 \
    .25 0 1 .75 \
    .5 0 1 .5 \
    .75 0 1 .25 > gnuplot.data

And that gnuplot data can then be printed with:

 #!/usr/bin/gnuplot
 set terminal qt persist
 set style data lines
 set xrange [0:1]
 set yrange [0:1]
 plot \
  "gnuplot.data" using 1:2 title "  0, .75, .25, 1", \
  "gnuplot.data" using 1:3 title "  0, .50, .50, 1", \
  "gnuplot.data" using 1:4 title "  0, .25, .75, 1", \
  "gnuplot.data" using 1:5 title "  0,   0,   1, 1", \
  "gnuplot.data" using 1:6 title ".25, 0,   1, .75", \
  "gnuplot.data" using 1:7 title ".50, 0,   1, .50", \
  "gnuplot.data" using 1:8 title ".75, 0,   1, .25