spandsp: t4_tx.h Source File

spandsp 0.0.6

private/t4_tx.h
1/*
2 * SpanDSP - a series of DSP components for telephony
3 *
4 * private/t4_tx.h - definitions for T.4 FAX transmit processing
5 *
6 * Written by Steve Underwood <steveu@coppice.org>
7 *
8 * Copyright (C) 2003 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 Lesser General Public License version 2.1,
14 * as 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 Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this program; if not, write to the Free Software
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 */
25
26#if !defined(_SPANDSP_PRIVATE_T4_TX_H_)
27#define _SPANDSP_PRIVATE_T4_TX_H_
28
29#define t4_tx_state_s t4_state_s
30
31/*!
32 T.4 FAX compression/decompression descriptor. This defines the working state
33 for a single instance of a T.4 FAX compression or decompression channel.
34*/
35 struct t4_state_s
36{
37 /*! \brief The same structure is used for T.4 transmit and receive. This variable
38 records which mode is in progress. */
39 int rx;
40
41 /*! \brief The type of compression used between the FAX machines. */
42 int line_encoding;
43
44 /*! \brief The time at which handling of the current page began. */
45 time_t page_start_time;
46
47 /*! \brief The text which will be used in FAX page header. No text results
48 in no header line. */
49 const char *header_info;
50 /*! \brief Optional per instance time zone for the FAX page header timestamp. */
51 struct tz_s *tz;
52
53 /*! \brief The size of the compressed image on the line side, in bits. */
54 int line_image_size;
55
56 /*! \brief The current number of bytes per row of uncompressed image data. */
57 int bytes_per_row;
58 /*! \brief The size of the image in the image buffer, in bytes. */
59 int image_size;
60 /*! \brief The current size of the image buffer. */
61 int image_buffer_size;
62 /*! \brief A point to the image buffer. */
63 uint8_t *image_buffer;
64
65 /*! \brief The number of pages transferred to date. */
66 int current_page;
67 /*! \brief Column-to-column (X) resolution in pixels per metre. */
68 int x_resolution;
69 /*! \brief Row-to-row (Y) resolution in pixels per metre. */
70 int y_resolution;
71 /*! \brief Width of the current page, in pixels. */
72 int image_width;
73 /*! \brief Length of the current page, in pixels. */
74 int image_length;
75 /*! \brief Current pixel row number. */
76 int row;
77
78 /*! \brief This variable is set if we are treating the current row as a 2D encoded
79 one. */
80 int row_is_2d;
81 /*! \brief The current length of the current row. */
82 int row_len;
83
84 /*! \brief Black and white run-lengths for the current row. */
85 uint32_t *cur_runs;
86 /*! \brief Black and white run-lengths for the reference row. */
87 uint32_t *ref_runs;
88 /*! \brief Pointer to the buffer for the current pixel row. */
89 uint8_t *row_buf;
90
91 /*! \brief Encoded data bits buffer. */
92 uint32_t tx_bitstream;
93 /*! \brief The number of bits currently in tx_bitstream. */
94 int tx_bits;
95
96 /*! \brief The current number of bits in the current encoded row. */
97 int row_bits;
98 /*! \brief The minimum bits in any row of the current page. For monitoring only. */
99 int min_row_bits;
100 /*! \brief The maximum bits in any row of the current page. For monitoring only. */
101 int max_row_bits;
102
103 /*! \brief Error and flow logging control */
104 logging_state_t logging;
105
106 /*! \brief All TIFF file specific state information for the T.4 context. */
107 t4_tiff_state_t tiff;
108 t4_t6_decode_state_t t4_t6_rx;
109 t4_t6_encode_state_t t4_t6_tx;
110};
111
112#endif
113/*- End of file ------------------------------------------------------------*/
logging_state_t
struct logging_state_s logging_state_t
Definition logging.h:75
t4_state_s
Definition private/t4_tx.h:36
t4_state_s::current_page
int current_page
The number of pages transferred to date.
Definition private/t4_tx.h:66
t4_state_s::row_is_2d
int row_is_2d
This variable is set if we are treating the current row as a 2D encoded one.
Definition private/t4_tx.h:80
t4_state_s::tiff
t4_tiff_state_t tiff
All TIFF file specific state information for the T.4 context.
Definition private/t4_tx.h:107
t4_state_s::tx_bitstream
uint32_t tx_bitstream
Encoded data bits buffer.
Definition private/t4_tx.h:92
t4_state_s::tx_bits
int tx_bits
The number of bits currently in tx_bitstream.
Definition private/t4_tx.h:94
t4_state_s::x_resolution
int x_resolution
Column-to-column (X) resolution in pixels per metre.
Definition private/t4_tx.h:68
t4_state_s::min_row_bits
int min_row_bits
The minimum bits in any row of the current page. For monitoring only.
Definition private/t4_tx.h:99
t4_state_s::row_len
int row_len
The current length of the current row.
Definition private/t4_tx.h:82
t4_state_s::line_image_size
int line_image_size
The size of the compressed image on the line side, in bits.
Definition private/t4_tx.h:54
t4_state_s::y_resolution
int y_resolution
Row-to-row (Y) resolution in pixels per metre.
Definition private/t4_tx.h:70
t4_state_s::row
int row
Current pixel row number.
Definition private/t4_tx.h:76
t4_state_s::image_width
int image_width
Width of the current page, in pixels.
Definition private/t4_tx.h:72
t4_state_s::image_length
int image_length
Length of the current page, in pixels.
Definition private/t4_tx.h:74
t4_state_s::header_info
const char * header_info
The text which will be used in FAX page header. No text results in no header line.
Definition private/t4_tx.h:49
t4_state_s::max_row_bits
int max_row_bits
The maximum bits in any row of the current page. For monitoring only.
Definition private/t4_tx.h:101
t4_state_s::image_buffer_size
int image_buffer_size
The current size of the image buffer.
Definition private/t4_tx.h:61
t4_state_s::logging
logging_state_t logging
Error and flow logging control.
Definition private/t4_tx.h:104
t4_state_s::row_bits
int row_bits
The current number of bits in the current encoded row.
Definition private/t4_tx.h:97
t4_state_s::row_buf
uint8_t * row_buf
Pointer to the buffer for the current pixel row.
Definition private/t4_tx.h:89
t4_state_s::bytes_per_row
int bytes_per_row
The current number of bytes per row of uncompressed image data.
Definition private/t4_tx.h:57
t4_state_s::image_buffer
uint8_t * image_buffer
A point to the image buffer.
Definition private/t4_tx.h:63
t4_state_s::rx
int rx
The same structure is used for T.4 transmit and receive. This variable records which mode is in progr...
Definition private/t4_tx.h:39
t4_state_s::line_encoding
int line_encoding
The type of compression used between the FAX machines.
Definition private/t4_tx.h:42
t4_state_s::page_start_time
time_t page_start_time
The time at which handling of the current page began.
Definition private/t4_tx.h:45
t4_state_s::cur_runs
uint32_t * cur_runs
Black and white run-lengths for the current row.
Definition private/t4_tx.h:85
t4_state_s::tz
struct tz_s * tz
Optional per instance time zone for the FAX page header timestamp.
Definition private/t4_tx.h:51
t4_state_s::image_size
int image_size
The size of the image in the image buffer, in bytes.
Definition private/t4_tx.h:59
t4_state_s::ref_runs
uint32_t * ref_runs
Black and white run-lengths for the reference row.
Definition private/t4_tx.h:87
t4_tiff_state_t
Definition private/t4_rx.h:55
tz_s
Definition private/timezone.h:82