## License along with this program; if not, write to the Free Software
## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
##
-## $Id: Makefile.am,v 1.127 2009/02/25 15:30:21 steveu Exp $
+## $Id: Makefile.am,v 1.128 2009/03/01 12:49:28 steveu Exp $
AM_CFLAGS = $(COMP_VENDOR_CFLAGS)
AM_LDFLAGS = $(COMP_VENDOR_LDFLAGS)
at_interpreter_dictionary.h: make_at_dictionary$(EXEEXT)
./make_at_dictionary$(EXEEXT) >at_interpreter_dictionary.h
+t4.$(OBJEXT): spandsp/version.h
+
+t4.lo: spandsp/version.h
+
v17rx.$(OBJEXT): v17rx_fixed_rrc.h v17rx_floating_rrc.h
v17rx.lo: v17rx_fixed_rrc.h v17rx_floating_rrc.h
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: bit_operations.h,v 1.25 2009/02/24 14:14:03 steveu Exp $
+ * $Id: bit_operations.h,v 1.26 2009/02/26 16:08:50 steveu Exp $
*/
/*! \file */
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: fast_convert.h,v 1.5 2009/02/24 14:14:03 steveu Exp $
+ * $Id: fast_convert.h,v 1.6 2009/02/26 16:08:51 steveu Exp $
*/
#if !defined(_SPANDSP_FAST_CONVERT_H_)
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: version.h.in,v 1.2 2007/04/06 13:20:36 steveu Exp $
+ * $Id: version.h.in,v 1.3 2009/03/01 12:39:02 steveu Exp $
*/
#if !defined(_SPANDSP_VERSION_H_)
/* The date and time of the version are in UTC form. */
-#define SPANDSP_RELEASE_DATE 20090226
-#define SPANDSP_RELEASE_TIME 121601
+#define SPANDSP_RELEASE_DATE 20090301
+#define SPANDSP_RELEASE_TIME 125126
+#define SPANDSP_RELEASE_DATETIME_STRING "20090301 125126"
#endif
/*- End of file ------------------------------------------------------------*/
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: version.h.in,v 1.2 2007/04/06 13:20:36 steveu Exp $
+ * $Id: version.h.in,v 1.3 2009/03/01 12:39:02 steveu Exp $
*/
#if !defined(_SPANDSP_VERSION_H_)
/* The date and time of the version are in UTC form. */
-#define SPANDSP_RELEASE_DATE $SPANDSP_RELEASE_DATE
-#define SPANDSP_RELEASE_TIME $SPANDSP_RELEASE_TIME
+#define SPANDSP_RELEASE_DATE $SPANDSP_RELEASE_DATE
+#define SPANDSP_RELEASE_TIME $SPANDSP_RELEASE_TIME
+#define SPANDSP_RELEASE_DATETIME_STRING "$SPANDSP_RELEASE_DATE $SPANDSP_RELEASE_TIME"
#endif
/*- End of file ------------------------------------------------------------*/
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: t4.c,v 1.127 2009/02/21 04:27:46 steveu Exp $
+ * $Id: t4.c,v 1.128 2009/03/01 11:47:03 steveu Exp $
*/
/*
#include "spandsp/bit_operations.h"
#include "spandsp/async.h"
#include "spandsp/t4.h"
+#include "spandsp/version.h"
#include "spandsp/private/logging.h"
#include "spandsp/private/t4.h"
TIFFSetField(t->tiff_file, TIFFTAG_RESOLUTIONUNIT, resunit);
#endif
/* TODO: add the version of spandsp */
- TIFFSetField(t->tiff_file, TIFFTAG_SOFTWARE, "spandsp");
+ TIFFSetField(t->tiff_file, TIFFTAG_SOFTWARE, "Spandsp " SPANDSP_RELEASE_DATETIME_STRING);
if (gethostname(buf, sizeof(buf)) == 0)
TIFFSetField(t->tiff_file, TIFFTAG_HOSTCOMPUTER, buf);
if (t->photo_metric != PHOTOMETRIC_MINISWHITE)
span_log(&s->logging, SPAN_LOG_FLOW, "%s: Photometric needs swapping.\n", s->file);
t->fill_order = FILLORDER_LSB2MSB;
+#if 0
TIFFGetField(t->tiff_file, TIFFTAG_FILLORDER, &t->fill_order);
if (t->fill_order != FILLORDER_LSB2MSB)
span_log(&s->logging, SPAN_LOG_FLOW, "%s: Fill order needs swapping.\n", s->file);
+#endif
/* Allow a little range for the X resolution in centimeters. The spec doesn't pin down the
precise value. The other value should be exact. */
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: generate_etsi_300_242_pages.c,v 1.3 2009/02/20 12:34:20 steveu Exp $
+ * $Id: generate_etsi_300_242_pages.c,v 1.4 2009/03/01 12:39:02 steveu Exp $
*/
/*! \file */
},
};
-int reverse_photo_metric = FALSE;
-int reverse_fill_order = FALSE;
+int photo_metric = PHOTOMETRIC_MINISWHITE;
+int fill_order = FILLORDER_LSB2MSB;
static void clear_row(uint8_t buf[], int width)
{
{
clear_row(image_buffer, 1728);
set_pixel_range(image_buffer, 1, start_pixel, start_pixel + 63);
- if (reverse_photo_metric)
+ if (photo_metric != PHOTOMETRIC_MINISWHITE)
{
for (i = 0; i < 1728/8; i++)
image_buffer[i] = ~image_buffer[i];
}
- if (reverse_fill_order)
+#if 0
+ if (fill_order != FILLORDER_LSB2MSB)
bit_reverse(image_buffer, image_buffer, 1728/8);
+#endif
if (TIFFWriteScanline(tiff_file, image_buffer, row, 0) < 0)
{
printf("Write error at row %d.\n", row);
float y_resolution;
int i;
int image_length;
+ int opt;
+ int compression;
+
+ compression = T4_COMPRESSION_ITU_T6;
+ photo_metric = PHOTOMETRIC_MINISWHITE;
+ fill_order = FILLORDER_LSB2MSB;
+ while ((opt = getopt(argc, argv, "126ir")) != -1)
+ {
+ switch (opt)
+ {
+ case '1':
+ compression = T4_COMPRESSION_ITU_T4_1D;
+ break;
+ case '2':
+ compression = T4_COMPRESSION_ITU_T4_2D;
+ break;
+ case '6':
+ compression = T4_COMPRESSION_ITU_T6;
+ break;
+ case 'i':
+ photo_metric = PHOTOMETRIC_MINISBLACK;
+ break;
+ case 'r':
+ fill_order = FILLORDER_MSB2LSB;
+ break;
+ default:
+ //usage();
+ exit(2);
+ break;
+ }
+ }
tiff_file = NULL;
for (i = 0; sequence[i].name; i++)
TIFFSetField(tiff_file, TIFFTAG_SAMPLESPERPIXEL, 1);
TIFFSetField(tiff_file, TIFFTAG_ROWSPERSTRIP, -1L);
TIFFSetField(tiff_file, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
- if (reverse_photo_metric)
- TIFFSetField(tiff_file, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK);
- else
- TIFFSetField(tiff_file, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISWHITE);
- if (reverse_fill_order)
- TIFFSetField(tiff_file, TIFFTAG_FILLORDER, FILLORDER_MSB2LSB);
- else
- TIFFSetField(tiff_file, TIFFTAG_FILLORDER, FILLORDER_LSB2MSB);
+ TIFFSetField(tiff_file, TIFFTAG_PHOTOMETRIC, photo_metric);
+ TIFFSetField(tiff_file, TIFFTAG_FILLORDER, fill_order);
x_resolution = sequence[i].x_res/100.0f;
y_resolution = sequence[i].y_res/100.0f;
TIFFSetField(tiff_file, TIFFTAG_XRESOLUTION, floorf(x_resolution*2.54f + 0.5f));
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: generate_sized_pages.c,v 1.2 2008/07/10 13:34:01 steveu Exp $
+ * $Id: generate_sized_pages.c,v 1.3 2009/03/01 12:39:02 steveu Exp $
*/
/*! \file */
float x_resolution;
float y_resolution;
int i;
+ int opt;
+ int compression;
+ int photo_metric;
+ int fill_order;
+
+ compression = T4_COMPRESSION_ITU_T6;
+ photo_metric = PHOTOMETRIC_MINISWHITE;
+ fill_order = FILLORDER_LSB2MSB;
+ while ((opt = getopt(argc, argv, "126ir")) != -1)
+ {
+ switch (opt)
+ {
+ case '1':
+ compression = T4_COMPRESSION_ITU_T4_1D;
+ break;
+ case '2':
+ compression = T4_COMPRESSION_ITU_T4_2D;
+ break;
+ case '6':
+ compression = T4_COMPRESSION_ITU_T6;
+ break;
+ case 'i':
+ photo_metric = PHOTOMETRIC_MINISBLACK;
+ break;
+ case 'r':
+ fill_order = FILLORDER_MSB2LSB;
+ break;
+ default:
+ //usage();
+ exit(2);
+ break;
+ }
+ }
for (i = 0; sequence[i].name; i++)
{
exit(2);
/* Prepare the directory entry fully before writing the image, or libtiff complains */
- TIFFSetField(tiff_file, TIFFTAG_COMPRESSION, COMPRESSION_CCITT_T6);
+ TIFFSetField(tiff_file, TIFFTAG_COMPRESSION, compression);
TIFFSetField(tiff_file, TIFFTAG_IMAGEWIDTH, sequence[i].width);
TIFFSetField(tiff_file, TIFFTAG_BITSPERSAMPLE, 1);
TIFFSetField(tiff_file, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
TIFFSetField(tiff_file, TIFFTAG_SAMPLESPERPIXEL, 1);
TIFFSetField(tiff_file, TIFFTAG_ROWSPERSTRIP, -1L);
TIFFSetField(tiff_file, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
- TIFFSetField(tiff_file, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISWHITE);
- TIFFSetField(tiff_file, TIFFTAG_FILLORDER, FILLORDER_LSB2MSB);
+ TIFFSetField(tiff_file, TIFFTAG_PHOTOMETRIC, photo_metric);
+ TIFFSetField(tiff_file, TIFFTAG_FILLORDER, fill_order);
x_resolution = sequence[i].x_res/100.0f;
y_resolution = sequence[i].y_res/100.0f;
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: t4_tests.c,v 1.67 2009/02/20 12:34:20 steveu Exp $
+ * $Id: t4_tests.c,v 1.68 2009/03/01 12:39:02 steveu Exp $
*/
/*! \file */
break;
}
}
+ else if (sscanf(buf, "%08x %02x %02x %02x", (unsigned int *) &bit, (unsigned int *) &bit, (unsigned int *) &bit, (unsigned int *) &bit) == 4)
+ {
+ for (i = 0; i < 16; i++)
+ {
+ if (sscanf(&buf[10 + 3*i], "%x", (unsigned int *) &bit) != 1)
+ break;
+ bit = bit_reverse8(bit);
+ if ((end_of_page = t4_rx_put_byte(&receive_state, bit)))
+ break;
+ }
+ }
else if (sscanf(buf, "Rx bit %*d - %d", &bit) == 1)
{
if ((end_of_page = t4_rx_put_bit(&receive_state, bit)))