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 * Command queue is the only way to modify images. | 6 * Command queue is the only way to modify images. |
7 * Supports undo/redo. | 7 * Supports undo/redo. |
8 * Command execution is asynchronous (callback-based). | 8 * Command execution is asynchronous (callback-based). |
9 * | 9 * |
10 * @param {!Document} document Document to create canvases in. | 10 * @param {!Document} document Document to create canvases in. |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 /** @override */ | 406 /** @override */ |
407 Command.Crop.prototype.revertView = function(canvas, imageView) { | 407 Command.Crop.prototype.revertView = function(canvas, imageView) { |
408 return imageView.animateAndReplace(canvas, this.imageRect_); | 408 return imageView.animateAndReplace(canvas, this.imageRect_); |
409 }; | 409 }; |
410 | 410 |
411 | 411 |
412 /** | 412 /** |
413 * Filter command. | 413 * Filter command. |
414 * | 414 * |
415 * @param {string} name Command name. | 415 * @param {string} name Command name. |
416 * @param {function(ImageData,ImageData,number,number)} filter Filter function. | 416 * @param {function(!ImageData,!ImageData,number,number)} filter Filter |
| 417 * function. |
417 * @param {?string} message Message to display when done. | 418 * @param {?string} message Message to display when done. |
418 * @constructor | 419 * @constructor |
419 * @extends {Command} | 420 * @extends {Command} |
420 * @struct | 421 * @struct |
421 */ | 422 */ |
422 Command.Filter = function(name, filter, message) { | 423 Command.Filter = function(name, filter, message) { |
423 Command.call(this, name); | 424 Command.call(this, name); |
424 this.filter_ = filter; | 425 this.filter_ = filter; |
425 this.message_ = message; | 426 this.message_ = message; |
426 }; | 427 }; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 | 461 |
461 function onProgressInvisible(updatedRow, rowCount) { | 462 function onProgressInvisible(updatedRow, rowCount) { |
462 if (updatedRow == rowCount) { | 463 if (updatedRow == rowCount) { |
463 callback(result); | 464 callback(result); |
464 } | 465 } |
465 } | 466 } |
466 | 467 |
467 filter.applyByStrips(result, srcCanvas, this.filter_, | 468 filter.applyByStrips(result, srcCanvas, this.filter_, |
468 uiContext.imageView ? onProgressVisible : onProgressInvisible); | 469 uiContext.imageView ? onProgressVisible : onProgressInvisible); |
469 }; | 470 }; |
OLD | NEW |