28#if !defined(_SPANDSP_T4_RX_H_)
29#define _SPANDSP_T4_RX_H_
76 T4_IMAGE_TYPE_BILEVEL = 0,
77 T4_IMAGE_TYPE_GRAY_8BIT = 1,
78 T4_IMAGE_TYPE_GRAY_12BIT = 2,
79 T4_IMAGE_TYPE_COLOUR_8BIT = 3,
80 T4_IMAGE_TYPE_COLOUR_12BIT = 4
86 T4_X_RESOLUTION_R4 = 4016,
87 T4_X_RESOLUTION_R8 = 8031,
88 T4_X_RESOLUTION_300 = 11811,
89 T4_X_RESOLUTION_R16 = 16063,
90 T4_X_RESOLUTION_600 = 23622,
91 T4_X_RESOLUTION_800 = 31496,
92 T4_X_RESOLUTION_1200 = 47244
98 T4_Y_RESOLUTION_STANDARD = 3850,
99 T4_Y_RESOLUTION_FINE = 7700,
100 T4_Y_RESOLUTION_300 = 11811,
101 T4_Y_RESOLUTION_SUPERFINE = 15400,
102 T4_Y_RESOLUTION_600 = 23622,
103 T4_Y_RESOLUTION_800 = 31496,
104 T4_Y_RESOLUTION_1200 = 47244
126 T4_WIDTH_R4_A4 = 864,
127 T4_WIDTH_R4_B4 = 1024,
128 T4_WIDTH_R4_A3 = 1216,
129 T4_WIDTH_R8_A4 = 1728,
130 T4_WIDTH_R8_B4 = 2048,
131 T4_WIDTH_R8_A3 = 2432,
132 T4_WIDTH_300_A4 = 2592,
133 T4_WIDTH_300_B4 = 3072,
134 T4_WIDTH_300_A3 = 3648,
135 T4_WIDTH_R16_A4 = 3456,
136 T4_WIDTH_R16_B4 = 4096,
137 T4_WIDTH_R16_A3 = 4864,
138 T4_WIDTH_600_A4 = 5184,
139 T4_WIDTH_600_B4 = 6144,
140 T4_WIDTH_600_A3 = 7296,
141 T4_WIDTH_1200_A4 = 10368,
142 T4_WIDTH_1200_B4 = 12288,
143 T4_WIDTH_1200_A3 = 14592
169 T4_LENGTH_STANDARD_A4 = 1143,
170 T4_LENGTH_FINE_A4 = 2286,
171 T4_LENGTH_300_A4 = 4665,
172 T4_LENGTH_SUPERFINE_A4 = 4573,
173 T4_LENGTH_600_A4 = 6998,
174 T4_LENGTH_800_A4 = 9330,
175 T4_LENGTH_1200_A4 = 13996,
177 T4_LENGTH_STANDARD_B4 = 1401,
178 T4_LENGTH_FINE_B4 = 2802,
179 T4_LENGTH_300_B4 = 0,
180 T4_LENGTH_SUPERFINE_B4 = 5605,
181 T4_LENGTH_600_B4 = 0,
182 T4_LENGTH_800_B4 = 0,
183 T4_LENGTH_1200_B4 = 0,
185 T4_LENGTH_STANDARD_US_LETTER = 1075,
186 T4_LENGTH_FINE_US_LETTER = 2151,
187 T4_LENGTH_300_US_LETTER = 0,
188 T4_LENGTH_SUPERFINE_US_LETTER = 4302,
189 T4_LENGTH_600_US_LETTER = 0,
190 T4_LENGTH_800_US_LETTER = 0,
191 T4_LENGTH_1200_US_LETTER = 0,
193 T4_LENGTH_STANDARD_US_LEGAL = 1369,
194 T4_LENGTH_FINE_US_LEGAL = 2738,
195 T4_LENGTH_300_US_LEGAL = 0,
196 T4_LENGTH_SUPERFINE_US_LEGAL = 5476,
197 T4_LENGTH_600_US_LEGAL = 0,
198 T4_LENGTH_800_US_LEGAL = 0,
199 T4_LENGTH_1200_US_LEGAL = 0
236#if defined(__cplusplus)
262SPAN_DECLARE(
int)
t4_rx_put_chunk(t4_rx_state_t *s,
const uint8_t buf[],
int len);
299SPAN_DECLARE(
void)
t4_rx_set_dcs(t4_rx_state_t *s,
const char *dcs);
319SPAN_DECLARE(
void)
t4_rx_set_model(t4_rx_state_t *s,
const char *model);
338SPAN_DECLARE(t4_rx_state_t *)
t4_rx_init(t4_rx_state_t *s,
const char *file,
int output_encoding);
352SPAN_DECLARE(
int)
t4_rx_free(t4_rx_state_t *s);
354#if defined(__cplusplus)
Definition private/t4_tx.h:36
int pages_transferred
The number of pages transferred so far.
Definition t4_rx.h:215
int length
The number of vertical pixels in the most recent page.
Definition t4_rx.h:221
int pages_in_file
The number of pages in the file (<0 if unknown).
Definition t4_rx.h:217
int y_resolution
The vertical resolution of the page in pixels per metre.
Definition t4_rx.h:229
int bad_rows
The number of bad pixel rows in the most recent page.
Definition t4_rx.h:223
int encoding
The type of compression used between the FAX machines.
Definition t4_rx.h:231
int x_resolution
The horizontal resolution of the page in pixels per metre.
Definition t4_rx.h:227
int longest_bad_row_run
The largest number of bad pixel rows in a block in the most recent page.
Definition t4_rx.h:225
int line_image_size
The size of the image on the line, in bytes.
Definition t4_rx.h:233
int width
The number of horizontal pixels in the most recent page.
Definition t4_rx.h:219
void t4_rx_set_sub_address(t4_rx_state_t *s, const char *sub_address)
Set the sub-address of the fax, for inclusion in the file.
Definition t4_rx.c:1109
t4_image_compression_t
Definition t4_rx.h:50
@ T4_COMPRESSION_ITU_T85
Definition t4_rx.h:60
@ T4_COMPRESSION_ITU_T43
Definition t4_rx.h:64
@ T4_COMPRESSION_ITU_T6
Definition t4_rx.h:58
@ T4_COMPRESSION_ITU_T85_L0
Definition t4_rx.h:62
@ T4_COMPRESSION_ITU_T4_2D
Definition t4_rx.h:56
@ T4_COMPRESSION_NONE
Definition t4_rx.h:52
@ T4_COMPRESSION_ITU_T42
Definition t4_rx.h:68
@ T4_COMPRESSION_ITU_T4_1D
Definition t4_rx.h:54
@ T4_COMPRESSION_ITU_T45
Definition t4_rx.h:66
@ T4_COMPRESSION_ITU_SYCC_T42
Definition t4_rx.h:70
int t4_rx_put_byte(t4_rx_state_t *s, uint8_t byte)
Put a byte of the current document page.
Definition t4_rx.c:981
int t4_rx_start_page(t4_rx_state_t *s)
Prepare to receive the next page of the current document.
Definition t4_rx.c:1010
int t4_rx_set_row_write_handler(t4_rx_state_t *s, t4_row_write_handler_t handler, void *user_data)
Set the row write handler for a T.4 receive context.
Definition t4_rx.c:1002
void t4_rx_set_far_ident(t4_rx_state_t *s, const char *ident)
Set the identity of the remote machine, for inclusion in the file.
Definition t4_rx.c:1115
t4_image_x_resolution_t
Definition t4_rx.h:85
struct t4_state_s t4_state_t
Definition t4_rx.h:206
t4_image_width_t
Definition t4_rx.h:125
t4_image_types_t
Definition t4_rx.h:75
int t4_rx_put_chunk(t4_rx_state_t *s, const uint8_t buf[], int len)
Put a byte of the current document page.
Definition t4_rx.c:987
void t4_rx_set_x_resolution(t4_rx_state_t *s, int resolution)
Set the column-to-column (x) resolution to expect for a received image.
Definition t4_rx.c:1097
void t4_rx_set_model(t4_rx_state_t *s, const char *model)
Set the model of the remote machine, for inclusion in the file.
Definition t4_rx.c:1127
const char * t4_encoding_to_str(int encoding)
Get the short text name of an encoding format.
Definition t4_rx.c:1148
int t4_rx_free(t4_rx_state_t *s)
End reception of a document. Tidy up, close the file and free the context. This should be used to end...
Definition t4_rx.c:1246
void t4_rx_set_rx_encoding(t4_rx_state_t *s, int encoding)
Set the encoding for the received data.
Definition t4_rx.c:1079
t4_image_length_t
Definition t4_rx.h:167
void t4_rx_set_image_width(t4_rx_state_t *s, int width)
Set the expected width of the received image, in pixel columns.
Definition t4_rx.c:1085
void t4_rx_get_transfer_statistics(t4_rx_state_t *s, t4_stats_t *t)
Get the current transfer statistics.
Definition t4_rx.c:1133
t4_image_y_resolution_t
Definition t4_rx.h:97
int t4_rx_put_bit(t4_rx_state_t *s, int bit)
Put a bit of the current document page.
Definition t4_rx.c:975
int t4_rx_release(t4_rx_state_t *s)
End reception of a document. Tidy up and close the file. This should be used to end T....
Definition t4_rx.c:1235
t4_rx_state_t * t4_rx_init(t4_rx_state_t *s, const char *file, int output_encoding)
Prepare for reception of a document.
Definition t4_rx.c:1177
int(* t4_row_write_handler_t)(void *user_data, const uint8_t buf[], size_t len)
Definition t4_rx.h:46
void t4_rx_set_vendor(t4_rx_state_t *s, const char *vendor)
Set the vendor of the remote machine, for inclusion in the file.
Definition t4_rx.c:1121
void t4_rx_set_dcs(t4_rx_state_t *s, const char *dcs)
Set the DCS information of the fax, for inclusion in the file.
Definition t4_rx.c:1103
void t4_rx_set_y_resolution(t4_rx_state_t *s, int resolution)
Set the row-to-row (y) resolution to expect for a received image.
Definition t4_rx.c:1091
int t4_rx_end_page(t4_rx_state_t *s)
Complete the reception of a page.
Definition t4_rx.c:581