Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pdl::graphics2d(3pm) [debian man page]

Graphics2D(3pm) 					User Contributed Perl Documentation					   Graphics2D(3pm)

NAME
PDL::Graphics2D - An object oriented interface to PDL graphics SYNOPSIS
use PDL::Graphics2D; $win = PDL::Graphics2D->new(<Interface>, <Options>); $w = imag2d( $image, 'Title Here', ... ); DESCRIPTION
This is an umbrella class allowing for a simple interface to all plotting routines in PDL. On its own it does not do any work it merely passes information to the appropriate class. Ideally this should probably offer a uniform interface to a variety of packages. This requires a lot more work before it is useful I feel, but it can be used already. CONSTRUCTORS
new Create a 2-D graphics object with the requested interface type FUNCTIONS
imag2d Display a 2-D image in a figure window imag2d() creates a plain FreeGLUT OpenGL window and displays the input image with 1:1 aspect ratio for pixels. The window resize is constrained to the actual ratio of the image dimensions. The initial display size is currently a 200x200 window to prevent things from being too small by default. The image to display can have dimensions ($c,$M,$N) where for $c==4 the display is in GL_RGBA, for $c==3 the display is GL_RGB, for $c==2 the display is GL_LUMINANCE_ALPHA, and for $c==1 or for for dimensions ($M,$N) then the display is GL_LUMINANCE. This routine does not yet thread but multiple images may be viewed at the same time in separate windows by multiple calls to imag2d(). TriD graphics visualization windows and the imag2d() windows may be created and used independently. NOTE: If you are twiddling a TriD window, the imag2d() windows are active as well. If you call twiddle() the sub, only the imag2d() windows will update correctly. $window_id = imag2d($image, $name, $zoom, $x_off, $y_off); creates a new image figure window from the input piddle with the given title, zoom factor, and position (if possible) $window_id - may be used to refer to the figure window $image - 2D image piddle with at least 2 or 3 dimensions e.g. [M,N], [1,M,N], [2,M,N], [3,M,N], [4,M,N] $name - the name to use for the figure window (optional) $zoom - desired (float) pixel zoom factor (optional) ($x_off, $y_off) - desired window pixel position (optional) with (0,0) as the top left pixel of the display use PDL::Graphics2D; # imports imag2d() and twiddle() $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); $w1 = imag2d($a); # with parens... $w2 = imag2d $a->sqrt; # or without $w3 = imag2d $a**2; imag2d_update Update an existing imag2d window with new piddle data $image = random(3,64,48)/2 + 0.25; # random pixel image $win = imag2d($image); # create original image display imag2d_update($win, $image->sequence/$image->nelem); # update data "imag2d_update" allows one to update an "imag2d" display window by replacing the associated image data with new contents. The new image data must be the same type and shape as the previous. Eventually, we would like to implement this via some sort of dataflow that would be transparent to the user. twiddle Enable GUI interaction with a FreeGLUT display window. twiddle(); Runs the FreeGLUT event loop so window GUI operations such as resize, expose, mouse click,.. work perl v5.14.2 2012-02-10 Graphics2D(3pm)

Check Out this Related Man Page

OpenGL(3pm)						User Contributed Perl Documentation					       OpenGL(3pm)

NAME
PDL::Graphics::OpenGL::Perl::OpenGL - PDL TriD OpenGL interface using POGL VERSION
Version 0.01_10 SYNOPSIS
This module provides the glue between the Perl OpenGL functions and the API defined by the internal PDL::Graphics::OpenGL one. It also supports any miscellaneous OpenGL or GUI related functionality to support PDL::Graphics::TriD refactoring. You should eventually be able to replace: use PDL::Graphics::OpenGL by use PDL::Graphics::OpenGL::Perl::OpenGL; This module also includes support for FreeGLUT and GLUT instead of X11+GLX as mechanism for creating windows and graphics contexts. EXPORT
See the documentation for the OpenGL module. More details to follow as the refactored TriD module interface and build environment matures FUNCTIONS
TBD TBD new($class,$options,[$window_type]) Returns a new OpenGL object with attributes specified in the options field, and of the 3d window type, if specified. These attributes are: x,y - the position of the upper left corner of the window (0,0) width,height - the width and height of the window in pixels (500,500) parent - the parent under which the new window should be opened (root) mask - the user interface mask (StructureNotifyMask) attributes - attributes to pass to glXChooseVisual Allowed 3d window types, case insensitive, are: glut - use Perl OpenGL bindings and GLUT windows (no Tk) x11 - use Perl OpenGL (POGL) bindings with X11 (disabled) default GLUT callbacks These routines are set as the default GLUT callbacks for when GLUT windows are used for PDL/POGL. Their only function at the moment is to drive an fake XEvent queue to feed the existing TriD GUI controls. At some point, the X11 stuff will the deprecated and we can rewrite this more cleanly. default_options default options for object oriented methods XPending() OO interface to XPending XResizeWindow(x,y) OO interface to XResizeWindow glpXNextEvent() OO interface to glpXNextEvent glpRasterFont() OO interface to the glpRasterFont function AUTOLOAD If the function is not prototyped in OO we assume there is no explicit mention of the three identifying parameters (Display, Window, Context) and try to load the OpenGL function. glXSwapBuffers OO interface to the glXSwapBuffers function AUTHOR
Chris Marshall, "<devel dot chm dot 01 at gmail.com>" BUGS
Bugs and feature requests may be submitted through the PDL sourceforge project page at <http://sourceforge.net/tracker/?group_id=612> . SUPPORT
PDL uses a mailing list support model. The Perldl mailing list is the best for questions, problems, and feature discussions with other PDL users and PDL developers. To subscribe see the page at <http://mailman.jach.hawaii.edu/mailman/listinfo/perldl> ACKNOWLEDGEMENTS
TBD including PDL TriD developers and POGL developers...thanks to all. COPYRIGHT &; LICENSE Copyright 2009 Chris Marshall. This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License. See http://dev.perl.org/licenses/ for more information. perl v5.14.2 2012-01-02 OpenGL(3pm)
Man Page