Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Diff of /src/hugin_base/panotools/PanoToolsInterface.cpp [743724] .. [519868] Maximize Restore

  Switch to unified view

a/src/hugin_base/panotools/PanoToolsInterface.cpp b/src/hugin_base/panotools/PanoToolsInterface.cpp
...
...
537
//    image.data = (unsigned char**)malloc( sizeof(unsigned char*) );
537
//    image.data = (unsigned char**)malloc( sizeof(unsigned char*) );
538
//    if(image.data == NULL) {
538
//    if(image.data == NULL) {
539
//        DEBUG_FATAL("Out of memory");
539
//        DEBUG_FATAL("Out of memory");
540
//    }
540
//    }
541
    image.data = 0;
541
    image.data = 0;
542
#ifdef HasPANO13
543
    pano_projection_features projd;
542
    pano_projection_features projd;
544
    if (panoProjectionFeaturesQuery((int) format, &projd)) {
543
    if (panoProjectionFeaturesQuery((int) format, &projd)) {
545
        image.format = projd.internalFormat;
544
        image.format = projd.internalFormat;
546
    } else {
545
    } else {
547
        image.format = _equirectangular;
546
        image.format = _equirectangular;
...
...
551
    assert(image.formatParamCount == (int) projParams.size());
550
    assert(image.formatParamCount == (int) projParams.size());
552
    for (int i=0; i < projd.numberOfParameters; i++) {
551
    for (int i=0; i < projd.numberOfParameters; i++) {
553
        image.formatParam[i] = projParams[i];
552
        image.formatParam[i] = projParams[i];
554
        DEBUG_DEBUG("projection parameter " << i << ": " << image.formatParam[i]);
553
        DEBUG_DEBUG("projection parameter " << i << ": " << image.formatParam[i]);
555
    }
554
    }
556
#else
557
    switch (format) {
558
    case PanoramaOptions::RECTILINEAR:
559
        image.format = _rectilinear;
560
        break;
561
    case PanoramaOptions::CYLINDRICAL:
562
        image.format= _panorama;
563
        break;
564
    case PanoramaOptions::EQUIRECTANGULAR:
565
        image.format = _equirectangular;
566
        break;
567
    case PanoramaOptions::FULL_FRAME_FISHEYE:
568
        image.format = _fisheye_ff;
569
        break;
570
    case PanoramaOptions::STEREOGRAPHIC:
571
        image.format = _stereographic;
572
        break;
573
    case PanoramaOptions::MERCATOR:
574
        image.format = _mercator;
575
        break;
576
    case PanoramaOptions::TRANSVERSE_MERCATOR:
577
        image.format = _trans_mercator;
578
        break;
579
    case PanoramaOptions::SINUSOIDAL:
580
        image.format = _sinusoidal;
581
        break;
582
#ifdef HasPANO13
583
    case PanoramaOptions::LAMBERT:
584
        image.format = _lambert;
585
        break;
586
    case PanoramaOptions::LAMBERT_AZIMUTHAL:
587
        image.format = _lambertazimuthal;
588
        break;
589
    case PanoramaOptions::PANINI:
590
        image.format = _panini;
591
        break;
592
    case PanoramaOptions::ARCHITECTURAL:
593
        image.format = _architectural;
594
        break;
595
    case PanoramaOptions::ORTHOGRAPHIC:
596
        image.format = _ortographic;
597
        break;
598
    case PanoramaOptions::EQUISOLID:
599
        image.format = _equisolid;
600
        break;
601
  case PanoramaOptions::EQUI_PANINI:
602
      image.format = _equi_panini;
603
      break;
604
#endif
605
    default:
606
        PrintError("unsupported projection");
607
    }
608
#endif
609
    image.hfov = destHFOV;
555
    image.hfov = destHFOV;
610
}
556
}
611
557
612
558
613
// internal function, used by setFullImage() to set the distortion parameters
559
// internal function, used by setFullImage() to set the distortion parameters