_write_string_value(value_object, value);
break;
case 25:
- memcpy(value, &gamma_table[0][0], sizeof(int) * 256);
+ int depth = h->current_metadata->depth;
+ int* int_value = (int*) value;
+ *int_value = depth;
break;
case 26:
- memcpy(value, &gamma_table[0][1], sizeof(int) * 256);
+ memcpy(value, &gamma_table[0][0], sizeof(int) * 256);
break;
case 27:
- memcpy(value, &gamma_table[0][2], sizeof(int) * 256);
+ memcpy(value, &gamma_table[0][1], sizeof(int) * 256);
break;
case 28:
+ memcpy(value, &gamma_table[0][2], sizeof(int) * 256);
+ break;
+ case 29:
memcpy(value, &gamma_table[0][3], sizeof(int) * 256);
default:
break;
_load_options(h);
return;
break;
+ case 25:
+ int* int_value = (int*) value;
+ h->current_metadata->depth = *int_value;
+ *info = RELOAD_OPTIONS;
+ break;
default:
break;
}
SANE_Range* constraint_binarization_contrast = NULL;
SANE_String_Const* constraint_max_document_length = NULL;
SANE_String_Const* constraint_scan_source = NULL;
+SANE_Word* constraint_depth = NULL;
SANE_Range* constraint_gamma_range = NULL;
SANE_Range* constraint_gamma_range_r = NULL;
SANE_Range* constraint_gamma_range_g = NULL;
descriptor->name = SANE_NAME_SCAN_SOURCE;
descriptor->title = SANE_TITLE_SCAN_SOURCE;
descriptor->desc = SANE_DESC_SCAN_SOURCE;
- descriptor->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT;;
+ descriptor->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT;
descriptor->constraint_type = SANE_CONSTRAINT_STRING_LIST;
constraint_scan_source = malloc(sizeof(char*) * 4);
constraint_scan_source[0] = "DocumentFeeder";
return descriptor;
}
+SANE_Option_Descriptor* _kds_s2000w_option_descriptor_depth()
+{
+ debug_printf(ALL, "kds_s2000w_option_descriptor_depth");
+ SANE_Option_Descriptor* descriptor = malloc(sizeof(SANE_Option_Descriptor));
+
+ descriptor->name = SANE_NAME_BIT_DEPTH;
+ descriptor->title = SANE_TITLE_BIT_DEPTH;
+ descriptor->desc = SANE_DESC_BIT_DEPTH;
+ descriptor->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT;
+ descriptor->constraint_type = SANE_CONSTRAINT_WORD_LIST;
+ constraint_depth = malloc(sizeof(SANE_Int) * 3);
+ constraint_depth[0] = 2;
+ constraint_depth[1] = 1;
+ constraint_depth[2] = 8;
+ descriptor->constraint.word_list = constraint_depth;
+ descriptor->type = SANE_TYPE_INT;
+ descriptor->unit = SANE_UNIT_NONE;
+ descriptor->size = sizeof(SANE_Int);
+
+ return descriptor;
+}
+
SANE_Option_Descriptor* _kds_s2000w_option_descriptor_gamma_vector()
{
debug_printf(ALL, "kds_s2000w_option_descriptor_gamma_vector");
descriptor_array[22] = _kds_s2000w_option_descriptor_max_document_length();
descriptor_array[23] = _kds_s2000w_option_descriptor_scan_source();
descriptor_array[24] = _kds_s2000w_option_descriptor_config_reset();
- descriptor_array[25] = _kds_s2000w_option_descriptor_gamma_vector();
- descriptor_array[26] = _kds_s2000w_option_descriptor_gamma_vector_r();
- descriptor_array[27] = _kds_s2000w_option_descriptor_gamma_vector_g();
- descriptor_array[28] = _kds_s2000w_option_descriptor_gamma_vector_b();
+ descriptor_array[25] = _kds_s2000w_option_descriptor_depth();
+ descriptor_array[26] = _kds_s2000w_option_descriptor_gamma_vector();
+ descriptor_array[27] = _kds_s2000w_option_descriptor_gamma_vector_r();
+ descriptor_array[28] = _kds_s2000w_option_descriptor_gamma_vector_g();
+ descriptor_array[29] = _kds_s2000w_option_descriptor_gamma_vector_b();
}
void kds_s2000w_option_descriptor_free_option_descriptors()
constraint_max_document_length = NULL;
free(constraint_scan_source);
constraint_scan_source = NULL;
+ free(constraint_depth);
+ constraint_depth = NULL;
free(constraint_gamma_range);
constraint_gamma_range = NULL;
free(constraint_gamma_range_r);