]> mj.ucw.cz Git - leo.git/blobdiff - labeller.c
Labelling: Support for better bitmaps granularity
[leo.git] / labeller.c
index 71c0f5538c56b73499192d40d7967b7e3b89b118..c386574556d50d638816518ea330ed7fcb27852f 100644 (file)
@@ -1,6 +1,7 @@
 #include <stdio.h>
 #include <math.h>
 #include <ucw/lib.h>
+#include <ucw/conf.h>
 
 #include "leo.h"
 #include "sym.h"
@@ -47,6 +48,15 @@ uns num_map_parts_row = 0;
 uns num_map_parts_col = 0;
 uns num_map_parts = 0;
 
+static struct cf_section labelling_cf = {
+  CF_ITEMS {
+    CF_DOUBLE("MaxSectionLenght", &conf_max_section_length),
+    CF_DOUBLE("MaxSectionOverlay", &conf_max_section_overlay),
+    CF_DOUBLE("BitmapGranularity", &bitmap_granularity),
+    CF_END
+  }
+};
+
 static void labeller_add_linelabel(struct symbol *sym, struct osm_object *o, z_index_t zindex);
 static void labeller_add_arealabel(struct symbol *sym, struct osm_object *o, z_index_t zindex);
 
@@ -57,6 +67,9 @@ static void compute_sizes(void)
   page_width_int = floor(page_width);
   page_height_int = floor(page_height);
 
+  page_width_gran = page_width * bitmap_granularity;
+  page_height_gran = page_height * bitmap_granularity;
+
   num_map_parts_row = (page_width_int + conf_map_part_width) / conf_map_part_width;
   num_map_parts_col = (page_height_int + conf_map_part_height) / conf_map_part_height;
   num_map_parts = num_map_parts_row * num_map_parts_col;
@@ -65,8 +78,8 @@ static void compute_sizes(void)
 
 void labeller_conf(void)
 {
+  cf_declare_section("Labelling", &labelling_cf, 0);
   evolution_conf();
-  lines_conf();
 }
 
 void labeller_init(void)