add defect size option

This commit is contained in:
chrox
2012-11-03 17:32:57 +08:00
parent 486207ce1b
commit f7be331318
4 changed files with 9 additions and 4 deletions

3
djvu.c
View File

@@ -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);

View File

@@ -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;

View File

@@ -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
View File

@@ -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);