Пример #1
0
int main(int argc, char *argv[])
{
    double *L = 0;
    TIFF   *T;
    uint16  C;
    int     n = 256;
    int     c;

    while ((c = getopt(argc, argv, "n:f:ges")) != -1)
        switch (c)
        {
            case 'n': n = strtol(optarg, 0, 0);       break;
            case 'f': L = sph_file(optarg, &C);       break;
            case 'g': L = sph_grace_cathedral   (&C); break;
            case 'e': L = sph_eucalyptus_grove  (&C); break;
            case 's': L = sph_st_peters_basilica(&C); break;

            default: return usage(argv[0]);
        }

    if (L && optind < argc)
    {
        if ((T = TIFFOpen(argv[optind], "w")))
        {
            sph_dump(L, C);
            sph_to_irr(L, T, n, C);
            TIFFClose(T);
        }
        free(L);
    }
    else return usage(argv[0]);

    return 0;
}
Пример #2
0
int sph_cache::add_file(const std::string& name)
{
    if(!_useDiskCache)
    {
	int f = int(files.size());

	files[f] = sph_file(name);

	return f;
    }
    else
    {
	int f = _diskCache->add_file(name);
	files[f] = sph_file(name);
	return f;
    }
}