28#if !defined(_SPANDSP_T42_H_)
29#define _SPANDSP_T42_H_
46#if defined(__cplusplus)
62SPAN_DECLARE(
void)
srgb_to_lab(lab_params_t *s, uint8_t lab[],
const uint8_t srgb[],
int pixels);
69SPAN_DECLARE(
void)
lab_to_srgb(lab_params_t *s, uint8_t srgb[],
const uint8_t lab[],
int pixels);
71SPAN_DECLARE(
void) set_lab_illuminant(lab_params_t *s,
float new_xn,
float new_yn,
float new_zn);
73SPAN_DECLARE(
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);
75SPAN_DECLARE(
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);
77SPAN_DECLARE(
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);
79SPAN_DECLARE(
bool) t42_analyse_header(uint32_t *width, uint32_t *length,
const uint8_t data[],
size_t len);
81SPAN_DECLARE(
void) t42_encode_set_options(
t42_encode_state_t *s, uint32_t l0,
int quality,
int options);
83SPAN_DECLARE(
int) t42_encode_set_image_width(
t42_encode_state_t *s, uint32_t image_width);
91SPAN_DECLARE(
void) t42_encode_comment(
t42_encode_state_t *s,
const uint8_t comment[],
size_t len);
132 uint32_t image_width,
133 uint32_t image_length,
172 uint32_t max_comment_len,
232#if defined(__cplusplus)
struct logging_state_s logging_state_t
Definition logging.h:72
Definition private/t42.h:33
Definition private/t42.h:99
Definition private/t42.h:54
int t42_encode_free(t42_encode_state_t *s)
Free a T.42 encode context.
Definition t42.c:1086
int t42_encode_get_compressed_image_size(t42_encode_state_t *s)
Get the size of the compressed image in bits.
Definition t42.c:978
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.
Definition t42.c:525
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.
Definition t42.c:468
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.
Definition t42.c:1051
int t42_decode_release(t42_decode_state_t *s)
Release a T.42 decode context.
Definition t42.c:1457
int t42_decode_put(t42_decode_state_t *s, const uint8_t data[], size_t len)
Decode a chunk of T.42 data.
Definition t42.c:1314
logging_state_t * t42_encode_get_logging_state(t42_encode_state_t *s)
Get the logging context associated with a T.42 encode context.
Definition t42.c:994
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.
Definition t42.c:1369
int t42_encode_restart(t42_encode_state_t *s, uint32_t image_width, uint32_t image_length)
Restart a T.42 encode context.
Definition t42.c:1000
int t42_decode_free(t42_decode_state_t *s)
Free a T.42 decode context.
Definition t42.c:1488
int colour_temp_to_xyz(float xyz[3], float temp)
Convert a colour temperature to an X0, Y0, Z0 coordinate.
Definition t42.c:283
uint32_t t42_decode_get_image_length(t42_decode_state_t *s)
Get the length of the image.
Definition t42.c:1383
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.
Definition t42.c:1347
int t42_decode_get_compressed_image_size(t42_decode_state_t *s)
Get the size of the compressed image in bits.
Definition t42.c:1389
struct t42_decode_state_s t42_decode_state_t
Definition t42.h:42
int t42_decode_restart(t42_decode_state_t *s)
Restart a T.42 decode context.
Definition t42.c:1401
int t42_encode_image_complete(t42_encode_state_t *s)
Check if we are at the end of the current document page.
Definition t42.c:752
int xyz_to_corrected_color_temp(float *temp, float xyz[3])
Convert an X0, Y0, Z0 coordinate to a colour tempature.
Definition t42.c:243
uint32_t t42_decode_get_image_width(t42_decode_state_t *s)
Get the width of the image.
Definition t42.c:1377
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.
Definition t42.c:1357
struct t42_encode_state_s t42_encode_state_t
Definition t42.h:39
int t42_encode_release(t42_encode_state_t *s)
Release a T.42 encode context.
Definition t42.c:1080
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.
Definition t42.c:1430
logging_state_t * t42_decode_get_logging_state(t42_decode_state_t *s)
Get the logging context associated with a T.42 decode context.
Definition t42.c:1395
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