Commit 49e921ba25e8bca1d4d4d3fa882307c72c1d6e50
1 parent
f8b50c67
Added ScaleTransform
Showing
1 changed file
with
20 additions
and
0 deletions
openbr/plugins/cvt.cpp
| ... | ... | @@ -103,6 +103,26 @@ BR_REGISTER(Transform, CvtUCharTransform) |
| 103 | 103 | |
| 104 | 104 | /*! |
| 105 | 105 | * \ingroup transforms |
| 106 | + * \brief Scales using the given factor | |
| 107 | + * \author Scott Klum \cite sklum | |
| 108 | + */ | |
| 109 | +class ScaleTransform : public UntrainableTransform | |
| 110 | +{ | |
| 111 | + Q_OBJECT | |
| 112 | + | |
| 113 | + Q_PROPERTY(float scaleFactor READ get_scaleFactor WRITE set_scaleFactor RESET reset_scaleFactor STORED false) | |
| 114 | + BR_PROPERTY(float, scaleFactor, 1.) | |
| 115 | + | |
| 116 | + void project(const Template &src, Template &dst) const | |
| 117 | + { | |
| 118 | + resize(src, dst, Size(src.m().cols*scaleFactor,src.m().rows*scaleFactor)); | |
| 119 | + } | |
| 120 | +}; | |
| 121 | + | |
| 122 | +BR_REGISTER(Transform, ScaleTransform) | |
| 123 | + | |
| 124 | +/*! | |
| 125 | + * \ingroup transforms | |
| 106 | 126 | * \brief Split a multi-channel matrix into several single-channel matrices. |
| 107 | 127 | * \author Josh Klontz \cite jklontz |
| 108 | 128 | */ | ... | ... |