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

#include <SubImageAnalyzer.h>

List of all members.

Public Member Functions

 SubImageAnalyzer (std::shared_ptr< ImageType > _img, unsigned int width)
void run ()

Private Attributes

std::shared_ptr< ImageType > img
unsigned int width

Detailed Description

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

Definition at line 36 of file SubImageAnalyzer.h.


Constructor & Destructor Documentation

template<typename ImageType >
degate::SubImageAnalyzer< ImageType >::SubImageAnalyzer ( std::shared_ptr< ImageType >  _img,
unsigned int  width 
) [inline]

Definition at line 43 of file SubImageAnalyzer.h.

                                         :
      img(_img),
      width(_width) {

      assert_is_multi_channel_image<ImageType>();
    }

Member Function Documentation

template<typename ImageType >
void degate::SubImageAnalyzer< ImageType >::run ( ) [inline]

Definition at line 51 of file SubImageAnalyzer.h.

References degate::SubImageAnalyzer< ImageType >::img, and degate::SubImageAnalyzer< ImageType >::width.

               {

      std::vector<rgba_pixel_t> v(width * width);

      int radius = width >> 1;
      unsigned int i = 0;

      for(unsigned int y = width; y < img->get_height() - radius; y++)
        for(unsigned int x = width; x < img->get_width() - radius; x++, i++) {

          for(int _y = -radius; _y < radius; _y++)
            for(int _x = -radius; _x < radius; _x++) {
              rgba_pixel_t p = img->get_pixel(x + _x, y + _y);
              vector[i] = p;
            }
        }

      virtual bool calc(std::vector<rgba_pixel_t> const& v) const = 0;
    }

Member Data Documentation

template<typename ImageType >
std::shared_ptr<ImageType> degate::SubImageAnalyzer< ImageType >::img [private]

Definition at line 39 of file SubImageAnalyzer.h.

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

template<typename ImageType >
unsigned int degate::SubImageAnalyzer< ImageType >::width [private]

Definition at line 40 of file SubImageAnalyzer.h.

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


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