start of JPEG support. changed word_type to word_t.

Wed, 12 Mar 2003 10:58:33 +0000

author
eric
date
Wed, 12 Mar 2003 10:58:33 +0000
changeset 108
9b35b78d4c91
parent 107
312753062c5b
child 109
663da96ad2bc

start of JPEG support. changed word_type to word_t.

t2p.c file | annotate | diff | revisions
tumble.c file | annotate | diff | revisions
     1.1 --- a/t2p.c	Wed Mar 12 10:57:55 2003 +0000
     1.2 +++ b/t2p.c	Wed Mar 12 10:58:33 2003 +0000
     1.3 @@ -4,7 +4,7 @@
     1.4   *      will be compressed using ITU-T T.6 (G4) fax encoding.
     1.5   *
     1.6   * Main program
     1.7 - * $Id: t2p.c,v 1.28 2003/03/10 05:08:25 eric Exp $
     1.8 + * $Id: t2p.c,v 1.29 2003/03/12 02:58:33 eric Exp $
     1.9   * Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com>
    1.10   *
    1.11   * This program is free software; you can redistribute it and/or modify
    1.12 @@ -287,9 +287,9 @@
    1.13  }
    1.14  
    1.15  
    1.16 -bool process_page (int image,  /* range 1 .. n */
    1.17 -		   input_attributes_t input_attributes,
    1.18 -		   bookmark_t *bookmarks)
    1.19 +bool process_tiff_page (int image,  /* range 1 .. n */
    1.20 +			input_attributes_t input_attributes,
    1.21 +			bookmark_t *bookmarks)
    1.22  {
    1.23    int result = 0;
    1.24  
    1.25 @@ -436,7 +436,7 @@
    1.26  
    1.27  #ifdef TIFF_REVERSE_BITS
    1.28    reverse_bits ((uint8_t *) bitmap->bits,
    1.29 -		image_length * bitmap->row_words * sizeof (word_type));
    1.30 +		image_length * bitmap->row_words * sizeof (word_t));
    1.31  #endif /* TIFF_REVERSE_BITS */
    1.32  
    1.33  #if 0
    1.34 @@ -486,6 +486,43 @@
    1.35  }
    1.36  
    1.37  
    1.38 +#if 0
    1.39 +bool process_jpeg_page (int image,  /* range 1 .. n */
    1.40 +			input_attributes_t input_attributes,
    1.41 +			bookmark_t *bookmarks)
    1.42 +{
    1.43 +  int result = 0;
    1.44 +  FILE *f;
    1.45 +  pdf_page_handle page;
    1.46 +
    1.47 +  f = fopen (filename, "rb");
    1.48 +  if (! f)
    1.49 +    fatal ("error opening input file '%s'\n", filename);
    1.50 +
    1.51 +  page = pdf_new_page (out->pdf, width_points, height_points);
    1.52 +
    1.53 +  pdf_write_jpeg_image (page,
    1.54 +			0, 0,  /* x, y */
    1.55 +			width_points, height_points,
    1.56 +			f);
    1.57 +
    1.58 +  return (result);
    1.59 +}
    1.60 +#endif
    1.61 +
    1.62 +
    1.63 +bool process_page (int image,  /* range 1 .. n */
    1.64 +		   input_attributes_t input_attributes,
    1.65 +		   bookmark_t *bookmarks)
    1.66 +{
    1.67 +  int result = 0;
    1.68 +
    1.69 +  result = process_tiff_page (image, input_attributes, bookmarks);
    1.70 +
    1.71 +  return (result);
    1.72 +}
    1.73 +
    1.74 +
    1.75  #define MAX_BOOKMARK_NAME_LEN 500
    1.76  
    1.77  
     2.1 --- a/tumble.c	Wed Mar 12 10:57:55 2003 +0000
     2.2 +++ b/tumble.c	Wed Mar 12 10:58:33 2003 +0000
     2.3 @@ -4,7 +4,7 @@
     2.4   *      will be compressed using ITU-T T.6 (G4) fax encoding.
     2.5   *
     2.6   * Main program
     2.7 - * $Id: tumble.c,v 1.28 2003/03/10 05:08:25 eric Exp $
     2.8 + * $Id: tumble.c,v 1.29 2003/03/12 02:58:33 eric Exp $
     2.9   * Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com>
    2.10   *
    2.11   * This program is free software; you can redistribute it and/or modify
    2.12 @@ -287,9 +287,9 @@
    2.13  }
    2.14  
    2.15  
    2.16 -bool process_page (int image,  /* range 1 .. n */
    2.17 -		   input_attributes_t input_attributes,
    2.18 -		   bookmark_t *bookmarks)
    2.19 +bool process_tiff_page (int image,  /* range 1 .. n */
    2.20 +			input_attributes_t input_attributes,
    2.21 +			bookmark_t *bookmarks)
    2.22  {
    2.23    int result = 0;
    2.24  
    2.25 @@ -436,7 +436,7 @@
    2.26  
    2.27  #ifdef TIFF_REVERSE_BITS
    2.28    reverse_bits ((uint8_t *) bitmap->bits,
    2.29 -		image_length * bitmap->row_words * sizeof (word_type));
    2.30 +		image_length * bitmap->row_words * sizeof (word_t));
    2.31  #endif /* TIFF_REVERSE_BITS */
    2.32  
    2.33  #if 0
    2.34 @@ -486,6 +486,43 @@
    2.35  }
    2.36  
    2.37  
    2.38 +#if 0
    2.39 +bool process_jpeg_page (int image,  /* range 1 .. n */
    2.40 +			input_attributes_t input_attributes,
    2.41 +			bookmark_t *bookmarks)
    2.42 +{
    2.43 +  int result = 0;
    2.44 +  FILE *f;
    2.45 +  pdf_page_handle page;
    2.46 +
    2.47 +  f = fopen (filename, "rb");
    2.48 +  if (! f)
    2.49 +    fatal ("error opening input file '%s'\n", filename);
    2.50 +
    2.51 +  page = pdf_new_page (out->pdf, width_points, height_points);
    2.52 +
    2.53 +  pdf_write_jpeg_image (page,
    2.54 +			0, 0,  /* x, y */
    2.55 +			width_points, height_points,
    2.56 +			f);
    2.57 +
    2.58 +  return (result);
    2.59 +}
    2.60 +#endif
    2.61 +
    2.62 +
    2.63 +bool process_page (int image,  /* range 1 .. n */
    2.64 +		   input_attributes_t input_attributes,
    2.65 +		   bookmark_t *bookmarks)
    2.66 +{
    2.67 +  int result = 0;
    2.68 +
    2.69 +  result = process_tiff_page (image, input_attributes, bookmarks);
    2.70 +
    2.71 +  return (result);
    2.72 +}
    2.73 +
    2.74 +
    2.75  #define MAX_BOOKMARK_NAME_LEN 500
    2.76  
    2.77