OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_UTILITY_CLOUD_PRINT_PWG_ENCODER_H_ | 5 #ifndef CHROME_UTILITY_CLOUD_PRINT_PWG_ENCODER_H_ |
6 #define CHROME_UTILITY_CLOUD_PRINT_PWG_ENCODER_H_ | 6 #define CHROME_UTILITY_CLOUD_PRINT_PWG_ENCODER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 | 11 |
12 namespace cloud_print { | 12 namespace cloud_print { |
13 | 13 |
14 class BitmapImage; | 14 class BitmapImage; |
15 | 15 |
16 class PwgEncoder { | 16 class PwgEncoder { |
17 public: | 17 public: |
18 PwgEncoder(); | 18 PwgEncoder(); |
19 | 19 |
20 void EncodeDocumentHeader(std::string *output) const; | 20 void EncodeDocumentHeader(std::string *output) const; |
21 bool EncodePage(const BitmapImage& image, const uint32 dpi, | 21 bool EncodePage(const BitmapImage& image, |
22 const uint32 total_pages, std::string* output) const; | 22 const uint32 dpi, |
| 23 const uint32 total_pages, |
| 24 std::string* output, |
| 25 bool rotate) const; |
23 | 26 |
24 private: | 27 private: |
25 void EncodePageHeader(const BitmapImage& image, const uint32 dpi, | 28 void EncodePageHeader(const BitmapImage& image, const uint32 dpi, |
26 const uint32 total_pages, std::string* output) const; | 29 const uint32 total_pages, std::string* output) const; |
27 bool EncodeRowFrom32Bit(const uint8* row, const int width, | 30 bool EncodeRowFrom32Bit(const uint8* row, |
28 const int color_space, std::string* output) const; | 31 const int width, |
| 32 const int color_space, |
| 33 std::string* output) const; |
29 const uint8* GetRow(const BitmapImage& image, int row) const; | 34 const uint8* GetRow(const BitmapImage& image, int row) const; |
30 }; | 35 }; |
31 | 36 |
32 } // namespace cloud_print | 37 } // namespace cloud_print |
33 | 38 |
34 #endif // CHROME_UTILITY_CLOUD_PRINT_PWG_ENCODER_H_ | 39 #endif // CHROME_UTILITY_CLOUD_PRINT_PWG_ENCODER_H_ |
OLD | NEW |