| 1 | use strict; use warnings; |
| 2 | use Test::More; |
| 3 | use Config; |
| 4 | # Stop f77-linking causing spurious undefined symbols (alpha) |
| 5 | $ENV{'PERL_DL_NONLAZY'}=0 if $Config{'osname'} eq "dec_osf"; |
| 6 | require PGPLOT; |
| 7 | |
| 8 | my $dev = $ENV{PGPLOT_DEV} || '/NULL'; |
| 9 | |
| 10 | $ENV{PGPLOT_XW_WIDTH}=0.3; |
| 11 | |
| 12 | note "Testing pghi2d routine"; |
| 13 | |
| 14 | # Read in image (int*2) |
| 15 | |
| 16 | my $img=""; |
| 17 | open(my $fh,"test.img") || die "Data file test.img not found"; |
| 18 | if($^O =~ /mswin32/i) {binmode($fh)} |
| 19 | read($fh, $img, 32768); |
| 20 | close($fh) or die "Can't close test.img: $!"; |
| 21 | |
| 22 | note length($img)," bytes read"; |
| 23 | |
| 24 | my @image = unpack("n*",$img); |
| 25 | |
| 26 | note $#image+1," element image stored"; |
| 27 | |
| 28 | PGPLOT::pgbegin(0,$dev,1,1); |
| 29 | |
| 30 | note "Plotting\n"; |
| 31 | |
| 32 | PGPLOT::pgenv(0,256,0,65000,0,0); |
| 33 | |
| 34 | PGPLOT::pgsci(5); |
| 35 | |
| 36 | my @xvals = (1..128); |
| 37 | my @work = (1..128); |
| 38 | |
| 39 | PGPLOT::pgbbuf(); # buffer so giza does not flush to screen per primitive |
| 40 | PGPLOT::pghi2d(\@image, 128, 128, 1,128,1,128, \@xvals, 1, 200, 1, \@work); |
| 41 | PGPLOT::pgebuf(); |
| 42 | |
| 43 | PGPLOT::pgend(); |
| 44 | |
| 45 | pass; |
| 46 | done_testing; |