/*
* Auxiliary functions for processing PDF files
*
- * (c) 2018 Martin Mares <mj@ucw.cz>
+ * (c) 2018--2022 Martin Mares <mj@ucw.cz>
*/
#include <cstdio>
buf[--n] = 0;
return buf;
}
+
+/*** Rotation matrix construction ***/
+
+pdf_matrix pdf_rotation_matrix(int deg, double width, double height)
+{
+ pdf_matrix m;
+ switch (deg) {
+ case 0:
+ break;
+ case 90:
+ m.rotate_deg(-90);
+ m.shift(0, width);
+ break;
+ case 180:
+ m.rotate_deg(180);
+ m.shift(width, height);
+ break;
+ case 270:
+ m.rotate_deg(90);
+ m.shift(height, 0);
+ break;
+ default:
+ abort();
+ }
+ return m;
+}