| OLD | NEW |
| 1 // Copyright 2011 Google Inc. All Rights Reserved. | 1 // Copyright 2011 Google Inc. All Rights Reserved. |
| 2 // | 2 // |
| 3 // Use of this source code is governed by a BSD-style license | 3 // Use of this source code is governed by a BSD-style license |
| 4 // that can be found in the COPYING file in the root of the source | 4 // that can be found in the COPYING file in the root of the source |
| 5 // tree. An additional intellectual property rights grant can be found | 5 // tree. An additional intellectual property rights grant can be found |
| 6 // in the file PATENTS. All contributing project authors may | 6 // in the file PATENTS. All contributing project authors may |
| 7 // be found in the AUTHORS file in the root of the source tree. | 7 // be found in the AUTHORS file in the root of the source tree. |
| 8 // ----------------------------------------------------------------------------- | 8 // ----------------------------------------------------------------------------- |
| 9 // | 9 // |
| 10 // Coding tools configuration | 10 // Coding tools configuration |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 if (config->filter_sharpness < 0 || config->filter_sharpness > 7) | 104 if (config->filter_sharpness < 0 || config->filter_sharpness > 7) |
| 105 return 0; | 105 return 0; |
| 106 if (config->filter_type < 0 || config->filter_type > 1) | 106 if (config->filter_type < 0 || config->filter_type > 1) |
| 107 return 0; | 107 return 0; |
| 108 if (config->autofilter < 0 || config->autofilter > 1) | 108 if (config->autofilter < 0 || config->autofilter > 1) |
| 109 return 0; | 109 return 0; |
| 110 if (config->pass < 1 || config->pass > 10) | 110 if (config->pass < 1 || config->pass > 10) |
| 111 return 0; | 111 return 0; |
| 112 if (config->show_compressed < 0 || config->show_compressed > 1) | 112 if (config->show_compressed < 0 || config->show_compressed > 1) |
| 113 return 0; | 113 return 0; |
| 114 #if WEBP_ENCODER_ABI_VERSION > 0x0204 |
| 115 if (config->preprocessing < 0 || config->preprocessing > 7) |
| 116 #else |
| 114 if (config->preprocessing < 0 || config->preprocessing > 3) | 117 if (config->preprocessing < 0 || config->preprocessing > 3) |
| 118 #endif |
| 115 return 0; | 119 return 0; |
| 116 if (config->partitions < 0 || config->partitions > 3) | 120 if (config->partitions < 0 || config->partitions > 3) |
| 117 return 0; | 121 return 0; |
| 118 if (config->partition_limit < 0 || config->partition_limit > 100) | 122 if (config->partition_limit < 0 || config->partition_limit > 100) |
| 119 return 0; | 123 return 0; |
| 120 if (config->alpha_compression < 0) | 124 if (config->alpha_compression < 0) |
| 121 return 0; | 125 return 0; |
| 122 if (config->alpha_filtering < 0) | 126 if (config->alpha_filtering < 0) |
| 123 return 0; | 127 return 0; |
| 124 if (config->alpha_quality < 0 || config->alpha_quality > 100) | 128 if (config->alpha_quality < 0 || config->alpha_quality > 100) |
| (...skipping 28 matching lines...) Expand all Loading... |
| 153 int WebPConfigLosslessPreset(WebPConfig* config, int level) { | 157 int WebPConfigLosslessPreset(WebPConfig* config, int level) { |
| 154 if (config == NULL || level < 0 || level > MAX_LEVEL) return 0; | 158 if (config == NULL || level < 0 || level > MAX_LEVEL) return 0; |
| 155 config->lossless = 1; | 159 config->lossless = 1; |
| 156 config->method = kLosslessPresets[level].method_; | 160 config->method = kLosslessPresets[level].method_; |
| 157 config->quality = kLosslessPresets[level].quality_; | 161 config->quality = kLosslessPresets[level].quality_; |
| 158 return 1; | 162 return 1; |
| 159 } | 163 } |
| 160 #endif | 164 #endif |
| 161 | 165 |
| 162 //------------------------------------------------------------------------------ | 166 //------------------------------------------------------------------------------ |
| OLD | NEW |