NPSpec  0.2.0
Solve for the spectral properties of nanoparticles easily
 All Classes Files Functions Variables Enumerations Enumerator Macros Pages
npspec.h
Go to the documentation of this file.
1 
5 #ifndef NPSPEC_H
6 #define NPSPEC_H
7 
8 /* Pull in the constants */
9 #include "npspec/constants.h"
10 
11 /* Protect as C if C++ so that library can be called from C or Fortran */
12 #ifdef __cplusplus
13 extern "C" {
14 #else
15 
16 /* If using library in C, use stdbool.h if available */
17 #if __STDC_VERSION__ >= 199901L
18 #include <stdbool.h>
19 #else
20 typedef int bool;
21 const bool false = 0;
22 const bool true = 1;
23 #endif
24 
25 #endif
26 
41 int material_index(const char *material);
42 
79 #ifdef __cplusplus
80 NPSpec::ErrorCode npspec (const int nlayers,
81 #else
82 enum ErrorCode npspec (const int nlayers,
83 #endif
84  const double rad[2],
85  const double rel_rad[][2],
86  const int indx[],
87  const double mrefrac,
88  const bool size_correct,
89  const int increment,
90  const double path_length,
91  const double concentration,
92 #ifdef __cplusplus
93  const NPSpec::SpectraType spectra_type,
94 #else
95  const enum SpectraType spectra_type,
96 #endif
97  double extinct[],
98  double scat[],
99  double absorb[]
100  );
101 
115 void RGB(const double spec_in[],
116  const int inc,
117  const bool trans,
118  double *r,
119  double *g,
120  double *b);
121 
131 void RGB_to_HSV(const double r,
132  const double g,
133  const double b,
134  double *h,
135  double *s,
136  double *v);
137 
138 #ifdef __cplusplus
139 } // extern
140 #endif
141 
142 #endif /* NPSPEC_H */