void Insert( const tPlane8& in, tPlane8& out, int32_xy pos, uint32_xy size ) { auto yinbegin = in.begin(); auto yinend = in.begin() + size.y(); auto youtbegin = out.begin() + pos.y(); while( yinbegin != yinend ) { copy( yinbegin->begin(), yinbegin->begin() + size.x(), youtbegin->begin() + pos.x() ); ++yinbegin; ++youtbegin; } }
bool tBlob::ConnectedWithImageBorder( uint32_xy size_ )const { if( this->streak_count() == 0 ) { return false; } auto iStreakStart = _streaks.begin(); auto iStreakEnd = _streaks.end(); auto bottom = size_.x() - 1 ; auto right = size_.y() - 1; uint32_t top = 0; uint32_t left = 0; while( iStreakStart != iStreakEnd ) { auto x = iStreakStart->x(); auto y = iStreakStart->y(); auto last_ = iStreakStart->last(); if( // top y == top || // bottom y == bottom || // left x == left || // right last_ == right ) { return true; } ++iStreakStart; } return false; }
tAoi::tAoi( int32_xy const& pos0, uint32_xy const& size0 ):_pos( pos0.x(), pos0.y() ), _size( size0.x(), size0.y() ) {}