tumble_input.h

Mon, 14 Dec 2009 16:15:04 +0000

author
Philip Pemberton <philpem@philpem.me.uk>
date
Mon, 14 Dec 2009 16:15:04 +0000
changeset 168
ad0b9a8990ac
parent 166
301f6f17c364
permissions
-rw-r--r--

added support for TIFF Photometric Tag

eric@141 1 /*
eric@141 2 * tumble: build a PDF file from image files
eric@141 3 *
eric@157 4 * $Id: tumble_input.h,v 1.3 2003/04/10 00:47:30 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;
philpem@168 30 uint16_t tiff_photometric_tag;
eric@141 31 } image_info_t;
eric@141 32
eric@141 33
eric@141 34 typedef struct
eric@141 35 {
eric@151 36 bool (*match_suffix) (char *suffix);
eric@141 37 bool (*open_input_file) (FILE *f, char *name);
eric@141 38 bool (*close_input_file) (void);
eric@141 39 bool (*last_input_page) (void);
eric@141 40 bool (*get_image_info) (int image,
eric@141 41 input_attributes_t input_attributes,
eric@141 42 image_info_t *image_info);
eric@141 43 bool (*process_image) (int image,
eric@141 44 input_attributes_t input_attributes,
eric@141 45 image_info_t *image_info,
eric@141 46 pdf_page_handle page);
eric@141 47 } input_handler_t;
eric@141 48
eric@141 49
eric@141 50 void install_input_handler (input_handler_t *handler);
eric@141 51
eric@141 52
eric@151 53 bool match_input_suffix (char *suffix);
eric@141 54 bool open_input_file (char *name);
eric@141 55 bool close_input_file (void);
eric@141 56 bool last_input_page (void);
eric@141 57 bool get_image_info (int image,
eric@141 58 input_attributes_t input_attributes,
eric@141 59 image_info_t *image_info);
eric@141 60 bool process_image (int image,
eric@141 61 input_attributes_t input_attributes,
eric@141 62 image_info_t *image_info,
eric@141 63 pdf_page_handle page);
eric@141 64
eric@141 65
eric@141 66 void init_tiff_handler (void);
eric@141 67 void init_jpeg_handler (void);
eric@157 68 void init_pbm_handler (void);
philpem@166 69 void init_png_handler (void);
philpem@166 70 void init_jp2_handler (void);