20 #ifndef TESSERACT_CCUTIL_INDEXMAPBIDI_H_ 21 #define TESSERACT_CCUTIL_INDEXMAPBIDI_H_ 24 #include "genericvector.h" 111 void InitAndSetupRange(
int sparse_size,
int start,
int end);
117 void Init(
int size,
bool all_mapped);
119 void SetMap(
int sparse_index,
bool mapped);
128 bool Merge(
int compact_index1,
int compact_index2);
131 return MasterCompactIndex(index) < 0;
135 void CompleteMerges();
139 return sparse_map_[sparse_index];
143 return sparse_map_.size();
168 while (compact_index >= 0 &&
169 sparse_map_[
compact_map_[compact_index]] != compact_index)
170 compact_index = sparse_map_[
compact_map_[compact_index]];
171 return compact_index;
180 #endif // TESSERACT_CCUTIL_INDEXMAPBIDI_H_ virtual int SparseSize() const
Definition: indexmapbidi.h:142
bool DeSerialize(bool swap, FILE *fp)
Definition: indexmapbidi.cpp:54
int CompactToSparse(int compact_index) const
Definition: indexmapbidi.h:53
bool Serialize(FILE *fp) const
Definition: indexmapbidi.cpp:48
void CopyFrom(const IndexMap &src)
Definition: indexmapbidi.cpp:38
bool IsCompactDeleted(int index) const
Definition: indexmapbidi.h:130
virtual int SparseSize() const
Definition: indexmapbidi.h:57
int MasterCompactIndex(int compact_index) const
Definition: indexmapbidi.h:167
Definition: baseapi.cpp:94
Definition: indexmapbidi.h:42
GenericVector< int32_t > sparse_map_
Definition: indexmapbidi.h:175
Definition: indexmapbidi.h:102
int size() const
Definition: genericvector.h:71
GenericVector< int32_t > compact_map_
Definition: indexmapbidi.h:80
virtual int SparseToCompact(int sparse_index) const
Definition: indexmapbidi.h:138
int CompactSize() const
Definition: indexmapbidi.h:61
int32_t sparse_size_
Definition: indexmapbidi.h:77
virtual int SparseToCompact(int sparse_index) const
Definition: indexmapbidi.cpp:32