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 #include "chrome/utility/cloud_print/pwg_encoder.h" |
| 6 |
5 #include <algorithm> | 7 #include <algorithm> |
6 | 8 |
7 #include "base/logging.h" | 9 #include "base/logging.h" |
8 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
9 #include "chrome/utility/cloud_print/bitmap_image.h" | 11 #include "chrome/utility/cloud_print/bitmap_image.h" |
10 #include "chrome/utility/cloud_print/pwg_encoder.h" | |
11 #include "net/base/big_endian.h" | 12 #include "net/base/big_endian.h" |
12 | 13 |
13 namespace printing { | 14 namespace cloud_print { |
14 | 15 |
15 namespace { | 16 namespace { |
16 | 17 |
17 const uint32 kBitsPerColor = 8; | 18 const uint32 kBitsPerColor = 8; |
18 const uint32 kColorSpace = 19; // sRGB. | 19 const uint32 kColorSpace = 19; // sRGB. |
19 const uint32 kColorOrder = 0; // chunky. | 20 const uint32 kColorOrder = 0; // chunky. |
20 const uint32 kNumColors = 3; | 21 const uint32 kNumColors = 3; |
21 const uint32 kBitsPerPixel = kNumColors * kBitsPerColor; | 22 const uint32 kBitsPerPixel = kNumColors * kBitsPerColor; |
22 | 23 |
23 const char kPwgKeyword[] = "RaS2"; | 24 const char kPwgKeyword[] = "RaS2"; |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 | 183 |
183 // Both supported colorspaces have a 32-bit pixels information. | 184 // Both supported colorspaces have a 32-bit pixels information. |
184 if (!EncodeRowFrom32Bit( | 185 if (!EncodeRowFrom32Bit( |
185 current_row, image.width(), image.colorspace(), output)) { | 186 current_row, image.width(), image.colorspace(), output)) { |
186 return false; | 187 return false; |
187 } | 188 } |
188 } | 189 } |
189 return true; | 190 return true; |
190 } | 191 } |
191 | 192 |
192 } // namespace printing | 193 } // namespace cloud_print |
OLD | NEW |