t4_t6_decode.h File Reference

Go to the source code of this file.

Typedefs

typedef struct t4_t6_decode_state_s t4_t6_decode_state_t

Functions

int t4_t6_decode_put_bit (t4_t6_decode_state_t *s, int bit)
 Put a bit of the current document page.
int t4_t6_decode_put (t4_t6_decode_state_t *s, const uint8_t buf[], size_t len)
 Put a byte of the current document page.
int t4_t6_decode_set_row_write_handler (t4_t6_decode_state_t *s, t4_row_write_handler_t handler, void *user_data)
 Set the row write handler for a T.4/T.6 decode context.
int t4_t6_decode_set_encoding (t4_t6_decode_state_t *s, int encoding)
 Set the encoding for the encoded data.
uint32_t t4_t6_decode_get_image_width (t4_t6_decode_state_t *s)
 Get the width of the image.
uint32_t t4_t6_decode_get_image_length (t4_t6_decode_state_t *s)
 Get the length of the image.
int t4_t6_decode_get_compressed_image_size (t4_t6_decode_state_t *s)
 Get the size of the compressed image, in bits.
int t4_t6_decode_restart (t4_t6_decode_state_t *s, int image_width)
t4_t6_decode_state_tt4_t6_decode_init (t4_t6_decode_state_t *s, int encoding, int image_width, t4_row_write_handler_t handler, void *user_data)
 Prepare to decode an image in T.4 or T.6 format.
int t4_t6_decode_release (t4_t6_decode_state_t *s)
int t4_t6_decode_free (t4_t6_decode_state_t *s)

Detailed Description


Function Documentation

int t4_t6_decode_get_compressed_image_size ( t4_t6_decode_state_t s  ) 

Get the size of the compressed image, in bits.

Parameters:
s The T.4/T.6 context.
Returns:
The size of the compressed image, in bits.

Referenced by t4_rx_get_transfer_statistics().

uint32_t t4_t6_decode_get_image_length ( t4_t6_decode_state_t s  ) 

Get the length of the image.

Parameters:
s The T.4/T.6 context.
Returns:
The length of the image, in pixels.

Referenced by t4_rx_end_page(), and t4_rx_get_transfer_statistics().

uint32_t t4_t6_decode_get_image_width ( t4_t6_decode_state_t s  ) 

Get the width of the image.

Parameters:
s The T.4/T.6 context.
Returns:
The width of the image, in pixels.

Referenced by t4_rx_get_transfer_statistics().

t4_t6_decode_state_t* t4_t6_decode_init ( t4_t6_decode_state_t s,
int  encoding,
int  image_width,
t4_row_write_handler_t  handler,
void *  user_data 
)

Prepare to decode an image in T.4 or T.6 format.

Parameters:
s The T.4/T.6 context.
encoding The encoding mode.
image width The image width, in pixels.
handler A callback routine to handle decoded image rows.
user_data An opaque pointer passed to handler.
Returns:
A pointer to the context, or NULL if there was a problem.

Referenced by t4_rx_set_rx_encoding().

int t4_t6_decode_put ( t4_t6_decode_state_t s,
const uint8_t  buf[],
size_t  len 
)

Put a byte of the current document page.

Parameters:
s The T.4/T.6 context.
buf The buffer containing the chunk.
len The length of the chunk.
Returns:
T4_DECODE_MORE_DATA when the image is still in progress. T4_DECODE_OK when the image is complete.

References EOLS_TO_END_ANY_RX_PAGE, T4_DECODE_MORE_DATA, and T4_DECODE_OK.

Referenced by t4_rx_end_page(), and t4_rx_put().

int t4_t6_decode_put_bit ( t4_t6_decode_state_t s,
int  bit 
)

Put a bit of the current document page.

Parameters:
s The T.4/T.6 context.
bit The data bit.
Returns:
TRUE when the bit ends the document page, otherwise FALSE.

References T4_DECODE_MORE_DATA, and T4_DECODE_OK.

Referenced by t4_rx_put_bit().

int t4_t6_decode_set_encoding ( t4_t6_decode_state_t s,
int  encoding 
)

Set the encoding for the encoded data.

Parameters:
s The T.4/T.6 context.
encoding The encoding.
Returns:
0 for success, otherwise -1.

References T4_COMPRESSION_ITU_T4_1D, T4_COMPRESSION_ITU_T4_2D, and T4_COMPRESSION_ITU_T6.

Referenced by t4_rx_set_rx_encoding().

int t4_t6_decode_set_row_write_handler ( t4_t6_decode_state_t s,
t4_row_write_handler_t  handler,
void *  user_data 
)

Set the row write handler for a T.4/T.6 decode context.

Parameters:
s The T.4/T.6 context.
handler A pointer to the handler routine.
user_data An opaque pointer passed to the handler routine.
Returns:
0 for success, otherwise -1.

Referenced by t4_rx_set_row_write_handler().


Generated on 15 Sep 2012 for spandsp by  doxygen 1.6.1