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.
This commit is contained in:
Tigran Aivazian
2012-10-04 22:08:52 +01:00
parent c7b82f938a
commit 057c461e7d
2 changed files with 54 additions and 19 deletions

View File

@@ -70,19 +70,14 @@ function DJVUReader:invertTextYAxel(pageno, text_table)
return text_table
end
-- used in UniReader:showMenu()
---[[
function DJVUReader:_drawReadingInfo()
local secs, usecs = util.gettime()
local width, height = G_width, G_height
local numpages = self.doc:getPages()
local load_percent = self.pageno/numpages
-- changed to be the same font group as originaly intended
local face = Font:getFace("rifont", 20)
--local page_width, page_height, page_dpi = self.doc:getOriginalPageSize(self.pageno)
local page_width, page_height, page_dpi = self.doc:getPageInfo(self.pageno)
local page_width, page_height, page_dpi, page_gamma, page_type = self.doc:getPageInfo(self.pageno)
-- display memory on top of page
-- display memory, time, battery and DjVu info on top of page
fb.bb:paintRect(0, 0, width, 40+6*2, 0)
renderUtf8Text(fb.bb, 10, 15+6, face,
"M: "..
@@ -91,9 +86,9 @@ function DJVUReader:_drawReadingInfo()
os.date("%a %d %b %Y %T")..
" ["..BatteryLevel().."]", true)
renderUtf8Text(fb.bb, 10, 15+6+22, face,
"Gamma:"..tostring(self.globalgamma)..", "..
"Gm:"..string.format("%.1f",self.globalgamma).." ["..tostring(page_gamma).."], "..
tostring(page_width).."x"..tostring(page_height)..", "..
tostring(page_dpi).."dpi", true)
tostring(page_dpi).."dpi, "..page_type, true)
-- display reading progress on bottom of page
local ypos = height - 50
@@ -109,8 +104,4 @@ function DJVUReader:_drawReadingInfo()
ypos = ypos + 15
blitbuffer.progressBar(fb.bb, 10, ypos, width-20, 15,
5, 4, load_percent, 8)
local nsecs, nusecs = util.gettime()
local diff = (nsecs - secs)*1000000 + nusecs - usecs
print("DJVUReader:_drawReadingInfo(): "..tostring(diff).." us")
end
--]]