本文整理汇总了C++中Bounds::get_upper_edge方法的典型用法代码示例。如果您正苦于以下问题:C++ Bounds::get_upper_edge方法的具体用法?C++ Bounds::get_upper_edge怎么用?C++ Bounds::get_upper_edge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bounds
的用法示例。
在下文中一共展示了Bounds::get_upper_edge方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runtime_error
std::vector< Projection::MappedPoint >
ScaledProjection::cut_region_of_interest_( const ROISpecification& r ) const
{
std::vector< MappedPoint > rv;
Bounds bb = get_region_of_interest_( r );
if ( r.guaranteed_row_width ) {
quantity< camera::length, int >
one =1 * camera::pixel, width = bb.width(Direction_X),
lower = bb.get_lower_edge( Direction_X ), upper = bb.get_upper_edge( Direction_X );
if ( width < *r.guaranteed_row_width ) {
lower -= one; width += one;
if ( width < *r.guaranteed_row_width )
{ upper += one; width += one; }
} else if ( width > *r.guaranteed_row_width ) {
upper -= one; width -= one;
}
assert( width == *r.guaranteed_row_width );
while ( upper >= size.x() )
{ upper -= one; lower -= one; }
while ( lower < 0 * camera::pixel )
{ lower += one; upper += one; }
if ( upper >= size.x() )
throw std::runtime_error("Image is too small for desired ROI");
bb.set_range( lower, upper, Direction_X );
}
ImagePosition pos;
typedef ImagePosition::Scalar Pixel;
rv.reserve( bb.volume().value() );
SamplePosition sample;
for ( Bounds::const_iterator i = bb.begin(); i != bb.end(); ++i ) {
rv.push_back( MappedPoint( *i, pixel_in_sample_space(*i) ) );
}
return rv;
}