From: Bastian Dehn Date: Wed, 14 Feb 2024 15:37:22 +0000 (+0100) Subject: add option descriptor mehtods for gamma table X-Git-Tag: v1.0.0^2~288 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=d9698eb9a4c97064e2eaf1cdc38d1d96b820bd98;p=sane-kds-s2000w-net.git add option descriptor mehtods for gamma table --- diff --git a/src/kds_s2000w_option_descriptors.c b/src/kds_s2000w_option_descriptors.c index 0a633a3..a02de7c 100644 --- a/src/kds_s2000w_option_descriptors.c +++ b/src/kds_s2000w_option_descriptors.c @@ -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);