OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
Mask.h
Go to the documentation of this file.
1#ifndef MSLANG_MASK_H
2#define MSLANG_MASK_H
3
4#include "Utilities/MSLang.h"
6
7namespace mslang {
8 struct Mask : public Function {
9 static bool parse_detail(iterator& it, const iterator& end, Function*& fun);
10 virtual void print(int ident);
11 virtual void apply(std::vector<std::shared_ptr<Base> >& bfuncs);
12
13 std::vector<Rectangle> pixels_m;
14
15 private:
16 struct IntPoint {
17 IntPoint(int x, int y) : x_m(x), y_m(y) {}
18
19 int x_m;
20 int y_m;
21 };
22
23 typedef std::pair<IntPoint, IntPoint> IntPixel_t;
24
25 std::vector<IntPixel_t> minimizeNumberOfRectangles(
26 std::vector<bool> pixels, unsigned int height, unsigned int width);
27
28 std::pair<IntPoint, IntPoint> findMaximalRectangle(
29 const std::vector<bool>& pixels, unsigned int height, unsigned int width) const;
30
31 unsigned int computeArea(const IntPoint& ll, const IntPoint& ur) const;
32
33 void updateCache(
34 const std::vector<bool>& pixels, std::vector<unsigned int>& cache,
35 unsigned int y) const;
36 };
37} // namespace mslang
38
39#endif
std::string::iterator iterator
Definition MSLang.h:14
IntPoint(int x, int y)
Definition Mask.h:17
virtual void apply(std::vector< std::shared_ptr< Base > > &bfuncs)
Definition Mask.cpp:193
virtual void print(int ident)
Definition Mask.cpp:188
std::vector< IntPixel_t > minimizeNumberOfRectangles(std::vector< bool > pixels, unsigned int height, unsigned int width)
Definition Mask.cpp:85
std::pair< IntPoint, IntPoint > findMaximalRectangle(const std::vector< bool > &pixels, unsigned int height, unsigned int width) const
Definition Mask.cpp:30
static bool parse_detail(iterator &it, const iterator &end, Function *&fun)
Definition Mask.cpp:123
unsigned int computeArea(const IntPoint &ll, const IntPoint &ur) const
Definition Mask.cpp:24
std::pair< IntPoint, IntPoint > IntPixel_t
Definition Mask.h:23
void updateCache(const std::vector< bool > &pixels, std::vector< unsigned int > &cache, unsigned int y) const
Definition Mask.cpp:10
std::vector< Rectangle > pixels_m
Definition Mask.h:13