Watermark.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <?php
  2. /**
  3. * 水印配置
  4. */
  5. class Watermark implements JsonSerializable {
  6. private $type;
  7. private $content;
  8. private $fontSize;
  9. private $angle;
  10. private $fontColor;
  11. private $position;
  12. private $diaphaneity;
  13. private $imgScale;
  14. private $tileDensity;
  15. private $gratingSize;
  16. private $viewPermission;
  17. public function jsonSerialize() {
  18. $data = [];
  19. foreach ($this as $key=>$val){
  20. if ($val !== null) $data[$key] = $val;
  21. }
  22. if(sizeof($data) < 1){
  23. return null;
  24. }
  25. return $data;
  26. }
  27. /**
  28. * @return mixed
  29. */
  30. public function getType()
  31. {
  32. return $this->type;
  33. }
  34. /**
  35. * @param mixed $type
  36. */
  37. public function setType($type)
  38. {
  39. $this->type = $type;
  40. }
  41. /**
  42. * @return mixed
  43. */
  44. public function getContent()
  45. {
  46. return $this->content;
  47. }
  48. /**
  49. * @param mixed $content
  50. */
  51. public function setContent($content)
  52. {
  53. $this->content = $content;
  54. }
  55. /**
  56. * @return mixed
  57. */
  58. public function getFontSize()
  59. {
  60. return $this->fontSize;
  61. }
  62. /**
  63. * @param mixed $fontSize
  64. */
  65. public function setFontSize($fontSize)
  66. {
  67. $this->fontSize = $fontSize;
  68. }
  69. /**
  70. * @return mixed
  71. */
  72. public function getAngle()
  73. {
  74. return $this->angle;
  75. }
  76. /**
  77. * @param mixed $angle
  78. */
  79. public function setAngle($angle)
  80. {
  81. $this->angle = $angle;
  82. }
  83. /**
  84. * @return mixed
  85. */
  86. public function getFontColor()
  87. {
  88. return $this->fontColor;
  89. }
  90. /**
  91. * @param mixed $fontColor
  92. */
  93. public function setFontColor($fontColor)
  94. {
  95. $this->fontColor = $fontColor;
  96. }
  97. /**
  98. * @return mixed
  99. */
  100. public function getPosition()
  101. {
  102. return $this->position;
  103. }
  104. /**
  105. * @param mixed $position
  106. */
  107. public function setPosition($position)
  108. {
  109. $this->position = $position;
  110. }
  111. /**
  112. * @return mixed
  113. */
  114. public function getDiaphaneity()
  115. {
  116. return $this->diaphaneity;
  117. }
  118. /**
  119. * @param mixed $diaphaneity
  120. */
  121. public function setDiaphaneity($diaphaneity)
  122. {
  123. $this->diaphaneity = $diaphaneity;
  124. }
  125. /**
  126. * @return mixed
  127. */
  128. public function getImgScale()
  129. {
  130. return $this->imgScale;
  131. }
  132. /**
  133. * @param mixed $imgScale
  134. */
  135. public function setImgScale($imgScale)
  136. {
  137. $this->imgScale = $imgScale;
  138. }
  139. /**
  140. * @return mixed
  141. */
  142. public function getTileDensity()
  143. {
  144. return $this->tileDensity;
  145. }
  146. /**
  147. * @param mixed $tileDensity
  148. */
  149. public function setTileDensity($tileDensity)
  150. {
  151. $this->tileDensity = $tileDensity;
  152. }
  153. /**
  154. * @return mixed
  155. */
  156. public function getGratingSize()
  157. {
  158. return $this->gratingSize;
  159. }
  160. /**
  161. * @param mixed $gratingSize
  162. */
  163. public function setGratingSize($gratingSize)
  164. {
  165. $this->gratingSize = $gratingSize;
  166. }
  167. /**
  168. * @return mixed
  169. */
  170. public function getViewPermission()
  171. {
  172. return $this->viewPermission;
  173. }
  174. /**
  175. * @param mixed $viewPermission
  176. */
  177. public function setViewPermission($viewPermission)
  178. {
  179. $this->viewPermission = $viewPermission;
  180. }
  181. }