summaryrefslogtreecommitdiff
path: root/support/dktools/dk4grco.h
blob: 8913e331dcdc8a5904bfa181dedaeeb05f13bd11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
/*
Copyright (C) 2018-2020, Dirk Krause
SPDX-License-Identifier: BSD-3-Clause
*/

/*
	WARNING: This file was generated by the dkct program (see
	http://dktools.sourceforge.net/ for details).
	Changes you make here will be lost if dkct is run again!
	You should modify the original source and run dkct on it.
	Original source: dk4grco.ctr
*/

#ifndef DK4GRCO_H_INCLUDED
/** Avoid multiple inclusions. */
#define DK4GRCO_H_INCLUDED 1


#line 10 "dk4grco.ctr"

/**	@file	dk4grco.h	Graphics configuration.
*/

#ifndef	DK4CONF_H_INCLUDED
#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
#else
#include <dktools-4/dk4conf.h>
#endif
#endif

#ifndef	DK4PAPER_H_INCLUDED
#if DK4_BUILDING_DKTOOLS4
#include "dk4paper.h"
#else
#include <dktools-4/dk4paper.h>
#endif
#endif

#ifndef	DK4CS_H_INCLUDED
#if DK4_BUILDING_DKTOOLS4
#include "dk4cs.h"
#else
#include <dktools-4/dk4cs.h>
#endif
#endif

#ifndef	DK4GRA_H_INCLUDED
#if DK4_BUILDING_DKTOOLS4
#include "dk4gra.h"
#else
#include <dktools-4/dk4gra.h>
#endif
#endif

/**	Scopes for configuration entries
*/
enum	{
								/**	Base setup like choosing a driver,
									PS language level.
								*/
	DK4_GRA_CONF_SCOPE_SETUP	=	0x0001 ,

								/**	Setup tasks related to bitmap images.
								*/
	DK4_GRA_CONF_SCOPE_IMAGE	=	0x0002 ,

								/**	Setup tasks related to drawing operations.
								*/
	DK4_GRA_CONF_SCOPE_DRAW		=	0x0004 ,

								/**	Setup tasks related to text typesetting.
								*/
	DK4_GRA_CONF_SCOPE_TEXT		=	0x0008 ,

	/* ----- Combinations for some programs ----- */

								/**	The bmpp program only uses base
									setup and bitmap image setup.
								*/
	DK4_GRA_CONF_SCOPE_BMPP		=	(
		DK4_GRA_CONF_SCOPE_SETUP
		| DK4_GRA_CONF_SCOPE_IMAGE
	) ,

								/**	The fig2lat program uses all setup
									features.
								*/
	DK4_GRA_CONF_SCOPE_FIG2LAT =	(
		DK4_GRA_CONF_SCOPE_BMPP
		| DK4_GRA_CONF_SCOPE_DRAW
		| DK4_GRA_CONF_SCOPE_TEXT
	)

};

/**	Graphics configuration.
*/
typedef struct {
	dk4_paper_size_t	media;			/**< Paper size to use. */
	dk4_cs_conv_ctx_t	ctx;			/**< Color space conversion context. */
	double				xres;			/**< X resolution. */
	double				yres;			/**< Y resolution. */
	double				xslp;			/**< X-spline length precision. */
	double				xspp;			/**< X-spline parameter precision. */
	size_t				psi;			/**< Paper size index in collection. */
	unsigned			xsss;			/**< X-spline sub segments. */
	int					driver;			/**< Graphics output driver. */
	int					purpose;		/**< Intended output purpose. */
	int					color;			/**< Flag: Colored output. */
	int					ps_level;		/**< PS level, 2 or 3. */
	int					ps_lzw;			/**< Flag: Allow LZW. */
	int					ps_dsc;			/**< Flag: Write DSC comments. */
	int					img_bg_r;		/**< Image background red. */
	int					img_bg_g;		/**< Image background green. */
	int					img_bg_b;		/**< Image background blue. */
	int					img_bg_f;		/**< Flag: Force specified bg. */
	int					img_dct;		/**< Flag: Directly use DCT data. */
	int					img_int;		/**< Flag: Use image interpolation. */
	int					img_dct_int;	/**< Flag: Interpolation for DCT. */
	int					img_an_bpc;		/**< Flag: Analyse bits per sample. */
	int					img_an_color;	/**< Flag: Analyse color usage. */
	int					img_an_alpha;	/**< Flag: Analyse alpha channel use. */
	int					img_rot;		/**< Flag: Allow rotation. */
	int					img_ign_res;	/**< Flag: Ignore resolution chunk. */
	int					img_ign_asp;	/**< Flag: Ignore aspect ratio. */
	int					use_media;		/**< Flag: Fit to paper size. */
	int					doc_duplex;		/**< Flag: Use duplex printing. */
	int					doc_tumble;		/**< Flag: Use duplex and tumble. */
	int					have_psi;		/**< Flag: Have psi number. */
} dk4_gra_conf_t;

#ifdef	__cplusplus
extern "C" {
#endif

/**	Initialize configuration structure.
	@param	conf	Configuration structure to initialize.
*/
void
dk4gra_conf_init(
	dk4_gra_conf_t	*conf
);


/**	Retrieve flags for applying an image from the configuration.
	@param	conf	Configuration structure to obtain values from.
	@return	Or-combined set of flags.
*/
int
dk4gra_conf_flags_image(
	dk4_gra_conf_t	const	*conf
);


/**	Retrieve document flags for opening a graphics output structure
	from the configuration.
	@param	conf	Configuration structure to obtain values from.
	@return	Or-combined set of flags.
*/
int
dk4gra_conf_flags_document(
	dk4_gra_conf_t	const	*conf
);

#ifdef	__cplusplus
}
#endif

/* vim: set ai sw=4 ts=4 : */



#endif