poly
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 15
polyBSD 0.1
polyBSD is a multi-purpose (hence poly) framework for building embedded systems based on NetBSD. more>>
polyBSD is a "multi"-purpose (hence "poly") framework for building embedded systems based on NetBSD.
Of the three major *BSD flavors, FreeBSD and OpenBSD are often in the spotlight.
FreeBSD is touted for its stability, while OpenBSD usually claims the title of
the most secure operatin system available.
However, the third flavor (NetBSD) is what many consider to be the unsung hero - it has features that rival those of both FreeBSD and OpenBSD however is not often seen in the news. NetBSD has arguably the cleanest code base of all open source operating systems this fact has unforseen effect on its overall features. The reason for
NetBSDs clean code is the its stated goal to run on as many hardware architecture
as possible. In order to do that, the team behind NetBSD has been forced to write
code that is portable and easy to debug.
Portable code is achieved by using mostly libraries and functions that are likely to compile and run well on most platforms. In addition, in order to be able to reliably port the code to over 40 different architecture, the code has to be well written so that a large group of people can look at and understand it well so they can modify it easily and port it to a new architecture. But how does that translate into stability and security touted by FreeBSD and OpenBSD respectively. Well, clean code usually translates directly into stability - one cant expect a messy code to perform well or be easy to debug.
Clean code also leads to improved security - security bugs are easy to spot and
correct. Also the portability of the code ensures that only standard libraries
and functions are used. However, those standard libarries and functions are the
ones that have been around longer, which means they have been well tested and are
likely to contain the fewest number of security bugs.
The one feature that FreeBSD had long been able to claim exclusively is that in
terms of performance it blows all other *BSD flavors out of the water when it
comes to the i386 architecture.
However, this crown was recently captured by NetBSD thanks to an extensive performance benchmarking, the results of which are referenced on the section "NetBSD tools" on this site. So to sum it all up, NetBSD is no longer simply the portability prodigy on the block. It is a fast, rock-solid and secure operating system that can successfully meet the demands of the modern enterprise. Thats the reason for it being used by the people behind this project to build some tools that will hopefully be useful.
<<lessOf the three major *BSD flavors, FreeBSD and OpenBSD are often in the spotlight.
FreeBSD is touted for its stability, while OpenBSD usually claims the title of
the most secure operatin system available.
However, the third flavor (NetBSD) is what many consider to be the unsung hero - it has features that rival those of both FreeBSD and OpenBSD however is not often seen in the news. NetBSD has arguably the cleanest code base of all open source operating systems this fact has unforseen effect on its overall features. The reason for
NetBSDs clean code is the its stated goal to run on as many hardware architecture
as possible. In order to do that, the team behind NetBSD has been forced to write
code that is portable and easy to debug.
Portable code is achieved by using mostly libraries and functions that are likely to compile and run well on most platforms. In addition, in order to be able to reliably port the code to over 40 different architecture, the code has to be well written so that a large group of people can look at and understand it well so they can modify it easily and port it to a new architecture. But how does that translate into stability and security touted by FreeBSD and OpenBSD respectively. Well, clean code usually translates directly into stability - one cant expect a messy code to perform well or be easy to debug.
Clean code also leads to improved security - security bugs are easy to spot and
correct. Also the portability of the code ensures that only standard libraries
and functions are used. However, those standard libarries and functions are the
ones that have been around longer, which means they have been well tested and are
likely to contain the fewest number of security bugs.
The one feature that FreeBSD had long been able to claim exclusively is that in
terms of performance it blows all other *BSD flavors out of the water when it
comes to the i386 architecture.
However, this crown was recently captured by NetBSD thanks to an extensive performance benchmarking, the results of which are referenced on the section "NetBSD tools" on this site. So to sum it all up, NetBSD is no longer simply the portability prodigy on the block. It is a fast, rock-solid and secure operating system that can successfully meet the demands of the modern enterprise. Thats the reason for it being used by the people behind this project to build some tools that will hopefully be useful.
Download (31.8MB)
Added: 2006-11-01 License: BSD License Price:
1087 downloads
PolyPuzzle 1.6.2
PolyPuzzle project is a cute game, based on the original puzzle #0. more>>
PolyPuzzle project is a cute game, based on the original puzzle #0.
Poly Puzzle is my first original program to make use of Tks canvas widget. It was inspired by a plastic puzzle named Beat The Computer which came in an array of
sizes and loud colours.
It now has trays with polygons based on hexagons, squares and equilateral triangles. The new round tray is based on smooth triangles, and isnt quite as cute as
the original puzzle #0.
I had planned to incorporate a computer solution feature. This would be handy for the actual plastic game - which you have to put away at the end of the day - but
on the computer there are no little pieces to lose under the carpet ;>. More to the point - it would require quite a bit of programming / math!
<<lessPoly Puzzle is my first original program to make use of Tks canvas widget. It was inspired by a plastic puzzle named Beat The Computer which came in an array of
sizes and loud colours.
It now has trays with polygons based on hexagons, squares and equilateral triangles. The new round tray is based on smooth triangles, and isnt quite as cute as
the original puzzle #0.
I had planned to incorporate a computer solution feature. This would be handy for the actual plastic game - which you have to put away at the end of the day - but
on the computer there are no little pieces to lose under the carpet ;>. More to the point - it would require quite a bit of programming / math!
Download (MB)
Added: 2006-11-22 License: GPL (GNU General Public License) Price:
1067 downloads
Math::Cephes::Polynomial 0.44
Math::Cephes::Polynomial is a Perl interface to the cephes math polynomial routines. more>>
Math::Cephes::Polynomial is a Perl interface to the cephes math polynomial routines.
SYNOPSIS
use Math::Cephes::Polynomial qw(poly);
# poly is a shortcut for Math::Cephes::Polynomial->new
require Math::Cephes::Fraction; # if coefficients are fractions
require Math::Cephes::Complex; # if coefficients are complex
my $a = poly([1, 2, 3]); # a(x) = 1 + 2x + 3x^2
my $b = poly([4, 5, 6, 7]; # b(x) = 4 + 5x + 6x^2 + 7x^3
my $c = $a->add($b); # c(x) = 5 + 7x + 9x^2 + 7x^3
my $cc = $c->coef;
for (my $i=0; $ieval($x);
print "At x=$x, c(x) is $rn";
my $u1 = Math::Cephes::Complex->new(2,1);
my $u2 = Math::Cephes::Complex->new(1,-3);
my $v1 = Math::Cephes::Complex->new(1,3);
my $v2 = Math::Cephes::Complex->new(2,4);
my $z1 = Math::Cephes::Polynomial->new([$u1, $u2]);
my $z2 = Math::Cephes::Polynomial->new([$v1, $v2]);
my $z3 = $z1->add($z2);
my $z3c = $z3->coef;
for (my $i=0; $ieval($x);
print "At x=$x, z3(x) has real=", $r->r, " and imag=", $r->i, "n";
my $a1 = Math::Cephes::Fraction->new(1,2);
my $a2 = Math::Cephes::Fraction->new(2,1);
my $b1 = Math::Cephes::Fraction->new(1,2);
my $b2 = Math::Cephes::Fraction->new(2,2);
my $f1 = Math::Cephes::Polynomial->new([$a1, $a2]);
my $f2 = Math::Cephes::Polynomial->new([$b1, $b2]);
my $f3 = $f1->add($f2);
my $f3c = $f3->coef;
for (my $i=0; $ieval($x);
print "At x=$x, f3(x) has num=", $r->n, " and den=", $r->d, "n";
$r = $f3->eval($a1);
print "At x=", $a1->n, "/", $a1->d,
", f3(x) has num=", $r->n, " and den=", $r->d, "n";
<<lessSYNOPSIS
use Math::Cephes::Polynomial qw(poly);
# poly is a shortcut for Math::Cephes::Polynomial->new
require Math::Cephes::Fraction; # if coefficients are fractions
require Math::Cephes::Complex; # if coefficients are complex
my $a = poly([1, 2, 3]); # a(x) = 1 + 2x + 3x^2
my $b = poly([4, 5, 6, 7]; # b(x) = 4 + 5x + 6x^2 + 7x^3
my $c = $a->add($b); # c(x) = 5 + 7x + 9x^2 + 7x^3
my $cc = $c->coef;
for (my $i=0; $ieval($x);
print "At x=$x, c(x) is $rn";
my $u1 = Math::Cephes::Complex->new(2,1);
my $u2 = Math::Cephes::Complex->new(1,-3);
my $v1 = Math::Cephes::Complex->new(1,3);
my $v2 = Math::Cephes::Complex->new(2,4);
my $z1 = Math::Cephes::Polynomial->new([$u1, $u2]);
my $z2 = Math::Cephes::Polynomial->new([$v1, $v2]);
my $z3 = $z1->add($z2);
my $z3c = $z3->coef;
for (my $i=0; $ieval($x);
print "At x=$x, z3(x) has real=", $r->r, " and imag=", $r->i, "n";
my $a1 = Math::Cephes::Fraction->new(1,2);
my $a2 = Math::Cephes::Fraction->new(2,1);
my $b1 = Math::Cephes::Fraction->new(1,2);
my $b2 = Math::Cephes::Fraction->new(2,2);
my $f1 = Math::Cephes::Polynomial->new([$a1, $a2]);
my $f2 = Math::Cephes::Polynomial->new([$b1, $b2]);
my $f3 = $f1->add($f2);
my $f3c = $f3->coef;
for (my $i=0; $ieval($x);
print "At x=$x, f3(x) has num=", $r->n, " and den=", $r->d, "n";
$r = $f3->eval($a1);
print "At x=", $a1->n, "/", $a1->d,
", f3(x) has num=", $r->n, " and den=", $r->d, "n";
Download (0.29MB)
Added: 2007-07-03 License: Perl Artistic License Price:
844 downloads
GD::Simple 2.35
GD::Simple module is a simplified interface to GD library. more>>
GD::Simple module is a simplified interface to GD library.
SYNOPSIS
use GD::Simple;
# create a new image
$img = GD::Simple->new(400,250);
# draw a red rectangle with blue borders
$img->bgcolor(red);
$img->fgcolor(blue);
$img->rectangle(10,10,50,50);
# draw an empty rectangle with green borders
$img->bgcolor(undef);
$img->fgcolor(green);
$img->rectangle(30,30,100,100);
# move to (80,80) and draw a green line to (100,190)
$img->moveTo(80,80);
$img->lineTo(100,190);
# draw a solid orange ellipse
$img->moveTo(110,100);
$img->bgcolor(orange);
$img->fgcolor(orange);
$img->ellipse(40,40);
# draw a black filled arc
$img->moveTo(150,150);
$img->fgcolor(black);
$img->arc(50,50,0,100,gdNoFill|gdEdged);
# draw a string at (10,180) using the default
# built-in font
$img->moveTo(10,180);
$img->string(This is very simple);
# draw a string at (280,210) using 20 point
# times italic, angled upward 90 degrees
$img->moveTo(280,210);
$img->font(Times:italic);
$img->fontsize(20);
$img->angle(-90);
$img->string(This is very fancy);
# some turtle graphics
$img->moveTo(300,100);
$img->penSize(3,3);
$img->angle(0);
$img->line(20); # 20 pixels going to the right
$img->turn(30); # set turning angle to 30 degrees
$img->line(20); # 20 pixel line
$img->line(20);
$img->line(20);
$img->turn(-90); # set turning angle to -90 degrees
$img->line(50); # 50 pixel line
# draw a cyan polygon edged in blue
my $poly = new GD::Polygon;
$poly->addPt(150,100);
$poly->addPt(199,199);
$poly->addPt(100,199);
$img->bgcolor(cyan);
$img->fgcolor(blue);
$img->penSize(1,1);
$img->polygon($poly);
# convert into png data
print $img->png;
GD::Simple is a subclass of the GD library that shortens many of the long GD method calls by storing information about the pen color, size and position in the GD object itself. It also adds a small number of "turtle graphics" style calls for those who prefer to work in polar coordinates. In addition, the library allows you to use symbolic names for colors, such as "chartreuse", and will manage the colors for you.
The Pen
GD::Simple maintains a "pen" whose settings are used for line- and shape-drawing operations. The pen has the following properties:
fgcolor
The pen foreground color is the color of lines and the borders of filled and unfilled shapes.
bgcolor
The pen background color is the color of the contents of filled shapes.
pensize
The pen size is the width of the pen. Larger sizes draw thicker lines.
position
The pen position is its current position on the canvas in (X,Y) coordinates.
angle
When drawing in turtle mode, the pen angle determines the current direction of lines of relative length.
turn
When drawing in turtle mode, the turn determines the clockwise or counterclockwise angle that the pen will turn before drawing the next line.
font
The font to use when drawing text. Both built-in bitmapped fonts and TrueType fonts are supported.
fontsize
The size of the font to use when drawing with TrueType fonts.
One sets the position and properties of the pen and then draws. As the drawing progresses, the position of the pen is updated.
Methods
GD::Simple introduces a number of new methods, a few of which have the same name as GD::Image methods, and hence change their behavior. In addition to these new methods, GD::Simple objects support all of the GD::Image methods. If you make a method call that isnt directly supported by GD::Simple, it refers the request to the underlying GD::Image object. Hence one can load a JPEG image into GD::Simple and declare it to be TrueColor by using this call, which is effectively inherited from GD::Image:
my $img = GD::Simple->newFromJpeg(./myimage.jpg,1);
The rest of this section describes GD::Simple-specific methods.
$img->moveTo($x,$y)
This call changes the position of the pen without drawing. It moves the pen to position ($x,$y) on the drawing canvas.
$img->move($dx,$dy)
$img->move($dr)
This call changes the position of the pen without drawing. When called with two arguments it moves the pen $dx pixels to the right and $dy pixels downward. When called with one argument it moves the pen $dr pixels along the vector described by the current pen angle.
$img->lineTo($x,$y)
The lineTo() call simultaneously draws and moves the pen. It draws a line from the current pen position to the position defined by ($x,$y) using the current pen size and color. After drawing, the position of the pen is updated to the new position.
$img->line($dx,$dy)
$img->line($dr)
The line() call simultaneously draws and moves the pen. When called with two arguments it draws a line from the current position of the pen to the position $dx pixels to the right and $dy pixels down. When called with one argument, it draws a line $dr pixels long along the angle defined by the current pen angle.
$img->clear
This method clears the canvas by painting over it with the current background color.
$img->rectangle($x1,$y1,$x2,$y2)
This method draws the rectangle defined by corners ($x1,$y1), ($x2,$y2). The rectangles edges are drawn in the foreground color and its contents are filled with the background color. To draw a solid rectangle set bgcolor equal to fgcolor. To draw an unfilled rectangle (transparent inside), set bgcolor to undef.
$img->ellipse($width,$height)
This method draws the ellipse centered at the current location with width $width and height $height. The ellipses border is drawn in the foreground color and its contents are filled with the background color. To draw a solid ellipse set bgcolor equal to fgcolor. To draw an unfilled ellipse (transparent inside), set bgcolor to undef.
$img->arc($cx,$cy,$width,$height,$start,$end [,$style])
This method draws filled and unfilled arcs. See GD for a description of the arguments. To draw a solid arc (such as a pie wedge) set bgcolor equal to fgcolor. To draw an unfilled arc, set bgcolor to undef.
$img->polygon($poly)
This method draws filled and unfilled polygon using the current settings of fgcolor for the polygon border and bgcolor for the polygon fill color. See GD for a description of creating polygons. To draw a solid polygon set bgcolor equal to fgcolor. To draw an unfilled polygon, set bgcolor to undef.
$img->polyline($poly)
This method draws polygons without closing the first and last vertices (similar to GD::Image->unclosedPolygon()). It uses the fgcolor to draw the line.
$img->string($string)
This method draws the indicated string starting at the current position of the pen. The pen is moved to the end of the drawn string. Depending on the font selected with the font() method, this will use either a bitmapped GD font or a TrueType font. The angle of the pen will be consulted when drawing the text. For TrueType fonts, any angle is accepted. For GD bitmapped fonts, the angle can be either 0 (draw horizontal) or -90 (draw upwards).
For consistency between the TrueType and GD font behavior, the string is always drawn so that the current position of the pen corresponds to the bottom left of the first character of the text. This is different from the GD behavior, in which the first character of bitmapped fonts hangs down from the pen point.
This method returns a polygon indicating the bounding box of the rendered text. If an error occurred (such as invalid font specification) it returns undef and an error message in $@.
$metrics = $img->fontMetrics
($metrics,$width,$height) = GD::Simple->fontMetrics($font,$fontsize,$string)
This method returns information about the current font, most commonly a TrueType font. It can be invoked as an instance method (on a previously-created GD::Simple object) or as a class method (on the GD::Simple class).
When called as an instance method, fontMetrics() takes no arguments and returns a single hash reference containing the metrics that describe the currently selected font and size. The hash reference contains the following information:
xheight the base height of the font from the bottom to the top of
a lowercase m
ascent the length of the upper stem of the lowercase d
descent the length of the lower step of the lowercase j
lineheight the distance from the bottom of the j to the top of
the d
leading the distance between two adjacent lines
($delta_x,$delta_y)= $img->stringBounds($string)
This method indicates the X and Y offsets (which may be negative) that will occur when the given string is drawn using the current font, fontsize and angle. When the string is drawn horizontally, it gives the width and height of the strings bounding box.
$delta_x = $img->stringWidth($string)
This method indicates the width of the string given the current font, fontsize and angle. It is the same as ($img->stringBounds($string))[0]
($x,$y) = $img->curPos
Return the current position of the pen. Set the current position using moveTo().
$font = $img->font([$newfont] [,$newsize])
Get or set the current font. Fonts can be GD::Font objects, TrueType font file paths, or fontconfig font patterns like "Times:italic" (see fontconfig). The latter feature requires that you have the fontconfig library installed and are using libgd version 2.0.33 or higher.
As a shortcut, you may pass two arguments to set the font and the fontsize simultaneously. The fontsize is only valid when drawing with TrueType fonts.
$size = $img->fontsize([$newfontsize])
Get or set the current font size. This is only valid for TrueType fonts.
$size = $img->penSize([$newpensize])
Get or set the current pen width for use during line drawing operations.
$angle = $img->angle([$newangle])
Set the current angle for use when calling line() or move() with a single argument.
Here is an example of using turn() and angle() together to draw an octagon. The first line drawn is the downward-slanting top right edge. The last line drawn is the horizontal top of the octagon.
$img->moveTo(200,50);
$img->angle(0);
$img->turn(360/8);
for (1..8) { $img->line(50) }
$angle = $img->turn([$newangle])
Get or set the current angle to turn prior to drawing lines. This value is only used when calling line() or move() with a single argument. The turning angle will be applied to each call to line() or move() just before the actual drawing occurs.
Angles are in degrees. Positive values turn the angle clockwise.
$color = $img->fgcolor([$newcolor])
Get or set the pens foreground color. The current pen color can be set by (1) using an (r,g,b) triple; (2) using a previously-allocated color from the GD palette; or (3) by using a symbolic color name such as "chartreuse." The list of color names can be obtained using color_names().
$color = $img->bgcolor([$newcolor])
Get or set the pens background color. The current pen color can be set by (1) using an (r,g,b) triple; (2) using a previously-allocated color from the GD palette; or (3) by using a symbolic color name such as "chartreuse." The list of color names can be obtained using color_names().
$index = $img->translate_color(@args)
Translates a color into a GD palette or TrueColor index. You may pass either an (r,g,b) triple or a symbolic color name. If you pass a previously-allocated index, the method will return it unchanged.
$index = $img->alphaColor(@args,$alpha)
Creates an alpha color. You may pass either an (r,g,b) triple or a symbolic color name, followed by an integer indicating its opacity. The opacity value ranges from 0 (fully opaque) to 127 (fully transparent).
@names = GD::Simple->color_names
$translate_table = GD::Simple->color_names
Called in a list context, color_names() returns the list of symbolic color names recognized by this module. Called in a scalar context, the method returns a hash reference in which the keys are the color names and the values are array references containing [r,g,b] triples.
$gd = $img->gd
Return the internal GD::Image object. Usually you will not need to call this since all GD methods are automatically referred to this object.
($red,$green,$blue) = GD::Simple->HSVtoRGB($hue,$saturation,$value)
Convert a Hue/Saturation/Value (HSV) color into an RGB triple. The hue, saturation and value are integers from 0 to 255.
($hue,$saturation,$value) = GD::Simple->RGBtoHSV($hue,$saturation,$value)
Convert a Red/Green/Blue (RGB) value into a Hue/Saturation/Value (HSV) triple. The hue, saturation and value are integers from 0 to 255.
COLORS
This script will create an image showing all the symbolic colors.
#!/usr/bin/perl
use strict;
use GD::Simple;
my @color_names = GD::Simple->color_names;
my $cols = int(sqrt(@color_names));
my $rows = int(@color_names/$cols)+1;
my $cell_width = 100;
my $cell_height = 50;
my $legend_height = 16;
my $width = $cols * $cell_width;
my $height = $rows * $cell_height;
my $img = GD::Simple->new($width,$height);
$img->font(gdSmallFont);
for (my $c=0; $cfgcolor($color);
$img->rectangle(@topleft,@botright);
$img->moveTo($topleft[0]+2,$botright[1]+$legend_height-2);
$img->fgcolor(black);
$img->string($color);
}
}
print $img->png;
<<lessSYNOPSIS
use GD::Simple;
# create a new image
$img = GD::Simple->new(400,250);
# draw a red rectangle with blue borders
$img->bgcolor(red);
$img->fgcolor(blue);
$img->rectangle(10,10,50,50);
# draw an empty rectangle with green borders
$img->bgcolor(undef);
$img->fgcolor(green);
$img->rectangle(30,30,100,100);
# move to (80,80) and draw a green line to (100,190)
$img->moveTo(80,80);
$img->lineTo(100,190);
# draw a solid orange ellipse
$img->moveTo(110,100);
$img->bgcolor(orange);
$img->fgcolor(orange);
$img->ellipse(40,40);
# draw a black filled arc
$img->moveTo(150,150);
$img->fgcolor(black);
$img->arc(50,50,0,100,gdNoFill|gdEdged);
# draw a string at (10,180) using the default
# built-in font
$img->moveTo(10,180);
$img->string(This is very simple);
# draw a string at (280,210) using 20 point
# times italic, angled upward 90 degrees
$img->moveTo(280,210);
$img->font(Times:italic);
$img->fontsize(20);
$img->angle(-90);
$img->string(This is very fancy);
# some turtle graphics
$img->moveTo(300,100);
$img->penSize(3,3);
$img->angle(0);
$img->line(20); # 20 pixels going to the right
$img->turn(30); # set turning angle to 30 degrees
$img->line(20); # 20 pixel line
$img->line(20);
$img->line(20);
$img->turn(-90); # set turning angle to -90 degrees
$img->line(50); # 50 pixel line
# draw a cyan polygon edged in blue
my $poly = new GD::Polygon;
$poly->addPt(150,100);
$poly->addPt(199,199);
$poly->addPt(100,199);
$img->bgcolor(cyan);
$img->fgcolor(blue);
$img->penSize(1,1);
$img->polygon($poly);
# convert into png data
print $img->png;
GD::Simple is a subclass of the GD library that shortens many of the long GD method calls by storing information about the pen color, size and position in the GD object itself. It also adds a small number of "turtle graphics" style calls for those who prefer to work in polar coordinates. In addition, the library allows you to use symbolic names for colors, such as "chartreuse", and will manage the colors for you.
The Pen
GD::Simple maintains a "pen" whose settings are used for line- and shape-drawing operations. The pen has the following properties:
fgcolor
The pen foreground color is the color of lines and the borders of filled and unfilled shapes.
bgcolor
The pen background color is the color of the contents of filled shapes.
pensize
The pen size is the width of the pen. Larger sizes draw thicker lines.
position
The pen position is its current position on the canvas in (X,Y) coordinates.
angle
When drawing in turtle mode, the pen angle determines the current direction of lines of relative length.
turn
When drawing in turtle mode, the turn determines the clockwise or counterclockwise angle that the pen will turn before drawing the next line.
font
The font to use when drawing text. Both built-in bitmapped fonts and TrueType fonts are supported.
fontsize
The size of the font to use when drawing with TrueType fonts.
One sets the position and properties of the pen and then draws. As the drawing progresses, the position of the pen is updated.
Methods
GD::Simple introduces a number of new methods, a few of which have the same name as GD::Image methods, and hence change their behavior. In addition to these new methods, GD::Simple objects support all of the GD::Image methods. If you make a method call that isnt directly supported by GD::Simple, it refers the request to the underlying GD::Image object. Hence one can load a JPEG image into GD::Simple and declare it to be TrueColor by using this call, which is effectively inherited from GD::Image:
my $img = GD::Simple->newFromJpeg(./myimage.jpg,1);
The rest of this section describes GD::Simple-specific methods.
$img->moveTo($x,$y)
This call changes the position of the pen without drawing. It moves the pen to position ($x,$y) on the drawing canvas.
$img->move($dx,$dy)
$img->move($dr)
This call changes the position of the pen without drawing. When called with two arguments it moves the pen $dx pixels to the right and $dy pixels downward. When called with one argument it moves the pen $dr pixels along the vector described by the current pen angle.
$img->lineTo($x,$y)
The lineTo() call simultaneously draws and moves the pen. It draws a line from the current pen position to the position defined by ($x,$y) using the current pen size and color. After drawing, the position of the pen is updated to the new position.
$img->line($dx,$dy)
$img->line($dr)
The line() call simultaneously draws and moves the pen. When called with two arguments it draws a line from the current position of the pen to the position $dx pixels to the right and $dy pixels down. When called with one argument, it draws a line $dr pixels long along the angle defined by the current pen angle.
$img->clear
This method clears the canvas by painting over it with the current background color.
$img->rectangle($x1,$y1,$x2,$y2)
This method draws the rectangle defined by corners ($x1,$y1), ($x2,$y2). The rectangles edges are drawn in the foreground color and its contents are filled with the background color. To draw a solid rectangle set bgcolor equal to fgcolor. To draw an unfilled rectangle (transparent inside), set bgcolor to undef.
$img->ellipse($width,$height)
This method draws the ellipse centered at the current location with width $width and height $height. The ellipses border is drawn in the foreground color and its contents are filled with the background color. To draw a solid ellipse set bgcolor equal to fgcolor. To draw an unfilled ellipse (transparent inside), set bgcolor to undef.
$img->arc($cx,$cy,$width,$height,$start,$end [,$style])
This method draws filled and unfilled arcs. See GD for a description of the arguments. To draw a solid arc (such as a pie wedge) set bgcolor equal to fgcolor. To draw an unfilled arc, set bgcolor to undef.
$img->polygon($poly)
This method draws filled and unfilled polygon using the current settings of fgcolor for the polygon border and bgcolor for the polygon fill color. See GD for a description of creating polygons. To draw a solid polygon set bgcolor equal to fgcolor. To draw an unfilled polygon, set bgcolor to undef.
$img->polyline($poly)
This method draws polygons without closing the first and last vertices (similar to GD::Image->unclosedPolygon()). It uses the fgcolor to draw the line.
$img->string($string)
This method draws the indicated string starting at the current position of the pen. The pen is moved to the end of the drawn string. Depending on the font selected with the font() method, this will use either a bitmapped GD font or a TrueType font. The angle of the pen will be consulted when drawing the text. For TrueType fonts, any angle is accepted. For GD bitmapped fonts, the angle can be either 0 (draw horizontal) or -90 (draw upwards).
For consistency between the TrueType and GD font behavior, the string is always drawn so that the current position of the pen corresponds to the bottom left of the first character of the text. This is different from the GD behavior, in which the first character of bitmapped fonts hangs down from the pen point.
This method returns a polygon indicating the bounding box of the rendered text. If an error occurred (such as invalid font specification) it returns undef and an error message in $@.
$metrics = $img->fontMetrics
($metrics,$width,$height) = GD::Simple->fontMetrics($font,$fontsize,$string)
This method returns information about the current font, most commonly a TrueType font. It can be invoked as an instance method (on a previously-created GD::Simple object) or as a class method (on the GD::Simple class).
When called as an instance method, fontMetrics() takes no arguments and returns a single hash reference containing the metrics that describe the currently selected font and size. The hash reference contains the following information:
xheight the base height of the font from the bottom to the top of
a lowercase m
ascent the length of the upper stem of the lowercase d
descent the length of the lower step of the lowercase j
lineheight the distance from the bottom of the j to the top of
the d
leading the distance between two adjacent lines
($delta_x,$delta_y)= $img->stringBounds($string)
This method indicates the X and Y offsets (which may be negative) that will occur when the given string is drawn using the current font, fontsize and angle. When the string is drawn horizontally, it gives the width and height of the strings bounding box.
$delta_x = $img->stringWidth($string)
This method indicates the width of the string given the current font, fontsize and angle. It is the same as ($img->stringBounds($string))[0]
($x,$y) = $img->curPos
Return the current position of the pen. Set the current position using moveTo().
$font = $img->font([$newfont] [,$newsize])
Get or set the current font. Fonts can be GD::Font objects, TrueType font file paths, or fontconfig font patterns like "Times:italic" (see fontconfig). The latter feature requires that you have the fontconfig library installed and are using libgd version 2.0.33 or higher.
As a shortcut, you may pass two arguments to set the font and the fontsize simultaneously. The fontsize is only valid when drawing with TrueType fonts.
$size = $img->fontsize([$newfontsize])
Get or set the current font size. This is only valid for TrueType fonts.
$size = $img->penSize([$newpensize])
Get or set the current pen width for use during line drawing operations.
$angle = $img->angle([$newangle])
Set the current angle for use when calling line() or move() with a single argument.
Here is an example of using turn() and angle() together to draw an octagon. The first line drawn is the downward-slanting top right edge. The last line drawn is the horizontal top of the octagon.
$img->moveTo(200,50);
$img->angle(0);
$img->turn(360/8);
for (1..8) { $img->line(50) }
$angle = $img->turn([$newangle])
Get or set the current angle to turn prior to drawing lines. This value is only used when calling line() or move() with a single argument. The turning angle will be applied to each call to line() or move() just before the actual drawing occurs.
Angles are in degrees. Positive values turn the angle clockwise.
$color = $img->fgcolor([$newcolor])
Get or set the pens foreground color. The current pen color can be set by (1) using an (r,g,b) triple; (2) using a previously-allocated color from the GD palette; or (3) by using a symbolic color name such as "chartreuse." The list of color names can be obtained using color_names().
$color = $img->bgcolor([$newcolor])
Get or set the pens background color. The current pen color can be set by (1) using an (r,g,b) triple; (2) using a previously-allocated color from the GD palette; or (3) by using a symbolic color name such as "chartreuse." The list of color names can be obtained using color_names().
$index = $img->translate_color(@args)
Translates a color into a GD palette or TrueColor index. You may pass either an (r,g,b) triple or a symbolic color name. If you pass a previously-allocated index, the method will return it unchanged.
$index = $img->alphaColor(@args,$alpha)
Creates an alpha color. You may pass either an (r,g,b) triple or a symbolic color name, followed by an integer indicating its opacity. The opacity value ranges from 0 (fully opaque) to 127 (fully transparent).
@names = GD::Simple->color_names
$translate_table = GD::Simple->color_names
Called in a list context, color_names() returns the list of symbolic color names recognized by this module. Called in a scalar context, the method returns a hash reference in which the keys are the color names and the values are array references containing [r,g,b] triples.
$gd = $img->gd
Return the internal GD::Image object. Usually you will not need to call this since all GD methods are automatically referred to this object.
($red,$green,$blue) = GD::Simple->HSVtoRGB($hue,$saturation,$value)
Convert a Hue/Saturation/Value (HSV) color into an RGB triple. The hue, saturation and value are integers from 0 to 255.
($hue,$saturation,$value) = GD::Simple->RGBtoHSV($hue,$saturation,$value)
Convert a Red/Green/Blue (RGB) value into a Hue/Saturation/Value (HSV) triple. The hue, saturation and value are integers from 0 to 255.
COLORS
This script will create an image showing all the symbolic colors.
#!/usr/bin/perl
use strict;
use GD::Simple;
my @color_names = GD::Simple->color_names;
my $cols = int(sqrt(@color_names));
my $rows = int(@color_names/$cols)+1;
my $cell_width = 100;
my $cell_height = 50;
my $legend_height = 16;
my $width = $cols * $cell_width;
my $height = $rows * $cell_height;
my $img = GD::Simple->new($width,$height);
$img->font(gdSmallFont);
for (my $c=0; $cfgcolor($color);
$img->rectangle(@topleft,@botright);
$img->moveTo($topleft[0]+2,$botright[1]+$legend_height-2);
$img->fgcolor(black);
$img->string($color);
}
}
print $img->png;
Download (0.25MB)
Added: 2007-07-23 License: Perl Artistic License Price:
825 downloads
Ygl 4.1f
Ygl emulates SGIs GL routines under X11. more>>
Ygl emulates SGIs GL routines under X11. It compiles fine under AIX >3.2, HP-UX >7.0, Linux with XFree/Xorg, SunOS, ConvexOS, Mac A/UX, Mac OS/X and many others, but needs an ANSI-C compiler (gcc is ok). The library was written for two reasons:
On our RS/6000 GT4 hardware, 2D Ygl is up to twenty times faster (circf()) than GL (strange, isnt it?...)
2D (and 3D using OpenGL) graphics runs on non GL hardware and even on remote X-Servers.
Included are most of the two-dimensional graphics routines, the queue device routines, the query routines, doublebuffering, RGB mode with dithering, window attribute routines, FORTRAN bindings and more (see below).
3D stuff was added with version 4.0 using OpenGL calls.
Since Version 2.8, all Ygl functions do have a FORTRAN interface. The FORTRAN versions of all functions have an underscore appended, so the FORTRAN compiler must append a _ to all function names. f2c does this, xlf (under AIX 3.2) requires the option -qextname. See smile_f77.f for an example program. Set FortranBindings to 0 in Imakefile or change Makefile.std if you dont want these bindings. FORTRAN bindings are not tested because I have no programs.f to test. If you find bugs, feel free to report them to me.
You can always find the latest version of Ygl in the directory ftp.thp.Uni-Duisburg.de/pub/source/X11/.
Note that perl, python and tcl bindings for Ygl are available here thanks to Prabhu Ramachandran.
Enhancements:
- Added gsync() (only works with OpenGL bindings).
- Added {XY}MAXSCREEN macro
- Removed poly*() from Ygl.h, as they are not implemented yet.
<<lessOn our RS/6000 GT4 hardware, 2D Ygl is up to twenty times faster (circf()) than GL (strange, isnt it?...)
2D (and 3D using OpenGL) graphics runs on non GL hardware and even on remote X-Servers.
Included are most of the two-dimensional graphics routines, the queue device routines, the query routines, doublebuffering, RGB mode with dithering, window attribute routines, FORTRAN bindings and more (see below).
3D stuff was added with version 4.0 using OpenGL calls.
Since Version 2.8, all Ygl functions do have a FORTRAN interface. The FORTRAN versions of all functions have an underscore appended, so the FORTRAN compiler must append a _ to all function names. f2c does this, xlf (under AIX 3.2) requires the option -qextname. See smile_f77.f for an example program. Set FortranBindings to 0 in Imakefile or change Makefile.std if you dont want these bindings. FORTRAN bindings are not tested because I have no programs.f to test. If you find bugs, feel free to report them to me.
You can always find the latest version of Ygl in the directory ftp.thp.Uni-Duisburg.de/pub/source/X11/.
Note that perl, python and tcl bindings for Ygl are available here thanks to Prabhu Ramachandran.
Enhancements:
- Added gsync() (only works with OpenGL bindings).
- Added {XY}MAXSCREEN macro
- Removed poly*() from Ygl.h, as they are not implemented yet.
Download (0.13MB)
Added: 2006-07-15 License: GPL (GNU General Public License) Price:
1201 downloads
PDL::Graphics::X 0.04
PDL::Graphics::X is a PDL OO access to X windows. more>>
PDL::Graphics::X is a PDL OO access to X windows.
SYNOPSIS
# example 1
use PDL;
use PDL::Graphics::X;
my $x_size = 255; my $y_size = 255;
my $win1 = PDL::Graphics::X->new({SIZE_X => $x_size, SIZE_Y => $y_size});
my $a = xvals(zeroes(byte,$x_size,$y_size));
$win1->imag($a);
# example 2
use PDL;
use PDL::Graphics::X;
my $win1 = PDL::Graphics::X->new({WIN_TITLE => "PDL", SIZE_X => 210, SIZE_Y => 210});
my $x = pdl(10, 100, 100, 10);
my $y = pdl(10, 10, 100, 100);
$win1->line($x, $y, {COLOR => [1,0,0], LINEWIDTH => 5});
This module interfaces PDL directly to X windows in a OO fashion. Each X object has an associated X window and handles opening, closing and drawing in the associated window. Hopefully it is reasonably intuitive to use. The vision is that this will serve as a base upon which other fully native PDL graphics modules could be built.
Common options such as LINEWIDTH are remembered from function call to function call, i.e. if you call $win1->line($x, $y, {COLOR => [1,0,0], LINEWIDTH => 5}) then the rectangle drawn by $win1->rect(10, 10, 190, 190) will also have a red border of width equal to 5.
FUNCTIONS
new
Constructor for a new X window object.
Usage: my $win1 = PDL::Graphics::X->new(); # open the window with the defaults
Usage: my $win1 = PDL::Graphics::X->new({WIN_TITLE => "PDL", SIZE_X => 210, SIZE_Y => 210});
Creates a new X object & its associated X window.
Options recognized :
SIZE_X - window x size in pixels (default = 400)
SIZE_Y - window y size in pixels (default = 300)
WIN_TITLE - A title for the window, if desired (default = "X")
BACK_COLOR - [r, g, b] the windows background color (default = [1.0, 1.0, 1.0], i.e. white)
imag
Display a PDL as a bitmap.
Usage: $win1->imag($my_img); # display an image with default size and scaling
Usage: $win1->imag($my_img, {AUTO_SCALE => 1.0}); # display an auto-scaled image
Displays a PDL as a bitmap. The PDL can be of size either (m,n) or (m,n,3). PDLs of size (m,n) are converted to indexed color based on the current color table (see ctab). PDLs of size (m,n,3) are displayed as true-color images with the last dimension specifying the color (RGB). Unless a re-scaling is specified, the minimum value displayed is 0.0 and the maximum is 255.0. If the PDL is larger then the window then the window will be re-scaled to accomodate the PDL;
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)
MIN - the minimum value to be displayed (default = 0.0)
MAX - the maximum value to be displayed (default = 255.0)
ctab
Set the color table
Usage: $win1->ctab(cat(lut_data(idl5))); # set the color table to idl5
Makes 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.
line
Draws a vector as connected points.
Usage: $win1->line($x, $y, {COLOR => [0,0,0], LINEWIDTH => 5}); # draw black line of width 5
Draw a poly-line between a set of points given by two PDLs of size (n). The first PDL gives the x position & the second piddle gives the y position of the individual points, n is the total number of points.
Options recognized
LINEWIDTH - line width
LINESTYLE - line style (0 = normal, 1 = dashed)
COLOR - [r, g, b] color of the line
rect
Draws a rectangle.
Usage: $win1->rect($x1, $y1, $x2, $y2);
Draws a rectangle with corners at ($x1, $y1) and ($x2, $y2).
Options recognized
LINEWIDTH - line width
LINESTYLE - line style (0 = normal, 1 = dashed)
COLOR - [r, g, b] color of the line
circle
Draws a circle.
Usage: $win1->circle($x, $y, $r);
Draws a circle centered at ($x, $y) with radius $r.
Options recognized
LINEWIDTH - line width
LINESTYLE - line style (0 = normal, 1 = dashed)
COLOR - [r, g, b] color of the line
ellipse
Draws an oval.
Usage: $win1->ellipse($x, $y, $a, $b);
Draws a oval centered at ($x, $y) with x size $a and y size $b.
Options recognized
LINEWIDTH - line width
LINESTYLE - line style (0 = normal, 1 = dashed)
COLOR - [r, g, b] color of the line
erase
Erases the contents of the window.
Usage: $win1->erase();
Resets the contents of the window to the background color.
text
Draw text
Usage: $win1->text("hello", $x, $y, $angle);
Draws text starting at $x and $y with baseline angle given by $angle. If you know how to draw truly rotated text in X, please let me know. How fonts are currently dealt with is imperfect at best. So that the font size can easily be changed, a search is performed for a scalable font with specified font name. If such a font cannot be found then the text will be displayed with the default X font and no font scaling.
Options recognized
FONT_NAME - name of the font family (default = "courier")
CHARSIZE - desired font size in points
COLOR - [r, g, b] color of the font
cursor
Returns the location of next mouse click in the window
Usage : my($x,$y) = $win1->cursor();
Returns the x & y locations of the next mouse click in the window.
we_exist
Returns 0 if the window still exists, 1 if it does not
Usage : my $exists = $win1->we_exist();
Originally written to help debug some problems with associated with X windows being closed by the user with a mouse. Preserved on the off chance that it will be useful to a dependent module.
winsize
Returns the window size & maximum window size (in pixels) in x and y
Usage : my ($win_x, $win_y, $max_x, $max_y) = $win1->winsize();
Primarily intended for use by dependent modules that might want to know what the current and maximum window size is.
resize
resizes a window & returns the new size (which might not be what you requested)
Usage : my ($new_x, $new_y) = $win1->resize($size_x, $size_y);
Primarily intended for use by dependent modules that might want to resize a window without destroying it and creating another one.
<<lessSYNOPSIS
# example 1
use PDL;
use PDL::Graphics::X;
my $x_size = 255; my $y_size = 255;
my $win1 = PDL::Graphics::X->new({SIZE_X => $x_size, SIZE_Y => $y_size});
my $a = xvals(zeroes(byte,$x_size,$y_size));
$win1->imag($a);
# example 2
use PDL;
use PDL::Graphics::X;
my $win1 = PDL::Graphics::X->new({WIN_TITLE => "PDL", SIZE_X => 210, SIZE_Y => 210});
my $x = pdl(10, 100, 100, 10);
my $y = pdl(10, 10, 100, 100);
$win1->line($x, $y, {COLOR => [1,0,0], LINEWIDTH => 5});
This module interfaces PDL directly to X windows in a OO fashion. Each X object has an associated X window and handles opening, closing and drawing in the associated window. Hopefully it is reasonably intuitive to use. The vision is that this will serve as a base upon which other fully native PDL graphics modules could be built.
Common options such as LINEWIDTH are remembered from function call to function call, i.e. if you call $win1->line($x, $y, {COLOR => [1,0,0], LINEWIDTH => 5}) then the rectangle drawn by $win1->rect(10, 10, 190, 190) will also have a red border of width equal to 5.
FUNCTIONS
new
Constructor for a new X window object.
Usage: my $win1 = PDL::Graphics::X->new(); # open the window with the defaults
Usage: my $win1 = PDL::Graphics::X->new({WIN_TITLE => "PDL", SIZE_X => 210, SIZE_Y => 210});
Creates a new X object & its associated X window.
Options recognized :
SIZE_X - window x size in pixels (default = 400)
SIZE_Y - window y size in pixels (default = 300)
WIN_TITLE - A title for the window, if desired (default = "X")
BACK_COLOR - [r, g, b] the windows background color (default = [1.0, 1.0, 1.0], i.e. white)
imag
Display a PDL as a bitmap.
Usage: $win1->imag($my_img); # display an image with default size and scaling
Usage: $win1->imag($my_img, {AUTO_SCALE => 1.0}); # display an auto-scaled image
Displays a PDL as a bitmap. The PDL can be of size either (m,n) or (m,n,3). PDLs of size (m,n) are converted to indexed color based on the current color table (see ctab). PDLs of size (m,n,3) are displayed as true-color images with the last dimension specifying the color (RGB). Unless a re-scaling is specified, the minimum value displayed is 0.0 and the maximum is 255.0. If the PDL is larger then the window then the window will be re-scaled to accomodate the PDL;
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)
MIN - the minimum value to be displayed (default = 0.0)
MAX - the maximum value to be displayed (default = 255.0)
ctab
Set the color table
Usage: $win1->ctab(cat(lut_data(idl5))); # set the color table to idl5
Makes 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.
line
Draws a vector as connected points.
Usage: $win1->line($x, $y, {COLOR => [0,0,0], LINEWIDTH => 5}); # draw black line of width 5
Draw a poly-line between a set of points given by two PDLs of size (n). The first PDL gives the x position & the second piddle gives the y position of the individual points, n is the total number of points.
Options recognized
LINEWIDTH - line width
LINESTYLE - line style (0 = normal, 1 = dashed)
COLOR - [r, g, b] color of the line
rect
Draws a rectangle.
Usage: $win1->rect($x1, $y1, $x2, $y2);
Draws a rectangle with corners at ($x1, $y1) and ($x2, $y2).
Options recognized
LINEWIDTH - line width
LINESTYLE - line style (0 = normal, 1 = dashed)
COLOR - [r, g, b] color of the line
circle
Draws a circle.
Usage: $win1->circle($x, $y, $r);
Draws a circle centered at ($x, $y) with radius $r.
Options recognized
LINEWIDTH - line width
LINESTYLE - line style (0 = normal, 1 = dashed)
COLOR - [r, g, b] color of the line
ellipse
Draws an oval.
Usage: $win1->ellipse($x, $y, $a, $b);
Draws a oval centered at ($x, $y) with x size $a and y size $b.
Options recognized
LINEWIDTH - line width
LINESTYLE - line style (0 = normal, 1 = dashed)
COLOR - [r, g, b] color of the line
erase
Erases the contents of the window.
Usage: $win1->erase();
Resets the contents of the window to the background color.
text
Draw text
Usage: $win1->text("hello", $x, $y, $angle);
Draws text starting at $x and $y with baseline angle given by $angle. If you know how to draw truly rotated text in X, please let me know. How fonts are currently dealt with is imperfect at best. So that the font size can easily be changed, a search is performed for a scalable font with specified font name. If such a font cannot be found then the text will be displayed with the default X font and no font scaling.
Options recognized
FONT_NAME - name of the font family (default = "courier")
CHARSIZE - desired font size in points
COLOR - [r, g, b] color of the font
cursor
Returns the location of next mouse click in the window
Usage : my($x,$y) = $win1->cursor();
Returns the x & y locations of the next mouse click in the window.
we_exist
Returns 0 if the window still exists, 1 if it does not
Usage : my $exists = $win1->we_exist();
Originally written to help debug some problems with associated with X windows being closed by the user with a mouse. Preserved on the off chance that it will be useful to a dependent module.
winsize
Returns the window size & maximum window size (in pixels) in x and y
Usage : my ($win_x, $win_y, $max_x, $max_y) = $win1->winsize();
Primarily intended for use by dependent modules that might want to know what the current and maximum window size is.
resize
resizes a window & returns the new size (which might not be what you requested)
Usage : my ($new_x, $new_y) = $win1->resize($size_x, $size_y);
Primarily intended for use by dependent modules that might want to resize a window without destroying it and creating another one.
Download (0.010MB)
Added: 2007-07-09 License: Perl Artistic License Price:
837 downloads
lhs2tex 1.9
lhs2tex is a preprocessor to generate LaTeX from literate Haskell sources. more>>
lhs2TeX is a preprocessor to generate LaTeX code from literate Haskell sources.
Main features:
- Different styles to process your source file: for instance, "tt" style uses a monospaced font for the code while still allowing you to highlight keywords etc, whereas "poly" style uses proportional fonts for identifiers, handles indentation nicely, is able to replace binary operators by mathematical symbols and take care of complex horizontal alignments.
- Formatting directives, which let you customize the way certain tokens in the source code should appear in the processed output.
- A liberal parser that can handle most of the language extensions; you dont have to restrict yourself to Haskell 98.
- Preprocessor-style conditionals that allow you to generate different versions of a document from a single source file (for instance, a paper and a presentation).
- Active documents: you can use Haskell to generate parts of the document (useful for papers on Haskell).
- A manual explaining all the important aspects of lhs2TeX.
<<lessMain features:
- Different styles to process your source file: for instance, "tt" style uses a monospaced font for the code while still allowing you to highlight keywords etc, whereas "poly" style uses proportional fonts for identifiers, handles indentation nicely, is able to replace binary operators by mathematical symbols and take care of complex horizontal alignments.
- Formatting directives, which let you customize the way certain tokens in the source code should appear in the processed output.
- A liberal parser that can handle most of the language extensions; you dont have to restrict yourself to Haskell 98.
- Preprocessor-style conditionals that allow you to generate different versions of a document from a single source file (for instance, a paper and a presentation).
- Active documents: you can use Haskell to generate parts of the document (useful for papers on Haskell).
- A manual explaining all the important aspects of lhs2TeX.
Download (0.51MB)
Added: 2005-04-13 License: GPL (GNU General Public License) Price:
1658 downloads
Adobe Source Libraries 1.0.29
The Adobe Source Libraries (ASL) are a collection of C++ libraries to allow the construction of commercial application. more>>
The Adobe Source Libraries (ASL) are a collection of C++ libraries building foundation technology to allow the construction of commercial applications by assembling generic algorithms through declarative descriptions.
Enhancements:
- GIL version 2.1 (support for sub-byte aligned pixel values in images).
- An ASL version_0 namespace has been introduced to maintain binary compatibility going forward.
- There are poly< > library improvements. adobe/vector.hpp and adobe/closed_hash.hpp have been added as generic containers.
- There are many other improvements.
<<lessEnhancements:
- GIL version 2.1 (support for sub-byte aligned pixel values in images).
- An ASL version_0 namespace has been introduced to maintain binary compatibility going forward.
- There are poly< > library improvements. adobe/vector.hpp and adobe/closed_hash.hpp have been added as generic containers.
- There are many other improvements.
Download (8.2MB)
Added: 2007-07-16 License: MIT/X Consortium License Price:
831 downloads
PDL::Graphics::AquaTerm 0.02
PDL::Graphics::AquaTerm is a Perl module that provides access to the AquaTerm Mac OS-X graphics terminal. more>>
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.
FUNCTIONS
aquaOpen
Open a new AquaTerm window
Usage: aquaOpen(); # open the window with the defaults
Usage: aquaOpen({SIZE_X => 200, SIZE_Y => 200, BACK_COLOR => [0.0, 0.0, 0.0]});
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 - [r, g, b] the windows background color (default = [1.0, 1.0, 1.0], 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)
aquaBitmap
Display 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 => [1.0, 0.0, 0.0]});
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 = [0.0, 0.0, 0.0], i.e. black)
aquaSetColorTable
Set the color table
Usage: aquaSetColorTable(cat(lut_data(idl5))); # set the color table to idl5
Makes 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.
aquaPolyLine
Draws a (2,n) PDL as a line
Usage: aquaPolyLine($line, {WIDTH => 3, COLOR => [0.0, 0.0, 0.0]}); # draw $line black with width 3
Draw 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, Im still unsure exactly what this is... COLOR - RGB color of the line (default is black)
aquaText
Draw text
# draw red hello world at position 20, 30 in the current window
Usage: aquaText("hello world", X => 20, Y => 30, COLOR => [1.0, 0.0, 0.0]);
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 ref
Returns 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
<<lessSYNOPSIS
# 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.
FUNCTIONS
aquaOpen
Open a new AquaTerm window
Usage: aquaOpen(); # open the window with the defaults
Usage: aquaOpen({SIZE_X => 200, SIZE_Y => 200, BACK_COLOR => [0.0, 0.0, 0.0]});
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 - [r, g, b] the windows background color (default = [1.0, 1.0, 1.0], 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)
aquaBitmap
Display 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 => [1.0, 0.0, 0.0]});
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 = [0.0, 0.0, 0.0], i.e. black)
aquaSetColorTable
Set the color table
Usage: aquaSetColorTable(cat(lut_data(idl5))); # set the color table to idl5
Makes 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.
aquaPolyLine
Draws a (2,n) PDL as a line
Usage: aquaPolyLine($line, {WIDTH => 3, COLOR => [0.0, 0.0, 0.0]}); # draw $line black with width 3
Draw 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, Im still unsure exactly what this is... COLOR - RGB color of the line (default is black)
aquaText
Draw text
# draw red hello world at position 20, 30 in the current window
Usage: aquaText("hello world", X => 20, Y => 30, COLOR => [1.0, 0.0, 0.0]);
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 ref
Returns 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
Download (0.008MB)
Added: 2007-08-14 License: Perl Artistic License Price:
801 downloads
JMathLib 0.8.0
JMathLib is a Java Clone of Octave, SciLab and Matlab. more>>
JMathLib project is a Java Clone of Octave, SciLab and Matlab. A library of mathematical functions designed to be used in evaluating complex expressions and display the results graphically. It will be used either interactively through a terminal like window or to interpret script files.
It is intended to be a java version of programs such as MatLab, Octave and Scilab.
Enhancements:
- New functions: _class.java, angle.java, bench.m, beta.m, betaln.m, center.m, class.m, cloglog.m, close.java, compan.m, complement.m, cov.m, createnewfile.java, cumprod.java, cumsum.m, create_set.m, conj.java, delete.java, det.m, dot.m, eq.m, false.m, gammaln.m, ge.m, gray2ind.m, gray.m, gt.m, hankel.m, hurst.m, inf.java, int16.java, int32.java, int64.java, int8.java, inv.m, is_leap_year.m, isa.java, isdefinite.m, isdirectory.java, isfile.java, isfinite.java, ishidden.java, islogical.java, isnan.java, isinf.java, issymmetric.m, lastmodified.java, le.m, loadvariables.java, logical.java, logspace.m, lookup.m, mean.m, meansq.java, mkdir.java, nan.java, ne.m, npv.m, nthroot.m, ntsc2rgb.m, nper.m, numel.java, orth.m, pascal.m, perms.m, pmt.m, polyval.m, polyreduce.m, poly.m, print_usage.java, pv.m, pvl.m, qconj.m, qderiv.m, qderivmat.m, qinv.m, qmult.m, qtrans.m, qtransv.m, qtransvmat.m, quaternion.m, randperm.m, rehash.java, repmat.java, rmdir.java, roots.m, save_variables.java, size_equal.m, sort.java, std.m, stril.m, sylvester_matrix.m, toeplitz.m, triangle_lw.m, triangle_sw.m, triu.m, true.m, uint8.java, union.m, var.m, vech.m, wilkinson.m
- Updated functions: col.m, diag.java, ndims.java, imag.java, isempty.java, ones.java, rand.java, real.java, row.m, size.java, tic.java, whos.java, zeros.java All trigonometric functions have been updated
<<lessIt is intended to be a java version of programs such as MatLab, Octave and Scilab.
Enhancements:
- New functions: _class.java, angle.java, bench.m, beta.m, betaln.m, center.m, class.m, cloglog.m, close.java, compan.m, complement.m, cov.m, createnewfile.java, cumprod.java, cumsum.m, create_set.m, conj.java, delete.java, det.m, dot.m, eq.m, false.m, gammaln.m, ge.m, gray2ind.m, gray.m, gt.m, hankel.m, hurst.m, inf.java, int16.java, int32.java, int64.java, int8.java, inv.m, is_leap_year.m, isa.java, isdefinite.m, isdirectory.java, isfile.java, isfinite.java, ishidden.java, islogical.java, isnan.java, isinf.java, issymmetric.m, lastmodified.java, le.m, loadvariables.java, logical.java, logspace.m, lookup.m, mean.m, meansq.java, mkdir.java, nan.java, ne.m, npv.m, nthroot.m, ntsc2rgb.m, nper.m, numel.java, orth.m, pascal.m, perms.m, pmt.m, polyval.m, polyreduce.m, poly.m, print_usage.java, pv.m, pvl.m, qconj.m, qderiv.m, qderivmat.m, qinv.m, qmult.m, qtrans.m, qtransv.m, qtransvmat.m, quaternion.m, randperm.m, rehash.java, repmat.java, rmdir.java, roots.m, save_variables.java, size_equal.m, sort.java, std.m, stril.m, sylvester_matrix.m, toeplitz.m, triangle_lw.m, triangle_sw.m, triu.m, true.m, uint8.java, union.m, var.m, vech.m, wilkinson.m
- Updated functions: col.m, diag.java, ndims.java, imag.java, isempty.java, ones.java, rand.java, real.java, row.m, size.java, tic.java, whos.java, zeros.java All trigonometric functions have been updated
Download (3.0MB)
Added: 2007-06-05 License: LGPL (GNU Lesser General Public License) Price:
903 downloads
OpenArena 0.7.0
OpenArena is an open-source content package for Quake III Arena. more>>
OpenArena is an open-source content package for Quake III Arena licensed under the GPL, effectively creating a free stand-alone game.
The art direction of Open Arena is about "double" as Quake III Arena:
- double texture resolution, i.e. 512x512 as opposed to a 256x256
- double the polycount of models, instead of 700-900 youll have 1200-2000 poly players
- Sound is probably mixed in 44khz rather than 22khz, but I dunno about that as 44khz seems to crash Q3A at this moment
Hopefully the detail should still be scalable with texture resolution and LoDs for slower computers (read: my p100 with voodoo2)
Concepts would be loose, so dont expect a remake of Klesk in his original Klesk form, or any direct remakes of any map/weapon/model.
<<lessThe art direction of Open Arena is about "double" as Quake III Arena:
- double texture resolution, i.e. 512x512 as opposed to a 256x256
- double the polycount of models, instead of 700-900 youll have 1200-2000 poly players
- Sound is probably mixed in 44khz rather than 22khz, but I dunno about that as 44khz seems to crash Q3A at this moment
Hopefully the detail should still be scalable with texture resolution and LoDs for slower computers (read: my p100 with voodoo2)
Concepts would be loose, so dont expect a remake of Klesk in his original Klesk form, or any direct remakes of any map/weapon/model.
Download (250.9MB)
Added: 2007-07-08 License: GPL (GNU General Public License) Price:
559 downloads
PDL::Graphics::PGPLOT::Window 2.3.2
PDL::Graphics::PGPLOT::Window is a OO interface to PGPLOT windows. more>>
PDL::Graphics::PGPLOT::Window is a OO interface to PGPLOT windows.
SYNOPSIS
perldl> use PDL::Graphics::PGPLOT::Window
perldl> $win = PDL::Graphics::PGPLOT::Window->new(Device => /xs);
perldl> $a = pdl [1..100]
perldl> $b = sqrt($a)
perldl> $win->line($b)
perldl> $win->hold()
perldl> $c = sin($a/10)*2 + 4
perldl> $win->line($c)
In the following documentation the commands are not shown in their OO versions. This is for historical reasons and should not cause too much trouble.
This package offers a OO interface to the PGPLOT plotting package. This is intended to replace the traditional interface in PDL::Graphics::PGPLOT and contains interfaces to a large number of PGPLOT routines. Below the usage examples for each function tend to be given in the non-OO version for historical reasons. This will slowly be changed, but in the meantime refer to the section on OO-interface below to see how to convert the usage information below to OO usage (it is totally trivial).
PDL::Graphics::PGPLOT::Window is an interface to the PGPLOT graphical libraries.
The list of currently availably methods:
imag - Display an image (uses pgimag()/pggray() as appropriate)
ctab - Load an image colour table
ctab_info - Get information about currently loaded colour table
line - Plot vector as connected points
points - Plot vector as points
errb - Plot error bars
cont - Display image as contour map
bin - Plot vector as histogram (e.g. bin(hist($data)) )
hi2d - Plot image as 2d histogram (not very good IMHO...)
poly - Draw a polygon
vect - Display 2 images as a vector field
text - Write text in the plot area
label_axes - Print axis titles
legend - Create a legend with different texts, linestyles etc.
cursor - Interactively read cursor positions.
circle - Draw a circle
ellipse - Draw an ellipse.
Device manipulation commands:
new - Constructor for a new PGPLOT output device
close - Close a PGPLOT output device
focus - Set focus to the given device. This should normally be
done behind the scenes.
hold - Hold current plot window range - allows overlays etc.
release - Release back to autoscaling of new plot window for each
command
held - Returns true if the graphics is held on the current device.
env - Define a plot window, put on hold
panel - Move to a specified plot panel when several panels are defined.
erase - Erase the current window (or panel)
options - Get the options set for the present output device
id - The ID for the device
device - The device type
name - The window name
Notes: $transform for image/cont etc. is used in the same way as the TR() array in the underlying PGPLOT FORTRAN routine but is, fortunately, zero-offset. The transform() routine can be used to create this piddle.
For completeness: The transformation array connect the pixel index to a world coordinate such that:
X = tr[0] + tr[1]*i + tr[2]*j
Y = tr[3] + tr[4]*i + tr[5]*j
<<lessSYNOPSIS
perldl> use PDL::Graphics::PGPLOT::Window
perldl> $win = PDL::Graphics::PGPLOT::Window->new(Device => /xs);
perldl> $a = pdl [1..100]
perldl> $b = sqrt($a)
perldl> $win->line($b)
perldl> $win->hold()
perldl> $c = sin($a/10)*2 + 4
perldl> $win->line($c)
In the following documentation the commands are not shown in their OO versions. This is for historical reasons and should not cause too much trouble.
This package offers a OO interface to the PGPLOT plotting package. This is intended to replace the traditional interface in PDL::Graphics::PGPLOT and contains interfaces to a large number of PGPLOT routines. Below the usage examples for each function tend to be given in the non-OO version for historical reasons. This will slowly be changed, but in the meantime refer to the section on OO-interface below to see how to convert the usage information below to OO usage (it is totally trivial).
PDL::Graphics::PGPLOT::Window is an interface to the PGPLOT graphical libraries.
The list of currently availably methods:
imag - Display an image (uses pgimag()/pggray() as appropriate)
ctab - Load an image colour table
ctab_info - Get information about currently loaded colour table
line - Plot vector as connected points
points - Plot vector as points
errb - Plot error bars
cont - Display image as contour map
bin - Plot vector as histogram (e.g. bin(hist($data)) )
hi2d - Plot image as 2d histogram (not very good IMHO...)
poly - Draw a polygon
vect - Display 2 images as a vector field
text - Write text in the plot area
label_axes - Print axis titles
legend - Create a legend with different texts, linestyles etc.
cursor - Interactively read cursor positions.
circle - Draw a circle
ellipse - Draw an ellipse.
Device manipulation commands:
new - Constructor for a new PGPLOT output device
close - Close a PGPLOT output device
focus - Set focus to the given device. This should normally be
done behind the scenes.
hold - Hold current plot window range - allows overlays etc.
release - Release back to autoscaling of new plot window for each
command
held - Returns true if the graphics is held on the current device.
env - Define a plot window, put on hold
panel - Move to a specified plot panel when several panels are defined.
erase - Erase the current window (or panel)
options - Get the options set for the present output device
id - The ID for the device
device - The device type
name - The window name
Notes: $transform for image/cont etc. is used in the same way as the TR() array in the underlying PGPLOT FORTRAN routine but is, fortunately, zero-offset. The transform() routine can be used to create this piddle.
For completeness: The transformation array connect the pixel index to a world coordinate such that:
X = tr[0] + tr[1]*i + tr[2]*j
Y = tr[3] + tr[4]*i + tr[5]*j
Download (1.1MB)
Added: 2007-07-06 License: Perl Artistic License Price:
842 downloads
Image::Imlib2 1.13
Image::Imlib2 is a Perl interface to the Imlib2 image library. more>>
Image::Imlib2 is a Perl interface to the Imlib2 image library.
SYNOPSIS
use Image::Imlib2;
# create a new image
my $image = Image::Imlib2->new(200, 200);
# or load an image
$image = Image::Imlib2->load("foo.png");
# Enable the alpha channel support
$image->has_alpha(1);
# set a colour (rgba, so this is transparent orange)
$image->set_color(255, 127, 0, 127);
# draw a rectangle
$image->draw_rectangle(50, 50, 50, 50);
# draw a filled rectangle
$image->fill_rectangle(150, 50, 50, 50);
# draw a line
$image->draw_line(0, 0, 200, 50);
# set quality before saving
$image->set_quality(50);
# save out
$image->save(out.png);
# create a polygon
my $poly = Image::Imlib2::Polygon->new();
# add some points
$poly->add_point(0, 0);
$poly->add_point(100, 0);
$poly->add_point(100, 100);
$poly->add_point(0, 100);
# fill the polygon
$poly->fill();
# draw it closed on image
$image->draw_polygon($poly, 1);
# create a color range
my $cr = Image::Imlib2::ColorRange->new();
# add a color
my ($distance, $red, $green, $blue, $alpha) = (15, 200, 100, 50, 20);
$cr->add_color($distance, $red, $green, $blue, $alpha);
# draw it
my($x, $y, $width, $height, $angle) = (20, 30, 200, 200, 1);
$image->fill_color_range_rectangle($cr, $x, $y,
$width, $height, $angle);
Image::Imlib2 is a Perl port of Imlib2, a graphics library that does image file loading and saving as well as manipulation, arbitrary polygon support, etc. It does ALL of these operations FAST. It allows you to create colour images using a large number of graphics primitives, and output the images in a range of formats.
Image::Imlib2::Polygon and Image::Imlib2::ColorRange are described following Image::Imlib2 but may be referenced before their description.
Note that this is an early version of my attempt at a Perl interface to Imlib2. Currently, the API is just to test things out. Not everything is supported, but a great deal of functionality already exists. If you think the API can be tweaked to be a bit more intuitive, drop me a line!
Note that a development version of Imlib2 must be installed before installing this module.
<<lessSYNOPSIS
use Image::Imlib2;
# create a new image
my $image = Image::Imlib2->new(200, 200);
# or load an image
$image = Image::Imlib2->load("foo.png");
# Enable the alpha channel support
$image->has_alpha(1);
# set a colour (rgba, so this is transparent orange)
$image->set_color(255, 127, 0, 127);
# draw a rectangle
$image->draw_rectangle(50, 50, 50, 50);
# draw a filled rectangle
$image->fill_rectangle(150, 50, 50, 50);
# draw a line
$image->draw_line(0, 0, 200, 50);
# set quality before saving
$image->set_quality(50);
# save out
$image->save(out.png);
# create a polygon
my $poly = Image::Imlib2::Polygon->new();
# add some points
$poly->add_point(0, 0);
$poly->add_point(100, 0);
$poly->add_point(100, 100);
$poly->add_point(0, 100);
# fill the polygon
$poly->fill();
# draw it closed on image
$image->draw_polygon($poly, 1);
# create a color range
my $cr = Image::Imlib2::ColorRange->new();
# add a color
my ($distance, $red, $green, $blue, $alpha) = (15, 200, 100, 50, 20);
$cr->add_color($distance, $red, $green, $blue, $alpha);
# draw it
my($x, $y, $width, $height, $angle) = (20, 30, 200, 200, 1);
$image->fill_color_range_rectangle($cr, $x, $y,
$width, $height, $angle);
Image::Imlib2 is a Perl port of Imlib2, a graphics library that does image file loading and saving as well as manipulation, arbitrary polygon support, etc. It does ALL of these operations FAST. It allows you to create colour images using a large number of graphics primitives, and output the images in a range of formats.
Image::Imlib2::Polygon and Image::Imlib2::ColorRange are described following Image::Imlib2 but may be referenced before their description.
Note that this is an early version of my attempt at a Perl interface to Imlib2. Currently, the API is just to test things out. Not everything is supported, but a great deal of functionality already exists. If you think the API can be tweaked to be a bit more intuitive, drop me a line!
Note that a development version of Imlib2 must be installed before installing this module.
Download (0.026MB)
Added: 2007-08-14 License: Perl Artistic License Price:
805 downloads
MidiMountain 0.2.1
MidiMountain is a MIDI sequencer aimed to edit standard midi files. more>>
MidiMountain is a MIDI sequencer aimed to edit standard midi files. The easy to use interface should help even beginners to edit and create midi songs (sequences) with this application. For professionals, MidiMountain is designed to edit every definition known to standard midi files and the midi transfer protocol. From easy piano roll editing to changing binary system exclusive messages, MidiMountain is a complete and usable solution for every midi user.
Main features:
- Choose GUI language
- Select MIDI devices
- SMPTE/MTC or internal
- Load and save standard midi files 1 (single track) and 2 (multi track)
- Midi channel of event
- Time of event
- Duration and pitch
- Patch change
- Type and Values
- Single and poly
- Bend range of channel
Enhancements:
- Sequence/Overall
- Mapping Preset Editing
- Playback over Multi Devices Track
- Added Device Selection (over Port#)
- Color Setting
<<lessMain features:
- Choose GUI language
- Select MIDI devices
- SMPTE/MTC or internal
- Load and save standard midi files 1 (single track) and 2 (multi track)
- Midi channel of event
- Time of event
- Duration and pitch
- Patch change
- Type and Values
- Single and poly
- Bend range of channel
Enhancements:
- Sequence/Overall
- Mapping Preset Editing
- Playback over Multi Devices Track
- Added Device Selection (over Port#)
- Color Setting
Download (0.40MB)
Added: 2006-07-24 License: Freeware Price:
1187 downloads
Fract 0.5.15
Fract project is a Web-based fractal zoomer for the Mandelbrot set. more>>
Fract project is a Web-based fractal zoomer for the Mandelbrot set.
Its using poly-pen for rendering and Araneida for the web support.
There are no advanced features, the goal is to keep the code easy to read for someone interested in fractals.
The package also includes an offline renderer that you can use to generate hi resolution images of your favorite spots.
You can also play easily with the color map.
<<lessIts using poly-pen for rendering and Araneida for the web support.
There are no advanced features, the goal is to keep the code easy to read for someone interested in fractals.
The package also includes an offline renderer that you can use to generate hi resolution images of your favorite spots.
You can also play easily with the color map.
Download (0.010MB)
Added: 2006-11-14 License: GPL (GNU General Public License) Price:
1074 downloads
Secleted [ 0 ] software to compare
- Page: 1 of 1
- 1
Copyright Notice:
Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future software development. The above poly search only lists software in full, demo and trial versions for free download. Download links are directly from our mirror sites or publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed