degate  0.1.2
Public Member Functions | Private Attributes
degate::IPCopy< ImageTypeIn, ImageTypeOut > Class Template Reference

Processor: Copy an image with auto conversion. More...

#include <IPCopy.h>

Inheritance diagram for degate::IPCopy< ImageTypeIn, ImageTypeOut >:
Inheritance graph
[legend]

List of all members.

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

Detailed Description

template<typename ImageTypeIn, typename ImageTypeOut>
class degate::IPCopy< ImageTypeIn, ImageTypeOut >

Processor: Copy an image with auto conversion.

Definition at line 35 of file IPCopy.h.


Constructor & Destructor Documentation

template<typename ImageTypeIn , typename ImageTypeOut >
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) { }
template<typename ImageTypeIn , typename ImageTypeOut >
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) {
    }
template<typename ImageTypeIn , typename ImageTypeOut >
virtual degate::IPCopy< ImageTypeIn, ImageTypeOut >::~IPCopy ( ) [inline, virtual]

The destructor.

Definition at line 77 of file IPCopy.h.

{}

Member Function Documentation

template<typename ImageTypeIn , typename ImageTypeOut >
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::shared_ptr<ImageTypeIn> img_in =
        std::dynamic_pointer_cast<ImageTypeIn>(_in);

      std::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;
    }

Here is the call graph for this function:


Member Data Documentation

template<typename ImageTypeIn , typename ImageTypeOut >
unsigned int degate::IPCopy< ImageTypeIn, ImageTypeOut >::max_x [private]

Definition at line 39 of file IPCopy.h.

Referenced by degate::IPCopy< ImageTypeIn, ImageTypeOut >::run().

template<typename ImageTypeIn , typename ImageTypeOut >
unsigned int degate::IPCopy< ImageTypeIn, ImageTypeOut >::max_y [private]

Definition at line 39 of file IPCopy.h.

Referenced by degate::IPCopy< ImageTypeIn, ImageTypeOut >::run().

template<typename ImageTypeIn , typename ImageTypeOut >
unsigned int degate::IPCopy< ImageTypeIn, ImageTypeOut >::min_x [private]

Definition at line 39 of file IPCopy.h.

Referenced by degate::IPCopy< ImageTypeIn, ImageTypeOut >::run().

template<typename ImageTypeIn , typename ImageTypeOut >
unsigned int degate::IPCopy< ImageTypeIn, ImageTypeOut >::min_y [private]

Definition at line 39 of file IPCopy.h.

Referenced by degate::IPCopy< ImageTypeIn, ImageTypeOut >::run().

template<typename ImageTypeIn , typename ImageTypeOut >
bool degate::IPCopy< ImageTypeIn, ImageTypeOut >::work_on_region [private]

Definition at line 40 of file IPCopy.h.

Referenced by degate::IPCopy< ImageTypeIn, ImageTypeOut >::run().


The documentation for this class was generated from the following file: