OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef UI_GFX_IMAGESKIA_OPERATIONS_H_ | |
6 #define UI_GFX_IMAGESKIA_OPERATIONS_H_ | |
7 #pragma once | |
8 | |
9 #include "base/gtest_prod_util.h" | |
10 #include "ui/base/ui_export.h" | |
11 | |
12 namespace gfx { | |
13 class ImageSkia; | |
14 | |
15 class UI_EXPORT ImageSkiaOperations { | |
16 public: | |
17 // 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 | |
19 // use have the kARGB_8888_Config config and be of equal dimensions. | |
pkotwicz
2012/07/10 17:16:48
Nit: Get rid of 'have'
| |
20 static ImageSkia CreateBlendedImage(const ImageSkia& first, | |
21 const ImageSkia& second, | |
22 double alpha); | |
23 | |
24 // Create an image that is the original bitmap masked out by the mask defined | |
25 // in the alpha bitmap. The images must use the kARGB_8888_Config config and | |
26 // be of equal dimensions. | |
27 static ImageSkia CreateMaskedImage(const ImageSkia& first, | |
28 const ImageSkia& alpha); | |
29 | |
30 // Create a bitmap that is cropped from another bitmap. This is special | |
pkotwicz
2012/07/10 17:16:48
Nit: bitmap->image
| |
31 // because it tiles the original bitmap, so your coordinates can extend | |
32 // outside the bounds of the original image. | |
33 static ImageSkia CreateTiledImage(const ImageSkia& bitmap, | |
34 int src_x, int src_y, | |
35 int dst_w, int dst_h); | |
36 | |
37 private: | |
38 ImageSkiaOperations(); // Class for scoping only. | |
39 }; | |
40 | |
41 } | |
42 | |
43 #endif // UI_GFX_IMAGESKIA_OPERATIONS_H_ | |
OLD | NEW |