*info = RELOAD_OPTIONS | RELOAD_PARAMS;
}
-void kds_s2000w_handler_opts_get_option(handler* h, uint32_t option, void* value, int32_t* info)
+void _kds_s2000w_handler_opts_set_depends_opts(const char* config_name, json_object* config)
{
- if (option == STANDARD_GROUP_NUMBER
- || option == GEOMETRY_GROUP_NUMBER
- || option == BOLDNESS_SMOOTHING_NUMBER
- || option == BOLDNESS_COLOR_NUMBER
- || option == IMAGE_PROCESSING_NUMBER
- || option == FEEDER_GROUP_NUMBER)
- return;
+ if (strcmp(config_name, CROPPING_MODE) == 0) {
+ _kds_s2000w_handler_opts_set_enable_cropping_image(config);
+ _kds_s2000w_handler_opts_set_enable_suboptions_cropping_image(config);
+ }
+
+ if (strcmp(config_name, CROPPING_IMAGE) == 0)
+ _kds_s2000w_handler_opts_set_enable_suboptions_cropping_image(config);
+
+ if (strcmp(config_name, FOREGROUND_BOLDNESS_MODE) == 0)
+ _kds_s2000w_handler_opts_set_enable_boldness_aggressiveness(config);
+
+ if (strcmp(config_name, BACKGROUND_SMOOTHING_MODE) == 0)
+ _kds_s2000w_handler_opts_set_enable_smoothing_aggressiveness(config);
+
+ if (strcmp(config_name, COLOR_DROP_OUT) == 0)
+ _kds_s2000w_handler_opts_set_enable_color_drop_out_aggressiveness(config);
+
+ if (strcmp(config_name, COLOR_AUTO_BRIGHTNESS_MODE) == 0)
+ _kds_s2000w_handler_opts_set_enable_color_brightness_and_contrast(config);
+ if (strcmp(config_name, COLOR_BALANCE_MODE) == 0) {
+ _kds_s2000w_handler_opts_set_enable_color_balance(config);
+ _kds_s2000w_handler_opts_set_enable_color_aggressiveness(config);
+ }
+
+ if (strcmp(config_name, RESET) == 0) {
+ _kds_s2000w_handler_opts_set_enable_cropping_image(config);
+ _kds_s2000w_handler_opts_set_enable_suboptions_cropping_image(config);
+ _kds_s2000w_handler_opts_set_enable_boldness_aggressiveness(config);
+ _kds_s2000w_handler_opts_set_enable_smoothing_aggressiveness(config);
+ _kds_s2000w_handler_opts_set_enable_color_drop_out_aggressiveness(config);
+ _kds_s2000w_handler_opts_set_enable_color_brightness_and_contrast(config);
+ _kds_s2000w_handler_opts_set_enable_color_aggressiveness(config);
+ _kds_s2000w_handler_opts_set_enable_color_balance(config);
+ }
+}
+
+void kds_s2000w_handler_opts_get_option(handler* h, uint32_t option, void* value, int32_t* info)
+{
json_object* config = NULL;
if (h->current_scanner_config == NULL) {
_kds_s2000w_handler_opts_load_options(h);
if (h->read_info->scan_started)
return;
- if (option == STANDARD_GROUP_NUMBER
- || option == GEOMETRY_GROUP_NUMBER
- || option == BOLDNESS_SMOOTHING_NUMBER
- || option == BOLDNESS_COLOR_NUMBER
- || option == IMAGE_PROCESSING_NUMBER
- || option == FEEDER_GROUP_NUMBER)
- return;
-
json_object* config = NULL;
if (h->current_scanner_config == NULL) {
_kds_s2000w_handler_opts_load_options(h);
h->current_scan_status->feeder = Automatic;
}
- if (strcmp(descriptor->config_name, CROPPING_MODE) == 0) {
- _kds_s2000w_handler_opts_set_enable_cropping_image(config);
- _kds_s2000w_handler_opts_set_enable_suboptions_cropping_image(config);
- }
-
- if (strcmp(descriptor->config_name, CROPPING_IMAGE) == 0)
- _kds_s2000w_handler_opts_set_enable_suboptions_cropping_image(config);
-
- if (strcmp(descriptor->config_name, FOREGROUND_BOLDNESS_MODE) == 0)
- _kds_s2000w_handler_opts_set_enable_boldness_aggressiveness(config);
-
- if (strcmp(descriptor->config_name, BACKGROUND_SMOOTHING_MODE) == 0)
- _kds_s2000w_handler_opts_set_enable_smoothing_aggressiveness(config);
-
- if (strcmp(descriptor->config_name, COLOR_DROP_OUT) == 0)
- _kds_s2000w_handler_opts_set_enable_color_drop_out_aggressiveness(config);
-
- if (strcmp(descriptor->config_name, COLOR_AUTO_BRIGHTNESS_MODE) == 0)
- _kds_s2000w_handler_opts_set_enable_color_brightness_and_contrast(config);
-
- if (strcmp(descriptor->config_name, COLOR_BALANCE_MODE) == 0) {
- _kds_s2000w_handler_opts_set_enable_color_balance(config);
- _kds_s2000w_handler_opts_set_enable_color_aggressiveness(config);
- }
-
if (strcmp(descriptor->config_name, RESET) == 0) {
_kds_s2000w_handler_opts_set_option_to_default(h);
config = json_object_object_get(h->current_scanner_config, "Configuration");
_kds_s2000w_handler_opts_set_autostart_on(config);
- _kds_s2000w_handler_opts_set_enable_cropping_image(config);
- _kds_s2000w_handler_opts_set_enable_suboptions_cropping_image(config);
- _kds_s2000w_handler_opts_set_enable_boldness_aggressiveness(config);
- _kds_s2000w_handler_opts_set_enable_smoothing_aggressiveness(config);
- _kds_s2000w_handler_opts_set_enable_color_drop_out_aggressiveness(config);
- _kds_s2000w_handler_opts_set_enable_color_brightness_and_contrast(config);
- _kds_s2000w_handler_opts_set_enable_color_aggressiveness(config);
- _kds_s2000w_handler_opts_set_enable_color_balance(config);
}
+ if (h->profile == PROFILE_FULL)
+ _kds_s2000w_handler_opts_set_depends_opts(descriptor->config_name, config);
+
_kds_s2000w_handler_opts_set_info_option(descriptor, info);
_kds_s2000w_handler_opts_set_options(h);
}
\ No newline at end of file
#include "kds_s2000w_debug.h"
#define FULL_PROFILE_MAX_OPTION_COUNT 47
+#define MIN_PROFILE_MAX_OPTION_COUNT 10
option_descriptor** descriptors = NULL;
uint8_t max_option_count = 0;
return descriptor;
}
+void _kds_s2000w_option_descriptors_init_min_profile()
+{
+ max_option_count = MIN_PROFILE_MAX_OPTION_COUNT;
+
+ descriptors = malloc(sizeof(option_descriptor*) * max_option_count);
+ for (int i = 0; i < max_option_count; i++) {
+ descriptors[i] = malloc(sizeof(option_descriptor));
+ }
+
+ descriptors[0]->config_name = OPTION_COUNT;
+ descriptors[0]->descriptor = _kds_s2000w_option_descriptor_num_options();
+ descriptors[1]->config_name = STANDARD_GROUP;
+ descriptors[1]->descriptor = _kds_s2000w_option_descriptor_standard_group();
+ descriptors[3]->config_name = COLOR_MODE;
+ descriptors[3]->descriptor = _kds_s2000w_option_descriptor_color_mode();
+ descriptors[4]->config_name = DPI;
+ descriptors[4]->descriptor = _kds_s2000w_option_descriptor_dpi();
+ descriptors[5]->config_name = SCAN_SIDE;
+ descriptors[5]->descriptor = _kds_s2000w_option_descriptor_scanside();
+ descriptors[6]->config_name = BOLDNESS_COLOR_GROUP;
+ descriptors[6]->descriptor = _kds_s2000w_option_descriptor_boldness_color_group();
+ descriptors[7]->config_name = COLOR_DROP_OUT;
+ descriptors[7]->descriptor = _kds_s2000w_option_descriptor_color_drop();
+ descriptors[8]->config_name = RESET;
+ descriptors[8]->descriptor = _kds_s2000w_option_descriptor_config_reset();
+ descriptors[9]->config_name = SKIP_BLANK_PAGES;
+ descriptors[9]->descriptor = _kds_s2000w_option_descriptor_skip_blank_pages();
+}
+
void _kds_s2000w_option_descriptors_init_full_profile()
{
max_option_count = FULL_PROFILE_MAX_OPTION_COUNT;
if (profile == PROFILE_FULL)
_kds_s2000w_option_descriptors_init_full_profile();
+
+ if (profile == PROFILE_MIN)
+ _kds_s2000w_option_descriptors_init_min_profile();
}
void kds_s2000w_option_descriptors_free()
#define OPTION_COUNT "OptionCount"
-#define STANDARD_GROUP_NUMBER 1
#define STANDARD_GROUP "STANDARD_GROUP"
#define SCAN_SOURCE "ScanSource"
#define COLOR_MODE "ColorMode"
#define DPI "DPI"
#define SCAN_SIDE "ScanSide"
-#define GEOMETRY_GROUP_NUMBER 6
#define GEOMETRY_GROUP "GeometryGroup"
#define CROPPING_MODE "CroppingMode"
#define CROPPING_IMAGE "CroppingImage"
#define IMAGE_WIDTH "ImageWidth"
#define IMAGE_HEIGHT "ImageHeight"
-#define BOLDNESS_SMOOTHING_NUMBER 13
#define BOLDNESS_SMOOTHING_GROUP "BoldnessSmothingGroup"
#define FOREGROUND_BOLDNESS_MODE "ForegroundBoldnessMode"
#define FOREGROUND_BOLDNESS_AGGRESSIVENESS "ForegroundBoldnessAggressiveness"
#define BACKGROUND_SMOOTHING_MODE "BackgroundSmoothingMode"
#define BACKGROUND_SMOOTHING_AGGRESSIVENESS "BackgroundSmoothingAggressiveness"
-#define BOLDNESS_COLOR_NUMBER 18
#define BOLDNESS_COLOR_GROUP "BoldnessColorGroup"
#define COLOR_DROP_OUT "ColorDropOut"
#define COLOR_DROP_OUT_AGGRESSIVENESS "ColorDropOutAggressiveness"
#define BINARIZATION_CONTRAST "BinarizationContrast"
#define RESET "Reset"
-#define IMAGE_PROCESSING_NUMBER 32
#define IMAGE_PROCESSING_GROUP "ImageProcessingGroup"
#define SKIP_BLANK_PAGES "SkipBlankPages"
#define SKIP_BLANK_PAGES_CONTENT "SkipBlankPagesContent"
#define IMAGE_BORDER "ImageBorder"
#define JPEG_QUALITY "JpegQuality"
-#define FEEDER_GROUP_NUMBER 40
#define FEEDER_GROUP "FeederGroup"
#define MAX_DOCUMENT_LENGTH "MaxDocumentLength"
#define TRANSPORT_HANDLING "TransportHandling"
#define DOCUMENT_FEEDER_TIMEOUT_RESPONSE "DocumentFeederTimeoutResponse"
enum {
- PROFILE_FULL
+ PROFILE_FULL,
+ PROFILE_MIN
};
typedef struct {