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
3 // found in the LICENSE file.
5 #ifndef CHROME_UTILITY_CLOUD_PRINT_PWG_ENCODER_H_
6 #define CHROME_UTILITY_CLOUD_PRINT_PWG_ENCODER_H_
10 #include "base/basictypes.h"
12 namespace cloud_print {
16 struct PwgHeaderInfo {
25 enum ColorSpace { SGRAY = 18, SRGB = 19 };
30 ColorSpace color_space;
39 void EncodeDocumentHeader(std::string *output) const;
40 bool EncodePage(const BitmapImage& image,
41 const PwgHeaderInfo& pwg_header_info,
42 std::string* output) const;
45 void EncodePageHeader(const BitmapImage& image,
46 const PwgHeaderInfo& pwg_header_info,
47 std::string* output) const;
49 template <typename InputStruct, class RandomAccessIterator>
50 void EncodeRow(RandomAccessIterator pos,
51 RandomAccessIterator row_end,
53 std::string* output) const;
55 template <typename InputStruct>
56 bool EncodePageWithColorspace(const BitmapImage& image,
57 const PwgHeaderInfo& pwg_header_info,
58 std::string* output) const;
60 const uint8* GetRow(const BitmapImage& image, int row, bool flipy) const;
63 } // namespace cloud_print
65 #endif // CHROME_UTILITY_CLOUD_PRINT_PWG_ENCODER_H_