PDL::Graphics::AquaTerm

PDL::Graphics::AquaTerm is a Perl module that provides access to the AquaTerm Mac OS-X graphics terminal.
Download

PDL::Graphics::AquaTerm Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Hazen Babcock
  • Publisher web site:
  • http://search.cpan.org/~hbabcock/PDL-Graphics-AquaTerm-0.02/aquaterm.pd

PDL::Graphics::AquaTerm Tags


PDL::Graphics::AquaTerm Description

PDL::Graphics::AquaTerm is a Perl module that provides access to the AquaTerm Mac OS-X graphics terminal. PDL::Graphics::AquaTerm is a Perl module that provides access to the AquaTerm Mac OS-X graphics terminal.SYNOPSIS # example 1 use PDL; use PDL::Graphics::LUT; use PDL::Graphics::AquaTerm; my $x_size = 255; my $y_size = 255; aquaOpen({SIZE_X => $x_size, SIZE_Y => $y_size}); aquaSetColorTable(cat(lut_data('idl5'))); my $a = xvals(zeroes(byte,$x_size,$y_size)); aquaBitmap($a);# example 2 use PDL; use PDL::Graphics::AquaTerm; my $x_size = 255; my $y_size = 255; aquaOpen({WIN_NUM => 1, SIZE_X => $x_size, SIZE_Y => $y_size}); my $a = sin(xvals(zeroes(float, $x_size, $y_size)) * 0.1); aquaBitmap($a, {AUTO_SCALE => 1});This module interfaces PDL directly to the AquaTerm Mac OS-X graphics terminal. It is primarily intended for quickly and easily displaying bitmap images.The coordinate system is defined by the window size (given in pixels) with (0,0) at the bottom left corner of the window. This means that if the window is set to be 300 x 200, then the bottom left corner will have coordinates (0,0) and the upper right corner will have coordinates (300,200). Anything that is drawn outside this boundary will be automatically clipped.FUNCTIONSaquaOpenOpen a new AquaTerm window Usage: aquaOpen(); # open the window with the defaults Usage: aquaOpen({SIZE_X => 200, SIZE_Y => 200, BACK_COLOR => });Opens a new AquaTerm window, it also starts AquaTerm if necessary.Options recognized : SIZE_X - window x size in pixels (default = 400) SIZE_Y - window y size in pixels (default = 300) WIN_NUM - The window number, used by the drawing commands to specify which window to draw in WIN_TITLE - A title for the window, if desired (default = "Aquaterm.pm") BACK_COLOR - the windows background color (default = , i.e. white) WARN_ON - set to 1 to turn on warning messages, 0 to turn off (default = 1) DEBUG_ON - set to 1 to turn on debugging message, 0 to turn off (default = 0)aquaBitmapDisplay a PDL as a bitmap. Usage: aquaDisplay($my_img); # display $my_img as a bitmap in the currently open window Usage: aquaDisplay($my_img, {AUTO_SCALE => 1.0, TEXT => "my image", TEXT_C => });Displays a PDL as a bitmap. The PDL can be of size either (m,n) or (3,m,n). PDLs of size (m,n) are converted to indexed color based on the current color table (see aquaSetColorTable). PDLs of size (3,m,n) are displayed as true-color images with the first dimension specifying the color (RGB). Unless a re-scaling is specified, the minimum value displayed is 0.0 and the maximum is 255.0.Options recognized : DEST_X - position of the left side of the bitmap in pixels (default = 0) DEST_Y - position of the bottom of the bitmap in pixels (default = 0) DEST_W - width of the bitmap to be displayed (default = width of the PDL) DEST_H - height of the bitmap to be displayed (default = height of the PDL) AUTO_SCALE - if set equal to 1, the PDL will be rescaled such that its minimum value is 1 and its max is 255 (default = 0) M_MIN - the minimum value to be displayed (default = 0.0) M_MAX - the maximum value to be displayed (default = 255.0) WIN_NUM - specify which window to draw in (default = current window) TEXT - text to display on the bitmap TEXT_X - x location of the text in pixels (default = 6) TEXT_Y - y location of the text in pixels (default = 10) TEXT_C - RGB color of the text, (default = , i.e. black)aquaSetColorTableSet the color table Usage: aquaSetColorTable(cat(lut_data('idl5'))); # set the color table to idl5Makes a local copy of a user supplied color table. The color table must be a 256 x 4 pdl of the form (l,r,g,b), as would be generated by the command '$ct = cat(lut_data("xyz"))'. The l value is ignored. The r, g and b values should be in the range 0.0 - 1.0.aquaPolyLineDraws a (2,n) PDL as a line Usage: aquaPolyLine($line, {WIDTH => 3, COLOR => }); # draw $line black with width 3Draw a poly-line between a set of points given by a PDL of size (2,n). The first dimension of the PDL gives the x & y position of the individual points, n is the total number of points.Options recognized WIN_NUM - which window to draw the line in ERASE - clear the selected window prior to drawing the line WIDTH - line width (default = 1) CAPS - line cap style, I'm still unsure exactly what this is... COLOR - RGB color of the line (default is black)aquaTextDraw text # draw red 'hello world' at position 20, 30 in the current window Usage: aquaText("hello world", X => 20, Y => 30, COLOR => );Draws text.Options recognized WIN_NUM - which window to draw the text in ERASE - clear the current window prior to drawing the text NAME - name of the font to use (default = "Times-Roman") ANGLE - angle to display the text relative to the horizontal in degrees (default = 0.0) X - position in the window of the text anchor point (which depends on the justification of the text) (default = 6) Y - position in the window of the bottom of the text (default = 10) JUST - text justification, left = 0, center = 1, right = -1? (default = 0) SIZE - font size in points (default = 12) COLOR - text color (default is black)aquaMouse= for refReturns location of next mouse click in the active window= for usage($mx, $my) = aquaMouse();Returns the location of the next mouse click in the active window as a 2 element array. The elements of the array are the x and y coordinates of the mouse click in pixels. The coordinates are relative to the bottom left corner of the active area of the window.Options recognized WIN_NUM - which window to get the mouse click in Requirements: · Perl


PDL::Graphics::AquaTerm Related Software