spandsp 3.0.0
|
Go to the source code of this file.
Typedefs | |
typedef struct t42_encode_state_s | t42_encode_state_t |
typedef struct t42_decode_state_s | t42_decode_state_t |
typedef struct lab_params_s | lab_params_t |
Functions | |
int | xyz_to_corrected_color_temp (float *temp, float xyz[3]) |
Convert an X0, Y0, Z0 coordinate to a colour tempature. | |
int | colour_temp_to_xyz (float xyz[3], float temp) |
Convert a colour temperature to an X0, Y0, Z0 coordinate. | |
void | srgb_to_lab (lab_params_t *s, uint8_t lab[], const uint8_t srgb[], int pixels) |
Convert a row of 8 bit pixels from Lab to sRGB. More... | |
void | lab_to_srgb (lab_params_t *s, uint8_t srgb[], const uint8_t lab[], int pixels) |
Convert a row of 8 bit pixels from sRGB to Lab. More... | |
void | set_lab_illuminant (lab_params_t *s, float new_xn, float new_yn, float new_zn) |
void | set_lab_gamut (lab_params_t *s, int L_min, int L_max, int a_min, int a_max, int b_min, int b_max, int ab_are_signed) |
void | set_lab_gamut2 (lab_params_t *s, int L_P, int L_Q, int a_P, int a_Q, int b_P, int b_Q) |
void | get_lab_gamut2 (lab_params_t *s, int *L_P, int *L_Q, int *a_P, int *a_Q, int *b_P, int *b_Q) |
bool | t42_analyse_header (uint32_t *width, uint32_t *length, const uint8_t data[], size_t len) |
void | t42_encode_set_options (t42_encode_state_t *s, uint32_t l0, int quality, int options) |
int | t42_encode_set_image_width (t42_encode_state_t *s, uint32_t image_width) |
int | t42_encode_set_image_length (t42_encode_state_t *s, uint32_t length) |
int | t42_encode_set_image_type (t42_encode_state_t *s, int image_type) |
void | t42_encode_abort (t42_encode_state_t *s) |
void | t42_encode_comment (t42_encode_state_t *s, const uint8_t comment[], size_t len) |
int | t42_encode_image_complete (t42_encode_state_t *s) |
Check if we are at the end of the current document page. More... | |
int | t42_encode_get (t42_encode_state_t *s, uint8_t buf[], size_t max_len) |
uint32_t | t42_encode_get_image_width (t42_encode_state_t *s) |
uint32_t | t42_encode_get_image_length (t42_encode_state_t *s) |
int | t42_encode_get_compressed_image_size (t42_encode_state_t *s) |
Get the size of the compressed image in bits. More... | |
int | t42_encode_set_row_read_handler (t42_encode_state_t *s, t4_row_read_handler_t handler, void *user_data) |
logging_state_t * | t42_encode_get_logging_state (t42_encode_state_t *s) |
Get the logging context associated with a T.42 encode context. More... | |
int | t42_encode_restart (t42_encode_state_t *s, uint32_t image_width, uint32_t image_length) |
Restart a T.42 encode context. More... | |
t42_encode_state_t * | t42_encode_init (t42_encode_state_t *s, uint32_t image_width, uint32_t image_length, t4_row_read_handler_t handler, void *user_data) |
Prepare to encode an image in T.42 format. More... | |
int | t42_encode_release (t42_encode_state_t *s) |
Release a T.42 encode context. More... | |
int | t42_encode_free (t42_encode_state_t *s) |
Free a T.42 encode context. More... | |
void | t42_decode_rx_status (t42_decode_state_t *s, int status) |
int | t42_decode_put (t42_decode_state_t *s, const uint8_t data[], size_t len) |
Decode a chunk of T.42 data. More... | |
int | t42_decode_set_row_write_handler (t42_decode_state_t *s, t4_row_write_handler_t handler, void *user_data) |
Set the row handler routine. More... | |
int | t42_decode_set_comment_handler (t42_decode_state_t *s, uint32_t max_comment_len, t4_row_write_handler_t handler, void *user_data) |
Set the comment handler routine. More... | |
int | t42_decode_set_image_size_constraints (t42_decode_state_t *s, uint32_t max_xd, uint32_t max_yd) |
Set constraints on the received image size. More... | |
uint32_t | t42_decode_get_image_width (t42_decode_state_t *s) |
Get the width of the image. More... | |
uint32_t | t42_decode_get_image_length (t42_decode_state_t *s) |
Get the length of the image. More... | |
int | t42_decode_get_compressed_image_size (t42_decode_state_t *s) |
Get the size of the compressed image in bits. More... | |
logging_state_t * | t42_decode_get_logging_state (t42_decode_state_t *s) |
Get the logging context associated with a T.42 decode context. More... | |
int | t42_decode_restart (t42_decode_state_t *s) |
Restart a T.42 decode context. More... | |
t42_decode_state_t * | t42_decode_init (t42_decode_state_t *s, t4_row_write_handler_t handler, void *user_data) |
Prepare to decode an image in T.42 format. More... | |
int | t42_decode_release (t42_decode_state_t *s) |
Release a T.42 decode context. More... | |
int | t42_decode_free (t42_decode_state_t *s) |
Free a T.42 decode context. More... | |
typedef struct t42_decode_state_s t42_decode_state_t |
State of a working instance of the T.42 decoder
typedef struct t42_encode_state_s t42_encode_state_t |
State of a working instance of the T.42 encoder
void lab_to_srgb | ( | lab_params_t * | s, |
uint8_t | srgb[], | ||
const uint8_t | lab[], | ||
int | pixels | ||
) |
Convert a row of 8 bit pixels from sRGB to Lab.
s | The Lab parameters context. |
srgb | The output pixels |
lab | The input pixels |
pixel | The number of pixels in the row. |
void srgb_to_lab | ( | lab_params_t * | s, |
uint8_t | lab[], | ||
const uint8_t | srgb[], | ||
int | pixels | ||
) |
Convert a row of 8 bit pixels from Lab to sRGB.
s | The Lab parameters context. |
lab | The output pixels |
srgb | The input pixels |
pixel | The number of pixels in the row. |
int t42_decode_free | ( | t42_decode_state_t * | s | ) |
Free a T.42 decode context.
s | The T.42 decode context. |
References t42_decode_release().
int t42_decode_get_compressed_image_size | ( | t42_decode_state_t * | s | ) |
Get the size of the compressed image in bits.
s | The T.42 context. |
References t42_decode_state_s::compressed_image_size.
uint32_t t42_decode_get_image_length | ( | t42_decode_state_t * | s | ) |
Get the length of the image.
s | The T.42 context. |
uint32_t t42_decode_get_image_width | ( | t42_decode_state_t * | s | ) |
Get the width of the image.
s | The T.42 context. |
logging_state_t * t42_decode_get_logging_state | ( | t42_decode_state_t * | s | ) |
Get the logging context associated with a T.42 decode context.
Get the logging context associated with a T.42 decode context.
s | The T.42 decode context. |
References t42_decode_state_s::logging.
t42_decode_state_t * t42_decode_init | ( | t42_decode_state_t * | s, |
t4_row_write_handler_t | handler, | ||
void * | user_data | ||
) |
Prepare to decode an image in T.42 format.
s | The T.42 context. |
handler | A callback routine to handle decoded image rows. |
user_data | An opaque pointer passed to handler. |
int t42_decode_put | ( | t42_decode_state_t * | s, |
const uint8_t | data[], | ||
size_t | len | ||
) |
Decode a chunk of T.42 data.
s | The T.42 context. |
data | The data to be decoded. |
len | The length of the data to be decoded. |
int t42_decode_release | ( | t42_decode_state_t * | s | ) |
Release a T.42 decode context.
s | The T.42 decode context. |
Referenced by t42_decode_free().
int t42_decode_restart | ( | t42_decode_state_t * | s | ) |
Restart a T.42 decode context.
s | The T.42 context. |
int t42_decode_set_comment_handler | ( | t42_decode_state_t * | s, |
uint32_t | max_comment_len, | ||
t4_row_write_handler_t | handler, | ||
void * | user_data | ||
) |
Set the comment handler routine.
s | The T.42 context. |
max_comment_len | The maximum length of comment to be passed to the handler. |
handler | A callback routine to handle decoded comment. |
user_data | An opaque pointer passed to handler. |
References t42_decode_state_s::comment_handler, t42_decode_state_s::comment_user_data, and t42_decode_state_s::max_comment_len.
int t42_decode_set_image_size_constraints | ( | t42_decode_state_t * | s, |
uint32_t | max_xd, | ||
uint32_t | max_yd | ||
) |
Set constraints on the received image size.
A maliciously constructed T.42 image could consume too much memory, and constitute a denial of service attack on the system. This function allows constraints to be applied.
s | The T.42 context. |
max_xd | The maximum permitted width of the full image, in pixels |
max_yd | The maximum permitted height of the full image, in pixels |
int t42_decode_set_row_write_handler | ( | t42_decode_state_t * | s, |
t4_row_write_handler_t | handler, | ||
void * | user_data | ||
) |
Set the row handler routine.
s | The T.42 context. |
handler | A callback routine to handle decoded image rows. |
user_data | An opaque pointer passed to handler. |
References t42_decode_state_s::row_write_handler, and t42_decode_state_s::row_write_user_data.
Referenced by t4_rx_set_row_write_handler().
int t42_encode_free | ( | t42_encode_state_t * | s | ) |
Free a T.42 encode context.
s | The T.42 encode context. |
References t42_encode_release().
int t42_encode_get_compressed_image_size | ( | t42_encode_state_t * | s | ) |
Get the size of the compressed image in bits.
s | The T.42 context. |
References t42_encode_state_s::compressed_image_size.
logging_state_t * t42_encode_get_logging_state | ( | t42_encode_state_t * | s | ) |
Get the logging context associated with a T.42 encode context.
Get the logging context associated with a T.42 encode context.
s | The T.42 encode context. |
References t42_encode_state_s::logging.
int t42_encode_image_complete | ( | t42_encode_state_t * | s | ) |
Check if we are at the end of the current document page.
s | The T.42 context. |
Referenced by t4_tx_image_complete().
t42_encode_state_t * t42_encode_init | ( | t42_encode_state_t * | s, |
uint32_t | image_width, | ||
uint32_t | image_length, | ||
t4_row_read_handler_t | handler, | ||
void * | user_data | ||
) |
Prepare to encode an image in T.42 format.
s | The T.42 context. |
image_width | Image width, in pixels. |
image_length | Image length, in pixels. |
handler | A callback routine to handle encoded image rows. |
user_data | An opaque pointer passed to handler. |
int t42_encode_release | ( | t42_encode_state_t * | s | ) |
Release a T.42 encode context.
s | The T.42 encode context. |
Referenced by t42_encode_free().
int t42_encode_restart | ( | t42_encode_state_t * | s, |
uint32_t | image_width, | ||
uint32_t | image_length | ||
) |
Restart a T.42 encode context.
s | The T.42 context. |
image | image_width The image width, in pixels. |
image | image_width The image length, in pixels. |