| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * The base class for simple filters that only modify the image content | 6 * The base class for simple filters that only modify the image content |
| 7 * but do not modify the image dimensions. | 7 * but do not modify the image dimensions. |
| 8 * @param {string} name | 8 * @param {string} name |
| 9 * @param {string} title | 9 * @param {string} title |
| 10 * @constructor | 10 * @constructor |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 */ | 26 */ |
| 27 this.doneMessage_ = null; | 27 this.doneMessage_ = null; |
| 28 | 28 |
| 29 /** | 29 /** |
| 30 * @type {number} | 30 * @type {number} |
| 31 * @private | 31 * @private |
| 32 */ | 32 */ |
| 33 this.viewportGeneration_ = 0; | 33 this.viewportGeneration_ = 0; |
| 34 | 34 |
| 35 /** | 35 /** |
| 36 * @type {?string} | 36 * @type {?function(!ImageData,!ImageData,number,number)} |
| 37 * @private | 37 * @private |
| 38 */ | 38 */ |
| 39 this.filter_ = null; | 39 this.filter_ = null; |
| 40 | 40 |
| 41 /** | 41 /** |
| 42 * @type {HTMLCanvasElement} | 42 * @type {HTMLCanvasElement} |
| 43 * @private | 43 * @private |
| 44 */ | 44 */ |
| 45 this.canvas_ = null; | 45 this.canvas_ = null; |
| 46 | 46 |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 */ | 225 */ |
| 226 ImageEditor.Mode.Autofix = function() { | 226 ImageEditor.Mode.Autofix = function() { |
| 227 ImageEditor.Mode.ColorFilter.call(this, 'autofix', 'GALLERY_AUTOFIX'); | 227 ImageEditor.Mode.ColorFilter.call(this, 'autofix', 'GALLERY_AUTOFIX'); |
| 228 this.doneMessage_ = 'GALLERY_FIXED'; | 228 this.doneMessage_ = 'GALLERY_FIXED'; |
| 229 }; | 229 }; |
| 230 | 230 |
| 231 ImageEditor.Mode.Autofix.prototype = | 231 ImageEditor.Mode.Autofix.prototype = |
| 232 {__proto__: ImageEditor.Mode.ColorFilter.prototype}; | 232 {__proto__: ImageEditor.Mode.ColorFilter.prototype}; |
| 233 | 233 |
| 234 /** @override */ | 234 /** @override */ |
| 235 ImageEditor.Mode.Autofix.prototype.createTools = function(toolbar) { | |
| 236 var self = this; | |
| 237 toolbar.addButton('Apply', 'Apply', this.apply.bind(this)); | |
| 238 }; | |
| 239 | |
| 240 /** @override */ | |
| 241 ImageEditor.Mode.Autofix.prototype.isApplicable = function() { | 235 ImageEditor.Mode.Autofix.prototype.isApplicable = function() { |
| 242 return this.getImageView().hasValidImage() && | 236 return this.getImageView().hasValidImage() && |
| 243 filter.autofix.isApplicable(this.getHistogram()); | 237 filter.autofix.isApplicable(this.getHistogram()); |
| 244 }; | 238 }; |
| 245 | 239 |
| 246 /** | 240 /** |
| 247 * Applies autofix. | 241 * Applies autofix. |
| 248 */ | 242 */ |
| 249 ImageEditor.Mode.Autofix.prototype.apply = function() { | 243 ImageEditor.Mode.Autofix.prototype.apply = function() { |
| 250 this.update({histogram: this.getHistogram()}); | 244 this.update({histogram: this.getHistogram()}); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 }; | 294 }; |
| 301 | 295 |
| 302 ImageEditor.Mode.Sharpen.prototype = | 296 ImageEditor.Mode.Sharpen.prototype = |
| 303 {__proto__: ImageEditor.Mode.Adjust.prototype}; | 297 {__proto__: ImageEditor.Mode.Adjust.prototype}; |
| 304 | 298 |
| 305 /** @override */ | 299 /** @override */ |
| 306 ImageEditor.Mode.Sharpen.prototype.createTools = function(toolbar) { | 300 ImageEditor.Mode.Sharpen.prototype.createTools = function(toolbar) { |
| 307 toolbar.addRange('strength', 'GALLERY_STRENGTH', 0, 0, 1, 100); | 301 toolbar.addRange('strength', 'GALLERY_STRENGTH', 0, 0, 1, 100); |
| 308 toolbar.addRange('radius', 'GALLERY_RADIUS', 1, 1, 3); | 302 toolbar.addRange('radius', 'GALLERY_RADIUS', 1, 1, 3); |
| 309 }; | 303 }; |
| OLD | NEW |