degate  0.1.2
Public Member Functions | Private Attributes
degate::IPImageWriter< ImageType > Class Template Reference

Processor: Write an image to file. More...

#include <IPImageWriter.h>

Inheritance diagram for degate::IPImageWriter< ImageType >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 IPImageWriter (std::string _filename)
 The constructor.
virtual ~IPImageWriter ()
 The destructor.
virtual ImageBase_shptr run (ImageBase_shptr _in)
 Start processing.

Private Attributes

std::string filename

Detailed Description

template<typename ImageType>
class degate::IPImageWriter< ImageType >

Processor: Write an image to file.

Definition at line 36 of file IPImageWriter.h.


Constructor & Destructor Documentation

template<typename ImageType >
degate::IPImageWriter< ImageType >::IPImageWriter ( std::string  _filename) [inline]

The constructor.

Definition at line 47 of file IPImageWriter.h.

                                       :
      ImageProcessorBase("IPImageWriter",
                         "Write an image.",
                         false,
                         typeid(typename ImageType::pixel_type),
                         typeid(typename ImageType::pixel_type)),
      filename(_filename) { }
template<typename ImageType >
virtual degate::IPImageWriter< ImageType >::~IPImageWriter ( ) [inline, virtual]

The destructor.

Definition at line 59 of file IPImageWriter.h.

{}

Member Function Documentation

template<typename ImageType >
virtual ImageBase_shptr degate::IPImageWriter< ImageType >::run ( ImageBase_shptr  _in) [inline, virtual]

Start processing.

Implements degate::ImageProcessorBase.

Definition at line 61 of file IPImageWriter.h.

References degate::IPImageWriter< ImageType >::filename.

                                                     {

      assert(_in != NULL);

      std::shared_ptr<ImageType> img_in =
        std::dynamic_pointer_cast<ImageType>(_in);


      std::shared_ptr<ImageType>
        img_out(new ImageType(_in->get_width(), _in->get_height()));

      assert(img_in != NULL);
      assert(img_out != NULL);

      std::cout << "writing file: " << filename << std::endl;

      normalize<ImageType, ImageType>(img_out, img_in, 0, 255);

      save_image<ImageType>(filename, img_out);

      return img_in;
    }

Member Data Documentation

template<typename ImageType >
std::string degate::IPImageWriter< ImageType >::filename [private]

Definition at line 39 of file IPImageWriter.h.

Referenced by degate::IPImageWriter< ImageType >::run().


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