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

More fax modem tweaks

上级 887c373c
...@@ -34,6 +34,11 @@ ...@@ -34,6 +34,11 @@
/*! \page image_translate_page Image translation /*! \page image_translate_page Image translation
\section image_translate_page_sec_1 What does it do? \section image_translate_page_sec_1 What does it do?
The image translate functions allow an image to be translated and resized between
various colour an monochrome formats. It also allows a colour or gray-scale image
to be reduced to a bi-level monochrome image. This is useful for preparing images
to be sent as traditional bi-level FAX pages.
\section image_translate_page_sec_2 How does it work? \section image_translate_page_sec_2 How does it work?
\section image_translate_page_sec_3 How do I use it? \section image_translate_page_sec_3 How do I use it?
......
...@@ -115,9 +115,15 @@ struct fax_modems_state_s ...@@ -115,9 +115,15 @@ struct fax_modems_state_s
/*! \brief The current receive signal handler */ /*! \brief The current receive signal handler */
span_rx_handler_t rx_handler; span_rx_handler_t rx_handler;
/*! \brief The current receive signal handler. Actual receiving hops between this
and a dummy receive routine. */
span_rx_handler_t base_rx_handler;
void *rx_user_data; void *rx_user_data;
/*! \brief The current receive missing signal fill-in handler */ /*! \brief The current receive missing signal fill-in handler */
span_rx_fillin_handler_t rx_fillin_handler; span_rx_fillin_handler_t rx_fillin_handler;
/*! \brief The current receive signal fillin handler. Actual receiving hops between this
and a dummy receive routine. */
span_rx_fillin_handler_t base_rx_fillin_handler;
void *rx_fillin_user_data; void *rx_fillin_user_data;
/*! \brief The current transmit signal handler */ /*! \brief The current transmit signal handler */
......
...@@ -59,10 +59,6 @@ typedef struct ...@@ -59,10 +59,6 @@ typedef struct
{ {
/*! \brief The FAX modem set for the audio side fo the gateway. */ /*! \brief The FAX modem set for the audio side fo the gateway. */
fax_modems_state_t modems; fax_modems_state_t modems;
/*! \brief The current receive signal handler. Actual receiving hops between this
and a dummy receive routine. */
span_rx_handler_t base_rx_handler;
span_rx_fillin_handler_t base_rx_fillin_handler;
} t38_gateway_audio_state_t; } t38_gateway_audio_state_t;
/*! /*!
......
...@@ -62,7 +62,7 @@ struct t85_encode_state_s ...@@ -62,7 +62,7 @@ struct t85_encode_state_s
uint32_t xd; uint32_t xd;
/*! The height of the full image, in pixels */ /*! The height of the full image, in pixels */
uint32_t yd; uint32_t yd;
/*! Then number of rows per stripe */ /*! The number of rows per stripe */
uint32_t l0; uint32_t l0;
/*! Maximum ATMOVE window size (0 - 127) */ /*! Maximum ATMOVE window size (0 - 127) */
int mx; int mx;
......
...@@ -87,6 +87,12 @@ SPAN_DECLARE(int) t85_encode_set_row_read_handler(t85_encode_state_t *s, ...@@ -87,6 +87,12 @@ SPAN_DECLARE(int) t85_encode_set_row_read_handler(t85_encode_state_t *s,
t4_row_read_handler_t handler, t4_row_read_handler_t handler,
void *user_data); void *user_data);
/*! Get the logging context associated with a T.85 encode context.
\brief Get the logging context associated with a T.85 encode context.
\param s The T.85 encode context.
\return A pointer to the logging context */
SPAN_DECLARE(logging_state_t *) t85_encode_get_logging_state(t85_encode_state_t *s);
/*! \brief Prepare to encode an image in T.85 format. /*! \brief Prepare to encode an image in T.85 format.
\param s The T.85 context. \param s The T.85 context.
\param image_width Image width, in pixels. \param image_width Image width, in pixels.
...@@ -164,6 +170,12 @@ SPAN_DECLARE(int) t85_encode_get_compressed_image_size(t85_encode_state_t *s); ...@@ -164,6 +170,12 @@ SPAN_DECLARE(int) t85_encode_get_compressed_image_size(t85_encode_state_t *s);
\param s The T.85 context. */ \param s The T.85 context. */
SPAN_DECLARE(void) t85_encode_abort(t85_encode_state_t *s); SPAN_DECLARE(void) t85_encode_abort(t85_encode_state_t *s);
/*! Get the logging context associated with a T.85 decode context.
\brief Get the logging context associated with a T.85 decode context.
\param s The T.85 decode context.
\return A pointer to the logging context */
SPAN_DECLARE(logging_state_t *) t85_decode_get_logging_state(t85_decode_state_t *s);
/*! \brief Prepare to decode an image in T.85 format. /*! \brief Prepare to decode an image in T.85 format.
\param s The T.85 context. \param s The T.85 context.
\param handler A callback routine to handle decoded image rows. \param handler A callback routine to handle decoded image rows.
......
...@@ -260,14 +260,7 @@ static int get_tiff_directory_info(t4_tx_state_t *s) ...@@ -260,14 +260,7 @@ static int get_tiff_directory_info(t4_tx_state_t *s)
} }
t4_tx_set_image_width(s, s->image_width); t4_tx_set_image_width(s, s->image_width);
t4_tx_set_image_length(s, s->image_length); t4_tx_set_image_length(s, s->image_length);
switch (s->line_encoding) t4_tx_set_max_2d_rows_per_1d_row(s, -s->metadata.y_resolution);
{
case T4_COMPRESSION_ITU_T4_1D:
case T4_COMPRESSION_ITU_T4_2D:
case T4_COMPRESSION_ITU_T6:
t4_t6_encode_set_max_2d_rows_per_1d_row(&s->encoder.t4_t6, -s->metadata.y_resolution);
break;
}
#if defined(SPANDSP_SUPPORT_TIFF_FX) #if defined(SPANDSP_SUPPORT_TIFF_FX)
if (TIFFGetField(t->tiff_file, TIFFTAG_PROFILETYPE, &parm32)) if (TIFFGetField(t->tiff_file, TIFFTAG_PROFILETYPE, &parm32))
span_log(&s->logging, SPAN_LOG_FLOW, "Profile type %u\n", parm32); span_log(&s->logging, SPAN_LOG_FLOW, "Profile type %u\n", parm32);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论