| 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 <stdint.h> |
| 9 |
| 8 #include <string> | 10 #include <string> |
| 9 | 11 |
| 10 #include "base/basictypes.h" | |
| 11 | 12 |
| 12 namespace cloud_print { | 13 namespace cloud_print { |
| 13 | 14 |
| 14 class BitmapImage; | 15 class BitmapImage; |
| 15 | 16 |
| 16 struct PwgHeaderInfo { | 17 struct PwgHeaderInfo { |
| 17 PwgHeaderInfo() | 18 PwgHeaderInfo() |
| 18 : dpi(300), | 19 : dpi(300), |
| 19 total_pages(1), | 20 total_pages(1), |
| 20 flipx(false), | 21 flipx(false), |
| 21 flipy(false), | 22 flipy(false), |
| 22 color_space(SRGB), | 23 color_space(SRGB), |
| 23 duplex(false), | 24 duplex(false), |
| 24 tumble(false) {} | 25 tumble(false) {} |
| 25 enum ColorSpace { SGRAY = 18, SRGB = 19 }; | 26 enum ColorSpace { SGRAY = 18, SRGB = 19 }; |
| 26 uint32 dpi; | 27 uint32_t dpi; |
| 27 uint32 total_pages; | 28 uint32_t total_pages; |
| 28 bool flipx; | 29 bool flipx; |
| 29 bool flipy; | 30 bool flipy; |
| 30 ColorSpace color_space; | 31 ColorSpace color_space; |
| 31 bool duplex; | 32 bool duplex; |
| 32 bool tumble; | 33 bool tumble; |
| 33 }; | 34 }; |
| 34 | 35 |
| 35 class PwgEncoder { | 36 class PwgEncoder { |
| 36 public: | 37 public: |
| 37 PwgEncoder(); | 38 PwgEncoder(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 50 void EncodeRow(RandomAccessIterator pos, | 51 void EncodeRow(RandomAccessIterator pos, |
| 51 RandomAccessIterator row_end, | 52 RandomAccessIterator row_end, |
| 52 bool monochrome, | 53 bool monochrome, |
| 53 std::string* output) const; | 54 std::string* output) const; |
| 54 | 55 |
| 55 template <typename InputStruct> | 56 template <typename InputStruct> |
| 56 bool EncodePageWithColorspace(const BitmapImage& image, | 57 bool EncodePageWithColorspace(const BitmapImage& image, |
| 57 const PwgHeaderInfo& pwg_header_info, | 58 const PwgHeaderInfo& pwg_header_info, |
| 58 std::string* output) const; | 59 std::string* output) const; |
| 59 | 60 |
| 60 const uint8* GetRow(const BitmapImage& image, int row, bool flipy) const; | 61 const uint8_t* GetRow(const BitmapImage& image, int row, bool flipy) const; |
| 61 }; | 62 }; |
| 62 | 63 |
| 63 } // namespace cloud_print | 64 } // namespace cloud_print |
| 64 | 65 |
| 65 #endif // CHROME_UTILITY_CLOUD_PRINT_PWG_ENCODER_H_ | 66 #endif // CHROME_UTILITY_CLOUD_PRINT_PWG_ENCODER_H_ |
| OLD | NEW |