tumble_input.h

Thu, 20 Mar 2003 06:54:08 +0000

author
eric
date
Thu, 20 Mar 2003 06:54:08 +0000
changeset 141
752599b50ff3
child 151
83a99cc69861
permissions
-rw-r--r--

more JPEG support. added input file handler API.

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