提交 9eab201f authored 作者: Steve Underwood's avatar Steve Underwood

More steps towards colour FAX

上级 fe4dff7c
......@@ -222,10 +222,12 @@ struct t30_state_s
int local_interrupt_pending;
/*! \brief The common ground in compression schemes between the local and far ends. */
int mutual_compressions;
/*! \brief The common group supported bi-level image resolutions. */
/*! \brief The common group of supported bi-level image resolutions. */
int mutual_bilevel_resolutions;
/*! \brief The common group supported colour image resolutions. */
/*! \brief The common group of supported colour image resolutions. */
int mutual_colour_resolutions;
/*! \brief The common group of supported image sizes. */
int mutual_image_sizes;
/*! \brief The image coding being used on the line. */
int line_encoding;
/*! \brief The image coding being used for output files. */
......
......@@ -80,9 +80,17 @@
/* Standard facsimile terminals conforming to ITU-T Rec. T.4 must have the following capability:
Paper length = 297 mm. */
/* Bits 17, 18 - recording width */
#define T30_DIS_BIT_215MM_255MM_WIDTH_CAPABLE 17
#define T30_DCS_BIT_255MM_WIDTH 17
/* Bits 19, 20 - paper length */
#define T30_DIS_BIT_215MM_255MM_303MM_WIDTH_CAPABLE 18
#define T30_DCS_BIT_303MM_WIDTH 18
#define T30_DIS_BIT_A4_B4_LENGTH_CAPABLE 19
#define T30_DCS_BIT_B4_LENGTH 19
#define T30_DIS_BIT_UNLIMITED_LENGTH_CAPABLE 20
#define T30_DCS_BIT_UNLIMITED_LENGTH 20
/* Bits 21, 22, 23 - min scan line time */
......
......@@ -82,6 +82,10 @@ typedef struct
int x_resolution;
/*! \brief Row-to-row (Y) resolution in pixels per metre on the wire. */
int y_resolution;
/*! \brief Code for the combined X and Y resolution of the image in the file. */
int resolution_code;
/*! \brief Image type - bi-level, gray, colour, etc. */
int image_type;
} t4_tx_metadata_t;
/*!
......
......@@ -98,11 +98,11 @@ enum
T30_SUPPORT_COMPRESSION_GRAYSCALE = 0x1000000,
/*! Colour support by multi-level codecs */
T30_SUPPORT_COMPRESSION_COLOUR = 0x2000000,
/*! 12 bit mode for gray scale and colour */
/*! 12 bit mode for gray-scale and colour */
T30_SUPPORT_COMPRESSION_12BIT = 0x4000000,
/*! Convert a colour image to a gray-scale one */
T30_SUPPORT_COMPRESSION_COLOUR_TO_GRAY = 0x8000000,
/*! Dither a gray scale image down a simple bilevel image, with rescaling to fit a FAX page */
/*! Dither a gray-scale image down a simple bilevel image, with rescaling to fit a FAX page */
T30_SUPPORT_GRAY_TO_BILEVEL = 0x10000000,
/*! Dither a colour image down a simple bilevel image, with rescaling to fit a FAX page */
T30_SUPPORT_COLOUR_TO_BILEVEL = 0x20000000,
......@@ -141,7 +141,7 @@ typedef enum
T4_X_RESOLUTION_200 = 7874,
T4_X_RESOLUTION_R8 = 8031,
T4_X_RESOLUTION_300 = 11811,
T4_X_RESOLUTION_400 = 15784,
T4_X_RESOLUTION_400 = 15748,
T4_X_RESOLUTION_R16 = 16063,
T4_X_RESOLUTION_600 = 23622,
T4_X_RESOLUTION_800 = 31496,
......@@ -176,27 +176,27 @@ enum
/*! Double FAX resolution 408dpi x 391dpi - bi-level only */
T4_RESOLUTION_R16_SUPERFINE = 4,
/*! 100dpi x 100 dpi - gray-scale and colour only */
/*! 100dpi x 100dpi - gray-scale and colour only */
T4_RESOLUTION_100_100 = 5,
/*! 200dpi x 100 dpi - bi-level only */
/*! 200dpi x 100dpi - bi-level only */
T4_RESOLUTION_200_100 = 6,
/*! 200dpi x 200 dpi */
/*! 200dpi x 200dpi */
T4_RESOLUTION_200_200 = 7,
/*! 200dpi x 400 dpi - bi-level only */
/*! 200dpi x 400dpi - bi-level only */
T4_RESOLUTION_200_400 = 8,
/*! 300dpi x 300 dpi */
/*! 300dpi x 300dpi */
T4_RESOLUTION_300_300 = 9,
/*! 300dpi x 600 dpi - bi-level only */
/*! 300dpi x 600dpi - bi-level only */
T4_RESOLUTION_300_600 = 10,
/*! 400dpi x 400 dpi */
/*! 400dpi x 400dpi */
T4_RESOLUTION_400_400 = 11,
/*! 400dpi x 800 dpi - bi-level only */
/*! 400dpi x 800dpi - bi-level only */
T4_RESOLUTION_400_800 = 12,
/*! 600dpi x 600 dpi */
/*! 600dpi x 600dpi */
T4_RESOLUTION_600_600 = 13,
/*! 600dpi x 1200 dpi - bi-level only */
/*! 600dpi x 1200dpi - bi-level only */
T4_RESOLUTION_600_1200 = 14,
/*! 1200dpi x 1200 dpi */
/*! 1200dpi x 1200dpi */
T4_RESOLUTION_1200_1200 = 15
};
......@@ -211,27 +211,27 @@ enum
/*! Support double FAX resolution 408dpi x 391dpi - bi-level only */
T4_SUPPORT_RESOLUTION_R16_SUPERFINE = 0x8,
/*! Support 100dpi x 100 dpi - gray scale and colour only */
/*! Support 100dpi x 100dpi - gray-scale and colour only */
T4_SUPPORT_RESOLUTION_100_100 = 0x10,
/*! Support 200dpi x 100 dpi - bi-level only */
/*! Support 200dpi x 100dpi - bi-level only */
T4_SUPPORT_RESOLUTION_200_100 = 0x20,
/*! Support 200dpi x 200 dpi */
/*! Support 200dpi x 200dpi */
T4_SUPPORT_RESOLUTION_200_200 = 0x40,
/*! Support 200dpi x 400 dpi - bi-level only */
/*! Support 200dpi x 400dpi - bi-level only */
T4_SUPPORT_RESOLUTION_200_400 = 0x80,
/*! Support 300dpi x 300 dpi */
/*! Support 300dpi x 300dpi */
T4_SUPPORT_RESOLUTION_300_300 = 0x100,
/*! Support 300dpi x 600 dpi - bi-level only */
/*! Support 300dpi x 600dpi - bi-level only */
T4_SUPPORT_RESOLUTION_300_600 = 0x200,
/*! Support 400dpi x 400 dpi */
/*! Support 400dpi x 400dpi */
T4_SUPPORT_RESOLUTION_400_400 = 0x400,
/*! Support 400dpi x 800 dpi - bi-level only */
/*! Support 400dpi x 800dpi - bi-level only */
T4_SUPPORT_RESOLUTION_400_800 = 0x800,
/*! Support 600dpi x 600 dpi */
/*! Support 600dpi x 600dpi */
T4_SUPPORT_RESOLUTION_600_600 = 0x1000,
/*! Support 600dpi x 1200 dpi - bi-level only */
/*! Support 600dpi x 1200dpi - bi-level only */
T4_SUPPORT_RESOLUTION_600_1200 = 0x2000,
/*! Support 1200dpi x 1200 dpi */
/*! Support 1200dpi x 1200dpi */
T4_SUPPORT_RESOLUTION_1200_1200 = 0x4000
};
......@@ -542,10 +542,16 @@ SPAN_DECLARE(const char *) t4_encoding_to_str(int encoding);
/*! Get the short text name of an image format.
\brief Get the short text name of an image format.
\param encoding The image format.
\param type The image format.
\return A pointer to the string. */
SPAN_DECLARE(const char *) t4_image_type_to_str(int type);
/*! Get the short text name of an image resolution.
\brief Get the short text name of an image resolution.
\param resolution_code The image resolution code.
\return A pointer to the string. */
SPAN_DECLARE(const char *) t4_image_resolution_to_str(int resolution_code);
/*! Get the logging context associated with a T.4 receive context.
\brief Get the logging context associated with a T.4 receive context.
\param s The T.4 receive context.
......
......@@ -341,11 +341,21 @@ SPAN_DECLARE(int) t4_tx_get_y_resolution(t4_tx_state_t *s);
\return The resolution, in pixels per metre. */
SPAN_DECLARE(int) t4_tx_get_x_resolution(t4_tx_state_t *s);
/*! \brief Get the X and Y resolution code of the current page.
\param s The T.4 context.
\return The resolution code,. */
SPAN_DECLARE(int) t4_tx_get_resolution(t4_tx_state_t *s);
/*! \brief Get the width of the current page, in pixel columns.
\param s The T.4 context.
\return The number of columns. */
SPAN_DECLARE(int) t4_tx_get_image_width(t4_tx_state_t *s);
/*! \brief Get the type of the current page, in pixel columns.
\param s The T.4 context.
\return The type. */
SPAN_DECLARE(int) t4_tx_get_image_type(t4_tx_state_t *s);
/*! \brief Get the number of pages in the file.
\param s The T.4 context.
\return The number of pages, or -1 if there is an error. */
......
差异被折叠。
......@@ -754,7 +754,10 @@ SPAN_DECLARE(int) t30_set_supported_colour_resolutions(t30_state_t *s, int suppo
SPAN_DECLARE(int) t30_set_supported_image_sizes(t30_state_t *s, int supported_image_sizes)
{
s->supported_image_sizes = supported_image_sizes;
/* Force the sizes which are always available */
s->supported_image_sizes = supported_image_sizes
| T4_SUPPORT_WIDTH_215MM
| T4_SUPPORT_LENGTH_A4;
t30_build_dis_or_dtc(s);
return 0;
}
......
差异被折叠。
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论