#ifndef _lua__bitmap__hpp__included__ #define _lua__bitmap__hpp__included__ #include #include #include #include "core/window.hpp" #include "library/luabase.hpp" #include "library/framebuffer.hpp" #include "library/threadtypes.hpp" #include "library/string.hpp" struct lua_palette { std::vector colors; lua_palette(lua_state& L); ~lua_palette(); mutex_class palette_mutex; std::string print(); }; struct lua_bitmap { lua_bitmap(lua_state& L, uint32_t w, uint32_t h); ~lua_bitmap(); size_t width; size_t height; std::vector pixels; std::vector save_png(const lua_palette& pal) const; std::string print(); }; struct lua_dbitmap { lua_dbitmap(lua_state& L, uint32_t w, uint32_t h); ~lua_dbitmap(); size_t width; size_t height; std::vector pixels; std::vector save_png() const; std::string print(); }; struct lua_loaded_bitmap { size_t w; size_t h; bool d; std::vector bitmap; std::vector palette; static struct lua_loaded_bitmap load(std::istream& stream); static struct lua_loaded_bitmap load(const std::string& name); }; #endif