kopia lustrzana https://gitlab.com/sane-project/backends
genesys: Introduce a model flag for inverted 16-bit output
rodzic
303cc7dedd
commit
7fb6582157
|
@ -1666,7 +1666,7 @@ static void genesys_shading_calibration_impl(Genesys_Device* dev, const Genesys_
|
|||
|
||||
dev->cmd_set->end_scan(dev, &dev->calib_reg, SANE_TRUE);
|
||||
|
||||
if (dev->model->model_id == MODEL_PLUSTEK_OPTICFILM_7200I) {
|
||||
if (dev->model->flags & GENESYS_FLAG_16BIT_DATA_INVERTED) {
|
||||
for (std::size_t i = 0; i < size / 2; ++i) {
|
||||
auto value = calibration_data[i];
|
||||
value = ((value >> 8) & 0xff) | ((value << 8) & 0xff00);
|
||||
|
|
|
@ -850,7 +850,7 @@ Image read_unshuffled_image_from_scanner(Genesys_Device* dev, const ScanSession&
|
|||
ImagePipelineStack pipeline;
|
||||
pipeline.push_first_node<ImagePipelineNodeImageSource>(image);
|
||||
|
||||
if (dev->model->model_id == MODEL_PLUSTEK_OPTICFILM_7200I && session.params.depth == 16) {
|
||||
if ((dev->model->flags & GENESYS_FLAG_16BIT_DATA_INVERTED) && session.params.depth == 16) {
|
||||
dev->pipeline.push_node<ImagePipelineNodeSwap16BitEndian>();
|
||||
}
|
||||
|
||||
|
@ -1714,7 +1714,7 @@ void build_image_pipeline(Genesys_Device* dev, const ScanSession& session)
|
|||
"_0_before_swap.pnm");
|
||||
}
|
||||
|
||||
if (dev->model->model_id == MODEL_PLUSTEK_OPTICFILM_7200I && depth == 16) {
|
||||
if ((dev->model->flags & GENESYS_FLAG_16BIT_DATA_INVERTED) && depth == 16) {
|
||||
dev->pipeline.push_node<ImagePipelineNodeSwap16BitEndian>();
|
||||
}
|
||||
|
||||
|
|
|
@ -138,6 +138,7 @@
|
|||
#define GENESYS_FLAG_HAS_UTA_INFRARED (1 << 20)
|
||||
// scanner calibration is handled on the host side
|
||||
#define GENESYS_FLAG_CALIBRATION_HOST_SIDE (1 << 21)
|
||||
#define GENESYS_FLAG_16BIT_DATA_INVERTED (1 << 22)
|
||||
|
||||
#define GENESYS_HAS_NO_BUTTONS 0 /**< scanner has no supported button */
|
||||
#define GENESYS_HAS_SCAN_SW (1 << 0) /**< scanner has SCAN button */
|
||||
|
|
|
@ -2380,7 +2380,8 @@ void genesys_init_usb_device_tables()
|
|||
GENESYS_FLAG_OFFSET_CALIBRATION |
|
||||
GENESYS_HAS_NO_BUTTONS |
|
||||
GENESYS_FLAG_SHADING_REPARK |
|
||||
GENESYS_FLAG_CALIBRATION_HOST_SIDE;
|
||||
GENESYS_FLAG_CALIBRATION_HOST_SIDE |
|
||||
GENESYS_FLAG_16BIT_DATA_INVERTED;
|
||||
|
||||
model.shading_lines = 7;
|
||||
model.shading_ta_lines = 50;
|
||||
|
|
Ładowanie…
Reference in New Issue