]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
add read gamma values in
authorBastian Dehn <hhaalo@arcor.de>
Wed, 14 Feb 2024 18:08:15 +0000 (19:08 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Wed, 14 Feb 2024 18:17:23 +0000 (19:17 +0100)
src/kds_s2000w_handler_opts.c
src/kds_s2000w_option_descriptors.c
src/kds_s2000w_option_descriptors.h

index 2d9ae9fad07eb0c87aa31df614bb69612d6ee2b8..51b7b32b3e62d772b63822a3d325bc39d9f876af 100644 (file)
@@ -8,7 +8,7 @@ extern current_state* state;
 extern response* resp;
 extern json_object* resp_config;
 extern json_object* config;
-char gamma_table[4][256];
+int gamma_table[4][256];
 
 void _write_string_value(json_object* value_object, void* value)
 {
@@ -120,7 +120,7 @@ void kds_s2000w_handler_get_option(int option, void* value)
        json_object* value_object = NULL;
        switch(option) {
                case 0:
-                       const int COUNT_CUSTOM_OPTIONS = 3;
+                       const int COUNT_CUSTOM_OPTIONS = 7;
                        _load_options();
                        int* int_value_ptr = (int*) value;
                        *int_value_ptr = json_object_object_length(config) + COUNT_CUSTOM_OPTIONS;
@@ -213,6 +213,18 @@ void kds_s2000w_handler_get_option(int option, void* value)
                        value_object = json_object_object_get(config, "ScanSource");
                        _write_string_value(value_object, value);
                        break;
+               case 24:
+                       memcpy(value, gamma_table[0], sizeof(int) * 256);
+                       break;
+               case 25:
+                       memcpy(value, gamma_table[1], sizeof(int) * 256);
+                       break;
+               case 26:
+                       memcpy(value, gamma_table[2], sizeof(int) * 256);
+                       break;
+               case 27:
+                       memcpy(value, gamma_table[3], sizeof(int) * 256);
+                       break;
                default:
                        break;
        }
index a02de7c129716e191d584f00a696d23586590890..9033fd1fb9ae57f250f780306ae1ba1730a15fd2 100644 (file)
@@ -637,6 +637,10 @@ void kds_s2000w_option_descriptor_init_option_descriptors()
        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();
 }
 
 void kds_s2000w_option_descriptor_free_option_descriptors()
index c057e75eaa92800b1747d0ac67b180217919e2ed..11f8fe7184725eaac2d3ee7b6dc1558bc5c7437b 100644 (file)
@@ -2,7 +2,7 @@
 #define KDS_S2000W_OPTION_DESCRIPTORS_H
 #include <sane/sane.h>
 
-#define MAX_OPTION_COUNT 25
+#define MAX_OPTION_COUNT 29
 
 void kds_s2000w_option_descriptor_init_option_descriptors();
 void kds_s2000w_option_descriptor_free_option_descriptors();