summaryrefslogtreecommitdiffstats
path: root/tksao/frame/fitsenvi.C
blob: 7ba66f63024b75c93b872fa0b9c75d7eb49427fb (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// 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 "envi.h"

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

  switch (fits_->pEncoding()) {
  case FitsFile::BSQ:
    // better not see this
    break;
  case FitsFile::BIL:
    switch (fits_->pBitpix()) {
    case 8: 
      post_ = new FitsENVIBILm<unsigned char>(fits_);
      break;
    case 16:
      post_ = new FitsENVIBILm<short>(fits_);
      break;
    case -16:
      post_ = new FitsENVIBILm<unsigned short>(fits_);
      break;
    case 32:
      post_ = new FitsENVIBILm<int>(fits_);
      break;
    case 64:
      post_ = new FitsENVIBILm<long long>(fits_);
      break;
    case -32:
      post_ = new FitsENVIBILm<float>(fits_);
      break;
    case -64:
      post_ = new FitsENVIBILm<double>(fits_);
      break;
    }
    break;
  case FitsFile::BIP:
    switch (fits_->pBitpix()) {
    case 8: 
      post_ = new FitsENVIBIPm<unsigned char>(fits_);
      break;
    case 16:
      post_ = new FitsENVIBIPm<short>(fits_);
      break;
    case -16:
      post_ = new FitsENVIBIPm<unsigned short>(fits_);
      break;
    case 32:
      post_ = new FitsENVIBIPm<int>(fits_);
      break;
    case 64:
      post_ = new FitsENVIBIPm<long long>(fits_);
      break;
    case -32:
      post_ = new FitsENVIBIPm<float>(fits_);
      break;
    case -64:
      post_ = new FitsENVIBIPm<double>(fits_);
      break;
    }
    break;
  default:
    // na
    break;
  }

  return;
}