mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-12-15 17:49:29 +08:00
scanedg: Add const attributes
Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
fdb3f58c6c
commit
90b12b3afa
@ -57,7 +57,7 @@ void block_edges(Pix *t_pix, // thresholded image
|
|||||||
|
|
||||||
std::unique_ptr<uint8_t[]> bwline(new uint8_t[width]);
|
std::unique_ptr<uint8_t[]> bwline(new uint8_t[width]);
|
||||||
|
|
||||||
uint8_t margin = WHITE_PIX;
|
const uint8_t margin = WHITE_PIX;
|
||||||
|
|
||||||
for (int y = tright.y() - 1; y >= bleft.y() - 1; y--) {
|
for (int y = tright.y() - 1; y >= bleft.y() - 1; y--) {
|
||||||
if (y >= bleft.y() && y < tright.y()) {
|
if (y >= bleft.y() && y < tright.y()) {
|
||||||
@ -149,7 +149,6 @@ void line_edges(int16_t x, // coord of line start
|
|||||||
C_OUTLINE_IT* outline_it) {
|
C_OUTLINE_IT* outline_it) {
|
||||||
CrackPos pos = {free_cracks, x, y };
|
CrackPos pos = {free_cracks, x, y };
|
||||||
int xmax; // max x coord
|
int xmax; // max x coord
|
||||||
int colour; // of current pixel
|
|
||||||
int prevcolour; // of previous pixel
|
int prevcolour; // of previous pixel
|
||||||
CRACKEDGE *current; // current h edge
|
CRACKEDGE *current; // current h edge
|
||||||
CRACKEDGE *newcurrent; // new h edge
|
CRACKEDGE *newcurrent; // new h edge
|
||||||
@ -160,7 +159,7 @@ void line_edges(int16_t x, // coord of line start
|
|||||||
|
|
||||||
// do each pixel
|
// do each pixel
|
||||||
for (; pos.x < xmax; pos.x++, prevline++) {
|
for (; pos.x < xmax; pos.x++, prevline++) {
|
||||||
colour = *bwpos++; // current pixel
|
const int colour = *bwpos++; // current pixel
|
||||||
if (*prevline != nullptr) {
|
if (*prevline != nullptr) {
|
||||||
// changed above
|
// changed above
|
||||||
// change colour
|
// change colour
|
||||||
|
Loading…
Reference in New Issue
Block a user