Lines Matching refs:config

20 int WebPConfigInitInternal(WebPConfig* config,
25 if (config == NULL) return 0;
27 config->quality = quality;
28 config->target_size = 0;
29 config->target_PSNR = 0.;
30 config->method = 4;
31 config->sns_strength = 50;
32 config->filter_strength = 60; // mid-filtering
33 config->filter_sharpness = 0;
34 config->filter_type = 1; // default: strong (so U/V is filtered too)
35 config->partitions = 0;
36 config->segments = 4;
37 config->pass = 1;
38 config->show_compressed = 0;
39 config->preprocessing = 0;
40 config->autofilter = 0;
41 config->partition_limit = 0;
42 config->alpha_compression = 1;
43 config->alpha_filtering = 1;
44 config->alpha_quality = 100;
45 config->lossless = 0;
46 config->image_hint = WEBP_HINT_DEFAULT;
47 config->emulate_jpeg_size = 0;
48 config->thread_level = 0;
49 config->low_memory = 0;
54 config->sns_strength = 80;
55 config->filter_sharpness = 4;
56 config->filter_strength = 35;
57 config->preprocessing &= ~2; // no dithering
60 config->sns_strength = 80;
61 config->filter_sharpness = 3;
62 config->filter_strength = 30;
63 config->preprocessing |= 2;
66 config->sns_strength = 25;
67 config->filter_sharpness = 6;
68 config->filter_strength = 10;
71 config->sns_strength = 0;
72 config->filter_strength = 0; // disable filtering to retain sharpness
73 config->preprocessing &= ~2; // no dithering
76 config->sns_strength = 0;
77 config->filter_strength = 0; // disable filtering to retain sharpness
78 config->preprocessing &= ~2; // no dithering
79 config->segments = 2;
85 return WebPValidateConfig(config);
88 int WebPValidateConfig(const WebPConfig* config) {
89 if (config == NULL) return 0;
90 if (config->quality < 0 || config->quality > 100)
92 if (config->target_size < 0)
94 if (config->target_PSNR < 0)
96 if (config->method < 0 || config->method > 6)
98 if (config->segments < 1 || config->segments > 4)
100 if (config->sns_strength < 0 || config->sns_strength > 100)
102 if (config->filter_strength < 0 || config->filter_strength > 100)
104 if (config->filter_sharpness < 0 || config->filter_sharpness > 7)
106 if (config->filter_type < 0 || config->filter_type > 1)
108 if (config->autofilter < 0 || config->autofilter > 1)
110 if (config->pass < 1 || config->pass > 10)
112 if (config->show_compressed < 0 || config->show_compressed > 1)
114 if (config->preprocessing < 0 || config->preprocessing > 3)
116 if (config->partitions < 0 || config->partitions > 3)
118 if (config->partition_limit < 0 || config->partition_limit > 100)
120 if (config->alpha_compression < 0)
122 if (config->alpha_filtering < 0)
124 if (config->alpha_quality < 0 || config->alpha_quality > 100)
126 if (config->lossless < 0 || config->lossless > 1)
128 if (config->image_hint >= WEBP_HINT_LAST)
130 if (config->emulate_jpeg_size < 0 || config->emulate_jpeg_size > 1)
132 if (config->thread_level < 0 || config->thread_level > 1)
134 if (config->low_memory < 0 || config->low_memory > 1)
153 int WebPConfigLosslessPreset(WebPConfig* config, int level) {
154 if (config == NULL || level < 0 || level > MAX_LEVEL) return 0;
155 config->lossless = 1;
156 config->method = kLosslessPresets[level].method_;
157 config->quality = kLosslessPresets[level].quality_;