Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef UI_GFX_IMAGESKIA_OPERATIONS_H_ | 5 #ifndef UI_GFX_IMAGE_IMAGE_SKIA_OPERATIONS_H_ |
| 6 #define UI_GFX_IMAGESKIA_OPERATIONS_H_ | 6 #define UI_GFX_IMAGE_IMAGE_SKIA_OPERATIONS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
| 10 #include "ui/base/ui_export.h" | 10 #include "ui/base/ui_export.h" |
| 11 #include "ui/gfx/shadow_value.h" | |
|
oshima
2012/07/11 18:08:41
can you use forward decl?
xiyuan
2012/07/11 21:40:40
This header is included for gfx::ShadowValues, whi
| |
| 11 | 12 |
| 12 namespace gfx { | 13 namespace gfx { |
| 13 class ImageSkia; | 14 class ImageSkia; |
| 15 class Size; | |
| 14 | 16 |
| 15 class UI_EXPORT ImageSkiaOperations { | 17 class UI_EXPORT ImageSkiaOperations { |
| 16 public: | 18 public: |
| 17 // Create an image that is a blend of two others. The alpha argument | 19 // Create an image that is a blend of two others. The alpha argument |
| 18 // specifies the opacity of the second imag. The provided image must | 20 // specifies the opacity of the second imag. The provided image must |
| 19 // use the kARGB_8888_Config config and be of equal dimensions. | 21 // use the kARGB_8888_Config config and be of equal dimensions. |
| 20 static ImageSkia CreateBlendedImage(const ImageSkia& first, | 22 static ImageSkia CreateBlendedImage(const ImageSkia& first, |
| 21 const ImageSkia& second, | 23 const ImageSkia& second, |
| 22 double alpha); | 24 double alpha); |
| 23 | 25 |
| 24 // Create an image that is the original image masked out by the mask defined | 26 // Create an image that is the original image masked out by the mask defined |
| 25 // in the alpha image. The images must use the kARGB_8888_Config config and | 27 // in the alpha image. The images must use the kARGB_8888_Config config and |
| 26 // be of equal dimensions. | 28 // be of equal dimensions. |
| 27 static ImageSkia CreateMaskedImage(const ImageSkia& first, | 29 static ImageSkia CreateMaskedImage(const ImageSkia& first, |
| 28 const ImageSkia& alpha); | 30 const ImageSkia& alpha); |
| 29 | 31 |
| 30 // Create an image that is cropped from another image. This is special | 32 // Create an image that is cropped from another image. This is special |
| 31 // because it tiles the original image, so your coordinates can extend | 33 // because it tiles the original image, so your coordinates can extend |
| 32 // outside the bounds of the original image. | 34 // outside the bounds of the original image. |
| 33 static ImageSkia CreateTiledImage(const ImageSkia& image, | 35 static ImageSkia CreateTiledImage(const ImageSkia& image, |
| 34 int src_x, int src_y, | 36 int src_x, int src_y, |
| 35 int dst_w, int dst_h); | 37 int dst_w, int dst_h); |
| 36 | 38 |
| 39 // Creates an image by resizing |source| to given |target_dip_size|. | |
| 40 static ImageSkia CreateResizedImage(const ImageSkia& source, | |
| 41 const Size& target_dip_size); | |
| 42 | |
| 43 // Creates an image with drop shadow defined in |shadows| for |source|. | |
| 44 static ImageSkia CreateDropShadowImage(const ImageSkia& source, | |
| 45 const ShadowValues& shadows); | |
| 46 | |
| 37 private: | 47 private: |
| 38 ImageSkiaOperations(); // Class for scoping only. | 48 ImageSkiaOperations(); // Class for scoping only. |
| 39 }; | 49 }; |
| 40 | 50 |
| 41 } | 51 } |
| 42 | 52 |
| 43 #endif // UI_GFX_IMAGESKIA_OPERATIONS_H_ | 53 #endif // UI_GFX_IMAGE_IMAGE_SKIA_OPERATIONS_H_ |
| OLD | NEW |