1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/tumble_input.h Thu Mar 20 06:54:08 2003 +0000 1.3 @@ -0,0 +1,64 @@ 1.4 +/* 1.5 + * tumble: build a PDF file from image files 1.6 + * 1.7 + * $Id: tumble_input.h,v 1.1 2003/03/19 22:54:08 eric Exp $ 1.8 + * Copyright 2003 Eric Smith <eric@brouhaha.com> 1.9 + * 1.10 + * This program is free software; you can redistribute it and/or modify 1.11 + * it under the terms of the GNU General Public License version 2 as 1.12 + * published by the Free Software Foundation. Note that permission is 1.13 + * not granted to redistribute this program under the terms of any 1.14 + * other version of the General Public License. 1.15 + * 1.16 + * This program is distributed in the hope that it will be useful, 1.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 1.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1.19 + * GNU General Public License for more details. 1.20 + * 1.21 + * You should have received a copy of the GNU General Public License 1.22 + * along with this program; if not, write to the Free Software 1.23 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA 1.24 + */ 1.25 + 1.26 + 1.27 +typedef struct 1.28 +{ 1.29 + bool color; 1.30 + uint32_t width_samples, height_samples; 1.31 + double width_points, height_points; 1.32 + double x_resolution, y_resolution; 1.33 +} image_info_t; 1.34 + 1.35 + 1.36 +typedef struct 1.37 +{ 1.38 + bool (*open_input_file) (FILE *f, char *name); 1.39 + bool (*close_input_file) (void); 1.40 + bool (*last_input_page) (void); 1.41 + bool (*get_image_info) (int image, 1.42 + input_attributes_t input_attributes, 1.43 + image_info_t *image_info); 1.44 + bool (*process_image) (int image, 1.45 + input_attributes_t input_attributes, 1.46 + image_info_t *image_info, 1.47 + pdf_page_handle page); 1.48 +} input_handler_t; 1.49 + 1.50 + 1.51 +void install_input_handler (input_handler_t *handler); 1.52 + 1.53 + 1.54 +bool open_input_file (char *name); 1.55 +bool close_input_file (void); 1.56 +bool last_input_page (void); 1.57 +bool get_image_info (int image, 1.58 + input_attributes_t input_attributes, 1.59 + image_info_t *image_info); 1.60 +bool process_image (int image, 1.61 + input_attributes_t input_attributes, 1.62 + image_info_t *image_info, 1.63 + pdf_page_handle page); 1.64 + 1.65 + 1.66 +void init_tiff_handler (void); 1.67 +void init_jpeg_handler (void);