From 1f1d206da8f14b7328279014288f068e15adf89f Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Mon, 26 Feb 2024 16:46:28 +0100 Subject: [PATCH] fix gamma table values and descriptors --- src/kds_s2000w_handler_opts.c | 8 ++++---- src/kds_s2000w_option_descriptors.c | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/kds_s2000w_handler_opts.c b/src/kds_s2000w_handler_opts.c index 1615d47..c1250d7 100644 --- a/src/kds_s2000w_handler_opts.c +++ b/src/kds_s2000w_handler_opts.c @@ -5,7 +5,7 @@ #include "kds_s2000w_handler_opts.h" #include "kds_s2000w_debug.h" -#define COUNT_CUSTOM_OPTIONS 7 +#define COUNT_CUSTOM_OPTIONS 8 extern response* resp; extern json_object* resp_config; @@ -224,13 +224,13 @@ void kds_s2000w_handler_get_option(handler* h, int option, void* value, int* inf memcpy(value, &gamma_table[0][0], sizeof(int) * 256); break; case 27: - memcpy(value, &gamma_table[0][1], sizeof(int) * 256); + memcpy(value, &gamma_table[1][0], sizeof(int) * 256); break; case 28: - memcpy(value, &gamma_table[0][2], sizeof(int) * 256); + memcpy(value, &gamma_table[2][0], sizeof(int) * 256); break; case 29: - memcpy(value, &gamma_table[0][3], sizeof(int) * 256); + memcpy(value, &gamma_table[3][0], sizeof(int) * 256); break; default: break; diff --git a/src/kds_s2000w_option_descriptors.c b/src/kds_s2000w_option_descriptors.c index fe1e494..8ce5761 100644 --- a/src/kds_s2000w_option_descriptors.c +++ b/src/kds_s2000w_option_descriptors.c @@ -622,9 +622,9 @@ SANE_Option_Descriptor* _kds_s2000w_option_descriptor_gamma_vector_r() descriptor->type = SANE_TYPE_INT; descriptor->unit = SANE_UNIT_NONE; constraint_gamma_range_r = malloc(sizeof(SANE_Range)); - constraint_gamma_range->min = 0; - constraint_gamma_range->max = 255; - constraint_gamma_range->quant = 1; + constraint_gamma_range_r->min = 0; + constraint_gamma_range_r->max = 255; + constraint_gamma_range_r->quant = 0; descriptor->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; descriptor->constraint_type = SANE_CONSTRAINT_RANGE; descriptor->constraint.range = constraint_gamma_range_r; @@ -644,9 +644,9 @@ SANE_Option_Descriptor* _kds_s2000w_option_descriptor_gamma_vector_g() descriptor->type = SANE_TYPE_INT; descriptor->unit = SANE_UNIT_NONE; constraint_gamma_range_g = malloc(sizeof(SANE_Range)); - constraint_gamma_range->min = 0; - constraint_gamma_range->max = 255; - constraint_gamma_range->quant = 0; + constraint_gamma_range_g->min = 0; + constraint_gamma_range_g->max = 255; + constraint_gamma_range_g->quant = 0; descriptor->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; descriptor->constraint_type = SANE_CONSTRAINT_RANGE; descriptor->constraint.range = constraint_gamma_range_g; @@ -666,9 +666,9 @@ SANE_Option_Descriptor* _kds_s2000w_option_descriptor_gamma_vector_b() descriptor->type = SANE_TYPE_INT; descriptor->unit = SANE_UNIT_NONE; constraint_gamma_range_b = malloc(sizeof(SANE_Range)); - constraint_gamma_range->min = 0; - constraint_gamma_range->max = 255; - constraint_gamma_range->quant = 0; + constraint_gamma_range_b->min = 0; + constraint_gamma_range_b->max = 255; + constraint_gamma_range_b->quant = 0; descriptor->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; descriptor->constraint_type = SANE_CONSTRAINT_RANGE; descriptor->constraint.range = constraint_gamma_range_b; -- 2.39.5