diff options
Diffstat (limited to 'backend/genesys/enums.h')
-rw-r--r-- | backend/genesys/enums.h | 202 |
1 files changed, 161 insertions, 41 deletions
diff --git a/backend/genesys/enums.h b/backend/genesys/enums.h index 810c4ca..0e16ba4 100644 --- a/backend/genesys/enums.h +++ b/backend/genesys/enums.h @@ -182,6 +182,7 @@ enum class ModelId : unsigned CANON_LIDE_50, CANON_LIDE_60, CANON_LIDE_80, + CANON_LIDE_90, CANON_LIDE_100, CANON_LIDE_110, CANON_LIDE_120, @@ -201,9 +202,12 @@ enum class ModelId : unsigned PANASONIC_KV_SS080, PENTAX_DSMOBILE_600, PLUSTEK_OPTICBOOK_3800, + PLUSTEK_OPTICFILM_7200, PLUSTEK_OPTICFILM_7200I, PLUSTEK_OPTICFILM_7300, + PLUSTEK_OPTICFILM_7400, PLUSTEK_OPTICFILM_7500I, + PLUSTEK_OPTICFILM_8200I, PLUSTEK_OPTICPRO_3600, PLUSTEK_OPTICPRO_ST12, PLUSTEK_OPTICPRO_ST24, @@ -222,16 +226,33 @@ enum class ModelId : unsigned XEROX_TRAVELSCANNER_100, }; +inline void serialize(std::istream& str, ModelId& x) +{ + unsigned value; + serialize(str, value); + x = static_cast<ModelId>(value); +} + +inline void serialize(std::ostream& str, ModelId& x) +{ + unsigned value = static_cast<unsigned>(x); + serialize(str, value); +} + +std::ostream& operator<<(std::ostream& out, ModelId id); + enum class SensorId : unsigned { UNKNOWN = 0, CCD_5345, CCD_CANON_4400F, + CCD_CANON_5600F, CCD_CANON_8400F, CCD_CANON_8600F, CCD_DP665, CCD_DP685, CCD_DSMOBILE600, + CCD_DOCKETPORT_487, CCD_G4050, CCD_HP2300, CCD_HP2400, @@ -241,9 +262,12 @@ enum class SensorId : unsigned CCD_IMG101, CCD_KVSS080, CCD_PLUSTEK_OPTICBOOK_3800, + CCD_PLUSTEK_OPTICFILM_7200, CCD_PLUSTEK_OPTICFILM_7200I, CCD_PLUSTEK_OPTICFILM_7300, + CCD_PLUSTEK_OPTICFILM_7400, CCD_PLUSTEK_OPTICFILM_7500I, + CCD_PLUSTEK_OPTICFILM_8200I, CCD_PLUSTEK_OPTICPRO_3600, CCD_ROADWARRIOR, CCD_ST12, // SONY ILX548: 5340 Pixel ??? @@ -251,7 +275,9 @@ enum class SensorId : unsigned CCD_UMAX, CCD_XP300, CIS_CANON_LIDE_35, + CIS_CANON_LIDE_60, CIS_CANON_LIDE_80, + CIS_CANON_LIDE_90, CIS_CANON_LIDE_100, CIS_CANON_LIDE_110, CIS_CANON_LIDE_120, @@ -275,6 +301,8 @@ inline void serialize(std::ostream& str, SensorId& x) serialize(str, value); } +std::ostream& operator<<(std::ostream& out, SensorId id); + enum class AdcId : unsigned { @@ -282,20 +310,25 @@ enum class AdcId : unsigned AD_XP200, CANON_LIDE_35, CANON_LIDE_80, + CANON_LIDE_90, CANON_LIDE_110, CANON_LIDE_120, CANON_LIDE_200, CANON_LIDE_700F, CANON_4400F, + CANON_5600F, CANON_8400F, CANON_8600F, G4050, IMG101, KVSS080, PLUSTEK_OPTICBOOK_3800, + PLUSTEK_OPTICFILM_7200, PLUSTEK_OPTICFILM_7200I, PLUSTEK_OPTICFILM_7300, + PLUSTEK_OPTICFILM_7400, PLUSTEK_OPTICFILM_7500I, + PLUSTEK_OPTICFILM_8200I, PLUSTEK_OPTICPRO_3600, WOLFSON_5345, WOLFSON_DSM600, @@ -321,17 +354,21 @@ inline void serialize(std::ostream& str, AdcId& x) serialize(str, value); } +std::ostream& operator<<(std::ostream& out, AdcId id); + enum class GpioId : unsigned { UNKNOWN = 0, CANON_LIDE_35, CANON_LIDE_80, + CANON_LIDE_90, CANON_LIDE_110, CANON_LIDE_120, CANON_LIDE_200, CANON_LIDE_210, CANON_LIDE_700F, CANON_4400F, + CANON_5600F, CANON_8400F, CANON_8600F, DP665, @@ -345,9 +382,12 @@ enum class GpioId : unsigned KVSS080, MD_5345, PLUSTEK_OPTICBOOK_3800, + PLUSTEK_OPTICFILM_7200, PLUSTEK_OPTICFILM_7200I, PLUSTEK_OPTICFILM_7300, + PLUSTEK_OPTICFILM_7400, PLUSTEK_OPTICFILM_7500I, + PLUSTEK_OPTICFILM_8200I, PLUSTEK_OPTICPRO_3600, ST12, ST24, @@ -356,6 +396,8 @@ enum class GpioId : unsigned XP300, }; +std::ostream& operator<<(std::ostream& out, GpioId id); + enum class MotorId : unsigned { UNKNOWN = 0, @@ -365,9 +407,12 @@ enum class MotorId : unsigned CANON_LIDE_200, CANON_LIDE_210, CANON_LIDE_35, + CANON_LIDE_60, CANON_LIDE_700, CANON_LIDE_80, + CANON_LIDE_90, CANON_4400F, + CANON_5600F, CANON_8400F, CANON_8600F, DP665, @@ -380,9 +425,12 @@ enum class MotorId : unsigned KVSS080, MD_5345, PLUSTEK_OPTICBOOK_3800, + PLUSTEK_OPTICFILM_7200, PLUSTEK_OPTICFILM_7200I, PLUSTEK_OPTICFILM_7300, + PLUSTEK_OPTICFILM_7400, PLUSTEK_OPTICFILM_7500I, + PLUSTEK_OPTICFILM_8200I, PLUSTEK_OPTICPRO_3600, ROADWARRIOR, ST24, @@ -391,6 +439,8 @@ enum class MotorId : unsigned XP300, }; +std::ostream& operator<<(std::ostream& out, MotorId id); + enum class StepType : unsigned { FULL = 0, @@ -423,6 +473,7 @@ enum class AsicType : unsigned UNKNOWN = 0, GL646, GL841, + GL842, GL843, GL845, GL846, @@ -431,6 +482,92 @@ enum class AsicType : unsigned }; +enum class ModelFlag : unsigned +{ + // no flags + NONE = 0, + + // scanner is not tested, print a warning as it's likely it won't work + UNTESTED = 1 << 0, + + // use 14-bit gamma table instead of 12-bit + GAMMA_14BIT = 1 << 1, + + // perform lamp warmup + WARMUP = 1 << 4, + + // whether to disable offset and gain calibration + DISABLE_ADC_CALIBRATION = 1 << 5, + + // whether to disable exposure calibration (this currently is only done on CIS + // scanners) + DISABLE_EXPOSURE_CALIBRATION = 1 << 6, + + // whether to disable shading calibration completely + DISABLE_SHADING_CALIBRATION = 1 << 7, + + // do dark calibration + DARK_CALIBRATION = 1 << 8, + + // host-side calibration uses a complete scan + HOST_SIDE_CALIBRATION_COMPLETE_SCAN = 1 << 9, + + // whether scanner must wait for the head while parking + MUST_WAIT = 1 << 10, + + // use zeroes for dark calibration + USE_CONSTANT_FOR_DARK_CALIBRATION = 1 << 11, + + // do dark and white calibration in one run + DARK_WHITE_CALIBRATION = 1 << 12, + + // allow custom gamma tables + CUSTOM_GAMMA = 1 << 13, + + // disable fast feeding mode on this scanner + DISABLE_FAST_FEEDING = 1 << 14, + + // the scanner uses multi-segment sensors that must be handled during calibration + SIS_SENSOR = 1 << 16, + + // the head must be reparked between shading scans + SHADING_REPARK = 1 << 18, + + // the scanner outputs inverted pixel data + INVERT_PIXEL_DATA = 1 << 19, + + // the scanner outputs 16-bit data that is byte-inverted + SWAP_16BIT_DATA = 1 << 20, + + // the scanner has transparency, but it's implemented using only one motor + UTA_NO_SECONDARY_MOTOR = 1 << 21, + + // the scanner has transparency, but it's implemented using only one lamp + TA_NO_SECONDARY_LAMP = 1 << 22, +}; + +inline ModelFlag operator|(ModelFlag left, ModelFlag right) +{ + return static_cast<ModelFlag>(static_cast<unsigned>(left) | static_cast<unsigned>(right)); +} + +inline ModelFlag& operator|=(ModelFlag& left, ModelFlag right) +{ + left = left | right; + return left; +} + +inline ModelFlag operator&(ModelFlag left, ModelFlag right) +{ + return static_cast<ModelFlag>(static_cast<unsigned>(left) & static_cast<unsigned>(right)); +} + +inline bool has_flag(ModelFlag flags, ModelFlag which) +{ + return (flags & which) == which; +} + + enum class ScanFlag : unsigned { NONE = 0, @@ -438,14 +575,24 @@ enum class ScanFlag : unsigned DISABLE_SHADING = 1 << 1, DISABLE_GAMMA = 1 << 2, DISABLE_BUFFER_FULL_MOVE = 1 << 3, - IGNORE_LINE_DISTANCE = 1 << 4, - DISABLE_LAMP = 1 << 5, - CALIBRATION = 1 << 6, - FEEDING = 1 << 7, - USE_XPA = 1 << 8, - ENABLE_LEDADD = 1 << 9, - USE_XCORRECTION = 1 << 10, - REVERSE = 1 << 11, + + // if this flag is set the sensor will always be handled ignoring staggering of multiple + // sensors to achieve high resolution. + IGNORE_STAGGER_OFFSET = 1 << 4, + + // if this flag is set the sensor will always be handled as if the components that scan + // different colors are at the same position. + IGNORE_COLOR_OFFSET = 1 << 5, + + DISABLE_LAMP = 1 << 6, + CALIBRATION = 1 << 7, + FEEDING = 1 << 8, + USE_XPA = 1 << 9, + ENABLE_LEDADD = 1 << 10, + REVERSE = 1 << 12, + + // the scanner should return head to home position automatically after scan. + AUTO_GO_HOME = 1 << 13, }; inline ScanFlag operator|(ScanFlag left, ScanFlag right) @@ -485,45 +632,18 @@ inline void serialize(std::ostream& str, ScanFlag& x) std::ostream& operator<<(std::ostream& out, ScanFlag flags); - -enum class MotorFlag : unsigned -{ - NONE = 0, - AUTO_GO_HOME = 1 << 0, - DISABLE_BUFFER_FULL_MOVE = 1 << 2, - FEED = 1 << 3, - USE_XPA = 1 << 4, - REVERSE = 1 << 5, -}; - -inline MotorFlag operator|(MotorFlag left, MotorFlag right) -{ - return static_cast<MotorFlag>(static_cast<unsigned>(left) | static_cast<unsigned>(right)); -} - -inline MotorFlag& operator|=(MotorFlag& left, MotorFlag right) -{ - left = left | right; - return left; -} - -inline MotorFlag operator&(MotorFlag left, MotorFlag right) -{ - return static_cast<MotorFlag>(static_cast<unsigned>(left) & static_cast<unsigned>(right)); -} - -inline bool has_flag(MotorFlag flags, MotorFlag which) -{ - return (flags & which) == which; -} - - enum class Direction : unsigned { FORWARD = 0, BACKWARD = 1 }; +enum class MotorMode : unsigned +{ + PRIMARY = 0, + PRIMARY_AND_SECONDARY, + SECONDARY, +}; } // namespace genesys |