=== 26/05/2017更 ===
- The static drawing function
static void DisplayBoxVector [tabfind.cpp]
does draw different colours other thanScrollView::WHITE
depending on blob typesTabFind::FindInitialTabVectors
gets called TWICE, hence produces two sets of debugging windows:
- ”VerticalLines”
- “InitialTabs”
- For 1st
"InitialTabs"
window, only white boxes are drawn via aboveDisplayBoxVector
- For 2nd
"InitialTabs"
window, colour boxes will be drawn first, conforming toBLOBNBOX::TextlineColor
colour scheme- For both cases, the box edges will be rendered based on Box Tab types
====================
- The debugging window “Initial textline Blobs” is drawn through
TextlineProjection::PlotGradedBlobs [textord/textlineprojection.cpp]
ONLY- NOTE the difference between
PlotGradedBlobs
andTO_BLOCK::plot_graded_blobs
- It ONLY has three colours:
ScrollView::YELLOW
: UniquelyVerticalScrollView::RED
: bad_box afterTextlineProjection::BoxOutOfHTextline
ScrollView::BLUE
:
// Display the blobs in the window colored according to textline quality.
void TextlineProjection::PlotGradedBlobs(BLOBNBOX_LIST* blobs,
ScrollView* win) {
#ifndef GRAPHICS_DISABLED
BLOBNBOX_IT it(blobs);
for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
BLOBNBOX* blob = it.data();
const TBOX& box = blob->bounding_box();
bool bad_box = BoxOutOfHTextline(box, NULL, false);
if (blob->UniquelyVertical())
win->Pen(ScrollView::YELLOW);
else
win->Pen(bad_box ? ScrollView::RED : ScrollView::BLUE);
win->Rectangle(box.left(), box.bottom(), box.right(), box.top());
}
win->Update();
#endif // GRAPHICS_DISABLED
}
=== 25/05/2017更 ===
- The following debugging windows from
StrokeWidth::FindInitialPartitions
are using mixed colour scheme for displaying blobs
- ”Initial text chains”
- “GoodTextline blobs”
- “Diacritics”
- “Smoothed blobs”
- From
template<class BBC, class BBC_CLIST, class BBC_C_IT>
void BBGrid<BBC, BBC_CLIST, BBC_C_IT>::DisplayBoxes- Where BBC is initialised as ColPartition [textord/colpartition.cpp]
#ifndef GRAPHICS_DISABLED
// Provides a color for BBGrid to draw the rectangle.
// Must be kept in sync with PolyBlockType.
ScrollView::Color ColPartition::BoxColor() const {
if (type_ == PT_UNKNOWN)
return BLOBNBOX::TextlineColor(blob_type_, flow_);
return POLY_BLOCK::ColorForPolyBlockType(type_);
}
#endif // GRAPHICS_DISABLED
=== 23/05/2017更 ===
#ifndef GRAPHICS_DISABLED
/// Returns a color to draw the given type.
ScrollView::Color POLY_BLOCK::ColorForPolyBlockType(PolyBlockType type) {
// Keep kPBColors in sync with PolyBlockType.
const ScrollView::Color kPBColors[PT_COUNT] = {
ScrollView::WHITE, // Type is not yet known. Keep as the 1st element.
ScrollView::BLUE, // Text that lives inside a column.
ScrollView::CYAN, // Text that spans more than one column.
ScrollView::MEDIUM_BLUE, // Text that is in a cross-column pull-out region.
ScrollView::AQUAMARINE, // Partition belonging to an equation region.
ScrollView::SKY_BLUE, // Partition belonging to an inline equation region.
ScrollView::MAGENTA, // Partition belonging to a table region.
ScrollView::GREEN, // Text-line runs vertically.
ScrollView::LIGHT_BLUE, // Text that belongs to an image.
ScrollView::RED, // Image that lives inside a column.
ScrollView::YELLOW, // Image