also looking at this
Client Image Operations
#65
3 files
+1302
-0
| @@ -4,6 +4,7 @@ namespace Meema\MeemaClient; | ||
| 4 | 4 | |
| 5 | 5 | use Dotenv\Dotenv; |
| 6 | 6 | use GuzzleHttp\Client as GuzzleClient; |
| 7 | use Meema\MeemaClient\Lambda\Image; | |
| 7 | 8 | use Meema\MeemaClient\Models\Favorite; |
| 8 | 9 | use Meema\MeemaClient\Models\Folder; |
| 9 | 10 | use Meema\MeemaClient\Models\Media; |
| @@ -159,6 +160,16 @@ class Client | ||
| 159 | 160 | return new Favorite($this); |
| 160 | 161 | } |
| 161 | 162 | |
| 163 | /** | |
| 164 | * Initialize the image lambda. | |
| 165 | * | |
| 166 | * @return Meema\MeemaClient\Lambda\Image | |
| 167 | */ | |
| 168 | public function image(): Image | |
| 169 | { | |
| 170 | return new Image($this); | |
| 171 | } | |
| 172 | ||
| 162 | 173 | /** |
| 163 | 174 | * Get the client config. |
| 164 | 175 | * |
src/Lambda/Image.phpadded+1291-0
| @@ -0,0 +1,1291 @@ | ||
| 1 | <?php | |
| 2 | ||
| 3 | namespace Meema\MeemaClient\Lambda; | |
| 4 | ||
| 5 | use Meema\MeemaClient\Client; | |
| 6 | ||
| 7 | class Image | |
| 8 | { | |
| 9 | /** | |
| 10 | * @var \Meema\MeemaClient\Client | |
| 11 | */ | |
| 12 | protected $client; | |
| 13 | ||
| 14 | /** | |
| 15 | * @var int | |
| 16 | */ | |
| 17 | protected $id; | |
| 18 | ||
| 19 | /** | |
| 20 | * @var array | |
| 21 | */ | |
| 22 | protected $args = []; | |
| 23 | ||
| 24 | /** | |
| 25 | * Construct media model. | |
| 26 | * | |
| 27 | * @param Meema\MeemaClient\Client $client | |
| 28 | */ | |
| 29 | public function __construct(Client $client) | |
| 30 | { | |
| 31 | $this->client = $client; | |
| 32 | } | |
| 33 | ||
| 34 | /** | |
| 35 | * Set the image width. | |
| 36 | * | |
| 37 | * @param int $value | |
| 38 | * | |
| 39 | * @return $this | |
| 40 | */ | |
| 41 | public function w($value) | |
| 42 | { | |
| 43 | $this->args = array_merge($this->args, ['w' => $value]); | |
| 44 | ||
| 45 | return $this; | |
| 46 | } | |
| 47 | ||
| 48 | /** | |
| 49 | * Set the image height value. | |
| 50 | * | |
| 51 | * @param int $value | |
| 52 | * | |
| 53 | * @return $this | |
| 54 | */ | |
| 55 | public function h($value) | |
| 56 | { | |
| 57 | $this->args = array_merge($this->args, ['h' => $value]); | |
| 58 | ||
| 59 | return $this; | |
| 60 | } | |
| 61 | ||
| 62 | /** | |
| 63 | * Set the image quality value. | |
| 64 | * | |
| 65 | * @param int $value | |
| 66 | * | |
| 67 | * @return $this | |
| 68 | */ | |
| 69 | public function q($value) | |
| 70 | { | |
| 71 | $this->args = array_merge($this->args, ['q' => $value]); | |
| 72 | ||
| 73 | return $this; | |
| 74 | } | |
| 75 | ||
| 76 | /** | |
| 77 | * Set the image blur value. | |
| 78 | * | |
| 79 | * @param int $value | |
| 80 | * | |
| 81 | * @return $this | |
| 82 | */ | |
| 83 | public function blur($value) | |
| 84 | { | |
| 85 | $this->args = array_merge($this->args, ['blur' => $value]); | |
| 86 | ||
| 87 | return $this; | |
| 88 | } | |
| 89 | ||
| 90 | /** | |
| 91 | * Determine if image is nsfw. | |
| 92 | * | |
| 93 | * @param int|string $value | |
| 94 | * | |
| 95 | * @return $this | |
| 96 | */ | |
| 97 | public function nsfw($value) | |
| 98 | { | |
| 99 | $this->args = array_merge($this->args, ['nsfw' => $value]); | |
| 100 | ||
| 101 | return $this; | |
| 102 | } | |
| 103 | ||
| 104 | /** | |
| 105 | * Set image rotation value. | |
| 106 | * | |
| 107 | * @param int $value | |
| 108 | * | |
| 109 | * @return $this | |
| 110 | */ | |
| 111 | public function rotate($value) | |
| 112 | { | |
| 113 | $this->args = array_merge($this->args, ['rotate' => $value]); | |
| 114 | ||
| 115 | return $this; | |
| 116 | } | |
| 117 | ||
| 118 | /** | |
| 119 | * Set image background value. | |
| 120 | * | |
| 121 | * @param string $value | |
| 122 | * | |
| 123 | * @return $this | |
| 124 | */ | |
| 125 | public function bg($value) | |
| 126 | { | |
| 127 | $this->args = array_merge($this->args, ['bg' => $value]); | |
| 128 | ||
| 129 | return $this; | |
| 130 | } | |
| 131 | ||
| 132 | /** | |
| 133 | * Set the aspect ratio value. | |
| 134 | * | |
| 135 | * @param int $value | |
| 136 | * | |
| 137 | * @return $this | |
| 138 | */ | |
| 139 | public function ar($value) | |
| 140 | { | |
| 141 | $this->args = array_merge($this->args, ['ar' => $value]); | |
| 142 | ||
| 143 | return $this; | |
| 144 | } | |
| 145 | ||
| 146 | /** | |
| 147 | * Set the brightness value. | |
| 148 | * | |
| 149 | * @param int $value | |
| 150 | * | |
| 151 | * @return $this | |
| 152 | */ | |
| 153 | public function br($value) | |
| 154 | { | |
| 155 | $this->args = array_merge($this->args, ['br' => $value]); | |
| 156 | ||
| 157 | return $this; | |
| 158 | } | |
| 159 | ||
| 160 | /** | |
| 161 | * Set the contrast value. | |
| 162 | * | |
| 163 | * @param int $value | |
| 164 | * | |
| 165 | * @return $this | |
| 166 | */ | |
| 167 | public function con($value) | |
| 168 | { | |
| 169 | $this->args = array_merge($this->args, ['con' => $value]); | |
| 170 | ||
| 171 | return $this; | |
| 172 | } | |
| 173 | ||
| 174 | /** | |
| 175 | * Set the exposure value. | |
| 176 | * | |
| 177 | * @param int $value | |
| 178 | * | |
| 179 | * @return $this | |
| 180 | */ | |
| 181 | public function exp($value) | |
| 182 | { | |
| 183 | $this->args = array_merge($this->args, ['exp' => $value]); | |
| 184 | ||
| 185 | return $this; | |
| 186 | } | |
| 187 | ||
| 188 | /** | |
| 189 | * Set the gamma value. | |
| 190 | * | |
| 191 | * @param int $value | |
| 192 | * | |
| 193 | * @return $this | |
| 194 | */ | |
| 195 | public function gam($value) | |
| 196 | { | |
| 197 | $this->args = array_merge($this->args, ['gam' => $value]); | |
| 198 | ||
| 199 | return $this; | |
| 200 | } | |
| 201 | ||
| 202 | /** | |
| 203 | * Set the hue shift value. | |
| 204 | * | |
| 205 | * @param int $value | |
| 206 | * | |
| 207 | * @return $this | |
| 208 | */ | |
| 209 | public function hue($value) | |
| 210 | { | |
| 211 | $this->args = array_merge($this->args, ['hue' => $value]); | |
| 212 | ||
| 213 | return $this; | |
| 214 | } | |
| 215 | ||
| 216 | /** | |
| 217 | * Set the highlight value. | |
| 218 | * | |
| 219 | * @param int $value | |
| 220 | * | |
| 221 | * @return $this | |
| 222 | */ | |
| 223 | public function high($value) | |
| 224 | { | |
| 225 | $this->args = array_merge($this->args, ['high' => $value]); | |
| 226 | ||
| 227 | return $this; | |
| 228 | } | |
| 229 | ||
| 230 | /** | |
| 231 | * Set the invert value. | |
| 232 | * | |
| 233 | * @param bool $value | |
| 234 | * | |
| 235 | * @return $this | |
| 236 | */ | |
| 237 | public function invert($value) | |
| 238 | { | |
| 239 | $this->args = array_merge($this->args, ['invert' => $value]); | |
| 240 | ||
| 241 | return $this; | |
| 242 | } | |
| 243 | ||
| 244 | /** | |
| 245 | * Set the saturation value. | |
| 246 | * | |
| 247 | * @param int $value | |
| 248 | * | |
| 249 | * @return $this | |
| 250 | */ | |
| 251 | public function sat($value) | |
| 252 | { | |
| 253 | $this->args = array_merge($this->args, ['sat' => $value]); | |
| 254 | ||
| 255 | return $this; | |
| 256 | } | |
| 257 | ||
| 258 | /** | |
| 259 | * Set the shadow value. | |
| 260 | * | |
| 261 | * @param int $value | |
| 262 | * | |
| 263 | * @return $this | |
| 264 | */ | |
| 265 | public function shad($value) | |
| 266 | { | |
| 267 | $this->args = array_merge($this->args, ['shad' => $value]); | |
| 268 | ||
| 269 | return $this; | |
| 270 | } | |
| 271 | ||
| 272 | /** | |
| 273 | * Set the sharpen value. | |
| 274 | * | |
| 275 | * @param int $value | |
| 276 | * | |
| 277 | * @return $this | |
| 278 | */ | |
| 279 | public function sharp($value) | |
| 280 | { | |
| 281 | $this->args = array_merge($this->args, ['sharp' => $value]); | |
| 282 | ||
| 283 | return $this; | |
| 284 | } | |
| 285 | ||
| 286 | /** | |
| 287 | * Set the unsharp mask value. | |
| 288 | * | |
| 289 | * @param int $value | |
| 290 | * | |
| 291 | * @return $this | |
| 292 | */ | |
| 293 | public function usm($value) | |
| 294 | { | |
| 295 | $this->args = array_merge($this->args, ['usm' => $value]); | |
| 296 | ||
| 297 | return $this; | |
| 298 | } | |
| 299 | ||
| 300 | /** | |
| 301 | * Set the unsharp mask radius value. | |
| 302 | * | |
| 303 | * @param int $value | |
| 304 | * | |
| 305 | * @return $this | |
| 306 | */ | |
| 307 | public function usmrad($value) | |
| 308 | { | |
| 309 | $this->args = array_merge($this->args, ['usmrad' => $value]); | |
| 310 | ||
| 311 | return $this; | |
| 312 | } | |
| 313 | ||
| 314 | /** | |
| 315 | * Set the vibrance value. | |
| 316 | * | |
| 317 | * @param int $value | |
| 318 | * | |
| 319 | * @return $this | |
| 320 | */ | |
| 321 | public function vib($value) | |
| 322 | { | |
| 323 | $this->args = array_merge($this->args, ['vib' => $value]); | |
| 324 | ||
| 325 | return $this; | |
| 326 | } | |
| 327 | ||
| 328 | /** | |
| 329 | * Set the blend value. | |
| 330 | * | |
| 331 | * @param string $value | |
| 332 | * | |
| 333 | * @return $this | |
| 334 | */ | |
| 335 | public function blend($value) | |
| 336 | { | |
| 337 | $this->args = array_merge($this->args, ['blend' => $value]); | |
| 338 | ||
| 339 | return $this; | |
| 340 | } | |
| 341 | ||
| 342 | /** | |
| 343 | * Set the blend-align value. | |
| 344 | * | |
| 345 | * @param string $value | |
| 346 | * | |
| 347 | * @return $this | |
| 348 | */ | |
| 349 | public function blendAlign($value) | |
| 350 | { | |
| 351 | $this->args = array_merge($this->args, ['blend-align' => $value]); | |
| 352 | ||
| 353 | return $this; | |
| 354 | } | |
| 355 | ||
| 356 | /** | |
| 357 | * Set the blend-alpha value. | |
| 358 | * | |
| 359 | * @param string $value | |
| 360 | * | |
| 361 | * @return $this | |
| 362 | */ | |
| 363 | public function blendAlpha($value) | |
| 364 | { | |
| 365 | $this->args = array_merge($this->args, ['blend-alpha' => $value]); | |
| 366 | ||
| 367 | return $this; | |
| 368 | } | |
| 369 | ||
| 370 | /** | |
| 371 | * Set the blend-crop value. | |
| 372 | * | |
| 373 | * @param string $value | |
| 374 | * | |
| 375 | * @return $this | |
| 376 | */ | |
| 377 | public function blendCrop($value) | |
| 378 | { | |
| 379 | $this->args = array_merge($this->args, ['blend-crop' => $value]); | |
| 380 | ||
| 381 | return $this; | |
| 382 | } | |
| 383 | ||
| 384 | /** | |
| 385 | * Set the blend-fit value. | |
| 386 | * | |
| 387 | * @param string $value | |
| 388 | * | |
| 389 | * @return $this | |
| 390 | */ | |
| 391 | public function blendFit($value) | |
| 392 | { | |
| 393 | $this->args = array_merge($this->args, ['blend-fit' => $value]); | |
| 394 | ||
| 395 | return $this; | |
| 396 | } | |
| 397 | ||
| 398 | /** | |
| 399 | * Set the blend-h value. | |
| 400 | * | |
| 401 | * @param string $value | |
| 402 | * | |
| 403 | * @return $this | |
| 404 | */ | |
| 405 | public function blendH($value) | |
| 406 | { | |
| 407 | $this->args = array_merge($this->args, ['blend-h' => $value]); | |
| 408 | ||
| 409 | return $this; | |
| 410 | } | |
| 411 | ||
| 412 | /** | |
| 413 | * Set the blend-mode value. | |
| 414 | * | |
| 415 | * @param string $value | |
| 416 | * | |
| 417 | * @return $this | |
| 418 | */ | |
| 419 | public function blendMode($value) | |
| 420 | { | |
| 421 | $this->args = array_merge($this->args, ['blend-mode' => $value]); | |
| 422 | ||
| 423 | return $this; | |
| 424 | } | |
| 425 | ||
| 426 | /** | |
| 427 | * Set the blend-pad value. | |
| 428 | * | |
| 429 | * @param int $value | |
| 430 | * | |
| 431 | * @return $this | |
| 432 | */ | |
| 433 | public function blendPad($value) | |
| 434 | { | |
| 435 | $this->args = array_merge($this->args, ['blend-pad' => $value]); | |
| 436 | ||
| 437 | return $this; | |
| 438 | } | |
| 439 | ||
| 440 | /** | |
| 441 | * Set the blend-size value. | |
| 442 | * | |
| 443 | * @param string $value | |
| 444 | * | |
| 445 | * @return $this | |
| 446 | */ | |
| 447 | public function blendSize($value) | |
| 448 | { | |
| 449 | $this->args = array_merge($this->args, ['blend-size' => $value]); | |
| 450 | ||
| 451 | return $this; | |
| 452 | } | |
| 453 | ||
| 454 | /** | |
| 455 | * Set the blend-width value. | |
| 456 | * | |
| 457 | * @param int $value | |
| 458 | * | |
| 459 | * @return $this | |
| 460 | */ | |
| 461 | public function blendW($value) | |
| 462 | { | |
| 463 | $this->args = array_merge($this->args, ['blend-w' => $value]); | |
| 464 | ||
| 465 | return $this; | |
| 466 | } | |
| 467 | ||
| 468 | /** | |
| 469 | * Set the blend-x value. | |
| 470 | * | |
| 471 | * @param int $value | |
| 472 | * | |
| 473 | * @return $this | |
| 474 | */ | |
| 475 | public function blendX($value) | |
| 476 | { | |
| 477 | $this->args = array_merge($this->args, ['blend-x' => $value]); | |
| 478 | ||
| 479 | return $this; | |
| 480 | } | |
| 481 | ||
| 482 | /** | |
| 483 | * Set the blend-y value. | |
| 484 | * | |
| 485 | * @param int $value | |
| 486 | * | |
| 487 | * @return $this | |
| 488 | */ | |
| 489 | public function blendY($value) | |
| 490 | { | |
| 491 | $this->args = array_merge($this->args, ['blend-y' => $value]); | |
| 492 | ||
| 493 | return $this; | |
| 494 | } | |
| 495 | ||
| 496 | /** | |
| 497 | * Set the border size color value. | |
| 498 | * | |
| 499 | * @param string $value | |
| 500 | * | |
| 501 | * @return $this | |
| 502 | */ | |
| 503 | public function border($value) | |
| 504 | { | |
| 505 | $this->args = array_merge($this->args, ['border' => $value]); | |
| 506 | ||
| 507 | return $this; | |
| 508 | } | |
| 509 | ||
| 510 | /** | |
| 511 | * Set the border inner radius value. | |
| 512 | * | |
| 513 | * @param string $value | |
| 514 | * | |
| 515 | * @return $this | |
| 516 | */ | |
| 517 | public function borderRadiusInner($value) | |
| 518 | { | |
| 519 | $this->args = array_merge($this->args, ['border-radius-inner' => $value]); | |
| 520 | ||
| 521 | return $this; | |
| 522 | } | |
| 523 | ||
| 524 | /** | |
| 525 | * Set the border radius outer value. | |
| 526 | * | |
| 527 | * @param string $value | |
| 528 | * | |
| 529 | * @return $this | |
| 530 | */ | |
| 531 | public function borderRadius($value) | |
| 532 | { | |
| 533 | $this->args = array_merge($this->args, ['border-radius' => $value]); | |
| 534 | ||
| 535 | return $this; | |
| 536 | } | |
| 537 | ||
| 538 | /** | |
| 539 | * Set the border radius outer value. | |
| 540 | * | |
| 541 | * @param string $value | |
| 542 | * | |
| 543 | * @return $this | |
| 544 | */ | |
| 545 | public function pad($value) | |
| 546 | { | |
| 547 | $this->args = array_merge($this->args, ['pad' => $value]); | |
| 548 | ||
| 549 | return $this; | |
| 550 | } | |
| 551 | ||
| 552 | /** | |
| 553 | * Set the greyscale value. | |
| 554 | * | |
| 555 | * @param bool $value | |
| 556 | * | |
| 557 | * @return $this | |
| 558 | */ | |
| 559 | public function greyscale($value) | |
| 560 | { | |
| 561 | $this->args = array_merge($this->args, ['greyscale' => $value]); | |
| 562 | ||
| 563 | return $this; | |
| 564 | } | |
| 565 | ||
| 566 | /** | |
| 567 | * Set the trim value. | |
| 568 | * | |
| 569 | * @param string $value | |
| 570 | * | |
| 571 | * @return $this | |
| 572 | */ | |
| 573 | public function trim($value) | |
| 574 | { | |
| 575 | $this->args = array_merge($this->args, ['trim' => $value]); | |
| 576 | ||
| 577 | return $this; | |
| 578 | } | |
| 579 | ||
| 580 | /** | |
| 581 | * Set the face index value. | |
| 582 | * | |
| 583 | * @param int $value | |
| 584 | * | |
| 585 | * @return $this | |
| 586 | */ | |
| 587 | public function faceindex($value) | |
| 588 | { | |
| 589 | $this->args = array_merge($this->args, ['faceindex' => $value]); | |
| 590 | ||
| 591 | return $this; | |
| 592 | } | |
| 593 | ||
| 594 | /** | |
| 595 | * Set the face index value. | |
| 596 | * | |
| 597 | * @param int $value | |
| 598 | * | |
| 599 | * @return $this | |
| 600 | */ | |
| 601 | public function facepad($value) | |
| 602 | { | |
| 603 | $this->args = array_merge($this->args, ['facepad' => $value]); | |
| 604 | ||
| 605 | return $this; | |
| 606 | } | |
| 607 | ||
| 608 | /** | |
| 609 | * Set the fill color value. | |
| 610 | * | |
| 611 | * @param string $value | |
| 612 | * | |
| 613 | * @return $this | |
| 614 | */ | |
| 615 | public function fillColor($value) | |
| 616 | { | |
| 617 | $this->args = array_merge($this->args, ['fill-color' => $value]); | |
| 618 | ||
| 619 | return $this; | |
| 620 | } | |
| 621 | ||
| 622 | /** | |
| 623 | * Set the fill value. | |
| 624 | * | |
| 625 | * @param string $value | |
| 626 | * | |
| 627 | * @return $this | |
| 628 | */ | |
| 629 | public function fill($value) | |
| 630 | { | |
| 631 | $this->args = array_merge($this->args, ['fill-color' => $value]); | |
| 632 | ||
| 633 | return $this; | |
| 634 | } | |
| 635 | ||
| 636 | /** | |
| 637 | * Set the chroma subsampling value. | |
| 638 | * | |
| 639 | * @param string $value | |
| 640 | * | |
| 641 | * @return $this | |
| 642 | */ | |
| 643 | public function chroma($value) | |
| 644 | { | |
| 645 | $this->args = array_merge($this->args, ['chromasub' => $value]); | |
| 646 | ||
| 647 | return $this; | |
| 648 | } | |
| 649 | ||
| 650 | /** | |
| 651 | * Set the client hints value. | |
| 652 | * | |
| 653 | * @param string $value | |
| 654 | * | |
| 655 | * @return $this | |
| 656 | */ | |
| 657 | public function ch($value) | |
| 658 | { | |
| 659 | $this->args = array_merge($this->args, ['ch' => $value]); | |
| 660 | ||
| 661 | return $this; | |
| 662 | } | |
| 663 | ||
| 664 | /** | |
| 665 | * Set the client hints value. | |
| 666 | * | |
| 667 | * @param int $value | |
| 668 | * | |
| 669 | * @return $this | |
| 670 | */ | |
| 671 | public function colorquant($value) | |
| 672 | { | |
| 673 | $this->args = array_merge($this->args, ['colorquant' => $value]); | |
| 674 | ||
| 675 | return $this; | |
| 676 | } | |
| 677 | ||
| 678 | /** | |
| 679 | * Set the color space value. | |
| 680 | * | |
| 681 | * @param string $value | |
| 682 | * | |
| 683 | * @return $this | |
| 684 | */ | |
| 685 | public function cs($value) | |
| 686 | { | |
| 687 | $this->args = array_merge($this->args, ['cs' => $value]); | |
| 688 | ||
| 689 | return $this; | |
| 690 | } | |
| 691 | ||
| 692 | /** | |
| 693 | * Set the dots per inch value. | |
| 694 | * | |
| 695 | * @param int $value | |
| 696 | * | |
| 697 | * @return $this | |
| 698 | */ | |
| 699 | public function dpi($value) | |
| 700 | { | |
| 701 | $this->args = array_merge($this->args, ['dpi' => $value]); | |
| 702 | ||
| 703 | return $this; | |
| 704 | } | |
| 705 | ||
| 706 | /** | |
| 707 | * Set lossless value. | |
| 708 | * | |
| 709 | * @param bool $value | |
| 710 | * | |
| 711 | * @return $this | |
| 712 | */ | |
| 713 | public function lossless($value) | |
| 714 | { | |
| 715 | $this->args = array_merge($this->args, ['lossless' => $value]); | |
| 716 | ||
| 717 | return $this; | |
| 718 | } | |
| 719 | ||
| 720 | /** | |
| 721 | * Set the output format value. | |
| 722 | * | |
| 723 | * @param bool $value | |
| 724 | * | |
| 725 | * @return $this | |
| 726 | */ | |
| 727 | public function fm($value) | |
| 728 | { | |
| 729 | $this->args = array_merge($this->args, ['fm' => $value]); | |
| 730 | ||
| 731 | return $this; | |
| 732 | } | |
| 733 | ||
| 734 | /** | |
| 735 | * Set the flop value. | |
| 736 | * | |
| 737 | * @param bool $value | |
| 738 | * | |
| 739 | * @return $this | |
| 740 | */ | |
| 741 | public function flop($value) | |
| 742 | { | |
| 743 | $this->args = array_merge($this->args, ['flop' => $value]); | |
| 744 | ||
| 745 | return $this; | |
| 746 | } | |
| 747 | ||
| 748 | /** | |
| 749 | * Set the automatic value. | |
| 750 | * | |
| 751 | * @param string $value | |
| 752 | * | |
| 753 | * @return $this | |
| 754 | */ | |
| 755 | public function auto($value) | |
| 756 | { | |
| 757 | $this->args = array_merge($this->args, ['auto' => $value]); | |
| 758 | ||
| 759 | return $this; | |
| 760 | } | |
| 761 | ||
| 762 | /** | |
| 763 | * Set the expiration automatic value. | |
| 764 | * | |
| 765 | * @param string $value | |
| 766 | * | |
| 767 | * @return $this | |
| 768 | */ | |
| 769 | public function expires($value) | |
| 770 | { | |
| 771 | $this->args = array_merge($this->args, ['expires' => $value]); | |
| 772 | ||
| 773 | return $this; | |
| 774 | } | |
| 775 | ||
| 776 | /** | |
| 777 | * Set the device pixel ration value. | |
| 778 | * | |
| 779 | * @param string $value | |
| 780 | * | |
| 781 | * @return $this | |
| 782 | */ | |
| 783 | public function dpr($value) | |
| 784 | { | |
| 785 | $this->args = array_merge($this->args, ['dpr' => $value]); | |
| 786 | ||
| 787 | return $this; | |
| 788 | } | |
| 789 | ||
| 790 | /** | |
| 791 | * Set the mask corner radius. | |
| 792 | * | |
| 793 | * @param string $value | |
| 794 | * | |
| 795 | * @return $this | |
| 796 | */ | |
| 797 | public function cornerRadius($value) | |
| 798 | { | |
| 799 | $this->args = array_merge($this->args, ['corner-radius' => $value]); | |
| 800 | ||
| 801 | return $this; | |
| 802 | } | |
| 803 | ||
| 804 | /** | |
| 805 | * Set the mask corner radius. | |
| 806 | * | |
| 807 | * @param string $value | |
| 808 | * | |
| 809 | * @return $this | |
| 810 | */ | |
| 811 | public function mask($value) | |
| 812 | { | |
| 813 | $this->args = array_merge($this->args, ['mask' => $value]); | |
| 814 | ||
| 815 | return $this; | |
| 816 | } | |
| 817 | ||
| 818 | /** | |
| 819 | * Set the noise reduction value. | |
| 820 | * | |
| 821 | * @param int $value | |
| 822 | * | |
| 823 | * @return $this | |
| 824 | */ | |
| 825 | public function nr($value) | |
| 826 | { | |
| 827 | $this->args = array_merge($this->args, ['nr' => $value]); | |
| 828 | ||
| 829 | return $this; | |
| 830 | } | |
| 831 | ||
| 832 | /** | |
| 833 | * Set the noise reduction sharpen value. | |
| 834 | * | |
| 835 | * @param int $value | |
| 836 | * | |
| 837 | * @return $this | |
| 838 | */ | |
| 839 | public function nrs($value) | |
| 840 | { | |
| 841 | $this->args = array_merge($this->args, ['nrs' => $value]); | |
| 842 | ||
| 843 | return $this; | |
| 844 | } | |
| 845 | ||
| 846 | /** | |
| 847 | * Set the extend value. | |
| 848 | * | |
| 849 | * @param int $value | |
| 850 | * | |
| 851 | * @return $this | |
| 852 | */ | |
| 853 | public function extend($value) | |
| 854 | { | |
| 855 | $this->args = array_merge($this->args, ['extend' => $value]); | |
| 856 | ||
| 857 | return $this; | |
| 858 | } | |
| 859 | ||
| 860 | /** | |
| 861 | * Set the extract value. | |
| 862 | * | |
| 863 | * @param string $value | |
| 864 | * | |
| 865 | * @return $this | |
| 866 | */ | |
| 867 | public function extract($value) | |
| 868 | { | |
| 869 | $this->args = array_merge($this->args, ['extract' => $value]); | |
| 870 | ||
| 871 | return $this; | |
| 872 | } | |
| 873 | ||
| 874 | /** | |
| 875 | * Set the flip axis value. | |
| 876 | * | |
| 877 | * @param string $value | |
| 878 | * | |
| 879 | * @return $this | |
| 880 | */ | |
| 881 | public function flip($value) | |
| 882 | { | |
| 883 | $this->args = array_merge($this->args, ['flip' => $value]); | |
| 884 | ||
| 885 | return $this; | |
| 886 | } | |
| 887 | ||
| 888 | /** | |
| 889 | * Set the orientation value. | |
| 890 | * | |
| 891 | * @param int $value | |
| 892 | * | |
| 893 | * @return $this | |
| 894 | */ | |
| 895 | public function orient($value) | |
| 896 | { | |
| 897 | $this->args = array_merge($this->args, ['orient' => $value]); | |
| 898 | ||
| 899 | return $this; | |
| 900 | } | |
| 901 | ||
| 902 | /** | |
| 903 | * Set the crop value. | |
| 904 | * | |
| 905 | * @param string $value | |
| 906 | * | |
| 907 | * @return $this | |
| 908 | */ | |
| 909 | public function crop($value) | |
| 910 | { | |
| 911 | $this->args = array_merge($this->args, ['crop' => $value]); | |
| 912 | ||
| 913 | return $this; | |
| 914 | } | |
| 915 | ||
| 916 | /** | |
| 917 | * Set the max height value. | |
| 918 | * | |
| 919 | * @param int $value | |
| 920 | * | |
| 921 | * @return $this | |
| 922 | */ | |
| 923 | public function maxH($value) | |
| 924 | { | |
| 925 | $this->args = array_merge($this->args, ['max-h' => $value]); | |
| 926 | ||
| 927 | return $this; | |
| 928 | } | |
| 929 | ||
| 930 | /** | |
| 931 | * Set the min height value. | |
| 932 | * | |
| 933 | * @param int $value | |
| 934 | * | |
| 935 | * @return $this | |
| 936 | */ | |
| 937 | public function minH($value) | |
| 938 | { | |
| 939 | $this->args = array_merge($this->args, ['min-h' => $value]); | |
| 940 | ||
| 941 | return $this; | |
| 942 | } | |
| 943 | ||
| 944 | /** | |
| 945 | * Set the max width value. | |
| 946 | * | |
| 947 | * @param int $value | |
| 948 | * | |
| 949 | * @return $this | |
| 950 | */ | |
| 951 | public function maxW($value) | |
| 952 | { | |
| 953 | $this->args = array_merge($this->args, ['max-w' => $value]); | |
| 954 | ||
| 955 | return $this; | |
| 956 | } | |
| 957 | ||
| 958 | /** | |
| 959 | * Set the min width value. | |
| 960 | * | |
| 961 | * @param int $value | |
| 962 | * | |
| 963 | * @return $this | |
| 964 | */ | |
| 965 | public function minw($value) | |
| 966 | { | |
| 967 | $this->args = array_merge($this->args, ['min-w' => $value]); | |
| 968 | ||
| 969 | return $this; | |
| 970 | } | |
| 971 | ||
| 972 | /** | |
| 973 | * Set the resize fit mode value. | |
| 974 | * | |
| 975 | * @param string $value | |
| 976 | * | |
| 977 | * @return $this | |
| 978 | */ | |
| 979 | public function fit($value) | |
| 980 | { | |
| 981 | $this->args = array_merge($this->args, ['fit' => $value]); | |
| 982 | ||
| 983 | return $this; | |
| 984 | } | |
| 985 | ||
| 986 | /** | |
| 987 | * Set the source rectangle region value. | |
| 988 | * | |
| 989 | * @param string $value | |
| 990 | * | |
| 991 | * @return $this | |
| 992 | */ | |
| 993 | public function rect($value) | |
| 994 | { | |
| 995 | $this->args = array_merge($this->args, ['rect' => $value]); | |
| 996 | ||
| 997 | return $this; | |
| 998 | } | |
| 999 | ||
| 1000 | /** | |
| 1001 | * Set the duotone value. | |
| 1002 | * | |
| 1003 | * @param string $value | |
| 1004 | * | |
| 1005 | * @return $this | |
| 1006 | */ | |
| 1007 | public function duotone($value) | |
| 1008 | { | |
| 1009 | $this->args = array_merge($this->args, ['duotone' => $value]); | |
| 1010 | ||
| 1011 | return $this; | |
| 1012 | } | |
| 1013 | ||
| 1014 | /** | |
| 1015 | * Set the duotone-alpha value. | |
| 1016 | * | |
| 1017 | * @param int $value | |
| 1018 | * | |
| 1019 | * @return $this | |
| 1020 | */ | |
| 1021 | public function duotoneAlpha($value) | |
| 1022 | { | |
| 1023 | $this->args = array_merge($this->args, ['duotone-alpha' => $value]); | |
| 1024 | ||
| 1025 | return $this; | |
| 1026 | } | |
| 1027 | ||
| 1028 | /** | |
| 1029 | * Set the halftone value. | |
| 1030 | * | |
| 1031 | * @param int $value | |
| 1032 | * | |
| 1033 | * @return $this | |
| 1034 | */ | |
| 1035 | public function halftone($value) | |
| 1036 | { | |
| 1037 | $this->args = array_merge($this->args, ['halftone' => $value]); | |
| 1038 | ||
| 1039 | return $this; | |
| 1040 | } | |
| 1041 | ||
| 1042 | /** | |
| 1043 | * Set the halftone value. | |
| 1044 | * | |
| 1045 | * @param string $value | |
| 1046 | * | |
| 1047 | * @return $this | |
| 1048 | */ | |
| 1049 | public function monochrome($value) | |
| 1050 | { | |
| 1051 | $this->args = array_merge($this->args, ['monochrome' => $value]); | |
| 1052 | ||
| 1053 | return $this; | |
| 1054 | } | |
| 1055 | ||
| 1056 | /** | |
| 1057 | * Set the pixellate value. | |
| 1058 | * | |
| 1059 | * @param int $value | |
| 1060 | * | |
| 1061 | * @return $this | |
| 1062 | */ | |
| 1063 | public function px($value) | |
| 1064 | { | |
| 1065 | $this->args = array_merge($this->args, ['px' => $value]); | |
| 1066 | ||
| 1067 | return $this; | |
| 1068 | } | |
| 1069 | ||
| 1070 | /** | |
| 1071 | * Set the sepia value. | |
| 1072 | * | |
| 1073 | * @param int $value | |
| 1074 | * | |
| 1075 | * @return $this | |
| 1076 | */ | |
| 1077 | public function sepia($value) | |
| 1078 | { | |
| 1079 | $this->args = array_merge($this->args, ['sepia' => $value]); | |
| 1080 | ||
| 1081 | return $this; | |
| 1082 | } | |
| 1083 | ||
| 1084 | /** | |
| 1085 | * Set the text align value. | |
| 1086 | * | |
| 1087 | * @param string $value | |
| 1088 | * | |
| 1089 | * @return $this | |
| 1090 | */ | |
| 1091 | public function txtAlign($value) | |
| 1092 | { | |
| 1093 | $this->args = array_merge($this->args, ['txt-align' => $value]); | |
| 1094 | ||
| 1095 | return $this; | |
| 1096 | } | |
| 1097 | ||
| 1098 | /** | |
| 1099 | * Set the text clipping mode value. | |
| 1100 | * | |
| 1101 | * @param string $value | |
| 1102 | * | |
| 1103 | * @return $this | |
| 1104 | */ | |
| 1105 | public function txtClip($value) | |
| 1106 | { | |
| 1107 | $this->args = array_merge($this->args, ['txt-clip' => $value]); | |
| 1108 | ||
| 1109 | return $this; | |
| 1110 | } | |
| 1111 | ||
| 1112 | /** | |
| 1113 | * Set the text color value. | |
| 1114 | * | |
| 1115 | * @param string $value | |
| 1116 | * | |
| 1117 | * @return $this | |
| 1118 | */ | |
| 1119 | public function txtColor($value) | |
| 1120 | { | |
| 1121 | $this->args = array_merge($this->args, ['txt-color' => $value]); | |
| 1122 | ||
| 1123 | return $this; | |
| 1124 | } | |
| 1125 | ||
| 1126 | /** | |
| 1127 | * Set the text fit mode value. | |
| 1128 | * | |
| 1129 | * @param string $value | |
| 1130 | * | |
| 1131 | * @return $this | |
| 1132 | */ | |
| 1133 | public function txtFit($value) | |
| 1134 | { | |
| 1135 | $this->args = array_merge($this->args, ['txt-fit' => $value]); | |
| 1136 | ||
| 1137 | return $this; | |
| 1138 | } | |
| 1139 | ||
| 1140 | /** | |
| 1141 | * Set the text font value. | |
| 1142 | * | |
| 1143 | * @param string $value | |
| 1144 | * | |
| 1145 | * @return $this | |
| 1146 | */ | |
| 1147 | public function txtFont($value) | |
| 1148 | { | |
| 1149 | $this->args = array_merge($this->args, ['txt-font' => $value]); | |
| 1150 | ||
| 1151 | return $this; | |
| 1152 | } | |
| 1153 | ||
| 1154 | /** | |
| 1155 | * Set the text font size value. | |
| 1156 | * | |
| 1157 | * @param int $value | |
| 1158 | * | |
| 1159 | * @return $this | |
| 1160 | */ | |
| 1161 | public function txtSize($value) | |
| 1162 | { | |
| 1163 | $this->args = array_merge($this->args, ['txt-size' => $value]); | |
| 1164 | ||
| 1165 | return $this; | |
| 1166 | } | |
| 1167 | ||
| 1168 | /** | |
| 1169 | * Set the text ligatures value. | |
| 1170 | * | |
| 1171 | * @param int $value | |
| 1172 | * | |
| 1173 | * @return $this | |
| 1174 | */ | |
| 1175 | public function txtLig($value) | |
| 1176 | { | |
| 1177 | $this->args = array_merge($this->args, ['txt-lig' => $value]); | |
| 1178 | ||
| 1179 | return $this; | |
| 1180 | } | |
| 1181 | ||
| 1182 | /** | |
| 1183 | * Set the text outline value. | |
| 1184 | * | |
| 1185 | * @param int $value | |
| 1186 | * | |
| 1187 | * @return $this | |
| 1188 | */ | |
| 1189 | public function txtLine($value) | |
| 1190 | { | |
| 1191 | $this->args = array_merge($this->args, ['txt-line' => $value]); | |
| 1192 | ||
| 1193 | return $this; | |
| 1194 | } | |
| 1195 | ||
| 1196 | /** | |
| 1197 | * Set the text outline color value. | |
| 1198 | * | |
| 1199 | * @param string $value | |
| 1200 | * | |
| 1201 | * @return $this | |
| 1202 | */ | |
| 1203 | public function txtLineColor($value) | |
| 1204 | { | |
| 1205 | $this->args = array_merge($this->args, ['txt-line-color' => $value]); | |
| 1206 | ||
| 1207 | return $this; | |
| 1208 | } | |
| 1209 | ||
| 1210 | /** | |
| 1211 | * Set the text padding value. | |
| 1212 | * | |
| 1213 | * @param int $value | |
| 1214 | * | |
| 1215 | * @return $this | |
| 1216 | */ | |
| 1217 | public function txtPad($value) | |
| 1218 | { | |
| 1219 | $this->args = array_merge($this->args, ['txt-pad' => $value]); | |
| 1220 | ||
| 1221 | return $this; | |
| 1222 | } | |
| 1223 | ||
| 1224 | /** | |
| 1225 | * Set the text shadow value. | |
| 1226 | * | |
| 1227 | * @param int $value | |
| 1228 | * | |
| 1229 | * @return $this | |
| 1230 | */ | |
| 1231 | public function txtShad($value) | |
| 1232 | { | |
| 1233 | $this->args = array_merge($this->args, ['txt-shad' => $value]); | |
| 1234 | ||
| 1235 | return $this; | |
| 1236 | } | |
| 1237 | ||
| 1238 | /** | |
| 1239 | * Set the text string value. | |
| 1240 | * | |
| 1241 | * @param string $value | |
| 1242 | * | |
| 1243 | * @return $this | |
| 1244 | */ | |
| 1245 | public function txt($value) | |
| 1246 | { | |
| 1247 | $this->args = array_merge($this->args, ['txt' => $value]); | |
| 1248 | ||
| 1249 | return $this; | |
| 1250 | } | |
| 1251 | ||
| 1252 | /** | |
| 1253 | * Set the text width value. | |
| 1254 | * | |
| 1255 | * @param int $value | |
| 1256 | * | |
| 1257 | * @return $this | |
| 1258 | */ | |
| 1259 | public function txtWidth($value) | |
| 1260 | { | |
| 1261 | $this->args = array_merge($this->args, ['txt-width' => $value]); | |
| 1262 | ||
| 1263 | return $this; | |
| 1264 | } | |
| 1265 | ||
| 1266 | /** | |
| 1267 | * Convert all parameters to string url. | |
| 1268 | * | |
| 1269 | * @return string | |
| 1270 | */ | |
| 1271 | public function toUrl() | |
| 1272 | { | |
| 1273 | $queryParams = ''; | |
| 1274 | ||
| 1275 | $index = 0; | |
| 1276 | ||
| 1277 | foreach ($this->args as $key => $param) { | |
| 1278 | $separator = '?'; | |
| 1279 | ||
| 1280 | if ($index) { | |
| 1281 | $separator = '&'; | |
| 1282 | } | |
| 1283 | ||
| 1284 | $queryParams .= "{$separator}{$key}={$param}"; | |
| 1285 | ||
| 1286 | $index++; | |
| 1287 | } | |
| 1288 | ||
| 1289 | return "https://dev-ops.mee.ma/glenn/1/5/people.jpg{$queryParams}"; | |
| 1290 | } | |
| 1291 | } | |
No changes to show.