mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
add defect size option
This commit is contained in:
3
djvu.c
3
djvu.c
@@ -489,9 +489,10 @@ static int reflowPage(lua_State *L) {
|
||||
double contrast = luaL_checknumber(L, 15);
|
||||
int rotation = luaL_checkint(L, 16);
|
||||
double quality = luaL_checknumber(L, 17);
|
||||
double defect_size = luaL_checknumber(L, 18);
|
||||
|
||||
k2pdfopt_set_params(width, height, font_size, page_margin, line_spacing, word_spacing, \
|
||||
text_wrap, straighten, justification, detect_indent, columns, contrast, rotation, quality);
|
||||
text_wrap, straighten, justification, detect_indent, columns, contrast, rotation, quality, defect_size);
|
||||
k2pdfopt_djvu_reflow(page->page_ref, page->doc->context, mode, page->doc->pixelformat);
|
||||
k2pdfopt_rfbmp_size(&width, &height);
|
||||
k2pdfopt_rfbmp_zoom(&dc->zoom);
|
||||
|
||||
@@ -498,7 +498,8 @@ void k2pdfopt_set_params(int bb_width, int bb_height, \
|
||||
int wrapping, int straighten, \
|
||||
int justification, int detect_indent,\
|
||||
int columns, double contrast, \
|
||||
int rotation, double quality) {
|
||||
int rotation, double quality, \
|
||||
double defect_size) {
|
||||
dst_userwidth = bb_width; // dst_width is adjusted in adjust_params_init
|
||||
dst_userheight = bb_height;
|
||||
zoom_value = font_size;
|
||||
@@ -511,6 +512,7 @@ void k2pdfopt_set_params(int bb_width, int bb_height, \
|
||||
gamma_correction = contrast; // contrast is only used by k2pdfopt_mupdf_reflow
|
||||
src_rot = rotation;
|
||||
src_dpi = (int)300*quality;
|
||||
defect_size_pts = defect_size;
|
||||
|
||||
// margin
|
||||
dst_mar = page_margin;
|
||||
|
||||
@@ -32,7 +32,8 @@ void k2pdfopt_set_params(int bb_width, int bb_height, \
|
||||
int wrapping, int straighten, \
|
||||
int justification, int detect_indent, \
|
||||
int columns, double contrast, \
|
||||
int rotation, double quality);
|
||||
int rotation, double quality, \
|
||||
double defect_size);
|
||||
void k2pdfopt_mupdf_reflow(fz_document *doc, fz_page *page, fz_context *ctx);
|
||||
void k2pdfopt_djvu_reflow(ddjvu_page_t *page, ddjvu_context_t *ctx, ddjvu_render_mode_t mode, ddjvu_format_t *fmt);
|
||||
void k2pdfopt_rfbmp_size(int *width, int *height);
|
||||
|
||||
3
pdf.c
3
pdf.c
@@ -529,9 +529,10 @@ static int reflowPage(lua_State *L) {
|
||||
double contrast = luaL_checknumber(L, 15);
|
||||
int rotation = luaL_checkint(L, 16);
|
||||
double quality = luaL_checknumber(L, 17);
|
||||
double defect_size = luaL_checknumber(L, 18);
|
||||
|
||||
k2pdfopt_set_params(width, height, font_size, page_margin, line_spacing, word_spacing, \
|
||||
text_wrap, straighten, justification, detect_indent, columns, contrast, rotation, quality);
|
||||
text_wrap, straighten, justification, detect_indent, columns, contrast, rotation, quality, defect_size);
|
||||
k2pdfopt_mupdf_reflow(page->doc->xref, page->page, page->doc->context);
|
||||
k2pdfopt_rfbmp_size(&width, &height);
|
||||
k2pdfopt_rfbmp_zoom(&dc->zoom);
|
||||
|
||||
Reference in New Issue
Block a user