From 3eb6b9866aa1dae4c2778b450cc99b29e9d11d7e Mon Sep 17 00:00:00 2001 From: Ray Johnston Date: Sun, 10 Jan 2021 10:17:35 -0800 Subject: Implement Nup subclass device to support nesting images on a page. By using a subclassing device to intercept a few of the device procs (get_initial_matrix, output_page, fillpage, put_params, close_device, and dev_spec_op) pages can be placed on to a page that is eventually output. This initial implementation scales the pages on the 'nest' as defined by -sNupControl parameter that is a string of the form "HxV" where H and V are integers controlling nesting across (H) and down (V) the page. All pages on the nest are the same size/orientation as the first page of the nest, and if a different PageSize is encountered, any pages on the current nest will be output before starting a new nest. In gx_device_set_hwsize_from_media dev_spec_op is used to prevent changing the device width and height (HWSize) for PageSize or .MediaSize params. This requires that the graphics library should not assume that HWSize is derived from PageSize and HWResolution, but it allows the intial clip_path for the nested pages to be set from the MediaSize, Margins, and HWMargins in gx_default_clip_box. There are a few files that have differences with the 'psdcmyk' devices when tested with -sNupControl=1x1: Bug688584.ps: Page 6 missing graphics,related to SeparationOrder usage. (a bug will be opened for this once this is committed). Bug692517.ps: subclass device barely switches to clist mode for 72.0 (don't care, page mode still works for larger MaxBitmap), tests_private/pdf/PDFIA1.7_SUBSET/CATX2975.pdf.ppmraw.300.0..gs (seems to be a progression on page 9) --- base/gdevkrnlsclass.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'base/gdevkrnlsclass.h') diff --git a/base/gdevkrnlsclass.h b/base/gdevkrnlsclass.h index b73ce3c23..392e87301 100644 --- a/base/gdevkrnlsclass.h +++ b/base/gdevkrnlsclass.h @@ -19,6 +19,7 @@ #ifndef gdev_subclass_dev_INCLUDED # define gdev_subclass_dev_INCLUDED +#include "gdevnup.h" #include "gdevflp.h" #include "gdevoflt.h" @@ -26,6 +27,8 @@ extern gx_device_obj_filter gs_obj_filter_device; extern gx_device_flp gs_flp_device; +extern gx_device_nup gs_nup_device; + int install_internal_subclass_devices(gx_device **ppdev, int *devices_loaded); #endif /* gdev_subclass_dev_INCLUDED */ -- cgit v1.2.1