|
1 <?php |
|
2 /** |
|
3 * Zend Framework |
|
4 * |
|
5 * LICENSE |
|
6 * |
|
7 * This source file is subject to the new BSD license that is bundled |
|
8 * with this package in the file LICENSE.txt. |
|
9 * It is also available through the world-wide-web at this URL: |
|
10 * http://framework.zend.com/license/new-bsd |
|
11 * If you did not receive a copy of the license and are unable to |
|
12 * obtain it through the world-wide-web, please send an email |
|
13 * to license@zend.com so we can send you a copy immediately. |
|
14 * |
|
15 * @category Zend |
|
16 * @package Zend_Measure |
|
17 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
|
18 * @license http://framework.zend.com/license/new-bsd New BSD License |
|
19 * @version $Id: Lightness.php 20096 2010-01-06 02:05:09Z bkarwin $ |
|
20 */ |
|
21 |
|
22 /** |
|
23 * Implement needed classes |
|
24 */ |
|
25 require_once 'Zend/Measure/Abstract.php'; |
|
26 require_once 'Zend/Locale.php'; |
|
27 |
|
28 /** |
|
29 * Class for handling temperature conversions |
|
30 * |
|
31 * @category Zend |
|
32 * @package Zend_Measure |
|
33 * @subpackage Zend_Measure_Lightness |
|
34 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
|
35 * @license http://framework.zend.com/license/new-bsd New BSD License |
|
36 */ |
|
37 class Zend_Measure_Lightness extends Zend_Measure_Abstract |
|
38 { |
|
39 const STANDARD = 'CANDELA_PER_SQUARE_METER'; |
|
40 |
|
41 const APOSTILB = 'APOSTILB'; |
|
42 const BLONDEL = 'BLONDEL'; |
|
43 const CANDELA_PER_SQUARE_CENTIMETER = 'CANDELA_PER_SQUARE_CENTIMETER'; |
|
44 const CANDELA_PER_SQUARE_FOOT = 'CANDELA_PER_SQUARE_FOOT'; |
|
45 const CANDELA_PER_SQUARE_INCH = 'CANDELA_PER_SQUARE_INCH'; |
|
46 const CANDELA_PER_SQUARE_METER = 'CANDELA_PER_SQUARE_METER'; |
|
47 const FOOTLAMBERT = 'FOOTLAMBERT'; |
|
48 const KILOCANDELA_PER_SQUARE_CENTIMETER = 'KILOCANDELA_PER_SQUARE_CENTIMETER'; |
|
49 const KILOCANDELA_PER_SQUARE_FOOT = 'KILOCANDELA_PER_SQUARE_FOOT'; |
|
50 const KILOCANDELA_PER_SQUARE_INCH = 'KILOCANDELA_PER_SQUARE_INCH'; |
|
51 const KILOCANDELA_PER_SQUARE_METER = 'KILOCANDELA_PER_SQUARE_METER'; |
|
52 const LAMBERT = 'LAMBERT'; |
|
53 const MILLILAMBERT = 'MILLILAMBERT'; |
|
54 const NIT = 'NIT'; |
|
55 const STILB = 'STILB'; |
|
56 |
|
57 /** |
|
58 * Calculations for all lightness units |
|
59 * |
|
60 * @var array |
|
61 */ |
|
62 protected $_units = array( |
|
63 'APOSTILB' => array('0.31830989', 'asb'), |
|
64 'BLONDEL' => array('0.31830989', 'blondel'), |
|
65 'CANDELA_PER_SQUARE_CENTIMETER' => array('10000', 'cd/cm²'), |
|
66 'CANDELA_PER_SQUARE_FOOT' => array('10.76391', 'cd/ft²'), |
|
67 'CANDELA_PER_SQUARE_INCH' => array('1550.00304', 'cd/in²'), |
|
68 'CANDELA_PER_SQUARE_METER' => array('1', 'cd/m²'), |
|
69 'FOOTLAMBERT' => array('3.4262591', 'ftL'), |
|
70 'KILOCANDELA_PER_SQUARE_CENTIMETER' => array('10000000', 'kcd/cm²'), |
|
71 'KILOCANDELA_PER_SQUARE_FOOT' => array('10763.91', 'kcd/ft²'), |
|
72 'KILOCANDELA_PER_SQUARE_INCH' => array('1550003.04', 'kcd/in²'), |
|
73 'KILOCANDELA_PER_SQUARE_METER' => array('1000', 'kcd/m²'), |
|
74 'LAMBERT' => array('3183.0989', 'L'), |
|
75 'MILLILAMBERT' => array('3.1830989', 'mL'), |
|
76 'NIT' => array('1', 'nt'), |
|
77 'STILB' => array('10000', 'sb'), |
|
78 'STANDARD' => 'CANDELA_PER_SQUARE_METER' |
|
79 ); |
|
80 } |