+/*** rotate ***/
+
+class rotate_cmd : public cmd_exec {
+public:
+ int deg;
+ vector<page *> process(vector<page *> &pages);
+};
+
+vector<page *> rotate_cmd::process(vector<page *> &pages)
+{
+ vector<page *> out;
+ for (auto p: pages)
+ {
+ xform_page *q = new xform_page(p, p->width, p->height);
+ // FIXME: This does not work yet
+ q->xform.rotate_deg(90);
+ out.push_back(q);
+ }
+ return out;
+}
+
+static const arg_def rotate_args[] = {
+ { "angle", AT_INT | AT_MANDATORY | AT_POSITIONAL },
+ { NULL, 0 }
+};
+
+static cmd_exec *rotate_ctor(cmd *c)
+{
+ rotate_cmd *r = new rotate_cmd;
+ r->deg = c->args.at(0)->as_int(0);
+ return r;
+}
+