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