Changeset 1505 for trunk/packages


Ignore:
Timestamp:
Jun 10, 2009, 9:18:49 AM (15 years ago)
Author:
gah
Message:

Flip image along y-axis for movie

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/nanovis/FlowCmd.cpp

    r1504 r1505  
    18971897    }
    18981898    // Save the old dimensions of the offscreen buffer.
    1899     int oldWidth, oldHeight;
     1899    size_t oldWidth, oldHeight;
    19001900    oldWidth = NanoVis::win_width;
    19011901    oldHeight = NanoVis::win_height;
    19021902
     1903    char fileName[200];
     1904    sprintf(fileName,"/tmp/flow%d.mp4", getpid());
     1905
     1906    Trace("FLOW started\n");
     1907
     1908    Rappture::Outcome context;
     1909
     1910    Rappture::AVTranslate movie(width, height, bitRate, frameRate);
     1911    if (!movie.init(context, fileName)) {
     1912        Tcl_AppendResult(interp, "can't initialized movie \"", fileName,
     1913                         "\": ", context.remark(), (char *)NULL);
     1914        return TCL_ERROR;
     1915    }
    19031916    if ((width != oldWidth) || (height != oldHeight)) {
    19041917        // Resize to the requested size.
    19051918        NanoVis::resize_offscreen_buffer(width, height);
    19061919    }
    1907 
    1908     char fileName[128];
    1909     sprintf(fileName,"/tmp/flow%d.mp4", getpid());
    1910 
    1911     Trace("FLOW started\n");
    1912 
    1913     Rappture::Outcome context;
    1914     Rappture::AVTranslate movie(width, height, bitRate, frameRate);
    1915 
     1920    // Now compute the line padding for the offscreen buffer.
    19161921    int pad = 0;
    19171922    if ((3*NanoVis::win_width) % 4 > 0) {
    19181923        pad = 4 - ((3*NanoVis::win_width) % 4);
    19191924    }
    1920 
    1921     movie.init(context, fileName);
    1922 
     1925    NanoVis::ResetFlows();
    19231926    for (int i = 0; i < numFrames; i++) {
    19241927        // Generate the latest frame and send it back to the client
     
    19641967        NanoVis::resize_offscreen_buffer(oldWidth, oldHeight);
    19651968    }
     1969    NanoVis::ResetFlows();
    19661970    NanoVis::licRenderer->make_patterns();
    19671971    if (unlink(fileName) != 0) {
Note: See TracChangeset for help on using the changeset viewer.