]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
add option for gamma
authorBastian Dehn <hhaalo@arcor.de>
Wed, 14 Feb 2024 20:46:27 +0000 (21:46 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Wed, 14 Feb 2024 20:46:27 +0000 (21:46 +0100)
src/kds_s2000w_handler_opts.c
src/kds_s2000w_option_descriptors.c

index 4f6e8c42923ea760dda01c2c848b1bc71e666ff3..89797d883f9e1a6e414c57c9e24afa59f108cb45 100644 (file)
@@ -214,16 +214,20 @@ void kds_s2000w_handler_get_option(int option, void* value)
                        _write_string_value(value_object, value);
                        break;
                case 25:
-                       memcpy(value, &gamma_table[0][0], sizeof(int) * 256);
+                       int default_gamma = 0;
+                       memcpy(value, &default_gamma, sizeof(int));
                        break;
                case 26:
-                       memcpy(value, &gamma_table[1][0], sizeof(int) * 256);
+                       int default_gamma_r = 0;
+                       memcpy(value, &default_gamma_r, sizeof(int));
                        break;
                case 27:
-                       memcpy(value, &gamma_table[2][0], sizeof(int) * 256);
+                       int default_gamma_g = 0;
+                       memcpy(value, &default_gamma_g, sizeof(int));
                        break;
                case 28:
-                       memcpy(value, &gamma_table[3][0], sizeof(int) * 256);
+                       int default_gamma_b = 0;
+                       memcpy(value, &default_gamma_b, sizeof(int));
                default:
                        break;
        }
index e4dd22573d90eab920ee11ac7e43515096c76f70..d493afcbfd1345b70b0464110a640c6ae3dbecdd 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 = 0;
-       descriptor->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT | SANE_CAP_INACTIVE;
+       constraint_gamma_range->quant = 1;
+       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) * 256;
+       descriptor->size = sizeof(SANE_Int);
 }
 
 SANE_Option_Descriptor* _kds_s2000w_option_descriptor_gamma_vector_r()
@@ -559,11 +559,11 @@ SANE_Option_Descriptor* _kds_s2000w_option_descriptor_gamma_vector_r()
        constraint_gamma_range = malloc(sizeof(SANE_Range));
        constraint_gamma_range->min = 0;
        constraint_gamma_range->max = 255;
-       constraint_gamma_range->quant = 0;
-       descriptor->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT | SANE_CAP_INACTIVE;
+       constraint_gamma_range->quant = 1;
+       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) * 256;
+       descriptor->size = sizeof(SANE_Int);
 }
 
 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 = 0;
-       descriptor->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT | SANE_CAP_INACTIVE;
+       constraint_gamma_range->quant = 1;
+       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) * 256;
+       descriptor->size = sizeof(SANE_Int);
 }
 
 
@@ -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 = 0;
-       descriptor->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT | SANE_CAP_INACTIVE;
+       constraint_gamma_range->quant = 1;
+       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) * 256;
+       descriptor->size = sizeof(SANE_Int);
 }
 
 void kds_s2000w_option_descriptor_init_option_descriptors()