123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212 |
- <?php
- namespace Qcloud\Cos\ImageParamTemplate;
- class ImageWatermarkTemplate extends ImageTemplate
- {
- private $image;
- private $gravity;
- private $dx;
- private $dy;
- private $blogo;
- private $scatype;
- private $spcent;
- private $dissolve;
- private $batch;
- private $degree;
- public function __construct() {
- parent::__construct();
- $this->image = "";
- $this->gravity = "";
- $this->dx = "";
- $this->dy = "";
- $this->blogo = "";
- $this->scatype = "";
- $this->spcent = "";
- $this->dissolve = "";
- $this->batch = "";
- $this->degree = "";
- }
-
- public function setImage($value) {
- $this->image = "/image/" . $this->ciBase64($value);
- }
-
- public function setGravity($value) {
- $this->gravity = "/gravity/" . $value;
- }
-
- public function setDx($value) {
- $this->dx = "/dx/" . $value;
- }
-
- public function setDy($value) {
- $this->dy = "/dy/" . $value;
- }
-
- public function setBlogo($value) {
- $this->blogo = "/blogo/" . $value;
- }
-
- public function setScatype($value) {
- $this->scatype = "/scatype/" . $value;
- }
-
- public function setSpcent($value) {
- $this->spcent = "/spcent/" . $value;
- }
-
- public function setDissolve($value) {
- $this->dissolve = "/dissolve/" . $value;
- }
-
- public function setBatch($value) {
- $this->batch = "/batch/" . $value;
- }
-
- public function setDegree($value) {
- $this->degree = "/degree/" . $value;
- }
- public function getImage() {
- return $this->image;
- }
- public function getGravity() {
- return $this->gravity;
- }
- public function getDx() {
- return $this->dx;
- }
- public function getDy() {
- return $this->dy;
- }
- public function getBlogo() {
- return $this->blogo;
- }
- public function getScatype() {
- return $this->scatype;
- }
- public function getSpcent() {
- return $this->spcent;
- }
- public function getDissolve() {
- return $this->dissolve;
- }
- public function getBatch() {
- return $this->batch;
- }
- public function getDegree() {
- return $this->degree;
- }
- public function queryString() {
- $head = "watermark/1";
- $res = "";
- if($this->image) {
- $res .= $this->image;
- }
- if($this->gravity) {
- $res .= $this->gravity;
- }
- if($this->dx) {
- $res .= $this->dx;
- }
- if($this->dy) {
- $res .= $this->dy;
- }
- if($this->blogo) {
- $res .= $this->blogo;
- }
- if($this->scatype) {
- $res .= $this->scatype;
- }
- if($this->spcent) {
- $res .= $this->spcent;
- }
- if($this->dissolve) {
- $res .= $this->dissolve;
- }
- if($this->batch) {
- $res .= $this->batch;
- }
- if($this->degree) {
- $res .= $this->degree;
- }
- if($res) {
- $res = $head . $res;
- }
- return $res;
- }
- public function resetRule() {
- $this->image = "";
- $this->gravity = "";
- $this->dx = "";
- $this->dy = "";
- $this->blogo = "";
- $this->scatype = "";
- $this->spcent = "";
- $this->dissolve = "";
- $this->batch = "";
- $this->degree = "";
- }
- }
|