|
@@ -8,44 +8,25 @@
|
8
|
8
|
|
9
|
9
|
namespace App\Http\Business\Cameras;
|
10
|
10
|
|
11
|
|
-
|
12
|
11
|
use App\Http\DBO\CamerasDbo;
|
13
|
|
-use App\Http\DBO\CamerasImageDbo;
|
14
|
12
|
use Imagine\Image\Box;
|
15
|
13
|
use Imagine\Image\Palette\RGB;
|
16
|
14
|
use Imagine\Image\Point;
|
17
|
|
-use Imagine\Imagick\Image;
|
18
|
|
-use Imagine\Imagick\Imagine;
|
19
|
15
|
|
20
|
16
|
class DummyCamera extends AbstractCamera
|
21
|
17
|
{
|
22
|
|
- /**
|
23
|
|
- * @var $_image Image
|
24
|
|
- */
|
25
|
|
- private $_image;
|
26
|
|
- /**
|
27
|
|
- * @var $_imagine Imagine
|
28
|
|
- */
|
29
|
|
- private $_imagine;
|
30
|
18
|
|
31
|
19
|
public function __construct(CamerasDbo $camera)
|
32
|
20
|
{
|
33
|
21
|
parent::__construct($camera);
|
34
|
|
- $this->_imagine = new Imagine();
|
35
|
22
|
$this->_image = $this->_imagine->open("../resources/images/dummy_camera.jpg");
|
36
|
23
|
}
|
37
|
24
|
|
38
|
|
- /**
|
39
|
|
- * @return CamerasImageDbo
|
40
|
|
- */
|
41
|
|
- public function getImage()
|
|
25
|
+ public function prepareImage()
|
42
|
26
|
{
|
43
|
|
- $imageDbo = new CamerasImageDbo();
|
44
|
27
|
$draw = $this->_image->draw();
|
45
|
28
|
$palette = new RGB();
|
46
|
29
|
$radius = rand(10, 42);
|
47
|
30
|
$draw->ellipse(new Point(42, 42), new Box($radius, $radius), $palette->color('#ff0000'));
|
48
|
|
- $imageDbo->setImage(base64_encode($this->_image->get("jpeg")));
|
49
|
|
- return $imageDbo;
|
50
|
31
|
}
|
51
|
32
|
}
|