Skip to content
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.

Commit

Permalink
Added helper classes: Rectangle, Point, Color
Browse files Browse the repository at this point in the history
  • Loading branch information
stil committed Feb 18, 2015
1 parent 34fe79c commit ace8133
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/Color.php
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;
}
37 changes: 37 additions & 0 deletions src/Geometry/Point.php
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;
}
}
37 changes: 37 additions & 0 deletions src/Geometry/Rectangle.php
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;
}
}

0 comments on commit ace8133

Please sign in to comment.