Points&Forces (survey)
Software tools facilitating the task of surveying architecture
a_image_defo.h
Go to the documentation of this file.
1 /*
2  Copyright 2010-2011 Pierre SMARS (smars@yuntech.edu.tw)
3  This program is free software: you can redistribute it and/or modify
4  it under the terms of the GNU General Public License as published by
5  the Free Software Foundation, either version 2 of the License, or
6  (at your option) any later version.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16 #ifndef _A_IMAGE_DEFO_H_
17 #define _A_IMAGE_DEFO_H_
18 
19 #include <iostream>
20 #include "vtkImageData.h"
21 
29 {
30  public:
31  a_image_defo() {};
33  virtual void read(const std::string& name);
37  void write(const std::string& name);
39  virtual void new_coordinates(double xo, double yo, double& xn, double& yn) = 0;
41  virtual bool old_coordinates(double xn, double yn, double& xo, double& yo) = 0;
43  virtual void box_out();
45  void xm(const int val) {box_out_[0] = val;}
47  void xM(const int val) {box_out_[1] = val;}
49  void ym(const int val) {box_out_[2] = val;}
51  void yM(const int val) {box_out_[3] = val;}
52  void get_box_out() const {std::cout << box_out_[0] << " " << box_out_[1] << " " << box_out_[2] << " " << box_out_[3] << std::endl;}
54  void deform();
55  protected:
57  void box_out_reset();
58 
59  vtkImageData * in_;
60  vtkImageData * out_;
61  int box_in_[6];
62  int box_out_[6];
63 };
64 
65 #endif
a unit to deform an image. The transformation function needs to be defined in a children class.
Definition: a_image_defo.h:29
void box_out_reset()
reset the value of the bounding box
virtual bool old_coordinates(double xn, double yn, double &xo, double &yo)=0
gives the pixel coordinates in the input image in function of the pixel coordinates in the output ima...
void yM(const int val)
impose the size of the output bounding box
Definition: a_image_defo.h:51
void xm(const int val)
impose the size of the output bounding box
Definition: a_image_defo.h:45
void get_box_out() const
Definition: a_image_defo.h:52
void write(const std::string &name)
write the processed image to a file
void deform()
deform the image
void xM(const int val)
impose the size of the output bounding box
Definition: a_image_defo.h:47
virtual void new_coordinates(double xo, double yo, double &xn, double &yn)=0
gives the pixel coordinates in the output image in function of the pixel coordinates in the input ima...
virtual void read(const std::string &name)
read the image to be processed
vtkImageData * out_
Definition: a_image_defo.h:60
virtual void box_out()
compute the bounding box of the new image
vtkImageData * in_
Definition: a_image_defo.h:59
void ym(const int val)
impose the size of the output bounding box
Definition: a_image_defo.h:49
int box_out_[6]
Definition: a_image_defo.h:62
int box_in_[6]
Definition: a_image_defo.h:61
std::string name
Definition: pixelpos.cxx:77