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

The base class for image readers. More...

#include <ImageReaderBase.h>

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

List of all members.

Public Member Functions

 ImageReaderBase (std::string const &_filename)
 Constructor.
virtual ~ImageReaderBase ()
 The destructor.
std::string get_filename () const
 Get the filename.
virtual bool read ()=0
 Read the image ot at least its meta data.
unsigned int get_width () const
 Get the image width.
unsigned int get_height () const
 Get the image height.
virtual bool get_image (std::shared_ptr< ImageType > img)=0
 Read the file content into image.

Protected Member Functions

void set_width (unsigned int _width)
 Set the width of the image.
void set_height (unsigned int _height)
 Set the height of the image.

Private Attributes

std::string filename
unsigned int width
unsigned int height

Detailed Description

template<class ImageType>
class degate::ImageReaderBase< ImageType >

The base class for image readers.

Definition at line 41 of file ImageReaderBase.h.


Constructor & Destructor Documentation

template<class ImageType >
degate::ImageReaderBase< ImageType >::ImageReaderBase ( std::string const &  _filename) [inline]

Constructor.

Definition at line 71 of file ImageReaderBase.h.

                                                 :
      filename(_filename),
      width(0),
      height(0) {}
template<class ImageType >
virtual degate::ImageReaderBase< ImageType >::~ImageReaderBase ( ) [inline, virtual]

The destructor.

Definition at line 80 of file ImageReaderBase.h.

{}

Member Function Documentation

template<class ImageType >
std::string degate::ImageReaderBase< ImageType >::get_filename ( ) const [inline]

Get the filename.

Definition at line 86 of file ImageReaderBase.h.

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

{ return filename; }
template<class ImageType >
unsigned int degate::ImageReaderBase< ImageType >::get_height ( ) const [inline]

Get the image height.

You have to call read() before.

See also:
read()

Definition at line 115 of file ImageReaderBase.h.

References degate::ImageReaderBase< ImageType >::height.

{ return height; }
template<class ImageType >
virtual bool degate::ImageReaderBase< ImageType >::get_image ( std::shared_ptr< ImageType >  img) [pure virtual]

Read the file content into image.

Implemented in degate::TIFFReader< ImageType >, and degate::JPEGReader< ImageType >.

template<class ImageType >
unsigned int degate::ImageReaderBase< ImageType >::get_width ( ) const [inline]

Get the image width.

You have to call read() before.

See also:
read()

Definition at line 107 of file ImageReaderBase.h.

References degate::ImageReaderBase< ImageType >::width.

{ return width; }
template<class ImageType >
virtual bool degate::ImageReaderBase< ImageType >::read ( ) [pure virtual]

Read the image ot at least its meta data.

If you derive from class ImageReaderBase, you can implement a full image read operation here. But it is also possible to implement just the read of meta data, such as width and height.

Returns:
The function returns true, if the image file was read. Else false is returned. If read() was successful you can

Implemented in degate::TIFFReader< ImageType >, and degate::JPEGReader< ImageType >.

template<class ImageType >
void degate::ImageReaderBase< ImageType >::set_height ( unsigned int  _height) [inline, protected]

Set the height of the image.

This method should be called by derived image readers to set the image size.

Definition at line 62 of file ImageReaderBase.h.

References degate::ImageReaderBase< ImageType >::height.

{ height = _height; }
template<class ImageType >
void degate::ImageReaderBase< ImageType >::set_width ( unsigned int  _width) [inline, protected]

Set the width of the image.

This method should be called by derived image readers to set the image size.

Definition at line 54 of file ImageReaderBase.h.

References degate::ImageReaderBase< ImageType >::width.

{ width = _width; }

Member Data Documentation

template<class ImageType >
std::string degate::ImageReaderBase< ImageType >::filename [private]
template<class ImageType >
unsigned int degate::ImageReaderBase< ImageType >::height [private]
template<class ImageType >
unsigned int degate::ImageReaderBase< ImageType >::width [private]

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