src/ccstruct/seam.cpp
bool SEAM::PrepareToInsertSeam(const std::vector<SEAM *> &seams,
                               const std::vector<TBLOB *> &blobs, int insert_index, bool modify) {
  for (int s = 0; s < insert_index; ++s) {
    if (!seams[s]->FindBlobWidth(blobs, s, modify)) {
      return false;
    }
  }
  if (!FindBlobWidth(blobs, insert_index, modify)) {
    return false;
  }
  for (unsigned s = insert_index; s < seams.size(); ++s) {
    if (!seams[s]->FindBlobWidth(blobs, s + 1, modify)) {
      return false;
    }
  }
  return true;
}
// Computes the widthp_/widthn_ range for all existing SEAMs and for *this
// seam, which is about to be inserted at insert_index. Returns false if
// any of the computations fails, as this indicates an invalid chop.
// widthn_/widthp_ are only changed if modify is true.
Computes the widthp_/widthn_ range for all existing SEAMs and for *this
seam, which is about to be inserted at insert_index. Returns false if
any of the computations fails, as this indicates an invalid chop.
widthn_/widthp_ are only changed if modify is true.
Computes the widthp_ / widthn_ range for all existing SEAMs and for * this seam which is about to be inserted at insert_index . Returns false if any of the computations fails as this indicates an invalid chop . widthn_ / widthp_ are only changed if modify is true .
bool SEAM::PrepareToInsertSeam(const std::vector<SEAM *> &seams,
                               const std::vector<TBLOB *> &blobs, int insert_index, bool modify) {
  for (int s = 0; s < insert_index; ++s) {
    if (!seams[s]->FindBlobWidth(blobs, s, modify)) {
      return false;
    }
  }
  if (!FindBlobWidth(blobs, insert_index, modify)) {
    return false;
  }
  for (unsigned s = insert_index; s < seams.size(); ++s) {
    if (!seams[s]->FindBlobWidth(blobs, s + 1, modify)) {
      return false;
    }
  }
  return true;
}
bool SEAM :: PrepareToInsertSeam ( const std :: vector < SEAM * > & seams , const std :: vector < TBLOB * > & blobs , int insert_index , bool modify ) { for ( int s = 0 ; s < insert_index ; ++ s ) { if ( ! seams [ s ] -> FindBlobWidth ( blobs , s , modify ) ) { return false ; } } if ( ! FindBlobWidth ( blobs , insert_index , modify ) ) { return false ; } for ( unsigned s = insert_index ; s < seams . size ( ) ; ++ s ) { if ( ! seams [ s ] -> FindBlobWidth ( blobs , s + 1 , modify ) ) { return false ; } } return true ; }
Computes the widthp_/widthn_ range for all existing SEAMs and for *this
seam, which is about to be inserted at insert_index.
Computes the widthp_ / widthn_ range for all existing SEAMs and for * this seam which is about to be inserted at insert_index .