Get a clone/copy of the source image rectangle. The returned Pix must be pixDestroyed. This function will be used in the future by the page layout analysis, and the layout analysis that uses it will only be available with Leptonica, so there is no raw equivalent.
| 226 | // the layout analysis that uses it will only be available with Leptonica, |
| 227 | // so there is no raw equivalent. |
| 228 | Pix* ImageThresholder::GetPixRect() { |
| 229 | if (IsFullImage()) { |
| 230 | // Just clone the whole thing. |
| 231 | return pixClone(pix_); |
| 232 | } else { |
| 233 | // Crop to the given rectangle. |
| 234 | Box* box = boxCreate(rect_left_, rect_top_, rect_width_, rect_height_); |
| 235 | Pix* cropped = pixClipRectangle(pix_, box, NULL); |
| 236 | boxDestroy(&box); |
| 237 | return cropped; |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | // Get a clone/copy of the source image rectangle, reduced to greyscale, |
| 242 | // and at the same resolution as the output binary. |
no test coverage detected