Summary: grabpic3d() on cygwin/X11 gives
a bad (skewed) image when the TriD image
window is resized so the horizontal size
is not a multiple of 4.

Question: Do other PDL users with TriD
see this problem as well?

I've attached a perl script that allows
you to try this out.  You should be able
to run it and see the following:

(1) a TriD image window is created
    and you can twiddle3d as you wish
    and 'q' to continue.

(2) a grabpic3d() is made of the final
    image in the TriD window in a new
    window titled Grab-1.  Click in
    that window and type 'q' to continue.

(3) The TriD window will be reactivated
    and you can resize it with the usual
    stretch from the corners, 'q' to
    stop the twiddle3d.

(4) Another grabpic3d() image is
    taken and displayed in an imag2d
    window titled Grab-2.  'q' to
    stop twiddling this window.

(5) Hit the <Enter> key in the command
    window to exit the program.

I've attached the two images from the
Grab-1 and Grab-2 steps that show the
problem.

Thanks in advance for anyone who can
give this a try!

--Chris
#!/usr/bin/perl
use PDL;
use PDL::NiceSlice;
use PDL::Graphics2D;
use PDL::Graphics::TriD;

# make TriD image
line3d [sqrt(rvals(zeroes(50,50))/2)];

# grabpic3d a snapshot
$pic1 = grabpic3d();
imag2d $pic1(:,:,-1:0), 'Grab-1', 1.0;

# make TriD image again and resize window
line3d [sqrt(rvals(zeroes(50,50))/2)];

# grabpic3d a snapshot
$pic2 = grabpic3d();

imag2d $pic2(:,:,-1:0), 'Grab-2', 1.0;

print "Enter s to save PNGs or just <Enter> alone to quit\n";
if (scalar(<STDIN>) =~ /^s/i) {
   $pic1->wpic('grab1.png');
   $pic2->wpic('grab2.png');
}

print "Thank you for helping! \n";

<<attachment: grab2.png>>

<<attachment: grab1.png>>

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to