page block
More...
#include <pdblock.h>
page block
Definition at line 31 of file pdblock.h.
◆ PDBLK() [1/2]
empty constructor
Definition at line 37 of file pdblock.h.
POLY_BLOCK * hand_poly
weird as well
int index_
Serial number of this block.
◆ 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 41 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));
ICOORDELT_LIST rightside
right side vertices
ICOORDELT_LIST leftside
left side vertices
◆ ~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 |
get box
Definition at line 59 of file pdblock.h.
const ICOORD & botleft() const
const ICOORD & topright() const
◆ contains()
bool PDBLK::contains |
( |
ICOORD |
pt | ) |
|
is pt inside block
Definition at line 89 of file pdblock.cpp.
99 if (pt.
x() >= bleft.
x() && pt.
x() <= tright.
x()
100 && pt.
y() >= bleft.
y() && pt.
y() <= tright.
y())
void bounding_box(ICOORD &bleft, ICOORD &tright)
void start_block()
start iteration
bool cycled_rects()
test end
void forward()
next rectangle
int16_t y() const
access_function
int16_t x() const
access function
◆ index()
int PDBLK::index |
( |
| ) |
const |
|
inline |
◆ move()
void PDBLK::move |
( |
const ICOORD |
vec | ) |
|
reposition block
Definition at line 113 of file pdblock.cpp.
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;
void move(const ICOORD vec)
◆ operator=()
assignment
- Parameters
-
Definition at line 241 of file pdblock.cpp.
static ICOORDELT * deep_copy(const ICOORDELT *src)
◆ plot()
draw histogram
- Parameters
-
window | window to draw in |
serial | serial number |
colour | colour to draw in |
Definition at line 180 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 ());
227 prevpt = *(it.data ());
230 window->
DrawTo(endpt.
x(), endpt.
y());
#define BLOCK_LABEL_HEIGHT
void plot(ScrollView *window, int32_t num)
void DrawTo(int x, int y)
void TextAttributes(const char *font, int pixel_size, bool bold, bool italic, bool underlined)
void Text(int x, int y, const char *mystring)
void SetCursor(int x, int y)
◆ poly_block()
◆ render_mask()
Pix * PDBLK::render_mask |
( |
const FCOORD & |
rerotation, |
|
|
TBOX * |
mask_box |
|
) |
| |
Definition at line 131 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(),
166 PIX_SET,
nullptr, 0, 0);
168 if (mask_box !=
nullptr) *mask_box = rotated_box;
ICOORDELT_LIST * points()
PolyBlockType isA() const
◆ set_index()
void PDBLK::set_index |
( |
int |
value | ) |
|
|
inline |
◆ set_poly_block()
set the poly block
Definition at line 57 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 67 of file pdblock.cpp.
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);
◆ BLOCK
◆ BLOCK_RECT_IT
block iterator
Definition at line 32 of file pdblock.h.
◆ box
◆ hand_poly
◆ index_
Serial number of this block.
Definition at line 99 of file pdblock.h.
◆ leftside
ICOORDELT_LIST PDBLK::leftside |
|
protected |
left side vertices
Definition at line 96 of file pdblock.h.
◆ rightside
ICOORDELT_LIST PDBLK::rightside |
|
protected |
right side vertices
Definition at line 97 of file pdblock.h.
The documentation for this class was generated from the following files: