summaryrefslogtreecommitdiff
path: root/base/gxdownscale.h
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2016-02-01 17:22:53 +0000
committerRobin Watts <robin.watts@artifex.com>2016-02-05 15:47:25 +0000
commitafc7e2cfb9544a8cebd8abb0d89e02429ad98f7d (patch)
treedb08738276ac17ec4db4193f21ee3364128683e1 /base/gxdownscale.h
parentafbffabc7bf3593d3de5a210899e364371807c66 (diff)
downloadghostpdl-afc7e2cfb9544a8cebd8abb0d89e02429ad98f7d.tar.gz
Reduce boilerplate downscaler params handling.
The same sets of parameters (or subsets thereof) are read/ written in many devices get/put_params routines to control the downscaler. Arrange to read/write these all in one place to keep the code simpler.
Diffstat (limited to 'base/gxdownscale.h')
-rw-r--r--base/gxdownscale.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/base/gxdownscale.h b/base/gxdownscale.h
index b1092a537..1ecce325a 100644
--- a/base/gxdownscale.h
+++ b/base/gxdownscale.h
@@ -160,4 +160,32 @@ int gx_downscaler_init_planar_trapped(gx_downscaler_t *ds,
int trap_h,
const int *comp_order);
+/* The following structure is used to hold the configuration
+ * parameters for the downscaler.
+ */
+typedef struct gx_downscaler_params_s
+{
+ long downscale_factor;
+ long min_feature_size;
+ int trap_w;
+ int trap_h;
+ int trap_order[GS_CLIENT_COLOR_MAX_COMPONENTS];
+} gx_downscaler_params;
+
+#define GX_DOWNSCALER_PARAMS_DEFAULTS \
+{ 1, 0, 0, 0, { 3, 1, 0, 2 } }
+
+enum {
+ GX_DOWNSCALER_PARAMS_MFS = 1,
+ GX_DOWNSCALER_PARAMS_TRAP = 2
+};
+
+int gx_downscaler_read_params(gs_param_list *plist,
+ gx_downscaler_params *params,
+ int features);
+
+int gx_downscaler_write_params(gs_param_list *plist,
+ gx_downscaler_params *params,
+ int features);
+
#endif