GD::SIRDS

Create a GD image of a Single Image Random Dot Stereogram
Download

GD::SIRDS Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • David Hand
  • Publisher web site:
  • http://search.cpan.org/~cogent/

GD::SIRDS Tags


GD::SIRDS Description

Create a GD image of a Single Image Random Dot Stereogram GD::SIRDS is a Perl module that exports a single subroutine, gd_sirds, that produces a Single Image Random Dot Stereogram (SIRDS).gd_sirds MAP,COLORSgd_sirds MAP,COLORS,CIRCLESgd_sirds MAP,COLORS,CIRCLES,EYESEPgd_sirds MAP,COLORS,CIRCLES,EYESEP,FIELDDEPTH Create a Single Image Random Dot Stereogram based on the given depth MAP, with random dot colors selected from COLORS. The depth map can be either an instance of GD::Image or a reference to a two-dimensional array of numbers between 0 and 1, inclusive. Lighter colors (for GD::Images) and higher numbers (for arrays) stick out more from the background. COLORS is a reference to an array of RGB triples, each triple represented as an array of three integers between 0 and 255, as in GD(3). Set CIRCLES to true to put two circles at the bottom of the image representing the amount ones eyes need to diverge. (Aligning the circles so that the two become three should produce the proper divergence to see the stereogram.) EYESEP is the separation, in pixels, of the viewer's eyes. For a computer monitor, the default of 200 seems to work well. FIELDDEPTH is a bit trickier. Assume that the three-dimensional object displayed has an apparent distance from the viewer equal to twice the distance from the viewer to the screen. That is, the bottom of the object is as far behind the screen as the viewer is in front of the screen. In that case, the top of the three-dimensional object is FIELDDEPTH (default 1/3) of the way up back to the screen.SYNOPSIS use GD; use GD::SIRDS; my ($src, $dst, @colors); $src = GD->new("some.png"); @colors = ( , # basic black , # a nice grey , # a good dark blue-green , # another good blue-green ); $dst = gd_sirds($src, @colors); binmode STDOUT; print $dst->png; Requirements: · Perl


GD::SIRDS Related Software