]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
fix load gamma table
authorBastian Dehn <hhaalo@arcor.de>
Thu, 15 Feb 2024 15:47:03 +0000 (16:47 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Thu, 15 Feb 2024 15:47:03 +0000 (16:47 +0100)
src/kds_s2000w_handler_opts.c
src/kds_s2000w_option_descriptors.c

index 89797d883f9e1a6e414c57c9e24afa59f108cb45..e11e056bc203aa01138f0c068e57078cec3090c1 100644 (file)
@@ -214,20 +214,16 @@ void kds_s2000w_handler_get_option(int option, void* value)
                        _write_string_value(value_object, value);
                        break;
                case 25:
-                       int default_gamma = 0;
-                       memcpy(value, &default_gamma, sizeof(int));
+                       memcpy(value, &gamma_table[0][0], sizeof(int) * 256);
                        break;
                case 26:
-                       int default_gamma_r = 0;
-                       memcpy(value, &default_gamma_r, sizeof(int));
+                       memcpy(value, &gamma_table[0][1], sizeof(int) * 256);
                        break;
                case 27:
-                       int default_gamma_g = 0;
-                       memcpy(value, &default_gamma_g, sizeof(int));
+                       memcpy(value, &gamma_table[0][2], sizeof(int) * 256);
                        break;
                case 28:
-                       int default_gamma_b = 0;
-                       memcpy(value, &default_gamma_b, sizeof(int));
+                       memcpy(value, &gamma_table[0][3], sizeof(int) * 256);
                default:
                        break;
        }
index d493afcbfd1345b70b0464110a640c6ae3dbecdd..8c2417ee33401ccb56f8799d096004ae2bea0b70 100644 (file)
@@ -539,11 +539,11 @@ SANE_Option_Descriptor* _kds_s2000w_option_descriptor_gamma_vector()
        constraint_gamma_range = malloc(sizeof(SANE_Range));
        constraint_gamma_range->min = 0;
        constraint_gamma_range->max = 255;
-       constraint_gamma_range->quant = 1;
+       constraint_gamma_range->quant = 0;
        descriptor->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT;
        descriptor->constraint_type = SANE_CONSTRAINT_RANGE;
        descriptor->constraint.range = constraint_gamma_range;
-       descriptor->size = sizeof(SANE_Int);
+       descriptor->size = sizeof(SANE_Int) * 256;
 }
 
 SANE_Option_Descriptor* _kds_s2000w_option_descriptor_gamma_vector_r()
@@ -563,7 +563,7 @@ SANE_Option_Descriptor* _kds_s2000w_option_descriptor_gamma_vector_r()
        descriptor->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT;
        descriptor->constraint_type = SANE_CONSTRAINT_RANGE;
        descriptor->constraint.range = constraint_gamma_range;
-       descriptor->size = sizeof(SANE_Int);
+       descriptor->size = sizeof(SANE_Int) * 256;
 }
 
 SANE_Option_Descriptor* _kds_s2000w_option_descriptor_gamma_vector_g()
@@ -579,11 +579,11 @@ SANE_Option_Descriptor* _kds_s2000w_option_descriptor_gamma_vector_g()
        constraint_gamma_range = malloc(sizeof(SANE_Range));
        constraint_gamma_range->min = 0;
        constraint_gamma_range->max = 255;
-       constraint_gamma_range->quant = 1;
+       constraint_gamma_range->quant = 0;
        descriptor->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT;
        descriptor->constraint_type = SANE_CONSTRAINT_RANGE;
        descriptor->constraint.range = constraint_gamma_range;
-       descriptor->size = sizeof(SANE_Int);
+       descriptor->size = sizeof(SANE_Int) * 256;
 }
 
 
@@ -601,11 +601,11 @@ SANE_Option_Descriptor* _kds_s2000w_option_descriptor_gamma_vector_b()
        constraint_gamma_range = malloc(sizeof(SANE_Range));
        constraint_gamma_range->min = 0;
        constraint_gamma_range->max = 255;
-       constraint_gamma_range->quant = 1;
-       descriptor->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT;
+       constraint_gamma_range->quant = 0;
+       descriptor->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT | SANE_CAP_INACTIVE;
        descriptor->constraint_type = SANE_CONSTRAINT_RANGE;
        descriptor->constraint.range = constraint_gamma_range;
-       descriptor->size = sizeof(SANE_Int);
+       descriptor->size = sizeof(SANE_Int) * 256;
 }
 
 void kds_s2000w_option_descriptor_init_option_descriptors()