OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
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
17 struct IntPoint {
18 IntPoint(int x, int y):
19 x_m(x),
20 y_m(y)
21 { }
22
23 int x_m;
24 int y_m;
25 };
26
27 typedef std::pair<IntPoint, IntPoint> IntPixel_t;
28
29 std::vector<IntPixel_t> minimizeNumberOfRectangles(std::vector<bool> pixels,
30 int height,
31 int width);
32
33 std::pair<IntPoint, IntPoint> findMaximalRectangle(const std::vector<bool> &pixels,
34 int height,
35 int width) const;
36
37 long computeArea(const IntPoint &ll, const IntPoint &ur) const;
38 };
39}
40
41#endif
PartBunchBase< T, Dim >::ConstIterator end(PartBunchBase< T, Dim > const &bunch)
std::string::iterator iterator
Definition MSLang.h:15
virtual void apply(std::vector< std::shared_ptr< Base > > &bfuncs)
Definition Mask.cpp:190
virtual void print(int ident)
Definition Mask.cpp:186
static bool parse_detail(iterator &it, const iterator &end, Function *&fun)
Definition Mask.cpp:121
std::pair< IntPoint, IntPoint > IntPixel_t
Definition Mask.h:27
long computeArea(const IntPoint &ll, const IntPoint &ur) const
Definition Mask.cpp:23
std::pair< IntPoint, IntPoint > findMaximalRectangle(const std::vector< bool > &pixels, int height, int width) const
Definition Mask.cpp:30
std::vector< Rectangle > pixels_m
Definition Mask.h:13
std::vector< IntPixel_t > minimizeNumberOfRectangles(std::vector< bool > pixels, int height, int width)
Definition Mask.cpp:83
IntPoint(int x, int y)
Definition Mask.h:18