i have found some solution, inspired by many posts especially a message with a title "imag2d.pdl for test" :
http://mailman.jach.hawaii.edu/pipermail/perldl/2009-December/002665.html and
http://mailman.jach.hawaii.edu/pipermail/perldl/2010-January/002716.html
we need a file "imag2d.pdl" not in the pdl package, and to use PDL::AutoLoader, as explained in the above message
so putting the file imag2d.pdl in the same folder as the following code can run successfully the code with a red dusk like image. i run the code in windows xp activestate perl 5.10
use PDL;
use PGPLOT;
use PDL::Graphics2D; #imports imag2d() and twiddle()
use PDL::AutoLoader;
our @PDLLIB;
push @PDLLIB, '.';
my $winopt = {Device => '/GW', WindowWidth => 7, Aspect => 1};
my $w = PDL::Graphics2D->new('PGPLOT');
$a = sequence(64,48,3); # make test RGB image
$a = $a->mv(2,0); # color must be dim(0) with size [0..4]
$a /= $a->max; # pixel values in [0.0,1.0]
$a = sin(10*$a);
imag2d($a);
there may be more improvements, thanks for all
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.