OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 PRINTING_IMAGE_H_ | 5 #ifndef PRINTING_IMAGE_H_ |
6 #define PRINTING_IMAGE_H_ | 6 #define PRINTING_IMAGE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "printing/printing_export.h" |
13 #include "ui/gfx/size.h" | 14 #include "ui/gfx/size.h" |
14 | 15 |
15 class FilePath; | 16 class FilePath; |
16 | 17 |
17 namespace printing { | 18 namespace printing { |
18 | 19 |
19 class Metafile; | 20 class Metafile; |
20 | 21 |
21 // Lightweight raw-bitmap management. The image, once initialized, is immutable. | 22 // Lightweight raw-bitmap management. The image, once initialized, is immutable. |
22 // The main purpose is testing image contents. | 23 // The main purpose is testing image contents. |
23 class Image { | 24 class PRINTING_EXPORT Image { |
24 public: | 25 public: |
25 // Creates the image from the given file on disk. Uses extension to | 26 // Creates the image from the given file on disk. Uses extension to |
26 // defer file type. PNG and EMF (on Windows) currently supported. | 27 // defer file type. PNG and EMF (on Windows) currently supported. |
27 // If image loading fails size().IsEmpty() will be true. | 28 // If image loading fails size().IsEmpty() will be true. |
28 explicit Image(const FilePath& path); | 29 explicit Image(const FilePath& path); |
29 | 30 |
30 // Creates the image from the metafile. Deduces bounds based on bounds in | 31 // Creates the image from the metafile. Deduces bounds based on bounds in |
31 // metafile. If loading fails size().IsEmpty() will be true. | 32 // metafile. If loading fails size().IsEmpty() will be true. |
32 explicit Image(const Metafile& metafile); | 33 explicit Image(const Metafile& metafile); |
33 | 34 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 // Flag to signal if the comparison functions should ignore the alpha channel. | 90 // Flag to signal if the comparison functions should ignore the alpha channel. |
90 const bool ignore_alpha_; // Currently always true. | 91 const bool ignore_alpha_; // Currently always true. |
91 | 92 |
92 // Prevent operator= (this function has no implementation) | 93 // Prevent operator= (this function has no implementation) |
93 Image& operator=(const Image& image); | 94 Image& operator=(const Image& image); |
94 }; | 95 }; |
95 | 96 |
96 } // namespace printing | 97 } // namespace printing |
97 | 98 |
98 #endif // PRINTING_IMAGE_H_ | 99 #endif // PRINTING_IMAGE_H_ |
OLD | NEW |