summaryrefslogtreecommitdiffstats
path: root/apps/plugins/lua/include_lua/print.lua
AgeCommit message (Collapse)AuthorFilesLines
2021-04-28lua add submenu module + cleanupWilliam Wilgus1-8/+6
allows menus + submenus + context menus all with simple tables menu_t which is a table of strings func_t which are the corresponding functions to go with those strings see lua_scripts/submenu_demo.lua Change-Id: I907b74b4abef0ecbe49f181d0ced6e6d20e94de5
2021-04-20lua print table put_line a do_menu alternativeWilliam Wilgus1-38/+127
add stylized lines to lua the exported do_menu has a severe limitation of 64 items it also requires double the memory put_line is the way rockbox builds menus update printtable user config from core -- done code cleanup fixed for 1-bit screens changed button behavior fixed for 2-bit screens Change-Id: I4de55e42685aa1d2f53a33bc8e980827864e810b
2021-04-08lua print_table add ability to draw a line separatorWilliam Wilgus1-1/+7
allows you to draw a line between items Change-Id: I7e6e2f56738e12ff06d06a24f0f9d0769932a7b1
2020-09-27lua playback exampleWilliam Wilgus1-0/+1
cool little lua based audio player creates dynamic playlist of 10 mp3s found on device if no music loaded I had to limit the depth of search to 3 levels due to the recursive nature of the current dirbrowser functions this could be rectified with a bit more code fixed a bug in print.lua that kept scrolling text even after screen clear Change-Id: Ifd285332df41a409ecaeb1ea447ad15537b5d04c
2019-08-04lua optimize print include, fix draw_polyWilliam Wilgus1-4/+4
Change-Id: Ibb530cfa63681727be518173404952e897c9d297
2018-10-08Fix red rocklib_img 32-24 bit targetsWilliam Wilgus1-1/+1
int is an incompatible type for targets that have 32bit fb_data need to use FB_SCALARPACK for them Change-Id: Ib3b5ff19c54d8d1bb76af33d0538a17a71301514
2018-10-09Clean up rocklib_imgWilliam Wilgus1-44/+36
optimize both size and speed fix invert for color screens Change-Id: I7edecae32dcb3daf5b3ed984a0e5b3d463269e60
2018-07-23Rocklua -- Extend / Fix rliImageWilliam Wilgus1-0/+378
Some devices(1-bit / 2-bit displays) have packed bit formats that need to be unpacked in order to work on them at a pixel level. This caused a few issues on 1 & 2-bit devices: Greatly Oversized data arrays for bitmaps Improper handling of native image data Framebuffer data was near unusable without jumping through hoops Conversion between native addressing and per pixel addressing incurs extra overhead but it is much faster to do it on the 'C' side rather than in lua. Not to mention the advantage of a unified interface for the end programer ------------------------------------------------------------------- Adds a sane way to access each pixel of image data Adds: -------------------------------------------------------------------- img:clear([color],[x1],[y1],[x2],[y2]) (set whole image or a portion to a particular value) -------------------------------------------------------------------- img:invert([x1],[y1],[x2],[y2]) (inverts whole image or a portion) -------------------------------------------------------------------- img:marshal([x1],[y1],[x2],[y2],[funct]) (calls funct for each point defined by rect of x1,y1 x2,y2 returns value and allows setting value of each point return nil to terminate early) -------------------------------------------------------------------- img:points([x1],[y1],[x2],[y2],[dx],[dy]) (returns iterator function that steps delta-x and delta-y pixels each call returns value of pixel each call but doesn't allow setting to a new value compare to lua pairs method) -------------------------------------------------------------------- img:copy(src,[x1],[y1],[x2],[y2],[w],[h],[clip][operation][clr/funct]) (copies all or part of an image -- straight copy or special ops optionally calls funct for each point defined by rect of x1, y1, w, h and x2, y2, w, h for dest and src images returns value of dst and src and allows setting value of each point return nil to terminate early) -------------------------------------------------------------------- img:line(x1, y1, x2, y2, color) -------------------------------------------------------------------- img:ellipse(x1, y1, x2, y2, color, [fillcolor] -------------------------------------------------------------------- Fixed handling of 2-bit vertical integrated screens Added direct element access for saving / restoring native image etc. Added more data to tostring() handler and a way to access individual items Added equals method to see if two variables reference the same image address (doesn't check if two separate images contain the same 'picture') Optimized get and set routines Fixed out of bound x coord access shifting to next line Added lua include files to expose new functionality Finished image saving routine Static allocation of set_viewport struct faster + saves ram over dynamic Cleaned up code Fixed pixel get/set for 1/2 bit devices Fixed handling for 24-bit devices (32?) ------------------------------------------------------------------------- Example lua script to follow on forums ------------------------------------------------------------------------- Change-Id: I8a9ff0ff72aacf4b1662767ccb2b312fc355239c
2018-07-22Revert "Rocklua -- Extend / Fix rliImage"William Wilgus1-377/+0
This reverts commit 2daec3d3c3d84e7176a22bc073ca5530e8e44c6d. Change-Id: I53ea1f491e3c6d6fb759f426f203f927bd26b1e9
2018-07-22Rocklua -- Extend / Fix rliImageWilliam Wilgus1-0/+377
Some devices(1-bit / 2-bit displays) have packed bit formats that need to be unpacked in order to work on them at a pixel level. This caused a few issues on 1 & 2-bit devices: Greatly Oversized data arrays for bitmaps Improper handling of native image data Framebuffer data was near unusable without jumping through hoops Conversion between native addressing and per pixel addressing incurs extra overhead but it is much faster to do it on the 'C' side rather than in lua. Not to mention the advantage of a unified interface for the end programer ------------------------------------------------------------------- Adds a sane way to access each pixel of image data Adds: -------------------------------------------------------------------- img:clear([color],[x1],[y1],[x2],[y2]) (set whole image or a portion to a particular value) -------------------------------------------------------------------- img:invert([x1],[y1],[x2],[y2]) (inverts whole image or a portion) -------------------------------------------------------------------- img:marshal([x1],[y1],[x2],[y2],[funct]) (calls funct for each point defined by rect of x1,y1 x2,y2 returns value and allows setting value of each point return nil to terminate early) -------------------------------------------------------------------- img:points([x1],[y1],[x2],[y2],[dx],[dy]) (returns iterator function that steps delta-x and delta-y pixels each call returns value of pixel each call but doesn't allow setting to a new value compare to lua pairs method) -------------------------------------------------------------------- img:copy(src,[x1],[y1],[x2],[y2],[w],[h],[clip][operation][clr/funct]) (copies all or part of an image -- straight copy or special ops optionally calls funct for each point defined by rect of x1, y1, w, h and x2, y2, w, h for dest and src images returns value of dst and src and allows setting value of each point return nil to terminate early) -------------------------------------------------------------------- img:line(x1, y1, x2, y2, color) -------------------------------------------------------------------- img:ellipse(x1, y1, x2, y2, color, [fillcolor] -------------------------------------------------------------------- Fixed handling of 2-bit vertical integrated screens Added direct element access for saving / restoring native image etc. Added more data to tostring() handler and a way to access individual items Added equals method to see if two variables reference the same image address (doesn't check if two separate images contain the same 'picture') Optimized get and set routines Fixed out of bound x coord access shifting to next line Added lua include files to expose new functionality Finished image saving routine Static allocation of set_viewport struct faster + saves ram over dynamic Cleaned up code Fixed pixel get/set for 1/2 bit devices ------------------------------------------------------------------------- Example lua script to follow on forums ------------------------------------------------------------------------- Change-Id: I7b9c1fd699442fb683760f781021091786c18509