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 'use strict'; | 5 'use strict'; |
6 | 6 |
7 | 7 |
8 // Namespace object for the utilities. | 8 // Namespace object for the utilities. |
9 function ImageUtil() {} | 9 function ImageUtil() {} |
10 | 10 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 * rectangle are (x = right - 1) and the pixels (x = right) are not included | 145 * rectangle are (x = right - 1) and the pixels (x = right) are not included |
146 * in the rectangle. | 146 * in the rectangle. |
147 * @return {number} | 147 * @return {number} |
148 */ | 148 */ |
149 get right() { | 149 get right() { |
150 return this.left + this.width; | 150 return this.left + this.width; |
151 }, | 151 }, |
152 | 152 |
153 /** | 153 /** |
154 * Obtains the y coordinate of bottom edge. The most bottom pixels in the | 154 * Obtains the y coordinate of bottom edge. The most bottom pixels in the |
155 * rectanlge are (y = buttom - 1) and the pixels (y = bottom) are not included | 155 * rectangle are (y = bottom - 1) and the pixels (y = bottom) are not included |
156 * in the rectangle. | 156 * in the rectangle. |
157 * @return {number} | 157 * @return {number} |
158 */ | 158 */ |
159 get bottom() { | 159 get bottom() { |
160 return this.top + this.height; | 160 return this.top + this.height; |
161 } | 161 } |
162 }; | 162 }; |
163 | 163 |
164 /** | 164 /** |
165 * @param {number} factor Factor to scale. | 165 * @param {number} factor Factor to scale. |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 * @return {string} Full name. | 685 * @return {string} Full name. |
686 */ | 686 */ |
687 ImageUtil.getMetricName = function(name) { | 687 ImageUtil.getMetricName = function(name) { |
688 return 'PhotoEditor.' + name; | 688 return 'PhotoEditor.' + name; |
689 }; | 689 }; |
690 | 690 |
691 /** | 691 /** |
692 * Used for metrics reporting, keep in sync with the histogram description. | 692 * Used for metrics reporting, keep in sync with the histogram description. |
693 */ | 693 */ |
694 ImageUtil.FILE_TYPES = ['jpg', 'png', 'gif', 'bmp', 'webp']; | 694 ImageUtil.FILE_TYPES = ['jpg', 'png', 'gif', 'bmp', 'webp']; |
OLD | NEW |