2
0
mirror of https://github.com/koreader/koreader synced 2024-11-13 19:11:25 +00:00
Commit Graph

65 Commits

Author SHA1 Message Date
chrox
5b0e4b457b bugfix: destroying attr objects immediately after pthread_create 2012-11-26 22:17:27 +08:00
chrox
060eeec1c1 bugfix: reclaim thread stack explicitly by using detached threads
Otherwise the VmData size will keep increasing in multi-threads mode.
Although the increasing VmData size doesn't mean there is enormous
memory leak, it does show that the thread stack is not handled properly
when threads exit.
2012-11-26 22:17:02 +08:00
chrox
f981b70ac0 add multi-threaded precache
Because the lua reader is single threaded on which both user inputloop
and background page rendering is processed. Although there is a pretty
good precache system to save user's time spending on waiting for the
rendering when going to the next page, user input is indeed blocked when
running the precache thing. The situation is even worse in koptreader as
reflowing on page would usually take several second, in this period
users cannot move to the next page view even it's already in the cache.
This patch will let precache run in the background in a seperate thread
so that the koptreader is still responsive when precaching the next
page. Now it only just works. Welcome to find out bugs in it.
2012-11-26 22:10:26 +08:00
chrox
44361faeee build libk2pdfopt as a shared library 2012-11-26 22:02:09 +08:00
chrox
a5b28ff6f2 include k2pdfopt header in pdf.c and djvu.c and koptcontext.h 2012-11-26 21:58:53 +08:00
chrox
f70ef06ea6 use koptcontext to keep dozons of parameters for k2pdfopt 2012-11-26 21:57:23 +08:00
chrox
3a7535d350 add trim page option 2012-11-26 21:56:22 +08:00
chrox
f7be331318 add defect size option 2012-11-26 21:55:26 +08:00
chrox
486207ce1b add render quality option
Many users complained that the reflowing process is too slow. This is
rather a speed-quality dilemma. Trade-off can be made by decreasing the
dpi of source page. And by default quality is prefered.
2012-11-26 21:54:47 +08:00
chrox
19c0d282aa add indentation option in koptconfig
By default the indentaion detection is enabled in K2pdfopt. This will
sometimes generate very poor reflowed page when there are sidenotes on
the page which would be treated as indentation. Disabling indentaion
detection will rescue the reflowed page from this situation.
2012-11-26 21:50:34 +08:00
chrox
0b2f89d830 add screen rotation in koptconfig
Conflicts:

	koptconfig.lua
	koptreader.lua
2012-10-31 22:37:15 -04:00
chrox
2c3b4fa968 add auto straighten option for scanned pages
Conflicts:

	koptconfig.lua
	koptreader.lua
2012-10-31 22:36:29 -04:00
chrox
148dc48556 add column detection in koptconfig
Conflicts:

	koptconfig.lua
	koptreader.lua
2012-10-31 22:36:13 -04:00
chrox
06f3c382ac add font size option in koptconfig dialog
Conflicts:

	koptconfig.lua
	koptreader.lua
2012-10-31 22:35:44 -04:00
chrox
ddb46eeb41 merge justification and full justification to one option
Conflicts:

	koptconfig.lua
	koptreader.lua
2012-10-31 22:34:55 -04:00
chrox
5294d178a0 add justification option in koptconfig dialog
Conflicts:

	koptconfig.lua
	koptreader.lua
2012-10-31 22:34:12 -04:00
chrox
ad4deb26be add page margin and text wrap and contrast option in koptconfig
Conflicts:

	koptconfig.lua
	koptreader.lua
2012-10-31 22:32:45 -04:00
chrox
ce0b3acd6b add config dialog for koptreader
For now only line spaceing and word spaceing are configurable with
'F'/'Aa' commands. And device size are passed to k2pdfopt in place of
the hard-coded default width and height(via @dpavlin).
Conflicts:

	koptreader.lua
2012-10-31 22:29:48 -04:00
chrox
ae950ccf32 feedback zoom value used by page reflow
So that when zoom value exceed the upper limit of reflowable page size
user will notice that zoom value cannot be increased.
Conflicts:

	koptreader.lua
2012-10-31 22:21:03 -04:00
chrox
441d061664 add DJVU reflow
Conflicts:

	djvu.c
	koptreader.lua
	reader.lua
2012-10-31 21:30:06 -04:00
HW
b012f1b037 changed page number reading
this is far from complete since in fact, we read page references
which follow a more complex syntax. while specifying page numbers
is one option for them, they might also specify page names. we
currently do not yet have code for this case and we will return
"-1" for all page references we can not parse.
2012-10-09 16:27:31 -04:00
Tigran Aivazian
0d740d2b3b Optimize DjVu drawPage() function
We only need to fill the image buffer with white colour if DjVu page
rendering function did not fill it in with page data.
2012-10-09 16:23:21 -04:00
Tigran Aivazian
604f635c46 Cleanup of getUsedBBox() function.
The function getUsedBBox() does not need to perform any operations on
the DjvuPage structure, so there is no need to obtain it from Lua.
2012-10-09 14:54:17 -04:00
Tigran Aivazian
5fd9aac780 Display DjVu info in the status line.
The DjVu info shown in the status line includes:
1. Physical page dimensions.
2. Current value of gamma and (in square brackets) the value of the
display for which the page was designed.
3. Page resolution (in dpi).
4. Page type.
For the end-user probably the most useful bit is the page type as it
helps him decide which rendering mode to choose for this page (and also
explains why he can't see anything on the page --- e.g. when rendering
some COMPOUND or PHOTO pages in B&W mode). For the developer the
physical page dimensions are also interesting as they allow to estimate
the amount of time needed for page decoding and cache efficiency.

