]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
add init gamma table
authorBastian Dehn <hhaalo@arcor.de>
Wed, 14 Feb 2024 15:59:10 +0000 (16:59 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Wed, 14 Feb 2024 15:59:10 +0000 (16:59 +0100)
src/kds_s2000w_handler.c
src/kds_s2000w_handler_opts.c
src/kds_s2000w_handler_opts.h

index 9bb3869219a296d9723125ae89c5014c7e8b5643..5e40be238c6ce53aed71b2ab5907095a069c05b9 100644 (file)
@@ -163,6 +163,7 @@ void _get_current_scan_status()
 
 current_state* kds_s2000w_handler_open()
 {
+       init_gamma_table();
        image.size = 0;
        image.data = NULL;
        pnm_image.size = 0;
index f308ee2028d0acf56fc0a28e52eb247aef0530ee..2d9ae9fad07eb0c87aa31df614bb69612d6ee2b8 100644 (file)
@@ -8,6 +8,7 @@ extern current_state* state;
 extern response* resp;
 extern json_object* resp_config;
 extern json_object* config;
+char gamma_table[4][256];
 
 void _write_string_value(json_object* value_object, void* value)
 {
@@ -103,6 +104,16 @@ int _change_skip_blank_pages_off()
        return 0;
 }
 
+void init_gamma_table()
+{
+       for (int i = 0; i < 256; i++) {
+               gamma_table[0][i] = i;
+               gamma_table[1][i] = i;
+               gamma_table[2][i] = i;
+               gamma_table[3][i] = i;
+       }
+}
+
 void kds_s2000w_handler_get_option(int option, void* value)
 {
        config = json_object_object_get(resp_config, "Configuration");
index f9d050ca91054d97e104cf32e31103ca415ea97a..5a116c851b97c28ae8d7322aa14ed49dcf53c83f 100644 (file)
@@ -1,5 +1,6 @@
 #ifndef KDS_S2000W_HANDLER_OPTS_H
 #define KDS_S2000W_HANDLER_OPTS_H
+void init_gamma_table();
 void kds_s2000w_handler_get_option(int option, void* value);
 void kds_s2000w_handler_set_option(int option, void* value, int* info);
 void kds_s2000w_handler_set_option_auto(int option);