1 | <?php |
||
22 | class Drawing |
||
23 | { |
||
24 | const DPI_96 = 96; |
||
25 | |||
26 | /** |
||
27 | * Convert pixels to EMU |
||
28 | * |
||
29 | * @param int $pValue Value in pixels |
||
30 | * @return int |
||
31 | */ |
||
32 | 1 | public static function pixelsToEmu($pValue = 0) |
|
36 | |||
37 | /** |
||
38 | * Convert EMU to pixels |
||
39 | * |
||
40 | * @param int $pValue Value in EMU |
||
41 | * @return int |
||
42 | */ |
||
43 | 1 | public static function emuToPixels($pValue = 0) |
|
50 | |||
51 | /** |
||
52 | * Convert pixels to points |
||
53 | * |
||
54 | * @param int $pValue Value in pixels |
||
55 | * @return float |
||
56 | */ |
||
57 | 1 | public static function pixelsToPoints($pValue = 0) |
|
61 | |||
62 | /** |
||
63 | * Convert points width to centimeters |
||
64 | * |
||
65 | * @param int $pValue Value in points |
||
66 | * @return float |
||
67 | */ |
||
68 | 1 | public static function pointsToCentimeters($pValue = 0) |
|
75 | |||
76 | /** |
||
77 | * Convert points width to pixels |
||
78 | * |
||
79 | * @param int $pValue Value in points |
||
80 | * @return float |
||
81 | */ |
||
82 | 1 | public static function pointsToPixels($pValue = 0) |
|
89 | |||
90 | /** |
||
91 | * Convert pixels to centimeters |
||
92 | * |
||
93 | * @param int $pValue Value in pixels |
||
94 | * @return float |
||
95 | */ |
||
96 | 1 | public static function pixelsToCentimeters($pValue = 0) |
|
101 | |||
102 | /** |
||
103 | * Convert centimeters width to pixels |
||
104 | * |
||
105 | * @param int $pValue Value in centimeters |
||
106 | * @return float |
||
107 | */ |
||
108 | 1 | public static function centimetersToPixels($pValue = 0) |
|
115 | |||
116 | /** |
||
117 | * Convert degrees to angle |
||
118 | * |
||
119 | * @param int $pValue Degrees |
||
120 | * @return int |
||
121 | */ |
||
122 | 1 | public static function degreesToAngle($pValue = 0) |
|
126 | |||
127 | /** |
||
128 | * Convert angle to degrees |
||
129 | * |
||
130 | * @param int $pValue Angle |
||
131 | * @return int |
||
132 | */ |
||
133 | 1 | public static function angleToDegrees($pValue = 0) |
|
140 | |||
141 | /** |
||
142 | * Convert centimeters width to twips |
||
143 | * |
||
144 | * @param integer $pValue |
||
145 | * @return float |
||
146 | */ |
||
147 | 1 | public static function centimetersToTwips($pValue = 0) |
|
154 | |||
155 | /** |
||
156 | * Convert twips width to centimeters |
||
157 | * |
||
158 | * @param integer $pValue |
||
159 | * @return float |
||
160 | */ |
||
161 | 1 | public static function twipsToCentimeters($pValue = 0) |
|
168 | |||
169 | /** |
||
170 | * Convert inches width to twips |
||
171 | * |
||
172 | * @param integer $pValue |
||
173 | * @return float |
||
174 | */ |
||
175 | 1 | public static function inchesToTwips($pValue = 0) |
|
182 | |||
183 | /** |
||
184 | * Convert twips width to inches |
||
185 | * |
||
186 | * @param integer $pValue |
||
187 | * @return float |
||
188 | */ |
||
189 | 1 | public static function twipsToInches($pValue = 0) |
|
196 | |||
197 | /** |
||
198 | * Convert twips width to pixels |
||
199 | * |
||
200 | * @param integer $pValue |
||
201 | * @return float |
||
202 | */ |
||
203 | 1 | public static function twipsToPixels($pValue = 0) |
|
210 | |||
211 | /** |
||
212 | * Convert HTML hexadecimal to RGB |
||
213 | * |
||
214 | * @param string $pValue HTML Color in hexadecimal |
||
215 | * @return array|false Value in RGB |
||
216 | */ |
||
217 | 1 | public static function htmlToRGB($pValue) |
|
237 | } |
||
238 |