Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /branches/vis12/test/vr-lite-cam/main.c
ViewVC logotype

View of /branches/vis12/test/vr-lite-cam/main.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3291 - (download) (as text) (annotate)
Wed Oct 14 21:25:00 2015 UTC (4 years ago) by jhr
File size: 1038 byte(s)
code is copyright University of Chicago
/*! \file main.c
 *
 * \author John Reppy
 */

/*
 * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
 *
 * COPYRIGHT (c) 2015 The University of Chicago
 * All rights reserved.
 */

#include "vr-lite-cam.h"

int main (int argc, const char **argv)
{
    VR_World_t *wrld = VR_New ();

    if (VR_Init (wrld)) {
	char *err = biffGetDone(NRRD);
        fprintf(stderr, "Trouble saving nrrd struct: %s\n", err);
        return 1;
    }

    VR_SetVerbose (wrld, true);

    VR_Initially (wrld);

    uint32_t nSteps = VR_Run (wrld, 0);

  // get results
    Nrrd *nData = nrrdNew();
    if (VR_OutputGet_outRGBA (wrld, nData)) {
      // error
//	fprintf(stderr, "Error getting nrrd data: %s\n", ((WorldPrefix_t *)wrld)->err);
	fprintf(stderr, "Error getting nrrd data\n");
	return 1;
    }

    if (nrrdSave("out.nrrd", nData, NULL)) {
        char *err = biffGetDone(NRRD);
        fprintf(stderr, "Trouble saving nrrd struct: %s\n", err);
        return 1;
    }

    VR_Shutdown (wrld);

    return 0;
}

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0