summaryrefslogtreecommitdiffstats
path: root/tksao/frame/fvcontour.h
blob: 53d929aef2e61e96313b41d3aad8ed6578529ef7 (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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// Copyright (C) 1999-2018
// Smithsonian Astrophysical Observatory, Cambridge, MA, USA
// For conditions of distribution and use, see copyright notice in "copyright"

#ifndef __fvcontour_h__
#define __fvcontour_h__

#include "vector.h"
#include "contour.h"
#include "frscale.h"
#include "inversescale.h"

class FVContour;

typedef struct {
  double* kernel;
  double* src;
  double* dest;
  int xmin;
  int ymin;
  int xmax;
  int ymax;
  int width;
  int height;
  int r;
  Matrix mm;
  Base* parent;
  int numcontour;
  double* contour;
  unsigned long color;
  char* colorName;
  int lineWidth;
  int dash;
  int* dlist;
  List<ContourLevel>* lcl;
} t_fvcontour_arg;

class FVContour {
 public:
  enum Method {SMOOTH, BLOCK};

 private:
  Base* parent_;
  List<ContourLevel> lcontourlevel_;

  char* colorName_;
  int lineWidth_;
  int dash_;
  int dlist_[2];

  Method method_;
  int smooth_;
  int numLevel_;

  FrScale frScale_;

  char* level_;
  InverseScale* scale_;
  double* kernel_;

  void buildScale(FitsImage* fits);
  void unity(FitsImage*, pthread_t* thread, void* targ);
  void smooth(FitsImage*, pthread_t* thread, void* targ);
  void block(FitsImage*, pthread_t* thread, void* targ);

public:
  FVContour();
  ~FVContour();

  void create(Base*, FitsImage*, FrScale*, 
	      const char*, int, int, 
	      Method, int, int, 
	      const char*);
  void update(FitsImage*);
  void update(FitsImage*, FrScale*);

  void append(List<ContourLevel>*);
  void append(FitsImage*, pthread_t* thread, void* targ);

  int isEmpty() {return lcontourlevel_.isEmpty();}

  Base* parent() {return parent_;}
  List<ContourLevel>& lcontourlevel() {return lcontourlevel_;}

  const char* colorName() {return colorName_;}
  int lineWidth() {return lineWidth_;}
  int dash() {return dash_;}
  int* dlist() {return dlist_;}

  const char* methodName();
  int numLevel() {return numLevel_;}
  int smooth() {return smooth_;}

  FrScale* frScale() {return &frScale_;}

  InverseScale* scale() {return scale_;}
  char* level() {return level_;}
};

#endif