Debian Codegraph @

t/t9.t

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 use strictscip-perl cpan PGPLOT 2.36 strict/; use warningsscip-perl cpan PGPLOT 2.36 warnings/;
2 use Test::Morescip-perl cpan PGPLOT 2.36 Test/More/;
3 use Configscip-perl cpan PGPLOT 2.36 Config/;
4 # Stop f77-linking causing spurious undefined symbols (alpha)
5 $ENVscip-perl cpan PGPLOT 2.36 main/`%ENV`.{'PERL_DL_NONLAZY'}=0 if $Configscip-perl cpan PGPLOT 2.36 main/`%Config`.{'osname'} eq "dec_osf";
6 requirescip-perl cpan PGPLOT 2.36 main/require(). PGPLOT;
7 planscip-perl cpan PGPLOT 2.36 main/plan(). skip_all => 'CI fails with bus error' if $^Oscip-perl cpan PGPLOT 2.36 main/`$^O`. eq 'darwin' and $ENVscip-perl cpan PGPLOT 2.36 main/`%ENV`.{CI};
8
9 my $dev = $ENVscip-perl cpan PGPLOT 2.36 main/`%ENV`.{PGPLOT_DEV} || '/NULL';
10
11 $ENVscip-perl cpan PGPLOT 2.36 main/`%ENV`.{PGPLOT_XW_WIDTH}=0.3;
12
13 notescip-perl cpan PGPLOT 2.36 main/note(). "Testing PGPLOT 5.0 colour image routines";
14
15 # Read in image (int*2)
16
17 my $img="";
18 openscip-perl cpan PGPLOT 2.36 main/open().(my $fh,"test.img") || diescip-perl cpan PGPLOT 2.36 main/die(). "Data file test.img not found";
19 if($^Oscip-perl cpan PGPLOT 2.36 main/`$^O`. =~ /mswin32/i) {binmodescip-perl cpan PGPLOT 2.36 main/binmode().($fh)}
20 readscip-perl cpan PGPLOT 2.36 main/read().($fh, $img, 32768);
21 closescip-perl cpan PGPLOT 2.36 main/close().($fh) or diescip-perl cpan PGPLOT 2.36 main/die(). "Can't close test.img: $!";
22
23 notescip-perl cpan PGPLOT 2.36 main/note(). lengthscip-perl cpan PGPLOT 2.36 main/length().($img)," bytes read";
24
25 my @image = unpackscip-perl cpan PGPLOT 2.36 main/unpack().("n*",$img);
26
27 note $#imagescip-perl cpan PGPLOT 2.36 main/`$#image`.+1," element image stored";
28
29 PGPLOT::pgbeginscip-perl cpan PGPLOT 2.36 PGPLOT/pgbegin().(0,$dev,1,1); # Open plot device
30
31 notescip-perl cpan PGPLOT 2.36 main/note(). "Plotting...";
32
33 PGPLOT::pgsciscip-perl cpan PGPLOT 2.36 PGPLOT/pgsci().(3);
34 PGPLOT::pgwnadscip-perl cpan PGPLOT 2.36 PGPLOT/pgwnad().(12000,13000,13000,12000);
35
36 my @tr=(12000,8,0,12000,0,8);
37
38 PGPLOT::pgimagscip-perl cpan PGPLOT 2.36 PGPLOT/pgimag().(\@image,128,128,1,128,1,128,0,5000,\@tr);
39 PGPLOT::pglabelscip-perl cpan PGPLOT 2.36 PGPLOT/pglabel().("\\ga","\\gd","Galaxy");
40 PGPLOT::pgtboxscip-perl cpan PGPLOT 2.36 PGPLOT/pgtbox().("ZYHBCNST",0,0,"ZYDBCNST",0,0);
41
42 # Note: pgimag() usually defaults to a grey scale unless you explicitly set
43 # a colour ramp look-up table with pgctab(). Because it is a look
44 # up table it can be set after drawing the image. It is best to set an
45 # explicit LUT as a grey scale default can not be guaranteed on all devices.
46
47 # Set PHIL2 colour table
48
49 my @l=(0,0.004,0.502,0.941,1); my @r=(0,0,1,1,1);
50 my @g=(0,0,0.2,1,1); my @b=(0,0.2,0,0.1,1);
51
52 PGPLOT::pgctabscip-perl cpan PGPLOT 2.36 PGPLOT/pgctab().(\@l,\@r,\@g,\@b,5,1,0.5);
53
54 PGPLOT::pgsciscip-perl cpan PGPLOT 2.36 PGPLOT/pgsci().(4); PGPLOT::pgslsscip-perl cpan PGPLOT 2.36 PGPLOT/pgsls().(1);
55 my @cont = (-1,1000,2000,3000,4000,5000);
56 PGPLOT::pgconsscip-perl cpan PGPLOT 2.36 PGPLOT/pgcons().(\@image, 128, 128, 1,128,1,128, \@cont, 6, \@tr);
57
58 for(@cont){
59 PGPLOT::pgconlscip-perl cpan PGPLOT 2.36 PGPLOT/pgconl().(\@image, 128, 128, 1,128,1,128, $_scip-perl cpan PGPLOT 2.36 main/$_., \@tr, $_scip-perl cpan PGPLOT 2.36 main/$_.,200,100);
60 }
61
62 PGPLOT::pgsciscip-perl cpan PGPLOT 2.36 PGPLOT/pgsci().(4); PGPLOT::pgscfscip-perl cpan PGPLOT 2.36 PGPLOT/pgscf().(2);
63 my (@xbox, @ybox);
64 PGPLOT::pgqtxtscip-perl cpan PGPLOT 2.36 PGPLOT/pgqtxt().(12125,12100,45,0.5,'PGPLOT...',\@xbox,\@ybox);
65 PGPLOT::pgpolyscip-perl cpan PGPLOT 2.36 PGPLOT/pgpoly().(4,\@xbox, \@ybox);
66 PGPLOT::pgsciscip-perl cpan PGPLOT 2.36 PGPLOT/pgsci().(7);
67 PGPLOT::pgptxtscip-perl cpan PGPLOT 2.36 PGPLOT/pgptxt().(12125,12100,45,0.5,'PGPLOT...');
68
69 PGPLOT::pgqinfscip-perl cpan PGPLOT 2.36 PGPLOT/pgqinf().("CURSOR",my $ans,my $l);
70 # x/y are input/output for pgband: they set the initial cursor position,
71 # so initialise them (and let the position carry over between modes)
72 my ($x,$y,$ch) = (12500,12500,'');
•73 #if ($ans eq "YES") { for(my $mode=0; $mode<8; $mode++){
74 #
75 # note "Entering interactive PGBAND test MODE=$mode, hit any key, Q to exit early...";
76 #
77 # PGPLOT::pgsci($mode+1);
78 # PGPLOT::pgband($mode,0,12500,12500,$x,$y,$ch);
79 # last if $ch eq "q" || $ch eq "Q";
80 # PGPLOT::pgqtxt($x,$y,45,0.5,'PGPLOT...',\@xbox,\@ybox);
81 # PGPLOT::pgpoly(4,\@xbox, \@ybox);
82 # PGPLOT::pgsci($mode+2);
83 # PGPLOT::pgptxt($x,$y,45,0.5,'PGPLOT...');
84 #
85 #}}
86
87 PGPLOT::pgendscip-perl cpan PGPLOT 2.36 PGPLOT/pgend().();
88
89 pass;
90 done_testing;