提交 d3dbde63 authored 作者: Steve Underwood's avatar Steve Underwood

More moves towards colour FAX

上级 931c633e
......@@ -50,11 +50,12 @@ MOSTLYCLEANFILES = ${DISTCLEANFILES}
MAINTAINERCLEANFILES = ${DISTCLEANFILES}
EXTRA_DIST = floating_fudge.h \
libspandsp.dsp \
libspandsp.2005.sln \
libspandsp.2008.sln \
libspandsp.2005.vcproj \
libspandsp.2008.vcproj \
libspandsp.2010.vcproj \
libspandsp.2012.vcproj \
libtiff.2005.vcproj \
libtiff.2008.vcproj \
filter_tools.c \
......@@ -475,37 +476,18 @@ v29tx.lo: ${V29_TX_INCL}
v29tx_rrc.h: make_modem_filter$(EXEEXT)
./make_modem_filter$(EXEEXT) -m V.29 -t >v29tx_rrc.h
DSP = libspandsp.dsp
VCPROJ8 = libspandsp.2005.vcproj
VCPROJ9 = libspandsp.2008.vcproj
VCPROJ10 = libspandsp.2010.vcproj
VCPROJ12 = libspandsp.2012.vcproj
WIN32SOURCES = $(libspandsp_la_SOURCES) .\\msvc\\gettimeofday.c
WIN32HEADERS = $(nobase_include_HEADERS) spandsp.h
DSPOUT = | awk '{printf("%s\r\n", $$0)}' >> $(DSP)
VCPROJOUT8 = | awk '{printf("%s\r\n", $$0)}' >> $(VCPROJ8)
VCPROJOUT9 = | awk '{printf("%s\r\n", $$0)}' >> $(VCPROJ9)
$(DSP): msvc/msvcproj.head msvc/msvcproj.foot Makefile.am
echo "creating $(DSP)"
@(cp $(srcdir)/msvc/msvcproj.head $(DSP); \
echo "# Begin Group \"Source Files\"" $(DSPOUT); \
for file in $(WIN32SOURCES); do \
echo "# Begin Source File" $(DSPOUT); \
echo "" $(DSPOUT); \
echo "SOURCE=.\\"$$file $(DSPOUT); \
echo "# End Source File" $(DSPOUT); \
done; \
echo "# End Group" $(DSPOUT); \
echo "# Begin Group \"Header Files\"" $(DSPOUT); \
for file in $(WIN32HEADERS); do \
echo "# Begin Source File" $(DSPOUT); \
echo "" $(DSPOUT); \
echo "SOURCE=.\\"$$file $(DSPOUT); \
echo "# End Source File" $(DSPOUT); \
done; \
echo "# End Group" $(DSPOUT); \
cat $(srcdir)/msvc/msvcproj.foot $(DSPOUT) )
VCPROJOUT10 = | awk '{printf("%s\r\n", $$0)}' >> $(VCPROJ10)
VCPROJOUT12 = | awk '{printf("%s\r\n", $$0)}' >> $(VCPROJ12)
$(VCPROJ8): msvc/vc8proj.head msvc/vc8proj.foot Makefile.am
echo "creating $(VCPROJ8)"
......@@ -531,6 +513,30 @@ $(VCPROJ9): msvc/vc9proj.head msvc/vc9proj.foot Makefile.am
done; \
cat $(srcdir)/msvc/vc9proj.foot $(VCPROJOUT9) )
$(VCPROJ10): msvc/vc10proj.head msvc/vc10proj.foot Makefile.am
echo "creating $(VCPROJ10)"
@(cp $(srcdir)/msvc/vc10proj.head $(VCPROJ10); \
for file in $(WIN32SOURCES); do \
echo "<File RelativePath=\""$$file"\"></File>" $(VCPROJOUT10); \
done; \
echo "</Filter><Filter Name=\"Header Files\">" $(VCPROJOUT10); \
for file in $(WIN32HEADERS); do \
echo "<File RelativePath=\""$$file"\"></File>" $(VCPROJOUT10); \
done; \
cat $(srcdir)/msvc/vc10proj.foot $(VCPROJOUT10) )
$(VCPROJ12): msvc/vc12proj.head msvc/vc12proj.foot Makefile.am
echo "creating $(VCPROJ12)"
@(cp $(srcdir)/msvc/vc12proj.head $(VCPROJ12); \
for file in $(WIN32SOURCES); do \
echo "<File RelativePath=\""$$file"\"></File>" $(VCPROJOUT12); \
done; \
echo "</Filter><Filter Name=\"Header Files\">" $(VCPROJOUT12); \
for file in $(WIN32HEADERS); do \
echo "<File RelativePath=\""$$file"\"></File>" $(VCPROJOUT12); \
done; \
cat $(srcdir)/msvc/vc12proj.foot $(VCPROJOUT12) )
$(srcdir)/msvc/spandsp.h: spandsp.h.in
echo "creating $(srcdir)/msvc/spandsp.h"
@sed -e "s/#define _SPANDSP_H_/#define _SPANDSP_H_\n\n#define __inline__ __inline\n#pragma warning(disable:4200)/" \
......
差异被折叠。
......@@ -226,8 +226,6 @@ struct t30_state_s
int mutual_bilevel_resolutions;
/*! \brief The common group supported colour image resolutions. */
int mutual_colour_resolutions;
/*! \brief The image coding to be used on the line for non-bilevel images. */
int multilevel_line_encoding;
/*! \brief The image coding being used on the line. */
int line_encoding;
/*! \brief The image coding being used for output files. */
......@@ -238,6 +236,8 @@ struct t30_state_s
int x_resolution;
/*! \brief The Y direction resolution of the current image, in pixels per metre. */
int y_resolution;
/*! \brief The resolution code for the current page. */
int current_page_resolution;
/*! \brief The width of the current image, in pixels. */
t4_image_width_t image_width;
/*! \brief Current number of retries of the action in progress. */
......
......@@ -228,7 +228,7 @@
#define T30_DCS_BIT_DUPLEX_CAPABLE 67
#define T30_DIS_BIT_T81_CAPABLE 68
#define T30_DCS_BIT_FULL_COLOUR_MODEX 68
#define T30_DCS_BIT_T81_MODE 68
#define T30_DIS_BIT_FULL_COLOUR_CAPABLE 69
#define T30_DCS_BIT_FULL_COLOUR_MODE 69
......
......@@ -98,10 +98,6 @@ struct t4_tx_state_s
/*! \brief The type of compression used between the FAX machines. */
int line_encoding;
int line_encoding_bilevel;
int line_encoding_gray;
int line_encoding_colour;
/*! \brief When superfine and fine resolution images need to be squahed vertically
to a lower resolution, this value sets the number of source rows which
must be squashed to form each row on the wire. */
......
......@@ -352,19 +352,6 @@ typedef struct
extern "C" {
#endif
/*! Get the logging context associated with a T.4 receive context.
\brief Get the logging context associated with a T.4 receive context.
\param s The T.4 receive context.
\return A pointer to the logging context */
SPAN_DECLARE(logging_state_t *) t4_rx_get_logging_state(t4_rx_state_t *s);
/*! \brief Prepare for reception of a document.
\param s The T.4 context.
\param file The name of the file to be received.
\param output_encoding The output encoding.
\return A pointer to the context, or NULL if there was a problem. */
SPAN_DECLARE(t4_rx_state_t *) t4_rx_init(t4_rx_state_t *s, const char *file, int output_encoding);
/*! \brief Prepare to receive the next page of the current document.
\param s The T.4 context.
\return zero for success, -1 for failure. */
......@@ -388,20 +375,6 @@ SPAN_DECLARE(int) t4_rx_put(t4_rx_state_t *s, const uint8_t buf[], size_t len);
\return 0 for success, otherwise -1. */
SPAN_DECLARE(int) t4_rx_end_page(t4_rx_state_t *s);
/*! \brief End reception of a document. Tidy up and close the file.
This should be used to end T.4 reception started with
t4_rx_init.
\param s The T.4 receive context.
\return 0 for success, otherwise -1. */
SPAN_DECLARE(int) t4_rx_release(t4_rx_state_t *s);
/*! \brief End reception of a document. Tidy up, close the file and
free the context. This should be used to end T.4 reception
started with t4_rx_init.
\param s The T.4 receive context.
\return 0 for success, otherwise -1. */
SPAN_DECLARE(int) t4_rx_free(t4_rx_state_t *s);
/*! \brief Set the row write handler for a T.4 receive context.
\param s The T.4 receive context.
\param handler A pointer to the handler routine.
......@@ -473,6 +446,32 @@ SPAN_DECLARE(const char *) t4_encoding_to_str(int encoding);
\return A pointer to the string. */
SPAN_DECLARE(const char *) t4_image_type_to_str(int type);
/*! Get the logging context associated with a T.4 receive context.
\brief Get the logging context associated with a T.4 receive context.
\param s The T.4 receive context.
\return A pointer to the logging context */
SPAN_DECLARE(logging_state_t *) t4_rx_get_logging_state(t4_rx_state_t *s);
/*! \brief Prepare for reception of a document.
\param s The T.4 context.
\param file The name of the file to be received.
\param output_encoding The output encoding.
\return A pointer to the context, or NULL if there was a problem. */
SPAN_DECLARE(t4_rx_state_t *) t4_rx_init(t4_rx_state_t *s, const char *file, int output_encoding);
/*! \brief End reception of a document. Tidy up and close the file.
This should be used to end T.4 reception started with t4_rx_init.
\param s The T.4 receive context.
\return 0 for success, otherwise -1. */
SPAN_DECLARE(int) t4_rx_release(t4_rx_state_t *s);
/*! \brief End reception of a document. Tidy up, close the file and
free the context. This should be used to end T.4 reception
started with t4_rx_init.
\param s The T.4 receive context.
\return 0 for success, otherwise -1. */
SPAN_DECLARE(int) t4_rx_free(t4_rx_state_t *s);
#if defined(__cplusplus)
}
#endif
......
......@@ -221,20 +221,6 @@ extern "C" {
SPAN_DECLARE(void) TIFF_FX_init(void);
#endif
/*! Get the logging context associated with a T.4 transmit context.
\brief Get the logging context associated with a T.4 transmit context.
\param s The T.4 transmit context.
\return A pointer to the logging context */
SPAN_DECLARE(logging_state_t *) t4_tx_get_logging_state(t4_tx_state_t *s);
/*! \brief Prepare for transmission of a document.
\param s The T.4 context.
\param file The name of the file to be sent.
\param start_page The first page to send. -1 for no restriction.
\param stop_page The last page to send. -1 for no restriction.
\return A pointer to the context, or NULL if there was a problem. */
SPAN_DECLARE(t4_tx_state_t *) t4_tx_init(t4_tx_state_t *s, const char *file, int start_page, int stop_page);
/*! \brief Prepare to send the next page of the current document.
\param s The T.4 context.
\return zero for success, -1 for failure. */
......@@ -281,19 +267,6 @@ SPAN_DECLARE(int) t4_tx_get_bit(t4_tx_state_t *s);
indicates that the end of the document has been reached. */
SPAN_DECLARE(int) t4_tx_get(t4_tx_state_t *s, uint8_t buf[], size_t max_len);
/*! \brief End the transmission of a document. Tidy up and close the file.
This should be used to end T.4 transmission started with t4_tx_init.
\param s The T.4 context.
\return 0 for success, otherwise -1. */
SPAN_DECLARE(int) t4_tx_release(t4_tx_state_t *s);
/*! \brief End the transmission of a document. Tidy up, close the file and
free the context. This should be used to end T.4 transmission
started with t4_tx_init.
\param s The T.4 context.
\return 0 for success, otherwise -1. */
SPAN_DECLARE(int) t4_tx_free(t4_tx_state_t *s);
/*! \brief Set the encoding for the encoded data.
\param s The T.4 context.
\param encoding The encoding.
......@@ -389,6 +362,33 @@ SPAN_DECLARE(int) t4_tx_get_current_page_in_file(t4_tx_state_t *s);
\param t A pointer to a statistics structure. */
SPAN_DECLARE(void) t4_tx_get_transfer_statistics(t4_tx_state_t *s, t4_stats_t *t);
/*! Get the logging context associated with a T.4 transmit context.
\brief Get the logging context associated with a T.4 transmit context.
\param s The T.4 transmit context.
\return A pointer to the logging context */
SPAN_DECLARE(logging_state_t *) t4_tx_get_logging_state(t4_tx_state_t *s);
/*! \brief Prepare for transmission of a document.
\param s The T.4 context.
\param file The name of the file to be sent.
\param start_page The first page to send. -1 for no restriction.
\param stop_page The last page to send. -1 for no restriction.
\return A pointer to the context, or NULL if there was a problem. */
SPAN_DECLARE(t4_tx_state_t *) t4_tx_init(t4_tx_state_t *s, const char *file, int start_page, int stop_page);
/*! \brief End the transmission of a document. Tidy up and close the file.
This should be used to end T.4 transmission started with t4_tx_init.
\param s The T.4 context.
\return 0 for success, otherwise -1. */
SPAN_DECLARE(int) t4_tx_release(t4_tx_state_t *s);
/*! \brief End the transmission of a document. Tidy up, close the file and
free the context. This should be used to end T.4 transmission
started with t4_tx_init.
\param s The T.4 context.
\return 0 for success, otherwise -1. */
SPAN_DECLARE(int) t4_tx_free(t4_tx_state_t *s);
#if defined(__cplusplus)
}
#endif
......
......@@ -149,7 +149,6 @@ static int set_tiff_directory_info(t4_rx_state_t *s)
int bits_per_sample;
int samples_per_pixel;
int photometric;
int image_length;
t = &s->tiff;
/* Prepare the directory entry fully before writing the image, or libtiff complains */
......@@ -276,7 +275,7 @@ static int set_tiff_directory_info(t4_rx_state_t *s)
/* TIFF page numbers start from zero, so the number of pages in the file
is always one greater than the highest page number in the file. */
s->tiff.pages_in_file = s->current_page + 1;
image_length = 0;
s->image_length = 0;
switch (s->line_encoding)
{
case T4_COMPRESSION_T4_1D:
......@@ -297,23 +296,23 @@ static int set_tiff_directory_info(t4_rx_state_t *s)
}
/* Fall through */
case T4_COMPRESSION_T6:
image_length = t4_t6_decode_get_image_length(&s->decoder.t4_t6);
s->image_length = t4_t6_decode_get_image_length(&s->decoder.t4_t6);
break;
case T4_COMPRESSION_T42_T81:
image_length = t42_decode_get_image_length(&s->decoder.t42);
s->image_length = t42_decode_get_image_length(&s->decoder.t42);
break;
#if defined(SPANDSP_SUPPORT_T43)
case T4_COMPRESSION_T43:
image_length = t43_decode_get_image_length(&s->decoder.t43);
s->image_length = t43_decode_get_image_length(&s->decoder.t43);
break;
#endif
case T4_COMPRESSION_T85:
case T4_COMPRESSION_T85_L0:
image_length = t85_decode_get_image_length(&s->decoder.t85);
s->image_length = t85_decode_get_image_length(&s->decoder.t85);
break;
}
TIFFSetField(t->tiff_file, TIFFTAG_IMAGELENGTH, image_length);
TIFFSetField(t->tiff_file, TIFFTAG_ROWSPERSTRIP, image_length);
TIFFSetField(t->tiff_file, TIFFTAG_IMAGELENGTH, s->image_length);
TIFFSetField(t->tiff_file, TIFFTAG_ROWSPERSTRIP, s->image_length);
#if defined(SPANDSP_SUPPORT_TIFF_FX)
TIFFSetField(t->tiff_file, TIFFTAG_PROFILETYPE, PROFILETYPE_G3_FAX);
TIFFSetField(t->tiff_file, TIFFTAG_FAXPROFILE, FAXPROFILE_S);
......
......@@ -52,10 +52,10 @@ do
FILE="${ITUTESTS_DIR}/striped.tif"
run_fax_test
FILE="${ITUTESTS_DIR}/mixed_size_pages.tif"
run_fax_test
FILE="${ITUTESTS_DIR}/bilevel_R8_385_A4.tif"
run_fax_test
......
......@@ -285,15 +285,15 @@ int main(int argc, char *argv[])
T4_COMPRESSION_T4_1D,
T4_COMPRESSION_T4_2D,
T4_COMPRESSION_T6,
T4_COMPRESSION_T85,
T4_COMPRESSION_T85_L0,
#if defined(SPANDSP_SUPPORT_T42x)
T4_COMPRESSION_T42,
T4_COMPRESSION_SYCC_T42,
T4_COMPRESSION_T42_T81,
T4_COMPRESSION_SYCC_T81,
#endif
#if defined(SPANDSP_SUPPORT_T43x)
T4_COMPRESSION_T43,
#endif
T4_COMPRESSION_T85,
T4_COMPRESSION_T85_L0,
//T4_COMPRESSION_T45,
-1
};
......@@ -366,10 +366,15 @@ int main(int argc, char *argv[])
compression = T4_COMPRESSION_T6;
compression_step = -1;
}
else if (strcmp(optarg, "T85") == 0)
{
compression = T4_COMPRESSION_T85;
compression_step = -1;
}
#if defined(SPANDSP_SUPPORT_T42)
else if (strcmp(optarg, "T42") == 0)
else if (strcmp(optarg, "T81") == 0)
{
compression = T4_COMPRESSION_T42;
compression = T4_COMPRESSION_T42_T81;
compression_step = -1;
}
#endif
......@@ -380,11 +385,6 @@ int main(int argc, char *argv[])
compression_step = -1;
}
#endif
else if (strcmp(optarg, "T85") == 0)
{
compression = T4_COMPRESSION_T85;
compression_step = -1;
}
break;
case 'd':
decode_file_name = optarg;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论