import v1.1.0_RC2 | 2009-09-20
This commit is contained in:
@ -14,8 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Pdf
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Cmyk.php 16978 2009-07-22 19:59:40Z alexander $
|
||||
*/
|
||||
|
||||
/** Zend_Pdf_Color */
|
||||
@ -29,7 +30,7 @@ require_once 'Zend/Pdf/Element/Numeric.php';
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Pdf
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Pdf_Color_Cmyk extends Zend_Pdf_Color
|
||||
@ -77,22 +78,22 @@ class Zend_Pdf_Color_Cmyk extends Zend_Pdf_Color
|
||||
*/
|
||||
public function __construct($c, $m, $y, $k)
|
||||
{
|
||||
if ($c < 0) { $c = 0; }
|
||||
if ($c > 1) { $c = 1; }
|
||||
|
||||
if ($m < 0) { $m = 0; }
|
||||
if ($m > 1) { $m = 1; }
|
||||
|
||||
if ($y < 0) { $y = 0; }
|
||||
if ($y > 1) { $y = 1; }
|
||||
|
||||
if ($k < 0) { $k = 0; }
|
||||
if ($k > 1) { $k = 1; }
|
||||
|
||||
$this->_c = new Zend_Pdf_Element_Numeric($c);
|
||||
$this->_m = new Zend_Pdf_Element_Numeric($m);
|
||||
$this->_y = new Zend_Pdf_Element_Numeric($y);
|
||||
$this->_k = new Zend_Pdf_Element_Numeric($k);
|
||||
|
||||
if ($this->_c->value < 0) { $this->_c->value = 0; }
|
||||
if ($this->_c->value > 1) { $this->_c->value = 1; }
|
||||
|
||||
if ($this->_m->value < 0) { $this->_m->value = 0; }
|
||||
if ($this->_m->value > 1) { $this->_m->value = 1; }
|
||||
|
||||
if ($this->_y->value < 0) { $this->_y->value = 0; }
|
||||
if ($this->_y->value > 1) { $this->_y->value = 1; }
|
||||
|
||||
if ($this->_k->value < 0) { $this->_k->value = 0; }
|
||||
if ($this->_k->value > 1) { $this->_k->value = 1; }
|
||||
}
|
||||
|
||||
/**
|
||||
@ -110,5 +111,15 @@ class Zend_Pdf_Color_Cmyk extends Zend_Pdf_Color
|
||||
. $this->_y->toString() . ' '
|
||||
. $this->_k->toString() . ($stroking? " K\n" : " k\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get color components (color space dependent)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getComponents()
|
||||
{
|
||||
return array($this->_c->value, $this->_m->value, $this->_y->value, $this->_k->value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Pdf
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: GrayScale.php 16978 2009-07-22 19:59:40Z alexander $
|
||||
*/
|
||||
|
||||
/** Zend_Pdf_Color */
|
||||
@ -29,7 +30,7 @@ require_once 'Zend/Pdf/Element/Numeric.php';
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Pdf
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Pdf_Color_GrayScale extends Zend_Pdf_Color
|
||||
@ -49,15 +50,10 @@ class Zend_Pdf_Color_GrayScale extends Zend_Pdf_Color
|
||||
*/
|
||||
public function __construct($grayLevel)
|
||||
{
|
||||
if ($grayLevel < 0) { $grayLevel = 0; }
|
||||
if ($grayLevel > 1) { $grayLevel = 1; }
|
||||
|
||||
$this->_grayLevel = new Zend_Pdf_Element_Numeric($grayLevel);
|
||||
|
||||
if ($this->_grayLevel->value < 0) {
|
||||
$this->_grayLevel->value = 0;
|
||||
}
|
||||
|
||||
if ($this->_grayLevel->value > 1) {
|
||||
$this->_grayLevel->value = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -72,5 +68,15 @@ class Zend_Pdf_Color_GrayScale extends Zend_Pdf_Color
|
||||
{
|
||||
return $this->_grayLevel->toString() . ($stroking? " G\n" : " g\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get color components (color space dependent)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getComponents()
|
||||
{
|
||||
return array($this->_grayLevel->value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Pdf
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Html.php 16978 2009-07-22 19:59:40Z alexander $
|
||||
*/
|
||||
|
||||
/** Zend_Pdf_Color */
|
||||
@ -35,7 +36,7 @@ require_once 'Zend/Pdf/Color/GrayScale.php';
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Pdf
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Pdf_Color_Html extends Zend_Pdf_Color
|
||||
@ -73,6 +74,16 @@ class Zend_Pdf_Color_Html extends Zend_Pdf_Color
|
||||
return $this->_color->instructions($stroking);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get color components (color space dependent)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getComponents()
|
||||
{
|
||||
return $this->_color->getComponents();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a Zend_Pdf_Color object from the HTML representation.
|
||||
*
|
||||
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Pdf
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Rgb.php 16978 2009-07-22 19:59:40Z alexander $
|
||||
*/
|
||||
|
||||
/** Zend_Pdf_Color */
|
||||
@ -29,7 +30,7 @@ require_once 'Zend/Pdf/Element/Numeric.php';
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Pdf
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Pdf_Color_Rgb extends Zend_Pdf_Color
|
||||
@ -97,5 +98,15 @@ class Zend_Pdf_Color_Rgb extends Zend_Pdf_Color
|
||||
. $this->_g->toString() . ' '
|
||||
. $this->_b->toString() . ($stroking? " RG\n" : " rg\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get color components (color space dependent)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getComponents()
|
||||
{
|
||||
return array($this->_r->value, $this->_g->value, $this->_b->value);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user