Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    FigAnim 0.1

    Download button

    No screenshots available
    Downloads: 381  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    K. Imakita,Q. Lamerand and F. Perrin | More programs
    Perl Artistic License / FREE
    October 26th, 2007, 02:05 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    FigAnim description

    FigAnim is a XFig file animator class.

    FigAnim is a XFig file animator class.

    SYNOPSIS

    Here is a simple example where we first parse a file "file.fig". This file is supposed to contain an object named "Square" (in XFig the name of an object is it's commentary). Then this object translates according to vector (50px, 25px), the animation starts at t=0 second and it's duration is 1 second. In the end we generate an animated GIF file named "anim.gif", and a SVG+SMIL file named "anim.svg".

    use FigAnim;

    $fig_anim = new FigAnim;
    $fig_anim->parseFile("file.fig");

    $fig_anim->{objects}->{Square}->translate(0, 1, 50, 25, 'px');

    $fig_anim->generateGif("anim.gif", 12, 0);
    $fig_anim->generateSMIL("anim.svg");

    ABSTRACT

    FigAnim is a package which takes an existing FIG file (made by the XFig vector drawing program for example) and generates animations in animated GIF format and/or in SVG+SMIL format.

    Here are all the methods you can use in the package FigAnim :
    new(), parseFile(), writeFile(), setAttributevalue(), setPenColor(), setFillColor(), hide(), show(), changeThickness(), changeFillIntensity(), scale(), translate(), rotate(), generateGIF(), writeSVGfile(), generateSMIL(), selectByType(), selectByPenColor(), selectByFillColor(), selectByAttributeValue()
    The time unit used for every animation is in seconds.

    BASIC COMMANDS

    new()

    Creates a new instance of the class FigAnim. Every animation must begin with these two lines:

    use FigAnim;
    $fig_anim = new FigAnim;
    parseFile()

    Parses the file given in parameter, for example:

    $fig_anim->parseFile("file.fig");
    where "file.fig" is a correct FIG file.
    writeFile()

    Writes a new FIG file from another parsed FIG file. This method is only used for testing purpose (to test the identity). Example:

    $fig_anim->writeFile("another_file.fig");

    SET

    setAttributeValue()

    This method sets an attribute value of an object at a given time, without any interpolation. For example, if we have in our FIG file an object named "Square":
    $fig_anim->{objects}->{Square}->setAttributeValue(3, 'thickness', 2);
    sets the attribute "thickness" of object "Square" to 2 at instant t=3 seconds.

    setPenColor()

    Example:

    $fig_anim->{objects}->{Square}->setPenColor(4, 'Green4');
    this command modifies the object's pen color to a color called Green4 (in XFig) at instant t=4s, without any interpolation.

    setFillColor()

    Example:
    $fig_anim->{objects}->{Square}->setFillColor(5, 'Green4');
    similar to previous method, but modifies fill color instead of pen color at t=5s.

    HIDE/SHOW

    hide()

    Example:

    $fig_anim->{objects}->{Square}->hide(3);
    this command hides an object named "Square" at instant t=3s.
    show()

    Example:

    $fig_anim->{objects}->{Square}->hide(4);
    this command makes an object named "Square" appear at instant t=4s.

    CHANGE

    changeThickness()

    Example:

    $fig_anim->{objects}->{Square}->changeThickness(0, 1, 7);
    animates (with linear interpolation) the thickness of an object named "Square" from time t=0s for a duration of 1s. The thickness will have a value of 7 at the end of the animation.

    changeFillIntensity()

    Example:

    $fig_anim->{objects}->{Square}->changeFillIntensity(2, 1, 0);

    animates (with linear interpolation) the fill intensity of an object named "Square" from time t=2s for a duration of 1s. The intensity will have a value of 0 at the end of the animation. The intensity must be a number between 0 (black) and 20 (full saturation of the color). In the example the object becomes darker and darker until it becomes black.
    scale()

    Example:

    $fig_anim->{objects}->{Arc}->scale(0, 1, 1.2);

    scales the object named "Arc" from time t=0s for a duration of 1s according to scale factor 1.2. The center of the scale is the center of the object.

    MOVEMENTS

    translate()

    Example:

    $fig_anim->{objects}->{Square}->translate(0, 1, 2, 3, 'in');

    translates the object named "Square" from time t=0s for a duration of 1s according to vector (2in, 3in). Possible values for units (last parameter) are 'in', 'cm' or 'px'. Units are Fig units if none specified.

    rotate()

    Example:

    $fig_anim->{objects}->{Arc}->rotate(0, 1, -330);

    rotates the object named "Arc" from time t=0s for a duration of 1s according to rotation angle -330 degrees. In this case the center of the rotation is the center of the object.

    $fig_anim->{objects}->{Ellipse}->rotate(0, 1, -330, 2, 3,'in');

    rotates the object named "Arc" from time t=0s for a duration of 1s according to rotation angle -330 degrees. In this case the center of the rotation is point (2in, 3in). Possible values for units (last parameter) are 'in', 'cm' or 'px'. Units are Fig units if none specified.

    FILE GENERATION

    generateGif()

    Example:

    $fig_anim->generateGif("anim.gif", 10, 1);

    generates an animated GIF file named "anim.gif" with 10 frames per second, with only one loop (1). If you put a higher number of frames, the animation will be smoother but will take more time to be generated and the file size will be bigger. If you put a lower number of frames, the file will be generated faster and it's size will be smaller but the animation will be less smooth.

    Another example:

    $fig_anim->generateGif("anim.gif", 10, 0, 1);

    generates a GIF file named "anim.gif" with 10 frames per second, with infinite loop (0), and waits for 1s at the end of each loop. The last parameter is optional, if ommited its value is 0 (no waiting).

    writeSVGfile()

    Example: $fig_anim->writeSVGFile("file.svg");

    generates a SVG file named "file.svg" from a FIG file. This is a graphic filter with no animations.

    generateSMIL()

    Example:

    $fig_anim->generateSMIL("file.svg");

    generates a SVG+SMIL file named "file.svg", it is an animated SVG file with SMIL tags. For now only the Adobe SVG plugin can display animated SVG+SMIL files.

    Requirements:

    · Perl



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    Xfig class | animator class | Perl module | Xfig | animation | class

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM