Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_UNITS_H_ | 5 #ifndef PRINTING_UNITS_H_ |
| 6 #define PRINTING_UNITS_H_ | 6 #define PRINTING_UNITS_H_ |
| 7 | 7 |
| 8 struct PrintMsg_Print_Params; | |
| 9 | |
| 8 namespace printing { | 10 namespace printing { |
| 9 | 11 |
| 10 // Length of a thousanth of inches in 0.01mm unit. | 12 // Length of a thousanth of inches in 0.01mm unit. |
| 11 const int kHundrethsMMPerInch = 2540; | 13 const int kHundrethsMMPerInch = 2540; |
| 12 | 14 |
| 13 // Length of an inch in CSS's 1pt unit. | 15 // Length of an inch in CSS's 1pt unit. |
| 14 // http://dev.w3.org/csswg/css3-values/#absolute-length-units-cm-mm.-in-pt-pc | 16 // http://dev.w3.org/csswg/css3-values/#absolute-length-units-cm-mm.-in-pt-pc |
| 15 const int kPointsPerInch = 72; | 17 const int kPointsPerInch = 72; |
| 16 | 18 |
| 17 // Length of an inch in CSS's 1px unit. | 19 // Length of an inch in CSS's 1px unit. |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 29 | 31 |
| 30 // Converts from 0.00001 meter unit to 0.001 inch. | 32 // Converts from 0.00001 meter unit to 0.001 inch. |
| 31 int ConvertHundredThousanthMeterToMilliInch(int cmm); | 33 int ConvertHundredThousanthMeterToMilliInch(int cmm); |
| 32 | 34 |
| 33 // Converts from 1 pixel to 1 point using integers. | 35 // Converts from 1 pixel to 1 point using integers. |
| 34 int ConvertPixelsToPoint(int pixels); | 36 int ConvertPixelsToPoint(int pixels); |
| 35 | 37 |
| 36 // Converts from 1 pixel to 1 point using doubles. | 38 // Converts from 1 pixel to 1 point using doubles. |
| 37 double ConvertPixelsToPointDouble(double pixels); | 39 double ConvertPixelsToPointDouble(double pixels); |
| 38 | 40 |
| 41 // Converts from 1 point to 1 pixel using doubles. | |
| 42 double ConvertPointsToPixelDouble(double points); | |
| 43 | |
| 44 // Splits the horizontal width equally into segments with an interstice | |
| 45 // between each segment. Returns the width of a segment. | |
| 46 double GetSegmentWidth(double page_width); | |
| 47 | |
| 48 int GetDPI(const PrintMsg_Print_Params* print_params); | |
|
vandebo (ex-Chrome)
2011/08/11 23:32:13
const ref?
Aayush Kumar
2011/08/12 08:35:40
I have restored this change since I no longer need
| |
| 49 | |
| 39 } // namespace printing | 50 } // namespace printing |
| 40 | 51 |
| 41 #endif // PRINTING_UNITS_H_ | 52 #endif // PRINTING_UNITS_H_ |
| OLD | NEW |