Re: Colour Window Dump

New Message Reply Date view Thread view Subject view Author view

Brian Furtaw (brian++at++hotsauce.clubfed.sgi.com)
Fri, 6 Jun 1997 15:38:13 -0400


Try this code it comes directly from perfly it is attached to the `xX' on the
keybd....

snapImage(int snapAlpha)
{
    FILE *fp;
    static char str[80];
    static int count = 0;
    pfPipe* cpipe = ViewState->masterChan->getPipe();
    int id = pfGetId(cpipe)*10 + count++;

    sprintf(str, "perfly.%d.%s", id,
            (snapAlpha) ? "rgba" : "rgb");
    pfNotify(PFNFY_INFO, PFNFY_PRINT, "Saving pipe %d image in file %s\n",
            pfGetId(cpipe), str);

    pfuSaveImage(str, 0, 0,
                 ViewState->mouse.winSizeX,
                 ViewState->mouse.winSizeY,
                 (snapAlpha) ? 1 : 0);

    /* create info file to go with image */
    sprintf(str, "perfly.%d.info", id);
    if (fp = fopen(str,"w"))
    {
        float h, v;
        fprintf(fp, "Viewing parameters for snap %d of perfly\n\n", id);
        fprintf(fp, "XYZ: %f %f %f\n",
                ViewState->viewCoord.xyz[0],
                ViewState->viewCoord.xyz[1],
                ViewState->viewCoord.xyz[2]);
        fprintf(fp, "HPR: %f %f %f\n",
                ViewState->viewCoord.hpr[0],
                ViewState->viewCoord.hpr[1],
                ViewState->viewCoord.hpr[2]);
        fprintf(fp, "NEAR/FAR: %f %f \n",
                ViewState->near, ViewState->far);
        ViewState->masterChan->getFOV(&h, &v);
        fprintf(fp, "FOV: horiz=%f vert=%f\n", h, v);
        fclose(fp);
    }

    pfNotify(PFNFY_INFO, PFNFY_PRINT, "Done\n");
}

Brian

On Jun 3, 1:03pm, Simon Dimaio wrote:
> Subject: Colour Window Dump
> Hi
>
> Is there an easy way to dump a colour window to a file? I have used a
> ..._TYPE_X window and have tried using "xwd" and "xv" to dump the window
> containing my Performer simulation, but the colour map is not saved
> correctly. (?)
>
> Thanks.
>
> Regards
> Simon Dimaio
>
> =======================================================================
> List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
> SGI DevForum 97 info: http://www.sgi.com/Forum97/
>-- End of excerpt from Simon Dimaio

-- 
o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o

Brian Furtaw (brian++at++sgi.com) VisSim Technical Consultant 12200-G Plum Orchard Drive Office:(301)572-3293 Fax: (301)872-3293 Silver Spring, Maryland 20904 OpenGL/ImageVision/OpenInventor/Performer ======================================================================= List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/ Submissions: info-performer++at++sgi.com Admin. requests: info-performer-request++at++sgi.com SGI DevForum 97 info: http://www.sgi.com/Forum97/


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:55:24 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.