@@ -290,6 +290,16 @@ protected function resize(string $file, array $options): string
290
290
291
291
# (1) Basic options
292
292
293
+ # See https://github.com/joedrago/colorist/blob/master/docs/Usage.md#-j---jobs
294
+ protected function jobs (array $ options ): string
295
+ {
296
+ if ($ options ['jobs ' ] > 0 ) {
297
+ return '--jobs ' . $ options ['jobs ' ];
298
+ }
299
+
300
+ return '' ;
301
+ }
302
+
293
303
# See https://github.com/joedrago/colorist/blob/master/docs/Usage.md#--cmm---cms
294
304
protected function cmm (array $ options ): string
295
305
{
@@ -325,16 +335,6 @@ protected function hlglum(array $options): string
325
335
return '' ;
326
336
}
327
337
328
- # See https://github.com/joedrago/colorist/blob/master/docs/Usage.md#-j---jobs
329
- protected function jobs (array $ options ): string
330
- {
331
- if ($ options ['jobs ' ] > 0 ) {
332
- return '--jobs ' . $ options ['jobs ' ];
333
- }
334
-
335
- return '' ;
336
- }
337
-
338
338
# (2) Input profile options
339
339
protected function iccin (array $ options ): string
340
340
{
@@ -487,15 +487,7 @@ protected function format(array $options): string
487
487
return '' ;
488
488
}
489
489
490
- protected function nclx (array $ options ): string
491
- {
492
- if ($ options ['nclx ' ] !== null ) {
493
- return '--nclx ' . $ options ['nclx ' ];
494
- }
495
-
496
- return '' ;
497
- }
498
-
490
+ # See https://github.com/joedrago/colorist/blob/master/docs/Usage.md#-r---rate
499
491
protected function rate (array $ options ): string
500
492
{
501
493
if ($ options ['rate ' ] > 0 ) {
@@ -505,22 +497,6 @@ protected function rate(array $options): string
505
497
return '' ;
506
498
}
507
499
508
- protected function speed (array $ options ): string
509
- {
510
- if ($ options ['speed ' ] === null ) {
511
- return '' ;
512
- }
513
-
514
- $ min = 0 ;
515
- $ max = 10 ;
516
-
517
- if (($ min <= (int ) $ options ['speed ' ]) && ((int ) $ options ['speed ' ] <= $ max )) {
518
- return '--speed ' . $ options ['speed ' ];
519
- }
520
-
521
- return '' ;
522
- }
523
-
524
500
# See https://github.com/joedrago/colorist/blob/master/docs/Usage.md#-t---tonemap
525
501
protected function tonemap (array $ options ): string
526
502
{
@@ -562,6 +538,31 @@ protected function yuv(array $options): string
562
538
return '' ;
563
539
}
564
540
541
+ protected function speed (array $ options ): string
542
+ {
543
+ if ($ options ['speed ' ] === null ) {
544
+ return '' ;
545
+ }
546
+
547
+ $ min = 0 ;
548
+ $ max = 10 ;
549
+
550
+ if (($ min <= (int ) $ options ['speed ' ]) && ((int ) $ options ['speed ' ] <= $ max )) {
551
+ return '--speed ' . $ options ['speed ' ];
552
+ }
553
+
554
+ return '' ;
555
+ }
556
+
557
+ protected function nclx (array $ options ): string
558
+ {
559
+ if ($ options ['nclx ' ] !== null ) {
560
+ return '--nclx ' . $ options ['nclx ' ];
561
+ }
562
+
563
+ return '' ;
564
+ }
565
+
565
566
566
567
/**
567
568
* Core
@@ -645,11 +646,11 @@ public function process(string $file, array $options = []): array
645
646
# (5) Output format options
646
647
$ command [] = $ this ->bpc ($ options );
647
648
$ command [] = $ this ->format ($ options );
648
- $ command [] = $ this ->nclx ($ options );
649
649
$ command [] = $ this ->rate ($ options );
650
- $ command [] = $ this ->speed ($ options );
651
650
$ command [] = $ this ->tonemap ($ options );
652
651
$ command [] = $ this ->yuv ($ options );
652
+ $ command [] = $ this ->speed ($ options );
653
+ $ command [] = $ this ->nclx ($ options );
653
654
# (6) Save image
654
655
$ command [] = $ this ->save ($ file );
655
656
0 commit comments