File: testimg.p

package info (click to toggle)
libpdl-graphics-trid-perl 2.102-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 476 kB
  • sloc: perl: 5,082; ansic: 683; makefile: 8
file content (26 lines) | stat: -rw-r--r-- 700 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use PDL;
use PDL::Graphics::TriD;
use PDL::Graphics::TriD::Image;

$PDL::Graphics::TriD::verbose //= 0;

my $win = PDL::Graphics::TriD::get_current_window();
my $graph = PDL::Graphics::TriD::Graph->new;
$graph->default_axes;

# Here we show an 8-dimensional (!!!!!) RGB image to test Image.pm

my $r = zeroes(4,5,6,7,2,2,2,2)+0.1;
my $g = zeroes(4,5,6,7,2,2,2,2);
my $b = zeroes(4,5,6,7,2,2,2,2);

(my $tmp = $r->slice(":,:,2,2")) .= 1;
($tmp = $r->slice(":,:,:,1")) .= 0.5;
($tmp = $g->slice("2,:,1,2")) .= 1;
($tmp = $b->slice("2,3,1,:")) .= 1;

$graph->add_dataseries(PDL::Graphics::TriD::Image->new([$r,$g,$b]));
$graph->scalethings;
$win->clear_objects;
$win->add_object($graph);
$win->twiddle;