mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-12 12:37:05 +00:00
More tweaks towards colour FAXing
This commit is contained in:
1 parent
0b6c53217a
commit
3b595efc60
9 files changed
+29
-14
No files matched your search
@@ -74,6 +74,8 @@ SPAN_DECLARE(int) image_translate_get_output_length(image_translate_state_t *s);
|
||||
\return 0 for success, else -1. */
|
||||
SPAN_DECLARE(int) image_translate_set_row_read_handler(image_translate_state_t *s, t4_row_read_handler_t row_read_handler, void *row_read_user_data);
|
||||
|
||||
SPAN_DECLARE(int) image_translate_restart(image_translate_state_t *s, int input_length);
|
||||
|
||||
/*! \brief Initialise an image translation context for rescaling and squashing a gray scale
|
||||
or colour image to a bi-level FAX type image.
|
||||
\param s The image translation context.
|
||||
|
||||
@@ -163,6 +163,10 @@ struct t4_tx_state_s
|
||||
} encoder;
|
||||
|
||||
image_translate_state_t translator;
|
||||
uint8_t *pack_buf;
|
||||
int pack_ptr;
|
||||
int pack_row;
|
||||
int pack_bit_mask;
|
||||
|
||||
int apply_lab;
|
||||
lab_params_t lab_params;
|
||||
|
||||
@@ -479,7 +479,7 @@ typedef struct
|
||||
/*! \brief The size of the image, in bytes */
|
||||
int image_size;
|
||||
/*! \brief The type of compression used between the FAX machines */
|
||||
int encoding;
|
||||
int compression;
|
||||
/*! \brief The number of bad pixel rows in the most recent page. */
|
||||
int bad_rows;
|
||||
/*! \brief The largest number of bad pixel rows in a block in the most recent page. */
|
||||
|
||||
@@ -41,6 +41,17 @@ typedef struct t43_encode_state_s t43_encode_state_t;
|
||||
/*! State of a working instance of the T.43 decoder */
|
||||
typedef struct t43_decode_state_s t43_decode_state_t;
|
||||
|
||||
enum
|
||||
{
|
||||
T43_IMAGE_TYPE_RGB_BILEVEL = 0,
|
||||
T43_IMAGE_TYPE_CMY_BILEVEL = 1,
|
||||
T43_IMAGE_TYPE_CMYK_BILEVEL = 2,
|
||||
T43_IMAGE_TYPE_8BIT_COLOUR_PALETTE = 16,
|
||||
T43_IMAGE_TYPE_12BIT_COLOUR_PALETTE = 17,
|
||||
T43_IMAGE_TYPE_GRAY = 32,
|
||||
T43_IMAGE_TYPE_COLOUR = 48
|
||||
};
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
@@ -59,6 +70,8 @@ SPAN_DECLARE(int) t43_encode_set_image_length(t43_encode_state_t *s, uint32_t le
|
||||
|
||||
SPAN_DECLARE(void) t43_encode_abort(t43_encode_state_t *s);
|
||||
|
||||
SPAN_DECLARE(int) t43_encode_set_image_type(t43_encode_state_t *s, int image_type);
|
||||
|
||||
SPAN_DECLARE(void) t43_encode_comment(t43_encode_state_t *s, const uint8_t comment[], size_t len);
|
||||
|
||||
/*! \brief Check if we are at the end of the current document page.
|
||||
@@ -114,8 +127,6 @@ SPAN_DECLARE(int) t43_encode_release(t43_encode_state_t *s);
|
||||
\return 0 for OK, else -1. */
|
||||
SPAN_DECLARE(int) t43_encode_free(t43_encode_state_t *s);
|
||||
|
||||
SPAN_DECLARE(int) t43_create_header(t43_decode_state_t *s, uint8_t data[], size_t len);
|
||||
|
||||
SPAN_DECLARE(void) t43_decode_rx_status(t43_decode_state_t *s, int status);
|
||||
|
||||
/*! \brief Decode a chunk of T.43 data.
|
||||
|
||||
@@ -139,14 +139,13 @@ typedef enum
|
||||
typedef enum
|
||||
{
|
||||
T4_X_RESOLUTION_100 = 3937,
|
||||
T4_X_RESOLUTION_R4 = 4016,
|
||||
T4_X_RESOLUTION_R4 = 4020,
|
||||
T4_X_RESOLUTION_200 = 7874,
|
||||
T4_X_RESOLUTION_R8 = 8031,
|
||||
T4_X_RESOLUTION_R8 = 8040,
|
||||
T4_X_RESOLUTION_300 = 11811,
|
||||
T4_X_RESOLUTION_400 = 15748,
|
||||
T4_X_RESOLUTION_R16 = 16063,
|
||||
T4_X_RESOLUTION_R16 = 16080,
|
||||
T4_X_RESOLUTION_600 = 23622,
|
||||
T4_X_RESOLUTION_800 = 31496,
|
||||
T4_X_RESOLUTION_1200 = 47244
|
||||
} t4_image_x_resolution_t;
|
||||
|
||||
|
||||
@@ -6704,7 +6704,7 @@ SPAN_DECLARE(void) t30_get_transfer_statistics(t30_state_t *s, t30_stats_t *t)
|
||||
t->width = stats.width;
|
||||
t->length = stats.length;
|
||||
|
||||
t->encoding = stats.encoding;
|
||||
t->compression = stats.encoding;
|
||||
t->image_size = stats.line_image_size;
|
||||
t->current_status = s->current_status;
|
||||
t->rtn_events = s->rtn_events;
|
||||
|
||||
@@ -112,7 +112,6 @@ static const res_table_t x_res_table[] =
|
||||
{ 400.0f/CM_PER_INCH, T4_X_RESOLUTION_400},
|
||||
{ 408.0f/CM_PER_INCH, T4_X_RESOLUTION_R16},
|
||||
{ 600.0f/CM_PER_INCH, T4_X_RESOLUTION_600},
|
||||
{ 800.0f/CM_PER_INCH, T4_X_RESOLUTION_800},
|
||||
{1200.0f/CM_PER_INCH, T4_X_RESOLUTION_1200},
|
||||
{ -1.00f, -1}
|
||||
};
|
||||
|
||||
@@ -103,7 +103,7 @@ void fax_log_page_transfer_statistics(t30_state_t *s, const char *tag)
|
||||
printf("%s: Pages in the file %d\n", tag, t.pages_in_file);
|
||||
printf("%s: Bad rows %d, longest bad row run %d\n", tag, t.bad_rows, t.longest_bad_row_run);
|
||||
printf("%s: Bad ECM frames %d\n", tag, t.error_correcting_mode_retries);
|
||||
printf("%s: Compression type %s (%d)\n", tag, t4_encoding_to_str(t.encoding), t.encoding);
|
||||
printf("%s: Compression type %s (%d)\n", tag, t4_encoding_to_str(t.compression), t.compression);
|
||||
printf("%s: Compressed image size %d bytes\n", tag, t.image_size);
|
||||
printf("%s: Image type %s (%s in the file)\n", tag, t4_image_type_to_str(t.type), t4_image_type_to_str(t.image_type));
|
||||
printf("%s: Image size %d pels x %d pels (%d pels x %d pels in the file)\n", tag, t.width, t.length, t.image_width, t.image_length);
|
||||
|
||||
Reference in new issue
Block a user