Example #1
0
//---------------------------------------------------
void f0r_update(f0r_instance_t instance, double time, const uint32_t* inframe, uint32_t* outframe)
{

    assert(instance);
    tp_inst_t* inst = (tp_inst_t*)instance;

    float2color(inst->sl, outframe, inst->w , inst->h, inst->chan);

}
Example #2
0
int main(int argc, char *argv[])
{
    char *calibfile = NULL;
    float dmin = 0;
    float dmax = 0;
    int verbose = 0;

    int o;
    while ((o = getopt(argc, argv, "c:m:d:")) != -1)
	switch (o) {
	case 'c': calibfile  = optarg; break;
	case 'm': dmin  = atof(optarg); break;
	case 'd': dmax  = atof(optarg); break;
	default: 
	    fprintf(stderr, "Ignoring unrecognized option\n");
	}
    if (optind != argc-2) {
	fprintf(stderr, usage, argv[0]);
	exit(1);
    }
    try {
	if (calibfile != NULL)
	    readVizRange(calibfile, dmin, dmax); // if calibfile given, extract dmin, dmax from that
	    	
	char *fdispname = argv[optind++];
	char *dispname = argv[optind++];
      
	CFloatImage fdisp;
	CByteImage disp;
	ReadImageVerb(fdisp, fdispname, verbose);
	if (dmax == dmin)
	    getMinMax(fdisp, dmin, dmax);

	//printf("dmin=%f, dmax=%f\n", dmin, dmax);

	float2color(fdisp, disp, dmin, dmax);
	WriteImageVerb(disp, dispname, verbose);
    }
    catch (CError &err) {
	fprintf(stderr, err.message);
	fprintf(stderr, "\n");
	return -1;
    }
  
    return 0;
}