This repository has been archived by the owner on Jan 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added helper classes: Rectangle, Point, Color
- Loading branch information
stil
committed
Feb 18, 2015
1 parent
34fe79c
commit ace8133
Showing
3 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
namespace GIFEndec; | ||
|
||
class Color | ||
{ | ||
/** | ||
* @var int Color index | ||
*/ | ||
public $index = -1; | ||
|
||
/** | ||
* @var int Red component | ||
*/ | ||
public $red = -1; | ||
|
||
/** | ||
* @var int Green component | ||
*/ | ||
public $green = -1; | ||
|
||
/** | ||
* @var int Blue component | ||
*/ | ||
public $blue = -1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
namespace GIFEndec\Geometry; | ||
|
||
class Point | ||
{ | ||
/* @var int */ | ||
protected $x; | ||
|
||
/* @var int */ | ||
protected $y; | ||
|
||
/** | ||
* @param int $x | ||
* @param int $y | ||
*/ | ||
public function __construct($x, $y) | ||
{ | ||
$this->x = $x; | ||
$this->y = $y; | ||
} | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getX() | ||
{ | ||
return $this->x; | ||
} | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getY() | ||
{ | ||
return $this->y; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
namespace GIFEndec\Geometry; | ||
|
||
class Rectangle | ||
{ | ||
/* @var int */ | ||
protected $width; | ||
|
||
/* @var int */ | ||
protected $height; | ||
|
||
/** | ||
* @param int $width | ||
* @param int $height | ||
*/ | ||
public function __construct($width, $height) | ||
{ | ||
$this->width = $width; | ||
$this->height = $height; | ||
} | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getWidth() | ||
{ | ||
return $this->width; | ||
} | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getHeight() | ||
{ | ||
return $this->height; | ||
} | ||
} |