returns a copy of the charsamp that is scaled to the specified width and height
| 245 | // returns a copy of the charsamp that is scaled to the |
| 246 | // specified width and height |
| 247 | CharSamp *CharSamp::Scale(int wid, int hgt, bool isotropic) { |
| 248 | CharSamp *scaled_samp = new CharSamp(wid, hgt); |
| 249 | if (scaled_samp->ScaleFrom(this, isotropic) == false) { |
| 250 | delete scaled_samp; |
| 251 | return NULL; |
| 252 | } |
| 253 | scaled_samp->left_ = left_; |
| 254 | scaled_samp->top_ = top_; |
| 255 | scaled_samp->page_ = page_; |
| 256 | scaled_samp->SetLabel(label32_); |
| 257 | scaled_samp->first_char_ = first_char_; |
| 258 | scaled_samp->last_char_ = last_char_; |
| 259 | scaled_samp->norm_top_ = norm_top_; |
| 260 | scaled_samp->norm_bottom_ = norm_bottom_; |
| 261 | scaled_samp->norm_aspect_ratio_ = norm_aspect_ratio_; |
| 262 | return scaled_samp; |
| 263 | } |
| 264 | |
| 265 | // Load a Char Samp from a dump file |
| 266 | CharSamp *CharSamp::FromRawData(int left, int top, int wid, int hgt, |
no test coverage detected