本文整理汇总了C++中ColPartition::boxes方法的典型用法代码示例。如果您正苦于以下问题:C++ ColPartition::boxes方法的具体用法?C++ ColPartition::boxes怎么用?C++ ColPartition::boxes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ColPartition
的用法示例。
在下文中一共展示了ColPartition::boxes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UnmatchedWidth
// Returns the total width of all blobs in the part_set that do not lie
// within an approved column. Used as a cost measure for using this
// column set over another that might be compatible.
int ColPartitionSet::UnmatchedWidth(ColPartitionSet* part_set) {
int total_width = 0;
ColPartition_IT it(&part_set->parts_);
for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
ColPartition* part = it.data();
if (!BLOBNBOX::IsTextType(part->blob_type())) {
continue; // Non-text partitions are irrelevant to column compatibility.
}
int y = part->MidY();
BLOBNBOX_C_IT box_it(part->boxes());
for (box_it.mark_cycle_pt(); !box_it.cycled_list(); box_it.forward()) {
const TBOX& box = it.data()->bounding_box();
// Assume that the whole blob is outside any column iff its x-middle
// is outside.
int x = (box.left() + box.right()) / 2;
ColPartition* col = ColumnContaining(x, y);
if (col == NULL)
total_width += box.width();
}
}
return total_width;
}