Commit Graph

107 Commits (ce624be8b83e880b1a81106a143e1440eeda4aab)

Author SHA1 Message Date
chrox 4cfdce6105 fix several local calls of Math.round 11 years ago
HW 2154e7e852 Further refactoring
This should finish the work to make all globals to local variables.
That allows LuaJIT to properly compile things by interning the
references to the relevant parts (rather than looking up globals
all the time which stops a trace).
11 years ago
HW ef111b99c6 Refactored to use strictly locals 11 years ago
chrox 9f42289226 use pixels from reflowed page when doing OCR in reflowing mode
I hope it will get back OCR accuracy as in build 545.
11 years ago
chrox 2cd5a083ae fix getAutoBBox failed bug
If getAutoBBox is fed with a blank page the returned bbox will be
much smaller than the native page dimensions. The problem is that
in zoom to 'content*' mode document renderer will try to render
the whole page at a zoom level that can cover the screen with the
bbox region of the page. That's if the blank page size is 3000*4000
and the returned autobbox is 300*400, the screen size is 600*800,
then the page will be rendered in 3000*(600/300)*4000*(800/400)
which is so large that the cache manager will not accept.

This patch just check if the returned autobbox is considerablely
much smaller than the native page dimensions. If so it will return
the manual bbox.

This patch should fix #293. And it's tested with the case provided
by @Markismus in #291.
11 years ago
chrox 1ee6d5a9c5 add DEBUGBT function to traceback certain location 11 years ago
chrox 39da1251ec free blitbuffer as soon as tile is kicked out from cache
other than waiting for the lazy garbage collector of lua
11 years ago
chrox 4660a3532b synchronize hightlights in non-/reflowing modes
and there is no need to OCR word if we can extract text from
original page in reflowing mode thanks to the rect maps between
normal page and reflowed page.
11 years ago
chrox ffd31613a5 estimate cache size of koptcontext
This should fix #285.
11 years ago
chrox f2cf10a015 refactoring koptcontext creation function 11 years ago
chrox aefb58f5bf bugfix: fix invalid auto page cropping 11 years ago
chrox 1808c7e5c3 add document language option in config dialog
Document language setting is used for better text extraction and OCR.
11 years ago
chrox 2e5d2b9930 add semi-auto bbox option in page crop dialog 11 years ago
chrox 9cb9999865 semi-automatic bbox finding
Semi-automatic cropping is implemented with a initial
manual cropping that exclude the obvious decorating line or
the spine part in scanned books and then an automatic cropping
ie. background/foreground pixel detection restricted within
the manual cropping area.
This PR is a candidate for the solution of issue #141.
11 years ago
Qingping Hou 18122fe067 add defaults.lua 11 years ago
chrox 7c78e83e49 add hightlight/dictionary lookup in scanned pdf/djvu 11 years ago
chrox cb873ee528 init/free OCR engine when necessary 11 years ago
chrox 1a8bd4ca8c try to drop cache before OCR 11 years ago
chrox 936dfc6fd1 add text highlight in both reflow and non-reflow mode 11 years ago
chrox ac548d768c don't bother to consume background context
since now each context is independent and has its own dst bitmap.
11 years ago
chrox fb05f9a428 add auto page crop 11 years ago
chrox 22b650d0c7 move kopt/cre options into ui/data directory & wrap strings in config options 11 years ago
Qingping Hou 09e1c0af06 add gettext to document modules 11 years ago
chrox b2c23c6f4f cleanup: use lowercase option name && better reflow for vertical text 11 years ago
chrox 607c4baf2e add fine tuning of font size in koptinterface 11 years ago
chrox ef68ccebfe add background hinting in koptinterface 11 years ago
chrox 591a27ddfe log reflow duration for benchmarking 11 years ago
chrox a2dc5e00a2 bugfix: reset page scroll states when switching reflow on/off 11 years ago
chrox 63e5e7e577 add scroll mode for pdf/djvu reader 11 years ago
chrox 4c1fc6be5c make larger default page margin 11 years ago
chrox 86a65003d1 set manual cropping if bbox exists 11 years ago
chrox c5b4d958bb add reading progress bar at the bottom of ReaderView for pdf/djvu reader
And there is also a toggle full screen option to turn on/off the progress bar.
11 years ago
chrox 14bcec4b81 remove arguments of RestoreZoomMode events defined in KoptOptions
Now zoom mode restoration is handled by ReaderKoptListener
11 years ago
chrox 9efdefb22f add gamma correction for pdf/djvu reader 11 years ago
chrox df7f7714e4 remove default options in KoptOptions and CreOptions 11 years ago
chrox 666bb3d8ae restore zoom mode when toggling reflow on/off 11 years ago
chrox c53f866a93 cleanup: use screen size in page hash explicitly 11 years ago
chrox 7af80f63f6 check screen mode in koptinterface 11 years ago
chrox 1f511757c5 bugfix: calculate current config value or arg at runtime 11 years ago
{Qingping,Dave} Hou 85b4d60efc Merge pull request #735 from chrox/ui-tweaks
set menu font size according to screen dpi
11 years ago
chrox 21c972a786 hide DPI dependency in Font module 11 years ago
Qingping Hou ae6c4bd03a Merge branch 'new_ui_code' of github.com:hwhw/kindlepdfviewer into rotate
Conflicts:
	frontend/ui/reader/readerconfig.lua
11 years ago
chrox 0ed5d05bc0 hash current bbox explicitly 11 years ago
chrox 4675a220d8 add current bbox in page rendering hash
So that changing bbox could take effect on current page.
11 years ago
Qingping Hou f91c913530 set default_arg for screen_mode option on runtime 11 years ago
Qingping Hou 0dba667937 rename setScreenViewMode to setScreenMode 11 years ago
Qingping Hou 03b73712bc Merge branch 'new_ui_code' of github.com:hwhw/kindlepdfviewer into rotate
Conflicts:
	frontend/document/koptinterface.lua
11 years ago
chrox 1be80d15ae code cleanup 11 years ago
chrox 1c40d127cd add icon option items in config dialog 11 years ago
chrox 25bcbfa53a set menu font size according to screen dpi 11 years ago
chrox a1aa41136c add manual page crop for pdf/djvu documents 11 years ago
Qingping Hou 2d9534e092 add screen rotate to readerconfig 11 years ago
chrox 563fd50dc3 add toggle switch widget in config option 11 years ago
chrox 494585ce41 rename 'screen rotation' option in koptinterface to 'vertical text' 11 years ago
chrox 6ed1a9012b show more options 11 years ago
chrox aa152a8a51 make readerconfig independent of koptoptions
So that other readers could reuse readerconfig
11 years ago
chrox 349bcb996e use koptinterface to reflow text in pdf/djvu readers 11 years ago