|
degate 0.1.1
|
#include <SubImageAnalyzer.h>
Public Member Functions | |
| SubImageAnalyzer (std::tr1::shared_ptr< ImageType > _img, unsigned int width) | |
| void | run () |
Private Attributes | |
| std::tr1::shared_ptr< ImageType > | img |
| unsigned int | width |
Definition at line 36 of file SubImageAnalyzer.h.
| degate::SubImageAnalyzer< ImageType >::SubImageAnalyzer | ( | std::tr1::shared_ptr< ImageType > | _img, |
| unsigned int | width | ||
| ) | [inline] |
Definition at line 43 of file SubImageAnalyzer.h.
| 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;
}
std::tr1::shared_ptr<ImageType> degate::SubImageAnalyzer< ImageType >::img [private] |
Definition at line 39 of file SubImageAnalyzer.h.
Referenced by degate::SubImageAnalyzer< ImageType >::run().
unsigned int degate::SubImageAnalyzer< ImageType >::width [private] |
Definition at line 40 of file SubImageAnalyzer.h.
Referenced by degate::SubImageAnalyzer< ImageType >::run().
1.7.4