lsst.afw  14.0-63-g921e36d6a
Transformer.h
Go to the documentation of this file.
1 // -*- lsst-c++ -*-
2 
3 /*
4  * LSST Data Management System
5  * Copyright 2008, 2009, 2010 LSST Corporation.
6  *
7  * This product includes software developed by the
8  * LSST Project (http://www.lsst.org/).
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the LSST License Statement and
21  * the GNU General Public License along with this program. If not,
22  * see <http://www.lsstcorp.org/LegalNotices/>.
23  */
24 
25 #ifndef LSST_AFW_GEOM_ELLIPSES_Transformer_h_INCLUDED
26 #define LSST_AFW_GEOM_ELLIPSES_Transformer_h_INCLUDED
27 
28 /*
29  * Definitions for Ellipse::Transformer and BaseCore::Transformer.
30  *
31  * Note: do not include directly; use the main ellipse header file.
32  */
33 
36 
37 namespace lsst {
38 namespace afw {
39 namespace geom {
40 namespace ellipses {
41 
50 public:
52  typedef Eigen::Matrix3d DerivativeMatrix;
53 
55  typedef Eigen::Matrix<double, 3, 4> TransformDerivativeMatrix;
56 
58  Transformer(BaseCore &input_, LinearTransform const &transform_) : input(input_), transform(transform_) {}
59 
62 
64  void inPlace();
65 
66  void apply(BaseCore &result) const;
67 
69  DerivativeMatrix d() const;
70 
72  TransformDerivativeMatrix dTransform() const;
73 
76 };
77 
86 public:
88  typedef Eigen::Matrix<double, 5, 5> DerivativeMatrix;
89 
91  typedef Eigen::Matrix<double, 5, 6> TransformDerivativeMatrix;
92 
94  Transformer(Ellipse &input_, AffineTransform const &transform_) : input(input_), transform(transform_) {}
95 
98 
100  void inPlace();
101 
102  void apply(Ellipse &other) const;
103 
105  DerivativeMatrix d() const;
106 
108  TransformDerivativeMatrix dTransform() const;
109 
112 };
113 
115  return BaseCore::Transformer(*this, transform);
116 }
117 
119  return BaseCore::Transformer(const_cast<BaseCore &>(*this), transform);
120 }
121 
123  return Ellipse::Transformer(*this, transform);
124 }
125 
127  return Ellipse::Transformer(const_cast<Ellipse &>(*this), transform);
128 }
129 
131  : _core(other.input.getCore().transform(other.transform.getLinear()).copy()),
132  _center(other.transform(other.input.getCenter())) {}
133 }
134 }
135 }
136 } // namespace lsst::afw::geom::ellipses
137 
138 #endif // !LSST_AFW_GEOM_ELLIPSES_Transformer_h_INCLUDED
Eigen::Matrix< double, 5, 5 > DerivativeMatrix
Matrix type for derivative with respect to input ellipse parameters.
Definition: Transformer.h:88
A temporary-only expression object for ellipse core transformations.
Definition: Transformer.h:49
Ellipse & input
input ellipse to be transformed
Definition: Transformer.h:110
DerivativeMatrix d() const
Return the derivative of transformed core with respect to input core.
BaseCore & input
input core to be transformed
Definition: Transformer.h:74
Transformer(BaseCore &input_, LinearTransform const &transform_)
Standard constructor.
Definition: Transformer.h:58
TransformDerivativeMatrix dTransform() const
Return the derivative of transformed core with respect to transform parameters.
Transformer transform(LinearTransform const &transform)
Definition: Transformer.h:114
Eigen::Matrix3d DerivativeMatrix
Matrix type for derivative with respect to input ellipse parameters.
Definition: Transformer.h:52
Ellipse(BaseCore const &core, Point2D const &center=Point2D())
Definition: Ellipse.h:164
A 2D linear coordinate transformation.
std::shared_ptr< BaseCore > copy() const
Return a new transformed ellipse core.
void inPlace()
Transform the ellipse core in-place.
A base class for image defects.
Transformer transform(AffineTransform const &transform)
Definition: Transformer.h:122
An affine coordinate transformation consisting of a linear transformation and an offset.
An ellipse defined by an arbitrary BaseCore and a center point.
Definition: Ellipse.h:51
AffineTransform const & transform
transform object
Definition: Transformer.h:111
Eigen::Matrix< double, 5, 6 > TransformDerivativeMatrix
Matrix type for derivative with respect to transform parameters.
Definition: Transformer.h:91
LinearTransform const & transform
transform object
Definition: Transformer.h:75
Eigen::Matrix< double, 3, 4 > TransformDerivativeMatrix
Matrix type for derivative with respect to transform parameters.
Definition: Transformer.h:55
A base class for parametrizations of the "core" of an ellipse - the ellipticity and size...
Definition: BaseCore.h:55
A temporary-only expression object for ellipse transformations.
Definition: Transformer.h:85
Transformer(Ellipse &input_, AffineTransform const &transform_)
Standard constructor.
Definition: Transformer.h:94