Thu, 20 Mar 2003 06:54:08 +0000
more JPEG support. added input file handler API.
eric@141 | 1 | /* |
eric@141 | 2 | * tumble: build a PDF file from image files |
eric@141 | 3 | * |
eric@141 | 4 | * $Id: tumble_input.h,v 1.1 2003/03/19 22:54:08 eric Exp $ |
eric@141 | 5 | * Copyright 2003 Eric Smith <eric@brouhaha.com> |
eric@141 | 6 | * |
eric@141 | 7 | * This program is free software; you can redistribute it and/or modify |
eric@141 | 8 | * it under the terms of the GNU General Public License version 2 as |
eric@141 | 9 | * published by the Free Software Foundation. Note that permission is |
eric@141 | 10 | * not granted to redistribute this program under the terms of any |
eric@141 | 11 | * other version of the General Public License. |
eric@141 | 12 | * |
eric@141 | 13 | * This program is distributed in the hope that it will be useful, |
eric@141 | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
eric@141 | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
eric@141 | 16 | * GNU General Public License for more details. |
eric@141 | 17 | * |
eric@141 | 18 | * You should have received a copy of the GNU General Public License |
eric@141 | 19 | * along with this program; if not, write to the Free Software |
eric@141 | 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA |
eric@141 | 21 | */ |
eric@141 | 22 | |
eric@141 | 23 | |
eric@141 | 24 | typedef struct |
eric@141 | 25 | { |
eric@141 | 26 | bool color; |
eric@141 | 27 | uint32_t width_samples, height_samples; |
eric@141 | 28 | double width_points, height_points; |
eric@141 | 29 | double x_resolution, y_resolution; |
eric@141 | 30 | } image_info_t; |
eric@141 | 31 | |
eric@141 | 32 | |
eric@141 | 33 | typedef struct |
eric@141 | 34 | { |
eric@141 | 35 | bool (*open_input_file) (FILE *f, char *name); |
eric@141 | 36 | bool (*close_input_file) (void); |
eric@141 | 37 | bool (*last_input_page) (void); |
eric@141 | 38 | bool (*get_image_info) (int image, |
eric@141 | 39 | input_attributes_t input_attributes, |
eric@141 | 40 | image_info_t *image_info); |
eric@141 | 41 | bool (*process_image) (int image, |
eric@141 | 42 | input_attributes_t input_attributes, |
eric@141 | 43 | image_info_t *image_info, |
eric@141 | 44 | pdf_page_handle page); |
eric@141 | 45 | } input_handler_t; |
eric@141 | 46 | |
eric@141 | 47 | |
eric@141 | 48 | void install_input_handler (input_handler_t *handler); |
eric@141 | 49 | |
eric@141 | 50 | |
eric@141 | 51 | bool open_input_file (char *name); |
eric@141 | 52 | bool close_input_file (void); |
eric@141 | 53 | bool last_input_page (void); |
eric@141 | 54 | bool get_image_info (int image, |
eric@141 | 55 | input_attributes_t input_attributes, |
eric@141 | 56 | image_info_t *image_info); |
eric@141 | 57 | bool process_image (int image, |
eric@141 | 58 | input_attributes_t input_attributes, |
eric@141 | 59 | image_info_t *image_info, |
eric@141 | 60 | pdf_page_handle page); |
eric@141 | 61 | |
eric@141 | 62 | |
eric@141 | 63 | void init_tiff_handler (void); |
eric@141 | 64 | void init_jpeg_handler (void); |