170 if (!init_ && !Init())
173 if (!IsValidSegmentRange(start_pt, end_pt))
177 if (samp_cache_ && samp_cache_[start_pt + 1] &&
178 samp_cache_[start_pt + 1][end_pt]) {
179 return samp_cache_[start_pt + 1][end_pt];
185 end_pt - start_pt,
NULL,
186 &left_most, &right_most, hgt_);
190 if (kUseCroppedChars) {
191 CharSamp *cropped_samp = samp->Crop();
200 int char_top = samp->Top();
201 int char_wid = samp->Width();
202 int char_hgt = samp->Height();
208 bool first_char = rtl_ ? right_most : left_most;
209 bool last_char = rtl_ ? left_most : right_most;
211 samp->SetFirstChar(first_char ? 255 : 0);
212 samp->SetLastChar(last_char ? 255 : 0);
216 samp->SetFirstChar((start_pt == -1) ? 255 : 0);
217 samp->SetLastChar((end_pt == (segment_cnt_ - 1)) ? 255 : 0);
219 samp->SetNormTop(255 * char_top / hgt_);
220 samp->SetNormBottom(255 * (char_top + char_hgt) / hgt_);
221 samp->SetNormAspectRatio(255 * char_wid / (char_wid + char_hgt));
224 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)