]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
add option descriptor mehtods for gamma table
authorBastian Dehn <hhaalo@arcor.de>
Wed, 14 Feb 2024 15:37:22 +0000 (16:37 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Wed, 14 Feb 2024 15:37:22 +0000 (16:37 +0100)
src/kds_s2000w_option_descriptors.c

index 0a633a32db16363d438b06a8752c9aa1d2e32282..a02de7c129716e191d584f00a696d23586590890 100644 (file)
@@ -526,6 +526,88 @@ SANE_Option_Descriptor* _kds_s2000w_option_descriptor_config_reset()
        return descriptor;
 }
 
+SANE_Option_Descriptor* _kds_s2000w_option_descriptor_gamma_vector()
+{
+       SANE_Option_Descriptor* descriptor = malloc(sizeof(SANE_Option_Descriptor));
+
+       descriptor->name = SANE_NAME_GAMMA_VECTOR;
+       descriptor->title = SANE_TITLE_GAMMA_VECTOR;
+       descriptor->desc = SANE_DESC_GAMMA_VECTOR;
+       descriptor->type = SANE_TYPE_INT;
+       descriptor->unit = SANE_UNIT_NONE;
+       SANE_Range* constraint_gamma_range = NULL;
+       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;
+       descriptor->constraint_type = SANE_CONSTRAINT_RANGE;
+       descriptor->constraint.range = constraint_gamma_range;
+       descriptor->size = sizeof(SANE_Word) * 256;
+}
+
+SANE_Option_Descriptor* _kds_s2000w_option_descriptor_gamma_vector_r()
+{
+       SANE_Option_Descriptor* descriptor = malloc(sizeof(SANE_Option_Descriptor));
+
+       descriptor->name = SANE_NAME_GAMMA_VECTOR_R;
+       descriptor->title = SANE_TITLE_GAMMA_VECTOR_R;
+       descriptor->desc = SANE_DESC_GAMMA_VECTOR_R;
+       descriptor->type = SANE_TYPE_INT;
+       descriptor->unit = SANE_UNIT_NONE;
+       SANE_Range* constraint_gamma_range = NULL;
+       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;
+       descriptor->constraint_type = SANE_CONSTRAINT_RANGE;
+       descriptor->constraint.range = constraint_gamma_range;
+       descriptor->size = sizeof(SANE_Word) * 256;
+}
+
+SANE_Option_Descriptor* _kds_s2000w_option_descriptor_gamma_vector_g()
+{
+       SANE_Option_Descriptor* descriptor = malloc(sizeof(SANE_Option_Descriptor));
+
+       descriptor->name = SANE_NAME_GAMMA_VECTOR_G;
+       descriptor->title = SANE_TITLE_GAMMA_VECTOR_G;
+       descriptor->desc = SANE_DESC_GAMMA_VECTOR_G;
+       descriptor->type = SANE_TYPE_INT;
+       descriptor->unit = SANE_UNIT_NONE;
+       SANE_Range* constraint_gamma_range = NULL;
+       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;
+       descriptor->constraint_type = SANE_CONSTRAINT_RANGE;
+       descriptor->constraint.range = constraint_gamma_range;
+       descriptor->size = sizeof(SANE_Word) * 256;
+}
+
+
+
+SANE_Option_Descriptor* _kds_s2000w_option_descriptor_gamma_vector_b()
+{
+       SANE_Option_Descriptor* descriptor = malloc(sizeof(SANE_Option_Descriptor));
+
+       descriptor->name = SANE_NAME_GAMMA_VECTOR_B;
+       descriptor->title = SANE_TITLE_GAMMA_VECTOR_B;
+       descriptor->desc = SANE_DESC_GAMMA_VECTOR_B;
+       descriptor->type = SANE_TYPE_INT;
+       descriptor->unit = SANE_UNIT_NONE;
+       SANE_Range* constraint_gamma_range = NULL;
+       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;
+       descriptor->constraint_type = SANE_CONSTRAINT_RANGE;
+       descriptor->constraint.range = constraint_gamma_range;
+       descriptor->size = sizeof(SANE_Word) * 256;
+}
+
 void kds_s2000w_option_descriptor_init_option_descriptors()
 {
        descriptor_array = malloc(sizeof(SANE_Option_Descriptor*) * MAX_OPTION_COUNT);