comparison Framework/Radiography/RadiographyLayer.h @ 620:fd9b9d993fc7 am-dev

added flip to RadiographyLayer
author Alain Mazy <alain@mazy.be>
date Tue, 07 May 2019 11:15:57 +0200
parents 77e0eb83ff63
children 8d66efecd91c
comparison
equal deleted inserted replaced
601:8432926e9db9 620:fd9b9d993fc7
73 bool hasCrop_; 73 bool hasCrop_;
74 unsigned int cropX_; 74 unsigned int cropX_;
75 unsigned int cropY_; 75 unsigned int cropY_;
76 unsigned int cropWidth_; 76 unsigned int cropWidth_;
77 unsigned int cropHeight_; 77 unsigned int cropHeight_;
78 bool verticalFlip_;
79 bool horizontalFlip_;
78 double panX_; 80 double panX_;
79 double panY_; 81 double panY_;
80 double angle_; 82 double angle_;
81 bool resizeable_; 83 bool resizeable_;
82 double pixelSpacingX_; 84 double pixelSpacingX_;
164 double GetPixelSpacingY() const 166 double GetPixelSpacingY() const
165 { 167 {
166 return pixelSpacingY_; 168 return pixelSpacingY_;
167 } 169 }
168 170
171 void SetVerticalFlip(bool flip) // mirrors image around an horizontal axis (note: flip is applied before the rotation !)
172 {
173 verticalFlip_ = flip;
174 }
175
176 void SetHorizontalFlip(bool flip) // mirrors image around a vertical axis (note: flip is applied before the rotation !)
177 {
178 horizontalFlip_ = flip;
179 }
180
181 bool GetVerticalFlip() const
182 {
183 return verticalFlip_;
184 }
185
186 bool GetHorizontalFlip() const
187 {
188 return horizontalFlip_;
189 }
190
191 double GetScalingX() const
192 {
193 return (horizontalFlip_ ? - pixelSpacingX_: pixelSpacingX_);
194 }
195
196 double GetScalingY() const
197 {
198 return (verticalFlip_ ? - pixelSpacingY_: pixelSpacingY_);
199 }
169 }; 200 };
170 201
171 private: 202 private:
172 size_t index_; 203 size_t index_;
173 bool hasSize_; 204 bool hasSize_;
249 void SetAngle(double angle); 280 void SetAngle(double angle);
250 281
251 void SetPan(double x, 282 void SetPan(double x,
252 double y); 283 double y);
253 284
285 void SetVerticalFlip(bool flip); // mirrors image around an horizontal axis (note: flip is applied before the rotation !)
286
287 void SetHorizontalFlip(bool flip); // mirrors image around a vertical axis (note: flip is applied before the rotation !)
288
254 void SetResizeable(bool resizeable) 289 void SetResizeable(bool resizeable)
255 { 290 {
256 geometry_.SetResizeable(resizeable); 291 geometry_.SetResizeable(resizeable);
257 } 292 }
258 293