forked from brouhaha/tumble
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtumble_input.h
75 lines (64 loc) · 2.23 KB
/
tumble_input.h
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
/*
* tumble: build a PDF file from image files
*
* Copyright 2003, 2017 Eric Smith <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation. Note that permission is
* not granted to redistribute this program under the terms of any
* other version of the General Public License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
*
* 2010-09-02 [JDB] Added support for min-is-black TIFF images.
*/
typedef struct
{
bool color;
bool negative;
uint32_t width_samples, height_samples;
double width_points, height_points;
double x_resolution, y_resolution;
} image_info_t;
typedef struct
{
bool (*match_suffix) (char *suffix);
bool (*open_input_file) (FILE *f, char *name);
bool (*close_input_file) (void);
bool (*last_input_page) (void);
bool (*get_image_info) (int image,
input_attributes_t input_attributes,
image_info_t *image_info);
bool (*process_image) (int image,
input_attributes_t input_attributes,
image_info_t *image_info,
pdf_page_handle page,
output_attributes_t output_attributes
);
} input_handler_t;
void install_input_handler (input_handler_t *handler);
bool match_input_suffix (char *suffix);
bool open_input_file (char *name);
bool close_input_file (void);
bool last_input_page (void);
bool get_image_info (int image,
input_attributes_t input_attributes,
image_info_t *image_info);
bool process_image (int image,
input_attributes_t input_attributes,
image_info_t *image_info,
pdf_page_handle page,
output_attributes_t output_attributes);
void init_tiff_handler (void);
void init_jpeg_handler (void);
void init_pbm_handler (void);
void init_png_handler (void);
extern input_handler_t blank_handler;