]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
change background smoothing mode
authorBastian Dehn <hhaalo@arcor.de>
Mon, 17 Feb 2025 15:38:10 +0000 (16:38 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Mon, 17 Feb 2025 15:38:10 +0000 (16:38 +0100)
src/kds_s2000w_handler_opts.c
src/kds_s2000w_option_descriptors.c
tests/kds_s2000w_net_get_opt_tests.c
tests/kds_s2000w_option_descriptor_tests.c

index 351b011fe93fb478635afa7fbb5097a663ec9b95..29925c3057f57d136e9fc0dd6c76d24f43b7931f 100644 (file)
@@ -191,8 +191,8 @@ void kds_s2000w_handler_opts_get_option(handler* h, uint32_t option, void* value
                        _kds_s2000w_handler_opts_write_int_value(value_object, value);
                        break;
                case 16:
-                       value_object = json_object_object_get(config, "ColorBalanceBlue");
-                       _kds_s2000w_handler_opts_write_int_value(value_object, value);
+                       value_object = json_object_object_get(config, "BackgroundSmoothingMode");
+                       _kds_s2000w_handler_opts_write_string_value(value_object, value);
                        break;
                case 17:
                        value_object = json_object_object_get(config, "ColorBalanceRed");
@@ -203,8 +203,8 @@ void kds_s2000w_handler_opts_get_option(handler* h, uint32_t option, void* value
                        _kds_s2000w_handler_opts_write_int_value(value_object, value);
                        break;
                case 19:
-                       value_object = json_object_object_get(config, "BackgroundSmoothingMode");
-                       _kds_s2000w_handler_opts_write_string_value(value_object, value);
+                       value_object = json_object_object_get(config, "ColorBalanceBlue");
+                       _kds_s2000w_handler_opts_write_int_value(value_object, value);
                        break;
                case 20:
                        value_object = json_object_object_get(config, "BackgroundSmoothingAggressiveness");
@@ -385,8 +385,8 @@ void kds_s2000w_handler_opts_set_option(handler* h, uint32_t option, void* value
                        _kds_s2000w_handler_opts_write_int_value_to_json(value_object, value);
                        break;
                case 16:
-                       value_object = json_object_object_get(config, "ColorBalanceBlue");
-                       _kds_s2000w_handler_opts_write_int_value_to_json(value_object, value);
+                       value_object = json_object_object_get(config, "BackgroundSmoothingMode");
+                       _kds_s2000w_handler_opts_write_string_value_to_json(value_object, value);
                        break;
                case 17:
                        value_object = json_object_object_get(config, "ColorBalanceRed");
@@ -397,8 +397,8 @@ void kds_s2000w_handler_opts_set_option(handler* h, uint32_t option, void* value
                        _kds_s2000w_handler_opts_write_int_value_to_json(value_object, value);
                        break;
                case 19:
-                       value_object = json_object_object_get(config, "BackgroundSmoothingMode");
-                       _kds_s2000w_handler_opts_write_string_value_to_json(value_object, value);
+                       value_object = json_object_object_get(config, "ColorBalanceBlue");
+                       _kds_s2000w_handler_opts_write_int_value_to_json(value_object, value);
                        break;
                case 20:
                        value_object = json_object_object_get(config, "BackgroundSmoothingAggressiveness");
index cac54fd226fb7e2b7ac55cbb8188996739996f93..cc968a7760a720baa0e2b086b0f415dcc455bf59 100644 (file)
@@ -1076,10 +1076,10 @@ void kds_s2000w_option_descriptors_init()
        descriptor_array[13] = _kds_s2000w_option_descriptor_boldness_smoothing_group();
        descriptor_array[14] = _kds_s2000w_option_descriptor_foreground_boldness_mode();
        descriptor_array[15] = _kds_s2000w_option_descriptor_foreground_boldness_aggressiveness();
-       descriptor_array[16] = _kds_s2000w_option_descriptor_color_balance_blue();
+       descriptor_array[16] = _kds_s2000w_option_descriptor_background_smoothing_mode();
        descriptor_array[17] = _kds_s2000w_option_descriptor_color_balance_red();
        descriptor_array[18] = _kds_s2000w_option_descriptor_color_balance_green();
-       descriptor_array[19] = _kds_s2000w_option_descriptor_background_smoothing_mode();
+       descriptor_array[19] = _kds_s2000w_option_descriptor_color_balance_blue();
        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_multifeed_sensitivity();
index a4583016ae36a6a9ee772e9f6396ceb199292bfc..64f39d65c1e5cae321243d4c8397f297e13d0560 100644 (file)
@@ -215,11 +215,11 @@ void sane_kds_s2000w_net_control_get_option_sixteen_test(void** state)
        handler* h = kds_s2000w_handler_init();
        response* resp = (response*) *state;
        h->current_scanner_config = json_tokener_parse(resp->data);
-       int32_t value = -1;
+       char* value[50] = {0};
 
        sane_kds_s2000w_net_control_option(h, 16, SANE_ACTION_GET_VALUE, &value, NULL);
 
-       assert_int_equal(value, 0);
+       assert_string_equal(value, "None");
 
        kds_s2000w_handler_free(h);
        h = NULL;
@@ -257,14 +257,15 @@ void sane_kds_s2000w_net_control_get_option_eightteen_test(void** state)
 
 void sane_kds_s2000w_net_control_get_option_nineteen_test(void** state)
 {
+
        handler* h = kds_s2000w_handler_init();
        response* resp = (response*) *state;
        h->current_scanner_config = json_tokener_parse(resp->data);
-       char* value[50] = {0};
+       int32_t value = -1;
 
        sane_kds_s2000w_net_control_option(h, 19, SANE_ACTION_GET_VALUE, &value, NULL);
 
-       assert_string_equal(value, "None");
+       assert_int_equal(value, 0);
 
        kds_s2000w_handler_free(h);
        h = NULL;
index af511fbc998234395239ed2979f37c01e4cd1d02..01ab6a080781d38e0f01a2702e2ebd911086ebce 100644 (file)
@@ -291,17 +291,18 @@ void kds_s2000w_option_get_descriptor_sixteen_test()
 {
        SANE_Option_Descriptor* option = kds_s2000w_option_descriptors_get(16);
 
-       assert_string_equal("colorbalanceblue", option->name);
-       assert_string_equal("colorbalanceblue", option->title);
-       assert_string_equal("colorbalanceblue", option->desc);
-       assert_int_equal(SANE_TYPE_INT, option->type);
+       assert_string_equal("background-smoothing-mode", option->name);
+       assert_string_equal("Background Smoothing Mode", option->title);
+       assert_string_equal("Background Smoothing Mode", option->desc);
+       assert_int_equal(SANE_TYPE_STRING, option->type);
        assert_int_equal(SANE_UNIT_NONE, option->unit);
-       assert_int_equal(sizeof(SANE_Int),  option->size);
+       assert_int_equal(sizeof(SANE_String_Const*) * 4, option->size);
        assert_int_equal(SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT, option->cap);
-       assert_int_equal(SANE_CONSTRAINT_RANGE, option->constraint_type);
-       assert_int_equal(-50, option->constraint.range->min);
-       assert_int_equal(50, option->constraint.range->max);
-       assert_int_equal(1, option->constraint.range->quant);
+       assert_int_equal(SANE_CONSTRAINT_STRING_LIST, option->constraint_type);
+       assert_string_equal("None", option->constraint.string_list[0]);
+       assert_string_equal("AutomaticAdvanced", option->constraint.string_list[1]);
+       assert_string_equal("Automatic", option->constraint.string_list[2]);
+       assert_null(option->constraint.string_list[3]);
 }
 
 void kds_s2000w_option_get_descriptor_seventeen_test()
@@ -342,18 +343,17 @@ void kds_s2000w_option_get_descriptor_nineteen_test()
 {
        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_string_equal("Background Smoothing Mode", option->desc);
-       assert_int_equal(SANE_TYPE_STRING, option->type);
+       assert_string_equal("colorbalanceblue", option->name);
+       assert_string_equal("colorbalanceblue", option->title);
+       assert_string_equal("colorbalanceblue", option->desc);
+       assert_int_equal(SANE_TYPE_INT, option->type);
        assert_int_equal(SANE_UNIT_NONE, option->unit);
-       assert_int_equal(sizeof(SANE_String_Const*) * 4, option->size);
+       assert_int_equal(sizeof(SANE_Int),  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("AutomaticAdvanced", option->constraint.string_list[1]);
-       assert_string_equal("Automatic", option->constraint.string_list[2]);
-       assert_null(option->constraint.string_list[3]);
+       assert_int_equal(SANE_CONSTRAINT_RANGE, option->constraint_type);
+       assert_int_equal(-50, option->constraint.range->min);
+       assert_int_equal(50, option->constraint.range->max);
+       assert_int_equal(1, option->constraint.range->quant);
 }
 
 void kds_s2000w_option_get_descriptor_twenty_test()