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
7#include <memory>
8#include <utility>
9#include <vector>
10
11namespace mslang {
12 struct Mask: public Function {
13 static bool parse_detail(iterator &it, const iterator &end, Function* &fun);
14 virtual void print(int ident);
15 virtual void apply(std::vector<std::shared_ptr<Base> > &bfuncs);
16
17 std::vector<Rectangle> pixels_m;
18
19 private:
20
21 struct IntPoint {
22 IntPoint(int x, int y):
23 x_m(x),
24 y_m(y)
25 { }
26
27 int x_m;
28 int y_m;
29 };
30
31 typedef std::pair<IntPoint, IntPoint> IntPixel_t;
32
33 std::vector<IntPixel_t> minimizeNumberOfRectangles(std::vector<bool> pixels,
34 int height,
35 int width);
36
37 std::pair<IntPoint, IntPoint> findMaximalRectangle(const std::vector<bool> &pixels,
38 int height,
39 int width) const;
40
41 long computeArea(const IntPoint &ll, const IntPoint &ur) const;
42 };
43}
44
45#endif
PartBunchBase< T, Dim >::ConstIterator end(PartBunchBase< T, Dim > const &bunch)
std::string::iterator iterator
Definition MSLang.h:13
virtual void apply(std::vector< std::shared_ptr< Base > > &bfuncs)
Definition Mask.cpp:196
virtual void print(int ident)
Definition Mask.cpp:192
static bool parse_detail(iterator &it, const iterator &end, Function *&fun)
Definition Mask.cpp:127
std::pair< IntPoint, IntPoint > IntPixel_t
Definition Mask.h:31
long computeArea(const IntPoint &ll, const IntPoint &ur) const
Definition Mask.cpp:29
std::pair< IntPoint, IntPoint > findMaximalRectangle(const std::vector< bool > &pixels, int height, int width) const
Definition Mask.cpp:36
std::vector< Rectangle > pixels_m
Definition Mask.h:17
std::vector< IntPixel_t > minimizeNumberOfRectangles(std::vector< bool > pixels, int height, int width)
Definition Mask.cpp:89
IntPoint(int x, int y)
Definition Mask.h:22