/usr/share/php/Imlib/class.ImlibCliprect.php is in php-imlib 0.7-4.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | <?php
/**
* Provides variables and methods for a clipping rectangle
*
* The variables and methods in this class provide a clipping rectangle that
* can be used by any drawing function to restrict drawing/filling to a
* rectangular region.
*
* @version 0.3
* @author Matt McClanahan <cardinal@dodds.net>
* @package Imlib
* @access public
*/
class ImlibCliprect extends ImlibColor
{
/**
* The array defining the cliprect (x,y,w,h)
*
* @var array $cliprect
* @access private
*/
var $cliprect;
/**
* A boolean that determines if a cliprect is in use or not
*
* @var bool $cliprect_inuse
*/
var $cliprect_inuse;
/**
* ImlibCliprect constructor
*
* @access public
*/
function ImlibCliprect() { $this->cliprect_inuse = 0; }
/**
* Get the four values of the cliprect
*
* @param int Upper left X coordinate to clip from
* @param int Upper left Y coordinate to clip from
* @param int Width of the cliprect
* @param int Height of the cliprect
* @access public
* @see set_cliprect()
*/
function get_cliprect(&$x,&$y,&$w,&$h)
{
list($x,$y,$w,$h) = $this->cliprect;
}
/**
* Get the array that defines the cliprect (x,y,w,h)
*
* @return array Array defining the clipping rectangle
* @access public
* @see set_cliprect_array()
*/
function get_cliprect_array()
{
return $this->cliprect;
}
/**
* Get the boolean that determines if a cliprect is in use or not
*
* @return bool True if the cliprect is in use
* @access public
* @see set_cliprect_inuse()
*/
function get_cliprect_inuse()
{
return $this->cliprect_inuse;
}
/**
* Set the four values of the cliprect. 0 for X disables the cliprect.
*
* @param int Upper left X coordinate to clip from
* @param int Upper left Y coordinate to clip from
* @param int Width of the cliprect
* @param int Height of the cliprect
* @access public
* @see get_cliprect()
*/
function set_cliprect($x,$y,$w,$h)
{
if ($x == 0)
{
$this->cliprect = 0;
$this->cliprect_inuse = 0;
return;
}
$this->cliprect_inuse = 1;
$this->cliprect = Array($x,$y,$w,$h);
}
/**
* Set the array that defines the cliprect (x,y,w,h)
*
* @param array Array that defines the cliprect
* @access public
* @see get_cliprect_array()
*/
function set_cliprect_array($arr)
{
if ($arr[0] == 0)
{
$this->cliprect = 0;
$this->cliprect_inuse = 0;
return;
}
$this->cliprect_inuse = 1;
$this->cliprect = $arr;
}
/**
* Set the boolean that determines if the cliprect is in use
*
* @param bool True to enable, false to disable
* @access public
* @see get_cliprect_inuse()
*/
function set_cliprect_inuse($set)
{
$this->cliprect_inuse = $set;
}
};
?>
|