summaryrefslogtreecommitdiff
path: root/framebuf.lua
diff options
context:
space:
mode:
Diffstat (limited to 'framebuf.lua')
-rw-r--r--framebuf.lua10
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 = {}, {}, {}