summaryrefslogtreecommitdiffstats
path: root/tksao/frame/fitsnrrd.C
blob: 6372837e7b6d489058eaba78c3d166661e3538ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (C) 1999-2018
// Smithsonian Astrophysical Observatory, Cambridge, MA, USA
// For conditions of distribution and use, see copyright notice in "copyright"

#include "fitsimage.h"
#include "nrrdgzip.h"

void FitsImage::initNRRD()
{
  if (post_)
    delete post_;
  post_ = NULL;

  switch (fits_->pEncoding()) {
  case FitsFile::RAW:
    break;
  case FitsFile::GZIP:
    switch (fits_->pBitpix()) {
    case 8: 
      post_ = new FitsNRRDGzipm<unsigned char>(fits_);
      break;
    case 16:
      post_ = new FitsNRRDGzipm<short>(fits_);
      break;
    case -16:
      post_ = new FitsNRRDGzipm<unsigned short>(fits_);
      break;
    case 32:
      post_ = new FitsNRRDGzipm<int>(fits_);
      break;
    case 64:
      post_ = new FitsNRRDGzipm<long long>(fits_);
      break;
    case -32:
      post_ = new FitsNRRDGzipm<float>(fits_);
      break;
    case -64:
      post_ = new FitsNRRDGzipm<double>(fits_);
      break;
    }
    break;
  default:
    break;
  }

  return;
}