contrek 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +13 -0
- data/.rspec +3 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +84 -0
- data/LICENSE.md +9 -0
- data/README.md +118 -0
- data/Rakefile +19 -0
- data/contrek.gemspec +23 -0
- data/contrek.png +0 -0
- data/ext/cpp_polygon_finder/PolygonFinder/.cproject +136 -0
- data/ext/cpp_polygon_finder/PolygonFinder/.project +27 -0
- data/ext/cpp_polygon_finder/PolygonFinder/.settings/org.eclipse.ltk.core.refactoring.prefs +2 -0
- data/ext/cpp_polygon_finder/PolygonFinder/images/labyrinth.png +0 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/Main.cpp +41 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/Tests.cpp +69 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/Tests.h +19 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/bitmaps/Bitmap.cpp +52 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/bitmaps/Bitmap.h +32 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/bitmaps/FastPngBitmap.cpp +656 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/bitmaps/FastPngBitmap.h +42 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/bitmaps/PngBitmap.cpp +48 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/bitmaps/PngBitmap.h +32 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/bitmaps/RemoteFastPngBitmap.cpp +30 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/bitmaps/RemoteFastPngBitmap.h +26 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/bitmaps/X_picopng.cpp +576 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/finder/List.cpp +120 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/finder/List.h +40 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/finder/Lists.cpp +36 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/finder/Lists.h +30 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/finder/Node.cpp +111 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/finder/Node.h +80 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/finder/NodeCluster.cpp +325 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/finder/NodeCluster.h +59 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/finder/PolygonFinder.cpp +206 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/finder/PolygonFinder.h +69 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/finder/optionparser.h +2858 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/matchers/Matcher.cpp +23 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/matchers/Matcher.h +23 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/matchers/RGBMatcher.cpp +20 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/matchers/RGBMatcher.h +23 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/matchers/RGBNotMatcher.cpp +20 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/matchers/RGBNotMatcher.h +23 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/matchers/ValueNotMatcher.cpp +20 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/matchers/ValueNotMatcher.h +21 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/reducers/LinearReducer.cpp +40 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/reducers/LinearReducer.h +23 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/reducers/Reducer.cpp +19 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/reducers/Reducer.h +25 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/reducers/UniqReducer.cpp +30 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/reducers/UniqReducer.h +21 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/reducers/VisvalingamReducer.cpp +50 -0
- data/ext/cpp_polygon_finder/PolygonFinder/src/polygon/reducers/VisvalingamReducer.h +121 -0
- data/ext/cpp_polygon_finder/cpp_polygon_finder.cpp +260 -0
- data/ext/cpp_polygon_finder/extconf.rb +2 -0
- data/lib/contrek/bitmaps/bitmap.rb +21 -0
- data/lib/contrek/bitmaps/chunky_bitmap.rb +33 -0
- data/lib/contrek/bitmaps/painting.rb +40 -0
- data/lib/contrek/bitmaps/png_bitmap.rb +62 -0
- data/lib/contrek/bitmaps/rgb_color.rb +25 -0
- data/lib/contrek/finder/list.rb +132 -0
- data/lib/contrek/finder/list_entry.rb +11 -0
- data/lib/contrek/finder/listable.rb +8 -0
- data/lib/contrek/finder/lists.rb +25 -0
- data/lib/contrek/finder/node.rb +126 -0
- data/lib/contrek/finder/node_cluster.rb +294 -0
- data/lib/contrek/finder/polygon_finder.rb +121 -0
- data/lib/contrek/map/mercator_projection.rb +76 -0
- data/lib/contrek/matchers/matcher.rb +20 -0
- data/lib/contrek/matchers/matcher_hsb.rb +24 -0
- data/lib/contrek/matchers/value_not_matcher.rb +9 -0
- data/lib/contrek/reducers/linear_reducer.rb +25 -0
- data/lib/contrek/reducers/reducer.rb +14 -0
- data/lib/contrek/reducers/uniq_reducer.rb +9 -0
- data/lib/contrek/reducers/visvalingam_reducer.rb +139 -0
- data/lib/contrek/version.rb +3 -0
- data/lib/contrek.rb +58 -0
- metadata +175 -0
@@ -0,0 +1,32 @@
|
|
1
|
+
/*
|
2
|
+
* Bitmap.h
|
3
|
+
*
|
4
|
+
* Created on: 25 nov 2018
|
5
|
+
* Author: ema
|
6
|
+
* Copyright 2025 Emanuele Cesaroni
|
7
|
+
*/
|
8
|
+
|
9
|
+
#ifndef POLYGON_BITMAPS_BITMAP_H_
|
10
|
+
#define POLYGON_BITMAPS_BITMAP_H_
|
11
|
+
#include <string>
|
12
|
+
|
13
|
+
class Matcher;
|
14
|
+
|
15
|
+
class Bitmap {
|
16
|
+
private:
|
17
|
+
int module;
|
18
|
+
std::string raw;
|
19
|
+
public:
|
20
|
+
Bitmap(std::string data, int mod);
|
21
|
+
virtual ~Bitmap();
|
22
|
+
virtual int h();
|
23
|
+
virtual int w();
|
24
|
+
virtual int error();
|
25
|
+
virtual char value_at(int x, int y);
|
26
|
+
void value_set(int x, int y, char value);
|
27
|
+
void print();
|
28
|
+
void clear(char value);
|
29
|
+
virtual bool pixel_match(int x, int y, Matcher *matcher);
|
30
|
+
};
|
31
|
+
|
32
|
+
#endif /* POLYGON_BITMAPS_BITMAP_H_ */
|