28 #if !defined(_SPANDSP_T4_RX_H_)
29 #define _SPANDSP_T4_RX_H_
42 typedef int (*t4_row_write_handler_t)(
void *user_data,
const uint8_t buf[],
size_t len);
72 T4_X_RESOLUTION_R4 = 4016,
73 T4_X_RESOLUTION_R8 = 8031,
74 T4_X_RESOLUTION_300 = 11811,
75 T4_X_RESOLUTION_R16 = 16063,
76 T4_X_RESOLUTION_600 = 23622,
77 T4_X_RESOLUTION_800 = 31496,
78 T4_X_RESOLUTION_1200 = 47244
84 T4_Y_RESOLUTION_STANDARD = 3850,
85 T4_Y_RESOLUTION_FINE = 7700,
86 T4_Y_RESOLUTION_300 = 11811,
87 T4_Y_RESOLUTION_SUPERFINE = 15400,
88 T4_Y_RESOLUTION_600 = 23622,
89 T4_Y_RESOLUTION_800 = 31496,
90 T4_Y_RESOLUTION_1200 = 47244
112 T4_WIDTH_R4_A4 = 864,
113 T4_WIDTH_R4_B4 = 1024,
114 T4_WIDTH_R4_A3 = 1216,
115 T4_WIDTH_R8_A4 = 1728,
116 T4_WIDTH_R8_B4 = 2048,
117 T4_WIDTH_R8_A3 = 2432,
118 T4_WIDTH_300_A4 = 2592,
119 T4_WIDTH_300_B4 = 3072,
120 T4_WIDTH_300_A3 = 3648,
121 T4_WIDTH_R16_A4 = 3456,
122 T4_WIDTH_R16_B4 = 4096,
123 T4_WIDTH_R16_A3 = 4864,
124 T4_WIDTH_600_A4 = 5184,
125 T4_WIDTH_600_B4 = 6144,
126 T4_WIDTH_600_A3 = 7296,
127 T4_WIDTH_1200_A4 = 10368,
128 T4_WIDTH_1200_B4 = 12288,
129 T4_WIDTH_1200_A3 = 14592
155 T4_LENGTH_STANDARD_A4 = 1143,
156 T4_LENGTH_FINE_A4 = 2286,
157 T4_LENGTH_300_A4 = 4665,
158 T4_LENGTH_SUPERFINE_A4 = 4573,
159 T4_LENGTH_600_A4 = 6998,
160 T4_LENGTH_800_A4 = 9330,
161 T4_LENGTH_1200_A4 = 13996,
163 T4_LENGTH_STANDARD_B4 = 1401,
164 T4_LENGTH_FINE_B4 = 2802,
165 T4_LENGTH_300_B4 = 0,
166 T4_LENGTH_SUPERFINE_B4 = 5605,
167 T4_LENGTH_600_B4 = 0,
168 T4_LENGTH_800_B4 = 0,
169 T4_LENGTH_1200_B4 = 0,
171 T4_LENGTH_STANDARD_US_LETTER = 1075,
172 T4_LENGTH_FINE_US_LETTER = 2151,
173 T4_LENGTH_300_US_LETTER = 0,
174 T4_LENGTH_SUPERFINE_US_LETTER = 4302,
175 T4_LENGTH_600_US_LETTER = 0,
176 T4_LENGTH_800_US_LETTER = 0,
177 T4_LENGTH_1200_US_LETTER = 0,
179 T4_LENGTH_STANDARD_US_LEGAL = 1369,
180 T4_LENGTH_FINE_US_LEGAL = 2738,
181 T4_LENGTH_300_US_LEGAL = 0,
182 T4_LENGTH_SUPERFINE_US_LEGAL = 5476,
183 T4_LENGTH_600_US_LEGAL = 0,
184 T4_LENGTH_800_US_LEGAL = 0,
185 T4_LENGTH_1200_US_LEGAL = 0
221 #if defined(__cplusplus)
339 #if defined(__cplusplus)
int x_resolution
The horizontal resolution of the page in pixels per metre.
Definition: t4_rx.h:212
void t4_rx_set_model(t4_state_t *s, const char *model)
Set the model of the remote machine, for inclusion in the file.
Definition: t4_rx.c:1206
void t4_rx_set_rx_encoding(t4_state_t *s, int encoding)
Set the encoding for the received data.
Definition: t4_rx.c:1158
void t4_rx_set_vendor(t4_state_t *s, const char *vendor)
Set the vendor of the remote machine, for inclusion in the file.
Definition: t4_rx.c:1200
const char * t4_encoding_to_str(int encoding)
Get the short text name of an encoding format.
Definition: t4_rx.c:1227
int pages_transferred
The number of pages transferred so far.
Definition: t4_rx.h:200
int line_image_size
The size of the image on the line, in bytes.
Definition: t4_rx.h:218
void t4_rx_set_x_resolution(t4_state_t *s, int resolution)
Set the column-to-column (x) resolution to expect for a received image.
Definition: t4_rx.c:1176
void t4_rx_set_image_width(t4_state_t *s, int width)
Set the expected width of the received image, in pixel columns.
Definition: t4_rx.c:1164
int t4_rx_start_page(t4_state_t *s)
Prepare to receive the next page of the current document.
Definition: t4_rx.c:1068
int t4_rx_free(t4_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:1148
int length
The number of vertical pixels in the most recent page.
Definition: t4_rx.h:206
int t4_rx_set_row_write_handler(t4_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
t4_image_y_resolution_t
Definition: t4_rx.h:82
void t4_rx_set_y_resolution(t4_state_t *s, int resolution)
Set the row-to-row (y) resolution to expect for a received image.
Definition: t4_rx.c:1170
void t4_rx_set_dcs(t4_state_t *s, const char *dcs)
Set the DCS information of the fax, for inclusion in the file.
Definition: t4_rx.c:1182
int t4_rx_put_byte(t4_state_t *s, uint8_t byte)
Put a byte of the current document page.
Definition: t4_rx.c:981
int bad_rows
The number of bad pixel rows in the most recent page.
Definition: t4_rx.h:208
int width
The number of horizontal pixels in the most recent page.
Definition: t4_rx.h:204
int t4_rx_end_page(t4_state_t *s)
Complete the reception of a page.
Definition: t4_rx.c:581
t4_image_width_t
Definition: t4_rx.h:110
t4_image_compression_t
Definition: t4_rx.h:45
int y_resolution
The vertical resolution of the page in pixels per metre.
Definition: t4_rx.h:214
t4_image_length_t
Definition: t4_rx.h:152
void t4_rx_set_sub_address(t4_state_t *s, const char *sub_address)
Set the sub-address of the fax, for inclusion in the file.
Definition: t4_rx.c:1188
int t4_rx_put_bit(t4_state_t *s, int bit)
Put a bit of the current document page.
Definition: t4_rx.c:975
int pages_in_file
The number of pages in the file (<0 if unknown).
Definition: t4_rx.h:202
t4_image_x_resolution_t
Definition: t4_rx.h:70
int t4_rx_put_chunk(t4_state_t *s, const uint8_t buf[], int len)
Put a byte of the current document page.
Definition: t4_rx.c:987
int encoding
The type of compression used between the FAX machines.
Definition: t4_rx.h:216
t4_state_t * t4_rx_init(t4_state_t *s, const char *file, int output_encoding)
Prepare for reception of a document.
Definition: t4_rx.c:1010
Definition: private/t4_tx.h:33
int longest_bad_row_run
The largest number of bad pixel rows in a block in the most recent page.
Definition: t4_rx.h:210
int t4_rx_release(t4_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:1137
void t4_rx_set_far_ident(t4_state_t *s, const char *ident)
Set the identity of the remote machine, for inclusion in the file.
Definition: t4_rx.c:1194
void t4_rx_get_transfer_statistics(t4_state_t *s, t4_stats_t *t)
Get the current transfer statistics.
Definition: t4_rx.c:1212