#include "kds_s2000w_option_descriptors.h"
#include "kds_s2000w_debug.h"
+#define MAX_OPTION_COUNT 23
+
SANE_Option_Descriptor* descriptor_array = NULL;
SANE_Word constraint_dpi[] = {5, 100, 150, 200, 300, 600};
SANE_String_Const* constraint_binarization_mode = NULL;
SANE_String_Const* constraint_max_document_length = NULL;
SANE_String_Const* constraint_scan_source = NULL;
+SANE_String_Const* constraint_color_sharpen = NULL;
SANE_Option_Descriptor _kds_s2000w_option_descriptor_standard_group()
{
return descriptor;
}
+SANE_Option_Descriptor _kds_s2000w_option_descriptor_color_sharpen()
+{
+ kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_color_sharpen");
+
+ constraint_color_sharpen = malloc(sizeof(SANE_String_Const*) * 5);
+ constraint_color_sharpen[0] = "None";
+ constraint_color_sharpen[1] = "Normal";
+ constraint_color_sharpen[2] = "High";
+ constraint_color_sharpen[3] = "Exaggerated";
+ constraint_color_sharpen[4] = NULL;
+
+ SANE_Option_Descriptor descriptor = {
+ "colorsharpen",
+ "colorsharpen",
+ "colorsharpen",
+ SANE_TYPE_STRING,
+ SANE_UNIT_NONE,
+ sizeof(SANE_String_Const*) * 5,
+ SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT,
+ SANE_CONSTRAINT_STRING_LIST,
+ {.string_list = constraint_color_sharpen}
+ };
+
+ return descriptor;
+}
+
void kds_s2000w_option_descriptors_init()
{
kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_init_option_descriptors");
descriptor_array[8] = _kds_s2000w_option_descriptor_color_drop();
descriptor_array[9] = _kds_s2000w_option_descriptor_color_drop_out_aggressiveness();
descriptor_array[10] = _kds_s2000w_option_descriptor_color_auto_brightness_mode();
- descriptor_array[11] = _kds_s2000w_option_descriptor_color_balance_mode();
- descriptor_array[12] = _kds_s2000w_option_descriptor_color_balancea_agressiveness();
- descriptor_array[13] = _kds_s2000w_option_descriptor_color_balance_red();
- descriptor_array[14] = _kds_s2000w_option_descriptor_color_balance_green();
- descriptor_array[15] = _kds_s2000w_option_descriptor_color_balance_blue();
- descriptor_array[16] = _kds_s2000w_option_descriptor_foreground_boldness_mode();
- descriptor_array[17] = _kds_s2000w_option_descriptor_foreground_boldness_aggressiveness();
- descriptor_array[18] = _kds_s2000w_option_descriptor_background_smoothing_mode();
- descriptor_array[19] = _kds_s2000w_option_descriptor_background_smoothing_aggressiveness();
- descriptor_array[20] = _kds_s2000w_option_descriptor_binarization_contrast();
- descriptor_array[21] = _kds_s2000w_option_descriptor_config_reset();
+ descriptor_array[11] = _kds_s2000w_option_descriptor_color_sharpen();
+ descriptor_array[12] = _kds_s2000w_option_descriptor_color_balance_mode();
+ descriptor_array[13] = _kds_s2000w_option_descriptor_color_balancea_agressiveness();
+ descriptor_array[14] = _kds_s2000w_option_descriptor_color_balance_red();
+ descriptor_array[15] = _kds_s2000w_option_descriptor_color_balance_green();
+ descriptor_array[16] = _kds_s2000w_option_descriptor_color_balance_blue();
+ descriptor_array[17] = _kds_s2000w_option_descriptor_foreground_boldness_mode();
+ descriptor_array[18] = _kds_s2000w_option_descriptor_foreground_boldness_aggressiveness();
+ descriptor_array[19] = _kds_s2000w_option_descriptor_background_smoothing_mode();
+ descriptor_array[20] = _kds_s2000w_option_descriptor_background_smoothing_aggressiveness();
+ descriptor_array[21] = _kds_s2000w_option_descriptor_binarization_contrast();
+ descriptor_array[22] = _kds_s2000w_option_descriptor_config_reset();
}
void kds_s2000w_option_descriptors_free()
constraint_max_document_length = NULL;
free(constraint_scan_source);
constraint_scan_source = NULL;
+ free(constraint_color_sharpen);
+ constraint_color_sharpen = NULL;
free(descriptor_array);
descriptor_array = NULL;
}
#include "kds_s2000w_client_mock.h"
#include "../src/kds_s2000w_option_descriptors.h"
+#define MAX_OPTION_COUNT 23
+
int setup(void** state)
{
kds_s2000w_option_descriptors_init();
{
SANE_Option_Descriptor* option = kds_s2000w_option_descriptors_get(11);
+ assert_string_equal("colorsharpen", option->name);
+ assert_string_equal("colorsharpen", option->title);
+ assert_string_equal("colorsharpen", option->desc);
+ assert_int_equal(SANE_TYPE_STRING, option->type);
+ assert_int_equal(SANE_UNIT_NONE, option->unit);
+ assert_int_equal(sizeof(SANE_String_Const*) * 5, option->size);
+ assert_int_equal(SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT, option->cap);
+ assert_int_equal(SANE_CONSTRAINT_STRING_LIST, option->constraint_type);
+ assert_string_equal("None", option->constraint.string_list[0]);
+ assert_string_equal("Normal", option->constraint.string_list[1]);
+ assert_string_equal("High", option->constraint.string_list[2]);
+ assert_string_equal("Exaggerated", option->constraint.string_list[3]);
+ assert_null(option->constraint.string_list[4]);
+}
+
+void kds_s2000w_option_get_descriptor_twelve_test()
+{
+ SANE_Option_Descriptor* option = kds_s2000w_option_descriptors_get(12);
+
assert_string_equal("colorbalancemode", option->name);
assert_string_equal("colorbalancemode", option->title);
assert_string_equal("colorbalancemode", option->desc);
assert_null(option->constraint.string_list[4]);
}
-void kds_s2000w_option_get_descriptor_twelve_test()
+void kds_s2000w_option_get_descriptor_thirdteen_test()
{
- SANE_Option_Descriptor* option = kds_s2000w_option_descriptors_get(12);
+ SANE_Option_Descriptor* option = kds_s2000w_option_descriptors_get(13);
assert_string_equal("colorbalanceaggressiveness", option->name);
assert_string_equal("colorbalanceaggressiveness", option->title);
assert_int_equal(1, option->constraint.range->quant);
}
-void kds_s2000w_option_get_descriptor_thirdteen_test()
+void kds_s2000w_option_get_descriptor_fourteen_test()
{
- SANE_Option_Descriptor* option = kds_s2000w_option_descriptors_get(13);
+ SANE_Option_Descriptor* option = kds_s2000w_option_descriptors_get(14);
assert_string_equal("colorbalancered", option->name);
assert_string_equal("colorbalancered", option->title);
assert_int_equal(1, option->constraint.range->quant);
}
-void kds_s2000w_option_get_descriptor_fourteen_test()
+void kds_s2000w_option_get_descriptor_fifteen_test()
{
- SANE_Option_Descriptor* option = kds_s2000w_option_descriptors_get(14);
+ SANE_Option_Descriptor* option = kds_s2000w_option_descriptors_get(15);
assert_string_equal("colorbalancegreen", option->name);
assert_string_equal("colorbalancegreen", option->title);
assert_int_equal(1, option->constraint.range->quant);
}
-void kds_s2000w_option_get_descriptor_fifteen_test()
+void kds_s2000w_option_get_descriptor_sixteen_test()
{
- SANE_Option_Descriptor* option = kds_s2000w_option_descriptors_get(15);
+ SANE_Option_Descriptor* option = kds_s2000w_option_descriptors_get(16);
assert_string_equal("colorbalanceblue", option->name);
assert_string_equal("colorbalanceblue", option->title);
assert_int_equal(1, option->constraint.range->quant);
}
-void kds_s2000w_option_get_descriptor_sixteen_test()
+void kds_s2000w_option_get_descriptor_seventeen_test()
{
- SANE_Option_Descriptor* option = kds_s2000w_option_descriptors_get(16);
+ SANE_Option_Descriptor* option = kds_s2000w_option_descriptors_get(17);
assert_string_equal("foreground-boldness-mode", option->name);
assert_string_equal("Foreground Boldness Mode", option->title);
assert_null(option->constraint.string_list[3]);
}
-void kds_s2000w_option_get_descriptor_seventeen_test()
+void kds_s2000w_option_get_descriptor_eightteen_test()
{
- SANE_Option_Descriptor* option = kds_s2000w_option_descriptors_get(17);
+ SANE_Option_Descriptor* option = kds_s2000w_option_descriptors_get(18);
assert_string_equal("foreground-boldness-aggressiveness", option->name);
assert_string_equal("Foreground Boldness Aggressiveness", option->title);
assert_int_equal(1, option->constraint.range->quant);
}
-void kds_s2000w_option_get_descriptor_eightteen_test()
+void kds_s2000w_option_get_descriptor_nineteen_test()
{
- SANE_Option_Descriptor* option = kds_s2000w_option_descriptors_get(18);
+ SANE_Option_Descriptor* option = kds_s2000w_option_descriptors_get(19);
assert_string_equal("background-smoothing-mode", option->name);
assert_string_equal("Background Smoothing Mode", option->title);
assert_null(option->constraint.string_list[3]);
}
-void kds_s2000w_option_get_descriptor_nineteen_test()
+void kds_s2000w_option_get_descriptor_twenty_test()
{
- SANE_Option_Descriptor* option = kds_s2000w_option_descriptors_get(19);
+ SANE_Option_Descriptor* option = kds_s2000w_option_descriptors_get(20);
assert_string_equal("background-smoothing-aggressiveness", option->name);
assert_string_equal("Background Smoothing Aggressivenes", option->title);
assert_int_equal(1, option->constraint.range->quant);
}
-void kds_s2000w_option_get_descriptor_twenty_test()
+void kds_s2000w_option_get_descriptor_twentyone_test()
{
- SANE_Option_Descriptor* option = kds_s2000w_option_descriptors_get(20);
+ SANE_Option_Descriptor* option = kds_s2000w_option_descriptors_get(21);
assert_string_equal(SANE_NAME_CONTRAST, option->name);
assert_string_equal(SANE_TITLE_CONTRAST, option->title);
assert_int_equal(1, option->constraint.range->quant);
}
-void kds_s2000w_option_get_descriptor_twentyone_test()
+void kds_s2000w_option_get_descriptor_twentytwo_test()
{
- SANE_Option_Descriptor* option = kds_s2000w_option_descriptors_get(21);
+ SANE_Option_Descriptor* option = kds_s2000w_option_descriptors_get(22);
assert_string_equal("config-reset", option->name);
assert_string_equal("reset config", option->title);