page block
More...
#include <pdblock.h>
page block
Definition at line 30 of file pdblock.h.
◆ PDBLK() [1/2]
empty constructor
Definition at line 36 of file pdblock.h.
◆ PDBLK() [2/2]
PDBLK::PDBLK |
( |
int16_t |
xmin, |
|
|
int16_t |
ymin, |
|
|
int16_t |
xmax, |
|
|
int16_t |
ymax |
|
) |
| |
simple constructor
- Parameters
-
xmin | bottom left |
xmax | top right |
Definition at line 39 of file pdblock.cpp.
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));
◆ ~PDBLK()
◆ bounding_box() [1/2]
const TBOX& PDBLK::bounding_box |
( |
| ) |
const |
|
inline |
◆ bounding_box() [2/2]
void PDBLK::bounding_box |
( |
ICOORD & |
bottom_left, |
|
|
ICOORD & |
top_right |
|
) |
| const |
|
inline |
◆ contains()
bool PDBLK::contains |
( |
ICOORD |
pt | ) |
|
is pt inside block
Definition at line 85 of file pdblock.cpp.
99 if (pt.
x() >= bleft.
x() && pt.
x() <= tright.
x()
100 && pt.
y() >= bleft.
y() && pt.
y() <= tright.
y())
◆ index()
int PDBLK::index |
( |
| ) |
const |
|
inline |
◆ move()
void PDBLK::move |
( |
const ICOORD |
vec | ) |
|
reposition block
Definition at line 108 of file pdblock.cpp.
118 for (it.mark_cycle_pt (); !it.cycled_list (); it.forward ())
119 *(it.data ()) += vec;
◆ operator=()
◆ plot()
draw histogram
- Parameters
-
window | window to draw in |
serial | serial number |
colour | colour to draw in |
Definition at line 174 of file pdblock.cpp.
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 ());
◆ poly_block()
◆ render_mask()
Pix * PDBLK::render_mask |
( |
const FCOORD & |
rerotation, |
|
|
TBOX * |
mask_box |
|
) |
| |
Definition at line 126 of file pdblock.cpp.
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(),
157 rotated_box.height() - 1 - (y - rotated_box.bottom()),
158 xext, 1, PIX_SET,
nullptr, 0, 0);
165 pixRasterop(pix, 0, 0, rotated_box.width(), rotated_box.height(),
◆ set_index()
void PDBLK::set_index |
( |
int |
value | ) |
|
|
inline |
◆ set_poly_block()
set the poly block
Definition at line 56 of file pdblock.h.
◆ set_sides()
void PDBLK::set_sides |
( |
ICOORDELT_LIST * |
left, |
|
|
ICOORDELT_LIST * |
right |
|
) |
| |
set vertex lists
- Parameters
-
left | list of left vertices |
right | list of right vertices |
Definition at line 64 of file pdblock.cpp.
76 left_it.move_to_first();
77 left_it.add_list_before(left);
◆ BLOCK
◆ BLOCK_RECT_IT
block iterator
Definition at line 31 of file pdblock.h.
◆ box
◆ hand_poly
◆ index_
Serial number of this block.
Definition at line 98 of file pdblock.h.
◆ leftside
ICOORDELT_LIST PDBLK::leftside |
|
protected |
left side vertices
Definition at line 95 of file pdblock.h.
◆ rightside
ICOORDELT_LIST PDBLK::rightside |
|
protected |
right side vertices
Definition at line 96 of file pdblock.h.
The documentation for this class was generated from the following files: