a few more black_hexes and white_hexes

This commit is contained in:
keringo
2025-06-26 00:24:27 +03:00
parent 39f3e410bd
commit b2e1bbf8c3
4 changed files with 20 additions and 6 deletions

View File

@@ -19,6 +19,8 @@ local function copyPageState(page_state)
zoom = page_state.zoom,
rotation = page_state.rotation,
gamma = page_state.gamma,
black_hex = page_state.black_hex,
white_hex = page_state.white_hex,
offset = page_state.offset:copy(),
visible_area = page_state.visible_area:copy(),
page_area = page_state.page_area:copy(),
@@ -739,6 +741,8 @@ function ReaderPaging:getNextPageState(blank_area, image_offset)
zoom = self.view.state.zoom,
rotation = self.view.state.rotation,
gamma = self.view.state.gamma,
black_hex = self.view.state.black_hex,
white_hex = self.view.state.white_hex,
offset = page_offset,
visible_area = visible_area,
page_area = page_area,
@@ -766,6 +770,8 @@ function ReaderPaging:getPrevPageState(blank_area, image_offset)
zoom = self.view.state.zoom,
rotation = self.view.state.rotation,
gamma = self.view.state.gamma,
black_hex = self.view.state.black_hex,
white_hex = self.view.state.white_hex,
offset = page_offset,
visible_area = visible_area,
page_area = page_area,

View File

@@ -86,6 +86,8 @@ function ReaderView:init()
zoom = 1.0,
rotation = 0,
gamma = 1.0,
black_hex = 0x000000,
white_hex = 0xFFFFFF,
offset = nil,
bbox = nil,
}
@@ -384,7 +386,9 @@ function ReaderView:drawScrollPages(bb, x, y)
state.page,
state.zoom,
state.rotation,
state.gamma)
state.gamma,
state.black_hex,
state.white_hex)
pos.y = pos.y + state.visible_area.h
-- draw page gap if not the last part
if page ~= #self.page_states then
@@ -458,7 +462,9 @@ function ReaderView:drawSinglePage(bb, x, y)
self.state.page,
self.state.zoom,
self.state.rotation,
self.state.gamma)
self.state.gamma,
self.state.black_hex,
self.state.white_hex)
UIManager:nextTick(self.emitHintPageEvent)
end
@@ -871,6 +877,8 @@ function ReaderView:getViewContext()
zoom = self.state.zoom,
rotation = self.state.rotation,
gamma = self.state.gamma,
black_hex = self.state.black_hex,
white_hex = self.state.white_hex,
offset = self.state.offset:copy(),
bbox = self.state.bbox,
},

View File

@@ -537,13 +537,13 @@ function KoptInterface:hintReflowedPage(doc, pageno, zoom, rotation, gamma, hint
end
end
function KoptInterface:drawPage(doc, target, x, y, rect, pageno, zoom, rotation, gamma)
function KoptInterface:drawPage(doc, target, x, y, rect, pageno, zoom, rotation, gamma, black_hex, white_hex)
if doc.configurable.text_wrap == 1 then
self:drawContextPage(doc, target, x, y, rect, pageno, zoom, rotation)
elseif doc.configurable.page_opt == 1 or doc.configurable.auto_straighten > 0 then
self:drawContextPage(doc, target, x, y, rect, pageno, zoom, rotation)
else
Document.drawPage(doc, target, x, y, rect, pageno, zoom, rotation, gamma)
Document.drawPage(doc, target, x, y, rect, pageno, zoom, rotation, gamma, black_hex, white_hex)
end
end

View File

@@ -507,7 +507,7 @@ Some of the other settings are only available when reflow mode is enabled.]]),
buttonprogress = true,
-- For pdf reflowing mode (kopt_contrast):
values = {0x808080, 0x606060, 0x404040, 0x202020, 0x000000},
default_pos = 2,
default_pos = 5,
default_value = G_defaults:readSetting("DKOPTREADER_CONFIG_BLACK_HEX"),
event = "BlackLevelUpdate",
-- For pdf non-reflowing mode (mupdf):
@@ -521,7 +521,7 @@ Some of the other settings are only available when reflow mode is enabled.]]),
buttonprogress = true,
-- For pdf reflowing mode (kopt_contrast):
values = {0xFFFFFF, 0xE0E0E0, 0xC0C0C0, 0xA0A0A0, 0x808080},
default_pos = 2,
default_pos = 1,
default_value = G_defaults:readSetting("DKOPTREADER_CONFIG_WHITE_HEX"),
event = "WhiteLevelUpdate",
-- For pdf non-reflowing mode (mupdf):