|
degate 0.1.1
|
Processor: Copy an image with auto conversion. More...
#include <IPCopy.h>

Public Member Functions | |
| IPCopy () | |
| The constructor for processing the whole image. | |
| IPCopy (unsigned int _min_x, unsigned int _max_x, unsigned int _min_y, unsigned int _max_y) | |
| The constructor for working on an image region. | |
| virtual | ~IPCopy () |
| The destructor. | |
| virtual ImageBase_shptr | run (ImageBase_shptr _in) |
| Start processing. | |
Private Attributes | |
| unsigned int | min_x |
| unsigned int | max_x |
| unsigned int | min_y |
| unsigned int | max_y |
| bool | work_on_region |
Processor: Copy an image with auto conversion.
| degate::IPCopy< ImageTypeIn, ImageTypeOut >::IPCopy | ( | ) | [inline] |
The constructor for processing the whole image.
Definition at line 48 of file IPCopy.h.
:
ImageProcessorBase("IPCopy",
"Copy an image with pixel type auto conversion",
false,
typeid(typename ImageTypeIn::pixel_type),
typeid(typename ImageTypeOut::pixel_type)),
work_on_region(false) { }
| degate::IPCopy< ImageTypeIn, ImageTypeOut >::IPCopy | ( | unsigned int | _min_x, |
| unsigned int | _max_x, | ||
| unsigned int | _min_y, | ||
| unsigned int | _max_y | ||
| ) | [inline] |
The constructor for working on an image region.
Definition at line 60 of file IPCopy.h.
:
ImageProcessorBase("IPCopy",
"Copy an image with pixel type auto conversion",
false,
typeid(typename ImageTypeIn::pixel_type),
typeid(typename ImageTypeOut::pixel_type)),
min_x(_min_x),
max_x(_max_x),
min_y(_min_y),
max_y(_max_y),
work_on_region(true) {
}
| virtual degate::IPCopy< ImageTypeIn, ImageTypeOut >::~IPCopy | ( | ) | [inline, virtual] |
| virtual ImageBase_shptr degate::IPCopy< ImageTypeIn, ImageTypeOut >::run | ( | ImageBase_shptr | _in | ) | [inline, virtual] |
Start processing.
Implements degate::ImageProcessorBase.
Definition at line 81 of file IPCopy.h.
References degate::extract_partial_image(), degate::IPCopy< ImageTypeIn, ImageTypeOut >::max_x, degate::IPCopy< ImageTypeIn, ImageTypeOut >::max_y, degate::IPCopy< ImageTypeIn, ImageTypeOut >::min_x, degate::IPCopy< ImageTypeIn, ImageTypeOut >::min_y, and degate::IPCopy< ImageTypeIn, ImageTypeOut >::work_on_region.
{
assert(_in != NULL);
std::tr1::shared_ptr<ImageTypeIn> img_in =
std::tr1::dynamic_pointer_cast<ImageTypeIn>(_in);
std::tr1::shared_ptr<ImageTypeOut> img_out
(work_on_region ?
new ImageTypeOut(max_x - min_x, max_y - min_y) :
new ImageTypeOut(_in->get_width(), _in->get_height()));
assert(img_in != NULL);
assert(img_out != NULL);
std::cout << "Copy image." << std::endl;
if(work_on_region == true) {
extract_partial_image<ImageTypeOut,
ImageTypeIn>(img_out, img_in,
min_x, max_x,
min_y, max_y);
}
else {
copy_image<ImageTypeOut, ImageTypeIn>(img_out, img_in);
}
return img_out;
}

unsigned int degate::IPCopy< ImageTypeIn, ImageTypeOut >::max_x [private] |
Definition at line 39 of file IPCopy.h.
Referenced by degate::IPCopy< ImageTypeIn, ImageTypeOut >::run().
unsigned int degate::IPCopy< ImageTypeIn, ImageTypeOut >::max_y [private] |
Definition at line 39 of file IPCopy.h.
Referenced by degate::IPCopy< ImageTypeIn, ImageTypeOut >::run().
unsigned int degate::IPCopy< ImageTypeIn, ImageTypeOut >::min_x [private] |
Definition at line 39 of file IPCopy.h.
Referenced by degate::IPCopy< ImageTypeIn, ImageTypeOut >::run().
unsigned int degate::IPCopy< ImageTypeIn, ImageTypeOut >::min_y [private] |
Definition at line 39 of file IPCopy.h.
Referenced by degate::IPCopy< ImageTypeIn, ImageTypeOut >::run().
bool degate::IPCopy< ImageTypeIn, ImageTypeOut >::work_on_region [private] |
Definition at line 40 of file IPCopy.h.
Referenced by degate::IPCopy< ImageTypeIn, ImageTypeOut >::run().
1.7.4