16 #include <Eigen/Dense>
23 using Eigen::MatrixXd;
24 using Eigen::VectorXd;
25 using Eigen::VectorXi;
26 using Eigen::Matrix3d;
27 using Eigen::Vector3d;
42 using ptr = std::shared_ptr<T>;
53 template <
typename T,
typename F>
56 return std::dynamic_pointer_cast<T>(in);
68 explicit operator float()
const;
69 explicit operator double()
const;
70 explicit operator long double()
const;
71 explicit operator int64_t()
const;
72 explicit operator uint64_t()
const;
73 explicit operator int32_t()
const;
74 explicit operator uint32_t()
const;
75 explicit operator int16_t()
const;
76 explicit operator uint16_t()
const;
77 explicit operator int8_t()
const;
78 explicit operator uint8_t()
const;
84 cdouble_t(
double re = 0,
double im = 0) :
std::complex<double>(re, im) {} ;
87 explicit cdouble_t(
const std::complex<float>& );
88 explicit cdouble_t(
const std::complex<long double>&);
105 explicit operator float()
const;
106 explicit operator double()
const;
107 explicit operator long double()
const;
108 explicit operator int64_t()
const;
109 explicit operator uint64_t()
const;
110 explicit operator int32_t()
const;
111 explicit operator uint32_t()
const;
112 explicit operator int16_t()
const;
113 explicit operator uint16_t()
const;
114 explicit operator int8_t()
const;
115 explicit operator uint8_t()
const;
119 cfloat_t(
double re = 0,
double im = 0) :
std::complex<float>(re, im) {} ;
122 explicit cfloat_t(
const std::complex<double>&);
123 explicit cfloat_t(
const std::complex<long double>&);
124 cfloat_t(
const std::complex<float>&);
138 struct cquad_t :
public std::complex<long double>
140 explicit operator float()
const;
141 explicit operator double()
const;
142 explicit operator long double()
const;
143 explicit operator int64_t()
const;
144 explicit operator uint64_t()
const;
145 explicit operator int32_t()
const;
146 explicit operator uint32_t()
const;
147 explicit operator int16_t()
const;
148 explicit operator uint16_t()
const;
149 explicit operator int8_t()
const;
150 explicit operator uint8_t()
const;
154 cquad_t(
double re = 0,
double im = 0) :
std::complex<long double>(re, im) {} ;
157 explicit cquad_t(
const std::complex<float>&);
158 explicit cquad_t(
const std::complex<double>&);
159 cquad_t(
const std::complex<long double>&);
179 explicit operator float()
const;
180 explicit operator double()
const;
181 explicit operator long double()
const;
182 explicit operator int64_t()
const;
183 explicit operator uint64_t()
const;
184 explicit operator int32_t()
const;
185 explicit operator uint32_t()
const;
186 explicit operator int16_t()
const;
187 explicit operator uint16_t()
const;
188 explicit operator int8_t()
const;
189 explicit operator uint8_t()
const;
190 explicit operator cquad_t()
const;
207 rgb_t() : red(0), green(0), blue(0) {} ;
209 red(r), green(g), blue(b) {} ;
210 explicit rgb_t(
float);
211 explicit rgb_t(
double);
212 explicit rgb_t(
long double);
213 explicit rgb_t(int64_t);
214 explicit rgb_t(uint64_t);
215 explicit rgb_t(int32_t);
216 explicit rgb_t(uint32_t);
217 explicit rgb_t(int16_t);
218 explicit rgb_t(uint16_t);
219 explicit rgb_t(int8_t);
220 explicit rgb_t(uint8_t);
234 explicit operator float()
const;
235 explicit operator double()
const;
236 explicit operator long double()
const;
237 explicit operator int64_t()
const;
238 explicit operator uint64_t()
const;
239 explicit operator int32_t()
const;
240 explicit operator uint32_t()
const;
241 explicit operator int16_t()
const;
242 explicit operator uint16_t()
const;
243 explicit operator int8_t()
const;
244 explicit operator uint8_t()
const;
245 explicit operator cquad_t()
const;
261 rgba_t() : red(0), green(0), blue(0), alpha(0) {} ;
262 rgba_t(
char r,
char g,
char b,
char a = 0) :
263 red(r), green(g), blue(b), alpha(a) {} ;
266 explicit rgba_t(
long double);
268 explicit rgba_t(uint64_t);
270 explicit rgba_t(uint32_t);
272 explicit rgba_t(uint16_t);
282 std::ostream&
operator<< (std::ostream& stream,
const rgb_t& v);
283 std::ostream&
operator<< (std::ostream& stream,
const rgba_t& v);
308 rgb_t
operator+(
const rgb_t& lhs,
const double& rhs);
309 rgb_t
operator+(
const double& lhs,
const rgb_t& rhs);
310 rgb_t
operator-(
const rgb_t& lhs,
const double& rhs);
311 rgb_t
operator-(
const double& lhs,
const rgb_t& rhs);
312 rgb_t
operator*(
const rgb_t& lhs,
const double& rhs);
313 rgb_t
operator*(
const double& lhs,
const rgb_t& rhs);
314 rgb_t
operator/(
const rgb_t& lhs,
const double& rhs);
315 rgb_t
operator/(
const double& lhs,
const rgb_t& rhs);
318 rgba_t
operator+(
const rgba_t& lhs,
const double& rhs);
319 rgba_t
operator+(
const double& lhs,
const rgba_t& rhs);
320 rgba_t
operator-(
const rgba_t& lhs,
const double& rhs);
321 rgba_t
operator-(
const double& lhs,
const rgba_t& rhs);
322 rgba_t
operator*(
const rgba_t& lhs,
const double& rhs);
323 rgba_t
operator*(
const double& lhs,
const rgba_t& rhs);
324 rgba_t
operator/(
const rgba_t& lhs,
const double& rhs);
325 rgba_t
operator/(
const double& lhs,
const rgba_t& rhs);
ptr< T > dPtrCast(const ptr< F > &in)
Shorter name for dynamic_pointer_cast.
cdouble_t(double re=0, double im=0)
rgb_t(char r, char g, char b)
Matrix< D1, D2 > operator+(const Matrix< D1, D2 > &lhs, const Matrix< D1, D2 > &rhs)
cfloat_t(double re=0, double im=0)
std::ostream & operator<<(std::ostream &os, const Matrix< D1, D2 > &b)
rgba_t & operator=(float v)
rgba_t(char r, char g, char b, char a=0)
Matrix< D1, D3 > operator*(const Matrix< D1, D2 > &lhs, const Matrix< D2, D3 > &rhs)
cfloat_t & operator=(const std::complex< double > &v)
cquad_t & operator=(const std::complex< double > &v)
std::shared_ptr< T > ptr
Make the shared_ptr name shorter...
cdouble_t & operator=(const std::complex< double > &v)
cquad_t(double re=0, double im=0)
rgb_t operator/(const rgb_t &lhs, const double &rhs)
rgb_t & operator=(float v)
Matrix< D1, D2 > operator-(const Matrix< D1, D2 > &lhs, const Matrix< D1, D2 > &rhs)
Metric
Information-based Metric to use.