File: t7.t

package info (click to toggle)
libpgplot-perl 1%3A2.35-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,336 kB
  • sloc: perl: 3,880; ansic: 453; makefile: 5
file content (44 lines) | stat: -rw-r--r-- 872 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
use strict; use warnings;
use Test::More;
use Config;
# Stop f77-linking causing spurious undefined symbols (alpha)
$ENV{'PERL_DL_NONLAZY'}=0 if $Config{'osname'} eq "dec_osf";
require PGPLOT;

my $dev = $ENV{PGPLOT_DEV} || '/NULL';

$ENV{PGPLOT_XW_WIDTH}=0.3;

note "Testing pghi2d routine";

# Read in image (int*2)

my $img="";
open(my $fh,"test.img") || die "Data file test.img not found";
if($^O =~ /mswin32/i) {binmode($fh)}
read($fh, $img, 32768);
close($fh) or die "Can't close test.img: $!";

note length($img)," bytes read";

my @image = unpack("n*",$img);

note $#image+1," element image stored";

PGPLOT::pgbegin(0,$dev,1,1);

note "Plotting\n";

PGPLOT::pgenv(0,256,0,65000,0,0);

PGPLOT::pgsci(5);

my @xvals = (1..128);
my @work = (1..128);

PGPLOT::pghi2d(\@image, 128, 128, 1,128,1,128, \@xvals, 1, 200, 1, \@work);

PGPLOT::pgend();

pass;
done_testing;