summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-03-18 16:04:34 -0700
committerKeith Packard <keithp@keithp.com>2008-03-18 16:04:34 -0700
commitb816bf38b418618c2f1cb5ded09aa3b346f8eb15 (patch)
treef09c4950e61adaa443e087675325ade3a4d0122c
parent3809884530223e32f7026ec987257cb91e2122a9 (diff)
Add --transform to pass arbitrary transforms to the server
-rw-r--r--xrandr.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/xrandr.c b/xrandr.c
index cb23385..630697d 100644
--- a/xrandr.c
+++ b/xrandr.c
@@ -2101,6 +2101,27 @@ main (int argc, char **argv)
output->changes |= changes_transform;
continue;
}
+ if (!strcmp ("--transform", argv[i])) {
+ double transform[3][3];
+ int k, l;
+ if (++i>=argc) usage ();
+ if (sscanf(argv[i], "%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",
+ &transform[0][0],&transform[0][1],&transform[0][2],
+ &transform[1][0],&transform[1][1],&transform[1][2],
+ &transform[2][0],&transform[2][1],&transform[2][2])
+ != 9)
+ usage ();
+ init_transform (&output->transform);
+ for (k = 0; k < 3; k++)
+ for (l = 0; l < 3; l++) {
+ output->transform.transform.matrix[k][l] = XDoubleToFixed (transform[k][l]);
+ }
+ output->transform.filter = "bilinear";
+ output->transform.nparams = 0;
+ output->transform.params = NULL;
+ output->changes |= changes_transform;
+ continue;
+ }
if (!strcmp ("--off", argv[i])) {
if (!output) usage();
set_name_xid (&output->mode, None);