diff options
author | ubq323 <ubq323@ubq323.website> | 2024-04-01 04:34:21 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2024-04-01 04:34:21 +0100 |
commit | e94740c9a4cf94a100a1e6bf6ecce361cb10a668 (patch) | |
tree | f8ae443a67f5f8bb1cf3d0e49632327a59fa7faf /framebuf.lua | |
parent | c81b84f0577a99ff9c1ebfdd3bdcfd672cbae944 (diff) |
launch john
Diffstat (limited to 'framebuf.lua')
-rw-r--r-- | framebuf.lua | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/framebuf.lua b/framebuf.lua index 77f17e6..614f48b 100644 --- a/framebuf.lua +++ b/framebuf.lua @@ -53,6 +53,10 @@ function M:rect(x1, y1, x2, y2, r, g, b) end end +function M:get_size() + return #self, #(self[1] or {}) +end + function M:ppm(data, x, y) if type(data) ~= "string" then local f = data @@ -178,7 +182,7 @@ function M:present(mon, offsx, offsy) local pw, ph = M.resolution(mon) local cols = {} local chars = {} - print("","1") + -- print("","1") for y = offsy + 1, offsy + ph, 3 do for x = offsx + 1, offsx + pw, 2 do local char, fg, bg = get_char(self, x, y) @@ -189,12 +193,12 @@ function M:present(mon, offsx, offsy) end end end - print("","2") + -- print("","2") local palette, map = median_cut(cols, 16) for i, color in ipairs(palette) do mon.setPaletteColor(2^(i - 1), color) end - print("","3") + -- print("","3") for i = 1, w * h, w do mon.setCursorPos(1, (i - 1) / w) local blit_char, blit_fg, blit_bg = {}, {}, {} |