spandsp  3.0.0
private/t43.h
1 /*
2  * SpanDSP - a series of DSP components for telephony
3  *
4  * private/t43.h - ITU T.43 JBIG for gray and colour FAX image processing
5  *
6  * Written by Steve Underwood <steveu@coppice.org>
7  *
8  * Copyright (C) 2011 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_T43_H_)
27 #define _SPANDSP_PRIVATE_T43_H_
28 
29 /* State of a working instance of the T.43 JBIG for gray and colour FAX encoder */
31 {
32  /*! \brief Callback function to read a row of pixels from the image source. */
34  /*! \brief Opaque pointer passed to row_read_handler. */
36 
37  struct lab_params_s lab;
38  struct t85_encode_state_s t85;
39 
40  int image_type;
41  int bit_planes[4];
42 
43  int colour_map_entries;
44  uint8_t colour_map[3*256];
45 
46  uint8_t illuminant_code[4];
47  int illuminant_colour_temperature;
48 
49  /*! The width of the full image, in pixels */
50  uint32_t xd;
51  /*! The height of the full image, in pixels */
52  uint32_t yd;
53  /* The X or Y direction resolution, in pixels per inch */
54  int spatial_resolution;
55 
56  /*! \brief Error and flow logging control */
58 };
59 
60 /* State of a working instance of the T.43 JBIG for gray and colour FAX decoder */
62 {
63  /*! A callback routine to handle decoded pixel rows */
65  /*! An opaque pointer passed to row_write_handler() */
67 
68  struct lab_params_s lab;
69  struct t85_decode_state_s t85;
70 
71  int image_type;
72  int bit_planes[4];
73  uint8_t bit_plane_mask;
74  int current_bit_plane;
75  int plane_ptr;
76 
77  int colour_map_entries;
78  uint8_t colour_map[3*256];
79 
80  uint8_t illuminant_code[4];
81  int illuminant_colour_temperature;
82 
83  /* The X or Y direction resolution, in pixels per inch */
84  int spatial_resolution;
85  int samples_per_pixel;
86 
87  uint8_t *buf;
88  int ptr;
89  int row;
90 
91  /*! \brief Error and flow logging control */
93 };
94 
95 #endif
96 /*- End of file ------------------------------------------------------------*/
uint8_t bit_planes
Definition: private/t85.h:137
logging_state_t logging
Error and flow logging control.
Definition: private/t43.h:57
uint8_t bit_planes
Definition: private/t85.h:59
void * row_read_user_data
Opaque pointer passed to row_read_handler.
Definition: private/t43.h:35
logging_state_t logging
Error and flow logging control.
Definition: private/t43.h:92
Definition: private/t42.h:32
uint32_t yd
Definition: private/t43.h:52
t4_row_read_handler_t row_read_handler
Callback function to read a row of pixels from the image source.
Definition: private/t43.h:33
Definition: private/t43.h:61
void * row_write_user_data
Definition: private/t43.h:66
Definition: private/t43.h:30
Definition: private/logging.h:33
Definition: private/t85.h:116
Definition: private/t85.h:51
uint32_t xd
Definition: private/t43.h:50
int(* t4_row_write_handler_t)(void *user_data, const uint8_t buf[], size_t len)
Definition: t4_rx.h:46
int(* t4_row_read_handler_t)(void *user_data, uint8_t buf[], size_t len)
Definition: t4_tx.h:34
t4_row_write_handler_t row_write_handler
Definition: private/t43.h:64