spandsp  0.0.6
fax_utils.h
Go to the documentation of this file.
1 /*
2  * SpanDSP - a series of DSP components for telephony
3  *
4  * fax_utils.h
5  *
6  * Written by Steve Underwood <steveu@coppice.org>
7  *
8  * Copyright (C) 2009 Steve Underwood
9  *
10  * All rights reserved.
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License version 2, as
14  * published by the Free Software Foundation.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24  */
25 
26 /*! \file */
27 
28 #if !defined(_SPANDSP_FAX_UTILS_H_)
29 #define _SPANDSP_FAX_UTILS_H_
30 
31 #if defined(__cplusplus)
32 extern "C"
33 {
34 #endif
35 
36 void fax_log_tx_parameters(t30_state_t *s, const char *tag);
37 
38 void fax_log_rx_parameters(t30_state_t *s, const char *tag);
39 
40 void fax_log_page_transfer_statistics(t30_state_t *s, const char *tag);
41 
42 void fax_log_final_transfer_statistics(t30_state_t *s, const char *tag);
43 
44 int get_tiff_total_pages(const char *file);
45 
46 #if defined(__cplusplus)
47 }
48 #endif
49 
50 #endif
51 /*- End of file ------------------------------------------------------------*/
t30_set_rx_file
void t30_set_rx_file(t30_state_t *s, const char *file, int stop_page)
Set next receive file name.
Definition: t30_api.c:614
t30_get_rx_model
const char * t30_get_rx_model(t30_state_t *s)
Get the name of the model of the remote FAX machine associated with a T.30 context.
Definition: t30_api.c:608
t30_stats_t::bit_rate
int bit_rate
The current bit rate for image transfer.
Definition: t30.h:521
t30_set_tx_nsf
int t30_set_tx_nsf(t30_state_t *s, const uint8_t *nsf, int len)
Set the transmitted NSF frame to be associated with a T.30 context.
Definition: t30_api.c:271
t30_get_rx_vendor
const char * t30_get_rx_vendor(t30_state_t *s)
Get the name of the vendor of the remote FAX machine associated with a T.30 context.
Definition: t30_api.c:602
T30_SUPPORT_T6_COMPRESSION
@ T30_SUPPORT_T6_COMPRESSION
Definition: t30.h:362
t30_completion_code_to_str
const char * t30_completion_code_to_str(int result)
Convert a phase E completion code to a short text description.
Definition: t30_logging.c:108
T30_SUPPORT_600_1200_RESOLUTION
@ T30_SUPPORT_600_1200_RESOLUTION
Definition: t30.h:408
T30_SUPPORT_300_300_RESOLUTION
@ T30_SUPPORT_300_300_RESOLUTION
Definition: t30.h:396
t30_set_minimum_scan_line_time
int t30_set_minimum_scan_line_time(t30_state_t *s, int min_time)
Specify minimum scan line time.
Definition: t30_api.c:659
fax_set_transmit_on_idle
void fax_set_transmit_on_idle(fax_state_t *s, int transmit_on_idle)
Select whether silent audio will be sent when FAX transmit is idle.
Definition: fax.c:579
t30_stats_t::error_correcting_mode_retries
int error_correcting_mode_retries
The number of HDLC frame retries, if error correcting mode is used.
Definition: t30.h:547
t30_stats_t::x_resolution
int x_resolution
The horizontal column-to-column resolution of the most recent page, in pixels per metre.
Definition: t30.h:531
t30_set_document_handler
void t30_set_document_handler(t30_state_t *s, t30_document_handler_t *handler, void *user_data)
Set a callback function for T.30 end of document handling.
Definition: t30_api.c:770
fax_init
fax_state_t * fax_init(fax_state_t *s, int calling_party)
Initialise a FAX context.
Definition: fax.c:664
t30_set_supported_compressions
int t30_set_supported_compressions(t30_state_t *s, int supported_compressions)
Specify supported compression types.
Definition: t30_api.c:688
t30_stats_t
Definition: t30.h:519
t30_set_real_time_frame_handler
void t30_set_real_time_frame_handler(t30_state_t *s, t30_real_time_frame_handler_t *handler, void *user_data)
Set a callback function for T.30 frame exchange monitoring.
Definition: t30_api.c:777
fax_utils.h
t30_frametype
const char * t30_frametype(uint8_t x)
Return a text name for a T.30 frame type.
Definition: t30_logging.c:241
T30_PIP
@ T30_PIP
Definition: t30_fcf.h:87
awgn_state_s
Definition: private/awgn.h:33
t30_get_rx_country
const char * t30_get_rx_country(t30_state_t *s)
Get the country of origin of the remote FAX machine associated with a T.30 context.
Definition: t30_api.c:596
t30_stats_t::y_resolution
int y_resolution
The vertical row-to-row resolution of the most recent page, in pixels per metre.
Definition: t30.h:533
t30_get_rx_sub_address
const char * t30_get_rx_sub_address(t30_state_t *s)
Get the received sub-address associated with a T.30 context.
Definition: t30_api.c:143
t30_set_rx_encoding
int t30_set_rx_encoding(t30_state_t *s, int encoding)
Specify the output encoding for TIFF files created during FAX reception.
Definition: t30_api.c:645
T30_SUPPORT_SUB_ADDRESSING
@ T30_SUPPORT_SUB_ADDRESSING
Definition: t30.h:435
t30_get_rx_selective_polling_address
const char * t30_get_rx_selective_polling_address(t30_state_t *s)
Get the received selective polling address associated with a T.30 context.
Definition: t30_api.c:173
T30_SUPPORT_SELECTIVE_POLLING
@ T30_SUPPORT_SELECTIVE_POLLING
Definition: t30.h:429
t30_get_tx_ident
const char * t30_get_tx_ident(t30_state_t *s)
Set the transmitted identifier associated with a T.30 context.
Definition: t30_api.c:105
t30_get_tx_sub_address
const char * t30_get_tx_sub_address(t30_state_t *s)
Get the received sub-address associated with a T.30 context.
Definition: t30_api.c:135
t30_stats_t::encoding
int encoding
The type of compression used between the FAX machines.
Definition: t30.h:541
t30_get_tx_selective_polling_address
const char * t30_get_tx_selective_polling_address(t30_state_t *s)
Get the received selective polling address associated with a T.30 context.
Definition: t30_api.c:165
t30_state_s::t4
union t30_state_s::@57 t4
T.4 context for reading or writing image data.
t30_set_tx_sub_address
int t30_set_tx_sub_address(t30_state_t *s, const char *sub_address)
Set the transmitted sub-address associated with a T.30 context.
Definition: t30_api.c:121
t30_get_rx_ident
const char * t30_get_rx_ident(t30_state_t *s)
Set the transmitted identifier associated with a T.30 context.
Definition: t30_api.c:113
fax_set_tep_mode
void fax_set_tep_mode(fax_state_t *s, int use_tep)
Select whether TEP will be sent for the image modems.
Definition: fax.c:585
t30_stats_t::error_correcting_mode
int error_correcting_mode
TRUE if error correcting mode is used.
Definition: t30.h:523
T30_SUPPORT_600_600_RESOLUTION
@ T30_SUPPORT_600_600_RESOLUTION
Definition: t30.h:400
T30_PRI_EOM
@ T30_PRI_EOM
Definition: t30_fcf.h:75
T30_SUPPORT_300_600_RESOLUTION
@ T30_SUPPORT_300_600_RESOLUTION
Definition: t30.h:404
t30_stats_t::pages_in_file
int pages_in_file
The number of pages in the file (<0 if not known).
Definition: t30.h:529
T30_SUPPORT_T4_2D_COMPRESSION
@ T30_SUPPORT_T4_2D_COMPRESSION
Definition: t30.h:360
machine_s
Definition: fax_tests.c:60
t30_set_tx_sender_ident
int t30_set_tx_sender_ident(t30_state_t *s, const char *sender_ident)
Set the transmitted sender ident associated with a T.30 context.
Definition: t30_api.c:211
T30_SUPPORT_V29
@ T30_SUPPORT_V29
Definition: t30.h:344
T30_SUPPORT_400_400_RESOLUTION
@ T30_SUPPORT_400_400_RESOLUTION
Definition: t30.h:398
t30_get_rx_polled_sub_address
const char * t30_get_rx_polled_sub_address(t30_state_t *s)
Get the received polled sub-address associated with a T.30 context.
Definition: t30_api.c:203
t30_get_rx_sender_ident
const char * t30_get_rx_sender_ident(t30_state_t *s)
Get the received sender ident associated with a T.30 context.
Definition: t30_api.c:233
t30_set_supported_resolutions
int t30_set_supported_resolutions(t30_state_t *s, int supported_resolutions)
Specify supported resolutions.
Definition: t30_api.c:708
t30_get_logging_state
logging_state_t * t30_get_logging_state(t30_state_t *s)
Get a pointer to the logging context associated with a T.30 context.
Definition: t30_api.c:784
t30_stats_t::image_size
int image_size
The size of the image, in bytes.
Definition: t30.h:539
T30_SUPPORT_V27TER
@ T30_SUPPORT_V27TER
Definition: t30.h:342
T30_SUPPORT_R8_RESOLUTION
@ T30_SUPPORT_R8_RESOLUTION
Definition: t30.h:391
t30_state_s::state
int state
The current state of the T.30 state machine.
Definition: private/t30.h:146
fax_state_s
Definition: private/fax.h:36
t30_get_tx_sender_ident
const char * t30_get_tx_sender_ident(t30_state_t *s)
Get the received sender ident associated with a T.30 context.
Definition: t30_api.c:225
T30_SUPPORT_R16_RESOLUTION
@ T30_SUPPORT_R16_RESOLUTION
Definition: t30.h:393
T30_PRI_MPS
@ T30_PRI_MPS
Definition: t30_fcf.h:76
t30_set_supported_image_sizes
int t30_set_supported_image_sizes(t30_state_t *s, int supported_image_sizes)
Specify supported image sizes.
Definition: t30_api.c:716
T30_SUPPORT_FINE_RESOLUTION
@ T30_SUPPORT_FINE_RESOLUTION
Definition: t30.h:384
T30_PRI_EOP
@ T30_PRI_EOP
Definition: t30_fcf.h:77
t30_set_tx_selective_polling_address
int t30_set_tx_selective_polling_address(t30_state_t *s, const char *selective_polling_address)
Set the transmitted selective polling address associated with a T.30 context.
Definition: t30_api.c:151
T4_COMPRESSION_ITU_T6
@ T4_COMPRESSION_ITU_T6
Definition: t4_rx.h:58
t30_get_transfer_statistics
void t30_get_transfer_statistics(t30_state_t *s, t30_stats_t *t)
Get the current transfer statistics.
Definition: t30.c:6229
t30_set_phase_d_handler
void t30_set_phase_d_handler(t30_state_t *s, t30_phase_d_handler_t *handler, void *user_data)
Set a callback function for T.30 phase D handling.
Definition: t30_api.c:756
t30_get_tx_password
const char * t30_get_tx_password(t30_state_t *s)
Get the received password associated with a T.30 context.
Definition: t30_api.c:255
t30_set_tx_file
void t30_set_tx_file(t30_state_t *s, const char *file, int start_page, int stop_page)
Set next transmit file name.
Definition: t30_api.c:622
T30_SUPPORT_1200_1200_RESOLUTION
@ T30_SUPPORT_1200_1200_RESOLUTION
Definition: t30.h:402
spandsp-sim.h
t30_state_s
Definition: private/t30.h:36
t30_set_phase_b_handler
void t30_set_phase_b_handler(t30_state_t *s, t30_phase_b_handler_t *handler, void *user_data)
Set a callback function for T.30 phase B handling.
Definition: t30_api.c:749
t30_stats_t::width
int width
The number of horizontal pixels in the most recent page.
Definition: t30.h:535
t4_state_s::logging
logging_state_t logging
Error and flow logging control.
Definition: private/t4_tx.h:104
fax_get_t30_state
t30_state_t * fax_get_t30_state(fax_state_t *s)
Get a pointer to the T.30 engine associated with a FAX context.
Definition: fax.c:591
T30_PIN
@ T30_PIN
Definition: t30_fcf.h:88
t30_set_phase_e_handler
void t30_set_phase_e_handler(t30_state_t *s, t30_phase_e_handler_t *handler, void *user_data)
Set a callback function for T.30 phase E handling.
Definition: t30_api.c:763
t30_stats_t::length
int length
The number of vertical pixels in the most recent page.
Definition: t30.h:537
t4_encoding_to_str
const char * t4_encoding_to_str(int encoding)
Get the short text name of an encoding format.
Definition: t4_rx.c:1148
t30_set_supported_t30_features
int t30_set_supported_t30_features(t30_state_t *s, int supported_t30_features)
Specify supported T.30 features.
Definition: t30_api.c:724
fax_release
int fax_release(fax_state_t *s)
Release a FAX context.
Definition: fax.c:719
T30_SUPPORT_SUPERFINE_RESOLUTION
@ T30_SUPPORT_SUPERFINE_RESOLUTION
Definition: t30.h:386
t30_stats_t::bad_rows
int bad_rows
The number of bad pixel rows in the most recent page.
Definition: t30.h:543
t30_stats_t::pages_rx
int pages_rx
The number of pages received so far.
Definition: t30.h:527
t30_set_receiver_not_ready
int t30_set_receiver_not_ready(t30_state_t *s, int count)
Specify a period of responding with receiver not ready.
Definition: t30_api.c:742
T30_SUPPORT_T4_1D_COMPRESSION
@ T30_SUPPORT_T4_1D_COMPRESSION
Definition: t30.h:358
T30_SUPPORT_STANDARD_RESOLUTION
@ T30_SUPPORT_STANDARD_RESOLUTION
Definition: t30.h:382
t30_stats_t::pages_tx
int pages_tx
The number of pages sent so far.
Definition: t30.h:525
T30_SUPPORT_IDENTIFICATION
@ T30_SUPPORT_IDENTIFICATION
Definition: t30.h:427
t30_get_tx_polled_sub_address
const char * t30_get_tx_polled_sub_address(t30_state_t *s)
Get the received polled sub-address associated with a T.30 context.
Definition: t30_api.c:195
t30_set_supported_modems
int t30_set_supported_modems(t30_state_t *s, int supported_modems)
Specify supported modems.
Definition: t30_api.c:680
fax_get_logging_state
logging_state_t * fax_get_logging_state(fax_state_t *s)
Get a pointer to the logging context associated with a FAX context.
Definition: fax.c:597
T30_SUPPORT_V17
@ T30_SUPPORT_V17
Definition: t30.h:346
t30_get_rx_password
const char * t30_get_rx_password(t30_state_t *s)
Get the received password associated with a T.30 context.
Definition: t30_api.c:263
t30_stats_t::longest_bad_row_run
int longest_bad_row_run
The largest number of bad pixel rows in a block in the most recent page.
Definition: t30.h:545
T30_SUPPORT_400_800_RESOLUTION
@ T30_SUPPORT_400_800_RESOLUTION
Definition: t30.h:406
t30_set_tx_ident
int t30_set_tx_ident(t30_state_t *s, const char *id)
Set the transmitted identifier associated with a T.30 context.
Definition: t30_api.c:90
logging_state_s
Definition: private/logging.h:34
T30_SUPPORT_T85_COMPRESSION
@ T30_SUPPORT_T85_COMPRESSION
Definition: t30.h:364
t30_set_ecm_capability
int t30_set_ecm_capability(t30_state_t *s, int enabled)
Select ECM capability.
Definition: t30_api.c:637
t30_set_tx_page_header_info
int t30_set_tx_page_header_info(t30_state_t *s, const char *info)
Set the transmitted header information associated with a T.30 context.
Definition: t30_api.c:561
t30_set_tx_polled_sub_address
int t30_set_tx_polled_sub_address(t30_state_t *s, const char *polled_sub_address)
Set the transmitted polled sub-address associated with a T.30 context.
Definition: t30_api.c:181
t30_local_interrupt_request
void t30_local_interrupt_request(t30_state_t *s, int state)
Request a local interrupt of FAX exchange.
Definition: t30.c:6269
t30_set_tx_password
int t30_set_tx_password(t30_state_t *s, const char *password)
Set the transmitted password associated with a T.30 context.
Definition: t30_api.c:241