Browse Source

image & map

Erasin 4 years ago
parent
commit
35b58464d8
2 changed files with 50 additions and 10 deletions
  1. 47 7
      src/Dy/Image.php
  2. 3 3
      src/Dy/Map.php

+ 47 - 7
src/Dy/Image.php

@@ -4,31 +4,71 @@ namespace Dy;
 
 class Image
 {
+
+    /**
+     * new Image
+     *
+     * @param string $str
+     * @return Image|ErrorException
+     */
+    public function __construct(string $str)
+    {
+    }
+
+    /**
+     * new Image 空白图
+     *
+     * @param integer $width 长度
+     * @param integer $height 高度
+     * @return Image|ErrorException
+     */
+    public static function new(int $width, int $height)
+    {
+    }
+
     /**
      * 尺寸缩放
      *
-     * @param string $src 输入地址
-     * @param string $dest 输出地址
      * @param integer $width 长度
      * @param integer $height 高度
-     * @return void|ErrorException
+     * @return Image|ErrorException
      */
-    public static function resize(string $src, string $dest, int $width, int $height)
+    public function resize(int $width, int $height)
     {
     }
 
     /**
      * 截图
      *
-     * @param string $src
-     * @param string $dest
      * @param integer $x
      * @param integer $y
      * @param integer $width
      * @param integer $height
+     * @return Image|ErrorException
+     */
+    public function crop(int $x, int $y, int $width, int $height)
+    {
+    }
+
+    /**
+     * 图片覆盖
+     *
+     * @param Image $top
+     * @param integer $x
+     * @param integer $y
+     * @return Image|ErrorException
+     */
+    public function over(Image $top, int $x, int $y)
+    {
+    }
+
+    /**
+     * 截图
+     *
+     * @param string $dest
      * @return void|ErrorException
      */
-    public static function crop(string $src, string $dest, int $x, int $y, int $width, int $height)
+    public function save(string $dest)
     {
     }
 

+ 3 - 3
src/Dy/Map.php

@@ -9,14 +9,14 @@ class Map
      *
      * @var float
      */
-    public $lng;
+    protected $lng;
 
     /**
      * 经度
      *
      * @var float
      */
-    public $lat;
+    protected $lat;
 
     /**
      * 模式
@@ -26,7 +26,7 @@ class Map
      * 2. gcj02
      * @var int
      */
-    public $mode;
+    protected $mode;
 
     /**
      * 新建座标