summaryrefslogtreecommitdiff
path: root/backend/canon_dr.h
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2023-02-12 17:36:29 +0100
committerJörg Frings-Fürst <debian@jff.email>2023-02-12 17:36:29 +0100
commit882fd010527b8d8823f09e19edbed3746265fa08 (patch)
treebe5c7cace6697afc753c152d13ad5145d0884a42 /backend/canon_dr.h
parent527bedac30eb120915718eb7997e6dacd583512e (diff)
parente0d94cf4d39395df1e2c6bb4d967200298c13881 (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'backend/canon_dr.h')
-rw-r--r--backend/canon_dr.h81
1 files changed, 80 insertions, 1 deletions
diff --git a/backend/canon_dr.h b/backend/canon_dr.h
index 7afbb90..e84b5b7 100644
--- a/backend/canon_dr.h
+++ b/backend/canon_dr.h
@@ -51,6 +51,22 @@ enum scanner_Option
OPT_SIDE,
OPT_HW_CROP,
+ /*imprinter option group*/
+ OPT_IMPRINT_GROUP,
+ OPT_PRE_IMPRINT_SPECSTRING,
+ OPT_PRE_IMPRINT_H_OFFSET,
+ OPT_PRE_IMPRINT_V_OFFSET,
+ OPT_PRE_IMPRINT_FONT_SIZE,
+ OPT_PRE_IMPRINT_FONT_ROT,
+ OPT_PRE_IMPRINT_SPACING,
+ OPT_POST_IMPRINT_SPECSTRING,
+ OPT_POST_IMPRINT_H_OFFSET,
+ OPT_POST_IMPRINT_V_OFFSET,
+ OPT_POST_IMPRINT_FONT_SIZE,
+ OPT_POST_IMPRINT_FONT_ROT,
+ OPT_POST_IMPRINT_SPACING,
+ OPT_POST_IMPRINT_ADDON_MODE,
+
/*sensor group*/
OPT_SENSOR_GROUP,
OPT_START,
@@ -60,6 +76,8 @@ enum scanner_Option
OPT_COUNTONLY,
OPT_BYPASSMODE,
OPT_COUNTER,
+ OPT_ROLLERCOUNTER,
+ OPT_TOTALCOUNTER,
OPT_ADF_LOADED,
OPT_CARD_LOADED,
@@ -106,6 +124,32 @@ struct img_params
};
+struct imprint_params
+{
+ /* ------------------------------------------------------------------------------ */
+ /* allowed values for post imprinter (in mm units): */
+ /* 21, 35, 47, 59, 72, 99, 114, 143, 155, 167, 196, 211, 239, 251, 263, 275, 289 */
+ /* allowed values for pre imprinter (in mm units): */
+ /* 14, 28, 41, 53, 65, 106 */
+ int h_offset;
+ /* --------------------------------------- */
+ /* allowed values: 0 to 500 (in mm units) */
+ int v_offset;
+
+ int font_size;
+ int font_rot;
+ int spacing;
+
+#define IMPRINT_SPECSTRING_LEN 64
+ /* ---------------------------------- */
+ /* special tokens: */
+ /* \TIME time in HH:MM:SS */
+ /* \DMY date in DD/MM/YYYY */
+ /* \YMD date in YYYY/MM/DD */
+ /* [[0-9]+] scan page count */
+ char specstring[IMPRINT_SPECSTRING_LEN];
+};
+
struct scanner
{
/* --------------------------------------------------------------------- */
@@ -204,9 +248,12 @@ struct scanner
int has_ssm2; /* newer scanners user this similar command */
int has_ssm_pay_head_len; /* newer scanners put the length twice in ssm */
int has_hwcrop;
+ int has_pre_imprinter;
+ int has_post_imprinter;
int can_read_sensors;
int can_read_panel;
int can_write_panel;
+ int can_read_lifecycle_counters;
int rgb_format; /* meaning unknown */
int padding; /* meaning unknown */
@@ -317,13 +364,34 @@ struct scanner
unsigned char lut[256];
/* --------------------------------------------------------------------- */
- /* values used by the software enhancement code (deskew, crop, etc) */
+ /* values used by the software enhancement code (deskew, crop, etc) */
SANE_Status deskew_stat;
int deskew_vals[2];
double deskew_slope;
int crop_vals[4];
+ /* imprinter params */
+ struct imprint_params pre_imprint;
+ struct imprint_params post_imprint;
+ enum {
+ /*Black-on-White*/
+ ADDON_BoW = 0,
+ /*White-on-Black*/
+ ADDON_WoB,
+ /*Black-on-Image*/
+ ADDON_BoI,
+ ADDON_DISABLED
+ } post_imprint_addon_mode;
+
+ /* imprinter param constraints */
+ SANE_Int pre_imprinter_h_offset_list[7];
+ SANE_Int post_imprinter_h_offset_list[18];
+ SANE_Range imprinter_v_offset_range;
+ SANE_String_Const imprint_font_size_list[3];
+ SANE_Int imprinter_font_angle_list[5];
+ SANE_String_Const imprint_addon_mode_list[5];
+
/* this is defined in sane spec as a struct containing:
SANE_Frame format;
SANE_Bool last_frame;
@@ -379,6 +447,8 @@ struct scanner
int panel_counter;
int sensor_adf_loaded;
int sensor_card_loaded;
+ int roller_counter;
+ int total_counter;
/* values which are used to track the frontend's access to sensors */
char panel_read[OPT_COUNTER - OPT_START + 1];
@@ -541,7 +611,9 @@ static SANE_Status sense_handler (int scsi_fd, u_char * result, void *arg);
static SANE_Status init_inquire (struct scanner *s);
static SANE_Status init_vpd (struct scanner *s);
static SANE_Status init_model (struct scanner *s);
+static SANE_Status init_imprinters (struct scanner *s);
static SANE_Status init_panel (struct scanner *s);
+static SANE_Status init_counters (struct scanner *s);
static SANE_Status init_user (struct scanner *s);
static SANE_Status init_options (struct scanner *s);
@@ -589,6 +661,7 @@ static SANE_Status update_params (struct scanner *s, int calib);
static SANE_Status update_i_params (struct scanner *s);
static SANE_Status clean_params (struct scanner *s);
+static SANE_Status read_counters(struct scanner *s);
static SANE_Status read_sensors(struct scanner *s, SANE_Int option);
static SANE_Status read_panel(struct scanner *s, SANE_Int option);
static SANE_Status send_panel(struct scanner *s);
@@ -632,6 +705,12 @@ static SANE_Status calibrate_fine_dest_hw(struct scanner *s);
static SANE_Status write_AFE (struct scanner *s);
static SANE_Status calibration_scan (struct scanner *s, int);
+static SANE_Status send_imprint_positioning(struct scanner* s, int is_postimprint, int enabled);
+static SANE_Status send_imprint_specstring(struct scanner* s, int is_postimprint);
+static SANE_Status send_imprint_date_and_time(struct scanner* s);
+static SANE_Status load_imprinting_settings(struct scanner *s);
+static SANE_Status detect_imprinter(struct scanner *s, SANE_Int option);
+
static void hexdump (int level, char *comment, unsigned char *p, int l);
static void default_globals (void);