… | |
… | |
520 | |
520 | |
521 | =item contrast $r, $g, $b, $a, $img |
521 | =item contrast $r, $g, $b, $a, $img |
522 | |
522 | |
523 | Adjusts the I<contrast> of an image. |
523 | Adjusts the I<contrast> of an image. |
524 | |
524 | |
|
|
525 | #TODO# |
|
|
526 | |
525 | =item brightness $factor, $img |
527 | =item brightness $factor, $img |
526 | |
528 | |
527 | =item brightness $r, $g, $b, $img |
529 | =item brightness $r, $g, $b, $img |
528 | |
530 | |
529 | =item brightness $r, $g, $b, $a, $img |
531 | =item brightness $r, $g, $b, $a, $img |
|
|
532 | |
|
|
533 | Adjusts the brightness of an image. |
530 | |
534 | |
531 | =cut |
535 | =cut |
532 | |
536 | |
533 | sub contrast($$;$$;$) { |
537 | sub contrast($$;$$;$) { |
534 | my $img = pop; |
538 | my $img = pop; |
… | |
… | |
552 | $img = $img->clone; |
556 | $img = $img->clone; |
553 | $img->brightness ($r, $g, $b, $a); |
557 | $img->brightness ($r, $g, $b, $a); |
554 | $img |
558 | $img |
555 | } |
559 | } |
556 | |
560 | |
|
|
561 | =item blur $radius, $img |
|
|
562 | |
|
|
563 | =item blur $radius_horz, $radius_vert, $img |
|
|
564 | |
|
|
565 | Gaussian-blurs the image with (roughly) C<$radius> pixel radius. The radii |
|
|
566 | can also be specified separately. |
|
|
567 | |
|
|
568 | =cut |
|
|
569 | |
557 | sub blur($$;$) { |
570 | sub blur($$;$) { |
558 | my $img = pop; |
571 | my $img = pop; |
559 | $img->blur ($_[0], @_ >= 2 ? $_[1] : $_[0]) |
572 | $img->blur ($_[0], @_ >= 2 ? $_[1] : $_[0]) |
560 | } |
573 | } |
|
|
574 | |
|
|
575 | =item rotate $new_width, $new_height, $center_x, $center_y, $degrees |
|
|
576 | |
|
|
577 | Rotates the image by C<$degrees> degrees, counter-clockwise, around the |
|
|
578 | pointer at C<$center_x> and C<$center_y> (specified as percentage of image |
|
|
579 | width/height), generating a new image with width C<$new_width> and height |
|
|
580 | C<$new_height>. |
|
|
581 | |
|
|
582 | #TODO# new width, height, maybe more operators? |
|
|
583 | |
|
|
584 | Example: rotate the image by 90 degrees |
|
|
585 | |
|
|
586 | =cut |
561 | |
587 | |
562 | sub rotate($$$$$$) { |
588 | sub rotate($$$$$$) { |
563 | my $img = pop; |
589 | my $img = pop; |
564 | $img->rotate ( |
590 | $img->rotate ( |
565 | $_[0], |
591 | $_[0], |