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