19 #include "allheaders.h"
27 #include "config_auto.h"
30 #define BLOCK_LABEL_HEIGHT 150 //char height of block id
43 int16_t ymin, int16_t xmax,
44 int16_t ymax): box (
ICOORD (xmin, ymin),
ICOORD (xmax, ymax)) {
46 ICOORDELT_IT left_it = &leftside;
47 ICOORDELT_IT right_it = &rightside;
50 left_it.set_to_list (&leftside);
51 right_it.set_to_list (&rightside);
53 left_it.add_to_end (
new ICOORDELT (xmin, ymin));
54 left_it.add_to_end (
new ICOORDELT (xmin, ymax));
55 right_it.add_to_end (
new ICOORDELT (xmax, ymin));
56 right_it.add_to_end (
new ICOORDELT (xmax, ymax));
76 left_it.move_to_first();
77 left_it.add_list_before(left);
79 right_it.move_to_first();
80 right_it.add_list_before(right);
99 if (pt.
x() >= bleft.
x() && pt.
x() <= tright.
x()
100 && pt.
y() >= bleft.
y() && pt.
y() <= tright.
y())
118 for (it.mark_cycle_pt (); !it.cycled_list (); it.forward ())
119 *(it.data ()) += vec;
123 for (it.mark_cycle_pt (); !it.cycled_list (); it.forward ())
124 *(it.data ()) += vec;
133 rotated_box.
rotate(rerotation);
134 Pix* pix = pixCreate(rotated_box.
width(), rotated_box.
height(), 1);
138 ICOORDELT_LIST polygon;
141 image_block.
rotate(rerotation);
146 const std::unique_ptr< ICOORDELT_LIST> segments(
148 if (!segments->empty()) {
149 ICOORDELT_IT s_it(segments.get());
152 for (s_it.mark_cycle_pt(); !s_it.cycled_list(); s_it.forward()) {
153 int start = s_it.data()->x();
154 int xext = s_it.data()->y();
156 pixRasterop(pix, start - rotated_box.
left(),
158 xext, 1, PIX_SET,
nullptr, 0, 0);
165 pixRasterop(pix, 0, 0, rotated_box.
width(), rotated_box.
height(),
166 PIX_SET,
nullptr, 0, 0);
168 if (mask_box !=
nullptr) *mask_box = rotated_box;
179 #ifndef GRAPHICS_DISABLED
197 startpt = *(it.data ());
201 #if !defined(_WIN32) || defined(__MINGW32__)
202 snprintf(temp_buff,
sizeof(temp_buff),
"%" PRId32, serial);
204 _ultoa(serial, temp_buff, 10);
206 window->
Text(startpt.
x (), startpt.
y (), temp_buff);
210 prevpt = *(it.data ());
213 window->
DrawTo(prevpt.
x (), it.data ()->y ());
214 window->
DrawTo(it.data ()->x (), it.data ()->y ());
216 while (!it.at_last ());
217 endpt = *(it.data ());
223 for (it.mark_cycle_pt (); !it.cycled_list (); it.forward ()) {
225 window->
DrawTo(prevpt.
x (), it.data ()->y ());
226 window->
DrawTo(it.data ()->x (), it.data ()->y ());
227 prevpt = *(it.data ());
230 window->
DrawTo(endpt.
x(), endpt.
y());
265 ):left_it (&blkptr->leftside), right_it (&blkptr->rightside) {
284 left_it.set_to_list (&blkptr->
leftside);
285 right_it.set_to_list (&blkptr->
rightside);
298 left_it.move_to_first ();
299 right_it.move_to_first ();
300 left_it.mark_cycle_pt ();
301 right_it.mark_cycle_pt ();
302 ymin = left_it.data ()->y ();
303 ymax = left_it.data_relative (1)->y ();
304 if (right_it.data_relative (1)->y () < ymax)
306 ymax = right_it.data_relative (1)->y ();
317 if (!left_it.empty ()) {
318 if (left_it.data_relative (1)->y () == ymax)
320 if (right_it.data_relative (1)->y () == ymax)
323 if (left_it.at_last () || right_it.at_last ()) {
324 left_it.move_to_first ();
325 right_it.move_to_first ();
327 ymin = left_it.data ()->y ();
333 ymax = left_it.data_relative (1)->y ();
334 if (right_it.data_relative (1)->y () < ymax)
336 ymax = right_it.data_relative (1)->y ();
356 if (y < bleft.
y () || y >= tright.
y ()) {
364 if (y >= bleft.
y () && y < tright.
y ()) {
366 xext = tright.
x () - bleft.
x ();
373 if (y >= bleft.
y () && y < tright.
y ()) {
375 xext = tright.
x () - bleft.
x ();