-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBitmap.h
More file actions
44 lines (41 loc) · 1.92 KB
/
Bitmap.h
File metadata and controls
44 lines (41 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef BITMAP_HEADER
#define BITMAP_HEADER
#include <MiscLib/Vector.h>
#include <utility>
#include <GfxTL/VectorXD.h>
#include <MiscLib/Vector.h>
#ifndef DLL_LINKAGE
#define DLL_LINKAGE
#endif
DLL_LINKAGE void DilateSquare(const MiscLib::Vector< char > &bitmap, size_t uextent,
size_t vextent, bool uwrap, bool vwrap,
MiscLib::Vector< char > *dilated);
DLL_LINKAGE void DilateCross(const MiscLib::Vector< char > &bitmap, size_t uextent,
size_t vextent, bool uwrap, bool vwrap,
MiscLib::Vector< char > *dilated);
DLL_LINKAGE void ErodeSquare(const MiscLib::Vector< char > &bitmap, size_t uextent,
size_t vextent, bool uwrap, bool vwrap,
MiscLib::Vector< char > *eroded);
DLL_LINKAGE void ErodeCross(const MiscLib::Vector< char > &bitmap, size_t uextent,
size_t vextent, bool uwrap, bool vwrap,
MiscLib::Vector< char > *eroded);
DLL_LINKAGE void Components(const MiscLib::Vector< char > &bitmap, size_t uextent,
size_t vextent, bool uwrap, bool vwrap,
MiscLib::Vector< int > *componentsImg,
MiscLib::Vector< std::pair< int, size_t > > *labels);
DLL_LINKAGE void PreWrappedComponents(const MiscLib::Vector< char > &bitmap, size_t uextent,
size_t vextent, MiscLib::Vector< int > *componentsImg,
MiscLib::Vector< int > *relabelComponentsImg,
const MiscLib::Vector< std::pair< int, size_t > > &inLabels,
MiscLib::Vector< std::pair< int, size_t > > *labels);
DLL_LINKAGE int Label(int n[], int size, int *curLabel,
MiscLib::Vector< std::pair< int, size_t > > *labels);
DLL_LINKAGE void AssociateLabel(int a, int b,
MiscLib::Vector< std::pair< int, size_t > > *labels);
DLL_LINKAGE int ReduceLabel(int a, const MiscLib::Vector<
std::pair< int, size_t > > &labels);
// finds the loops around a connected component as polygons
DLL_LINKAGE void ComponentLoops(const MiscLib::Vector< int > &componentImg, size_t uextent,
size_t vextent, int label, bool uwrap, bool vwrap,
MiscLib::Vector< MiscLib::Vector< GfxTL::VectorXD< 2, size_t > > > *polys);
#endif