148 if (!init_ && !Init())
151 if (!IsValidSegmentRange(start_pt, end_pt))
155 if (samp_cache_ && samp_cache_[start_pt + 1] &&
156 samp_cache_[start_pt + 1][end_pt]) {
157 return samp_cache_[start_pt + 1][end_pt];
163 end_pt - start_pt, NULL,
164 &left_most, &right_most, hgt_);
168 if (kUseCroppedChars) {
169 CharSamp *cropped_samp = samp->Crop();
178 int char_top = samp->Top();
179 int char_wid = samp->Width();
180 int char_hgt = samp->Height();
186 bool first_char = rtl_ ? right_most : left_most;
187 bool last_char = rtl_ ? left_most : right_most;
189 samp->SetFirstChar(first_char ? 255 : 0);
190 samp->SetLastChar(last_char ? 255 : 0);
194 samp->SetFirstChar((start_pt == -1) ? 255 : 0);
195 samp->SetLastChar((end_pt == (segment_cnt_ - 1)) ? 255 : 0);
197 samp->SetNormTop(255 * char_top / hgt_);
198 samp->SetNormBottom(255 * (char_top + char_hgt) / hgt_);
199 samp->SetNormAspectRatio(255 * char_wid / (char_wid + char_hgt));
202 samp_cache_[start_pt + 1][end_pt] = samp;
static CharSamp * FromConComps(ConComp **concomp_array, int strt_concomp, int seg_flags_size, int *seg_flags, bool *left_most, bool *right_most, int word_hgt)