]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
fix gamma table values and descriptors
authorBastian Dehn <hhaalo@arcor.de>
Mon, 26 Feb 2024 15:46:28 +0000 (16:46 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Mon, 26 Feb 2024 15:46:28 +0000 (16:46 +0100)
src/kds_s2000w_handler_opts.c
src/kds_s2000w_option_descriptors.c

index 1615d479b1080bd341c9ef9b0a6ff32eb2aa38f9..c1250d7acb32608234f5416df63d8d9dba46fff1 100644 (file)
@@ -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;
index fe1e4944d204c9a1718e0bfa61a9b7de0d2aef3f..8ce57614a9ad6e30475cb0d89ae5cd8990969a61 100644 (file)
@@ -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;