Skip to content

Commit

Permalink
Use Leptonica API to access internals of Pix
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Jun 23, 2022
1 parent 71b045c commit 70109f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/training/degradeimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ Image DegradeImage(Image input, int exposure, TRand *randomizer, float *rotation
}
SET_DATA_BYTE(data, x, pixel);
}
data += input->wpl;
data += pixGetWpl(input);
}
return input;
}
Expand Down
2 changes: 1 addition & 1 deletion src/training/pango/stringrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static Image CairoARGB32ToPixFormat(cairo_surface_t *surface) {
int byte_stride = cairo_image_surface_get_stride(surface);

for (int i = 0; i < height; ++i) {
memcpy(reinterpret_cast<unsigned char *>(pix->data + i * pix->wpl) + 1,
memcpy(reinterpret_cast<unsigned char *>(pixGetData(pix) + i * pixGetWpl(pix)) + 1,
cairo_image_surface_get_data(surface) + i * byte_stride,
byte_stride - ((i == height - 1) ? 1 : 0));
}
Expand Down

0 comments on commit 70109f1

Please sign in to comment.