Conflicts:

	djvureader.lua
2012-10-04 18:24:22 -04:00
Tigran Aivazian
e3d02cd578 First stage of improving the DjVu status info.
Conflicts:

	djvureader.lua
2012-10-04 18:23:51 -04:00
Tigran Aivazian
cae259e0cb Cleanup of djvu.c
1. Use the proper <string.h> header.
2. Typo fixes and whitespace changes.
3. Comment out debug printf() about cache size.
4. Remove obsolete comment(s).

Conflicts:

	djvu.c
2012-09-25 10:38:52 -04:00
Tigran Aivazian
97f59ed07c 1. It is customary to call DjVu context by the name of the program.
2. When changing DjVu page rendering mode there is no need to clear DjVu cache, only our own tile cache.

Conflicts:

	djvureader.lua
2012-09-17 20:22:34 -04:00
Tigran Aivazian
bbbd64d96e Comment out the setting of dithering bits because djvulibre ignores anything less than 8 bits anyway. 2012-09-17 20:08:00 -04:00
Tigran Aivazian
b761418236 Small optimization in djvu.c:drawPage() --- there is no need to create and destroy
djvu pixel format on each redraw of the page as this can be done once on open and close
of the document. Also, set dither bits to 4 to help djvulibre choose the most
optimal dithering algorithm for the Kindle. Also, make coding style of "if(" -> "if ("
consistent (both instances were used, but "if (" was more frequent).

Conflicts:

	djvu.c
2012-09-17 20:03:47 -04:00
Tigran Aivazian
7f6d3097a2 Remove the local variable render_mode from drawPage() (although it would be optimized away by gcc anyway). 2012-09-17 19:32:13 -04:00
Tigran Aivazian
0d23340738 Move render_mode support out of unireader.lua into djvureader.lua as it is djvu-specific.
Also added support for all other rendering modes handled by djvulibre.
Also made the message print a human-readable description of the mode rather than just the number.

Conflicts:

	djvureader.lua
	unireader.lua
2012-09-17 13:04:04 -04:00
Tigran Aivazian
144f5c637a DjVu enhancements:
a) add support for switching the rendering mode between B&W (default, 1) and COLOUR (0) values.
b) handle the gamma values correctly.

Conflicts:

	unireader.lua
2012-09-17 11:24:46 -04:00
Kefu Chai
8ce1aef0af remove dependency on <linux/input.h>
* and kill a warning
2012-07-15 02:35:01 +08:00
Qingping Hou
75ee86b2cb fix offset calculation in djvu.c
use 4th and 5th args in renderrect in drawPage method.
2012-06-04 13:15:54 +08:00
Qingping Hou
eca9ec4877 fix TOC entry page number counting, it was one page ahead.
close #137
2012-04-24 17:10:38 +08:00
HW
ec905a5a13 fixed various bugs in pointer handling 2012-04-16 22:51:13 +02:00
Qingping Hou
9e4b2675f0 Merge branch 'master' into epub
Conflicts:
	unireader.lua
2012-04-01 08:27:25 +08:00
Dobrica Pavlinusic
d34ccb92e6 make cache_size optional 2012-03-31 14:46:49 +02:00
Dobrica Pavlinusic
5b1deedd86 remove setCacheSize set cache in openDocument 2012-03-31 14:41:23 +02:00
Qingping Hou
42c9773711 add: cache size control for djvureader 2012-03-31 20:40:46 +08:00
Dobrica Pavlinusic
60b7ccb3cb added cleanCache bound to C key in menu #80 2012-03-31 13:38:33 +02:00
Dobrica Pavlinusic
91bd1277d7 control renderer memory usage #80
added setCacheSize and cache_document_size configuration vairable
2012-03-31 13:24:38 +02:00
Dobrica Pavlinusic
92ec4213c0 show djvu cache size #80
Currently it shows cache_max_memsize and cache_item_max_pixels from
lua and djvu cache size on menu key
2012-03-31 12:54:45 +02:00
Qingping Hou
ad9d13a947 mod: rename TOC to Toc, adapt showMenu to CREReader 2012-03-29 18:17:32 +08:00
Qingping Hou
7c81f60a58 rewrite highlight again :( finished the cursor part 2012-03-22 23:12:57 +08:00
Qingping Hou
a185f238eb mod: rewrite highlight feature 2012-03-20 16:42:22 +08:00
Qingping Hou
f4ea1cdb62 Merge branch 'master' of github.com:hwhw/kindlepdfviewer into djvu-highlight
Conflicts:
	blitbuffer.c
	unireader.lua
2012-03-20 10:36:35 +08:00
HW
87ec4bbf6b factored pages counter out of document struct 2012-03-20 00:03:09 +01:00
HW
8869c52c31 fix a Lua 5.0 syntax that was deprecated in 5.1
luaL_reg is now renamed to luaL_Reg. Lua 5.2 does not know about
the old name anymore, Lua 5.1.x had backward compatibility.
2012-03-19 19:11:32 +01:00
HW
9ee7afa86d separate DC out of pdf.c and djvu.c (cleanup) 2012-03-19 18:59:36 +01:00