+void gfxdevice_rescale_setzoom(gfxdevice_t*dev, double scale)
+{
+ internal_t*i = (internal_t*)dev->internal;
+ if(strcmp(dev->name, "rescale")) {
+ fprintf(stderr, "Internal error: can't cast device %s to a rescale device\n", dev->name);
+ return;
+ }
+ i->matrix.m00 = scale;
+ i->matrix.m01 = 0;
+ i->matrix.m11 = scale;
+ i->matrix.m10 = 0;
+ i->matrix.tx = 0;
+ i->matrix.ty = 0;
+ i->zoomwidth = scale;
+}
+void gfxdevice_rescale_setdevice(gfxdevice_t*dev, gfxdevice_t*out)
+{
+ internal_t*i = (internal_t*)dev->internal;
+ if(strcmp(dev->name, "rescale")) {
+ fprintf(stderr, "Internal error: can't cast device %s to a rescale device\n", dev->name);
+ return;
+ }
+ i->out = out;
+}
+
+gfxdevice_t* gfxdevice_rescale_new(gfxdevice_t*out, int width, int height, double scale)
+{
+ gfxdevice_t* d = (gfxdevice_t*)malloc(sizeof(gfxdevice_t));
+ gfxdevice_rescale_init(d, out, width, height, scale);
+ return d;
+}