Commit graph

95 commits

Author SHA1 Message Date
William Wilgus
1930ca8d66 remove rockboxlogo after boot INIT_ATTR
nets about 5k on clipzip  (less on mono, more on others)
to move rockboxlogo to .initdata section

Remove show_logo completely and move to main.c
remove plugin stub
give credits plugin its own copy
credit fallback is now show_info()

Change-Id: Id9ed787e605ed29e7ab1e7a74d3821cd0f840ed4
2022-12-19 18:59:59 -05:00
Aidan MacDonald
d55dceff37 apps: Add ability to do a clean reboot
Allow a clean shutdown to end in either power off or reboot. Add a
new event SYS_REBOOT to signal it and sys_reboot() to trigger the
event. SYS_REBOOT signals a reboot request and should be listened
for alongside SYS_POWEROFF events.

Change-Id: I99ba7fb5feed2bb5a0a40a274e8466ad74fe3a43
2022-04-16 14:36:39 +01:00
William Wilgus
221e8752cc plugin.h & lua add playlist_insert_playlist
having issues running lua and loading a playlist

Change-Id: I72d32d77e6567ceed7e8e5fd492eebf0ee44561a
2021-12-05 23:10:19 -05:00
William Wilgus
9b2f23319c lua fix yellow and add temploader
temp loader allows some lua requires to be loaded and
later garbage collected unfortunately the module needs to be formatted
in such a way to pass back a call table in order to keep the functions
within from being garbage collected too early

BE AWARE this bypasses the module loader which would allow code reuse
so if you aren't careful this memory saving tool could spell disaster
for free RAM if you load the same code multiple times

Change-Id: I0b6f81e481b8c779edbd620c8403794f8353926f
2021-05-03 23:13:25 -04:00
William Wilgus
489a5f3ff7 lua add ability to use custom kbd layouts
bring custom keyboard layouts to lua
conversion to the proper format requires create_kbd_layout.lua
just pass a lua string with your desired layout

Change-Id: I14a392410846311a4f3cf8dda0e88d39834d0418
2021-05-04 01:52:08 +00:00
Solomon Peachy
388adff3cc pcm: Further cleanup of unused bits of the PCM ACPI:
* pcm_get_bytes_remaining()
 * pcm_calculate_peaks()
 * pcm_get_peak_buffer()

Nothing in-tree uses these at all (except for the lua plugin wrapper)

Change-Id: I971b7beed6760250c8b1ce58f401a601e1e2d585
2020-11-12 15:59:09 +00:00
Solomon Peachy
fe2d52cc7d pcm: Get rid of pcm_play_pause() and associated APIs
Nothing in the core has used it for some time.  It's exported to the
plugin API but the last plugins to use it were switched to the mixer API
back in 2011.

This allows us to get rid of pcm_play_dma_pause() from all audio drivers

Change-Id: Ic3fa02592316f84963e41d792d1cabb436d1ff6b
2020-10-31 01:18:27 +00:00
William Wilgus
ef34126913 lua add better memory stats
lua gives you a memory used number that only reflects the current allocations
if fact it doesn't even give you a way to get the amount of ram free

rb.mem_stats() seeks to fill this gap by marking the memory allocated for lua
with a sentinel value which can later be checked to get a high water mark
of the ram used by lua and a pretty good idea of how much ram is available

Also includes an example script
usage:
used, allocd, free = rb.mem_stats()

Change-Id: Ia282869f989848324d7d88c7df4827fdbce4fb4e
2020-10-05 11:53:27 -04:00
William Wilgus
80c3b84e08 lua Add scrollable stack traceback WIP
lua currently splashes a stack traceback on error
for deep tracebacks and especially on devices with smaller screens
this leaves out a lot of vital information

in the past I have resorted to splitting the traceback string or
even saving the return to a file

This patch provides a scrollable buffer with rudimentary text reflow
to allow you to read the whole traceback string

Upon traceback if you press nothing the screen will display for 5 seconds
If you press OK or CANCEL it will quit immediately
PREV/NEXT scrolls the list on button press timeout is disabled

lua now provides rb.splash_scroller(timeout, str)

example script provided too

Change-Id: Idbc8ce0c514196f0fae48c43aeaea8b60d6da1a5
2020-10-03 22:09:52 +00:00
Solomon Peachy
a3398a2143 plugins: Fix the builds for targets lacking HAVE_BACKLIGHT
Change-Id: Ifdb1501834b7ea63ca6f731bbd6414305d7e0001
2020-07-24 18:17:19 -04:00
Solomon Peachy
8cb555460f [3/4] Completely remove HWCODEC support
'swcodec' is now always set (and recording_swcodec for recording-capable
units) in feature.txt so the manual and language strings don't need to
all be fixed up.

Change-Id: Ib2c9d5d157af8d33653e2d4b4a12881b9aa6ddb0
2020-07-24 21:20:13 +00:00
Solomon Peachy
092c340a20 [1/4] Remove SH support and all archos targets
This removes all code specific to SH targets

Change-Id: I7980523785d2596e65c06430f4638eec74a06061
2020-07-24 21:20:13 +00:00
William Wilgus
cb94b3ae2e keyboard add ability to specify temporary custom layouts
rb core allows you to load custom keyboard layouts

this patch adds the ability to load a keyboard layout in a buffer
the custom layout is temporary and does not overwrite the current layout

use like so:

    unsigned short kbd[64];
    unsigned short *kbd_p = kbd;
    if (!kbd_create_layout("ABCD1234\n", kbd, sizeof(kbd)))
        kbd_p = NULL;

    rb->kbd_input(buf,sizeof(buf), kbd_p);

Change-Id: I7be2bd4a1b4797a147fa70228a9749dc56ac052a
2020-07-22 06:48:28 -04:00
William Wilgus
c39f95465b do_menu pass internal synclist reference to callback
keep running into the rigid nature of do_menu
it isn't too bad when you don't need voice but once
you do the fun awaits

do_menu likes to talk on menu enter which is in a loop when you use do_menu
I would like to move the processing to the callback
TOO BAD you only get an action and the menu_item_ex struct
you sent it when calling the function

Change-Id: Iaefd0cc133435d675b7dd27a558c504d6ccb327a
2020-07-19 22:10:26 +00:00
William Wilgus
01cccaf2d2 lua move strip_extension and create_numbered_filename out of main binary
rb.strip_extension and rb.create_numbered_filename
have been moved to include_lua/files.lua
to use simply add require('files') to your script

Change-Id: I95af7b312c8614cb10da4b71b22714b3e282e08a
2019-09-28 03:15:15 +02:00
William Wilgus
de06a06351 lua remove and consolidate some rb plugin functions
removes some usless / duplicated functions
removes atoi - lua tonumber() does this for you
removes strlen - lua string.len does this for you
removes system_memory_guard - if a device that actually implements
              system_memory_guard needs it we can add it back conditionally

consolidates talk_number and talk_spell (on backend)
consolidates talk_shutup and talk_force_shutup talk_shutup(bForce)

Change-Id: Id132642f087975a7c132e99a668a41c977942b81
2019-09-26 23:45:38 -05:00
William Wilgus
13245ebf76 lua add menu callback
forum user fprockboxer asked for a way to detect long presses within the
do_menu routine this adds that functionality

result = rb.do_menu("Title",t_items, start, menu_callback)

function menu_callback(action)
    ...
    return action
end

Change-Id: I110c590095a743a57d0a7d45b24309899a4629cf
2019-09-14 04:48:04 -05:00
William Wilgus
267d04d2bd Lua add metadata and settings reading helper module
Adds example scripts for reading track metadata + dumping albumart
and rockbox settings

settings are now stored as a table of strings rather than a table of tables
as it saves ~15 kb of ram without adding much complexity

Change-Id: I611c312b2a60ab96e595e4710b17aedbd6c0689b
2019-09-07 03:10:59 +02:00
William Wilgus
c251d1879f lua fix mem_read_write, strtol
back when I wrote this I was running the sim on a 32 bit machine
I didn't catch the hardcoded LONG_MAX reference or the fact that
lua_tointeger maxes ot at 32 bits

on 64 bit machines strtol caused all kinds of issues especially since
it returned the real LONG_MIN/MAX values

Change-Id: I3571ebbd9df333f7cbf4077562412c27429bfadc
2019-08-28 00:56:08 -05:00
William Wilgus
90118f14cf lua add demo scripts, atexit handler, gui_scrollbar_draw
Change-Id: Ie8794e8a487f73952dae43e036787b6972fdbbee
2019-07-29 02:51:29 -05:00
Franklin Wei
8379b230f6 lua: wrap thread_set_priority with #ifdef HAVE_PRIORITY_SCHEDULING
Should fix a compile-time error on simulator.

Change-Id: I5962479579350ebffe6dcce4f65a629b108ff936
2019-07-29 00:50:11 +02:00
William Wilgus
45bd14b392 Lua Add Emergency Garbage Collector
Derivative of work by RobertGabrielJakabosky
 http://lua-users.org/wiki/EmergencyGarbageCollector

I've only implemented the not enough memory part and
 expanded this idea to adding a mechanism to signal
 the OOM condition of the plugin buffer which allows us to only
 grab the playback buffer after garbage collection fails
 (SO THE MUSIC KEEPS PLAYING AS LONG AS POSSIBLE)

Change-Id: I684fb98b540ffc01f7ba324ab5b761ceb59b9f9b
2019-07-28 15:17:48 +02:00
William Wilgus
ddf612c84b lua remove unneeded plugin functions
Change-Id: I04bc38d03b7f0ca65a815685eb6ab0f5ff825c45
2019-07-28 07:29:10 -05:00
William Wilgus
6e32e06498 lua add sound_current, consolidate sound_ functions
add defines for sound functions
 SOUND_VOLUME, SOUND_BALANCE, SOUND_CHANNELS, SOUND_STEREO_WIDTH ...
 defines depend on target
 require "sound_defines" to add them to rb.sound_settings[]

consolidates:
 sound_set, sound_current, sound_default, sound_min, sound_max,
 sound_unit, sound_pitch, sound_val2phys to a single function

 rb.sound("name", setting, [value])

 require "sound.lua" for old functionality

Change-Id: Ice695218aa433f4fcbb48fbd6b8a9bf29c994110
2019-07-25 10:17:40 -05:00
William Wilgus
3e2b50ed3b lua events from rockbox
This library allows events to be subscribed / recieved within a lua script
most events in rb are synchronous so flags are set and later checked by a
secondary thread to make them (semi?) asynchronous.

There are a few caveats to be aware of:

FIRST, The main lua state is halted till the lua callback(s) are finished
 Yielding will not return control to your script from within a callback
 Also, subsequent callbacks may be delayed by the code in your lua callback
SECOND, You must store the value returned from the event_register function
 you might get away with it for a bit but gc will destroy your callback
 eventually if you do not store the event
THIRD, You only get one cb per event type
 ["action", "button", "custom", "playback", "timer"]
 (Re-registration of an event overwrites the previous one)

Usage:
 possible events =["action", "button", "custom", "playback", "timer"]

 local evX = rockev.register("event", cb_function, [timeout / flags])
  cb_function([id] [, data]) ... end

 rockev.suspend(["event"/nil][true/false]) passing nil affects all events
  stops event from executing, any but the last event before
  re-enabling will be lost, passing false, unregistering or re-registering
  an event will clear the suspend

 rockev.trigger("event", [true/false], [id])
  sets an event to triggered,
  NOTE!, CUSTOM_EVENT must be unset manually
  id is only passed to callback by custom and playback events

 rockev.unregister(evX)
  Use unregister(evX) to remove an event
  Unregistering is not necessary before script end, it will be
  cleaned up on script exit

Change-Id: Iea12a5cc0c0295b955dcc1cdf2eec835ca7e354d
2019-07-19 20:48:34 -05:00
William Wilgus
c9aeb4284e lua move constants out of binary image
Rockbox constants are auto generated by a perl script like the majority
 of the plugin functions.

Constants are contained in rb_defines.lua, if the file exists it is auto loaded
 by the lua state for backwards compatibility

Frees ~1k

Change-Id: I237700576c748f468249e501c839d89effca3f39
2019-07-18 08:42:00 -05:00
William Wilgus
c6fcb1cf45 lua inbinary strings
Allows saving of ram by reusing strings already stored in the binary
and storing a pointer instead of malloc and copy to get them inside
the lua state

Saves about 1.5K overall

Derivative of work by bogdanm
RAM optimizations: pseudo RO strings, functions in Flash
d54659b572

Change-Id: I21d6dcfa32523877efd9f70fb0f88f2a02872649
2019-07-11 00:31:41 +02:00
William Wilgus
c0dbfc8130 lua add track length & elapsed to rb.audio()
track elapsed is needed to use fast-forward and rewind effectively
track length might as well be added too..

Change-Id: I906c92eb5260164c6177d8c0a8ff879b1fad7898
2019-07-10 05:07:25 +02:00
William Wilgus
9d66b5459e Lua add read/write access to global_status, global_settings, audio_current_track
moved items to rb.system
added read access to audio_current_track and audio_next_track

Change-Id: Ia055b8cb3848e540067818f596ffd1058da057fb
2018-12-16 13:33:18 -06:00
William Wilgus
9ed486bdc7 lua add LCD_DEFAULT_FG, fix 2-bit screen fg/bg inversion
Change-Id: Ibe2bc6602ff27524a3b96d9523780acbfbf03c76
2018-11-24 16:40:23 -05:00
William Wilgus
f6e10b8488 Lua optimize combine and rework similar functions
rb.strncasecmp
    strcasecmp just exclude count -> rb.strncasecmp(s1, s2)

rb.backlight_brightness_set
    backlight_set_brightness -- redundant
    rb.backlight_brightness_use_setting -> rb.backlight_brightness_set()

rb.buttonlight_brightness_set
    buttonlight_set_brightness -- redundant
    rb.buttonlight_brightness_use_setting -> rb.buttonlight_brightness_set()

rb.mixer_frequency
    rb.mixer_set_frequency -> mixer_frequency(freq)
    rb.mixer_get_frequency -> mixer_frequency

rb.backlight_onoff
    rb.backlight_on  -> rb.backlight_onoff(true)
    rb.backlight_off -> rb.backlight_onoff(false)

rb.touchscreen_mode
    rb.touchscreen_set_mode -> rb.touchscreen_mode(mode)
    rb.touchscreen_get_mode -> rb.touchscreen_mode()

rb.schedule_cpu_boost
    rb.trigger_cpu_boost -> rb.schedule_cpu_boost(true)
    rb.cancel_cpu_boost -> rb.schedule_cpu_boost(false)

Includes rbcompat.lua for backwards compatibility
if your script is broken by this change you simply add
`require("rbcompat")` to the top for the old functionality

Change-Id: Ibffd79a0d9be6d7d6a65cc4af5c0a1c6a0f3f94d
2018-11-02 18:00:06 +01:00
William Wilgus
9b385f37ef Lua fix dir string constants and pcm_play_pause & pcm_set_frequency
String constants were already expanded in the first macro
pcm functions were looking for stack position #1 when they needed stack pos #2

Change-Id: I7b4fb90953ab2395b77cbd550fdd257fafca6aae
2018-11-01 18:18:46 -04:00
William Wilgus
be7a58c331 Lua Fix utf8encode, remove utf16 functions
The auto generated utf8/16 encode/decode functions did not work.
Upon implementing them correctly I found that lua handles the utf-8
form properly but I could not get utf-16 to work without crashing
maybe someone can come along later and implement utf-16 safe string
functions but for now utf-16 is removed.

Change-Id: I97a044e200dc27f683a45487cd93fce667c670c4
2018-11-01 16:34:02 +01:00
William Wilgus
bbfe477811 Lua Add underscores in audio, pcm, playlist functions
Lessen confusion for end users looking for the underlying function names in
plugin.h

Change-Id: I6662dc7bd9f22d83af372b3d3c5af53d9a1eac9a
2018-10-31 09:23:00 -04:00
William Wilgus
74fe5203d0 lua consolidate pcm_ functions
The way to call the pcm functions has changed
rb.pcm("option", var)
rb.pcm_set_frequency(freq) = becomes rb.pcm("pcmsetfrequency", freq)

added pcm.lua to the includes for conversion to old functions
if your script is broken by this change you simply add
`require("pcm")` to the top for the old functionality

added rb.pcm("calculatepeaks")

Change-Id: I092057b0c0b5575e567862661f122da1ca2680e8
2018-10-30 14:16:01 -04:00
William Wilgus
df8233e4ab Lua expand multiple screen support
Some of the lcd functions had support for multiple screens but this wasn't
very safe since the screen number wasn't bounded within the screens[] array
This adds support for all the lcd functions along with checking that screen#
is bounded properly, adds around 600 bytes to devices with a remote screen
devices without a remote screen lock to SCREEN_MAIN

Change-Id: I618bbc7b3919c7b0ff375fb2d71949d7cab43c87
2018-10-30 04:16:23 +01:00
William Wilgus
55533c4d36 Lua Fix kbd_input
While luaL_addstring() works perfectly fine for the
final buffer once Lual_pushresult() is called
kbd_input doesn't display a previous input properly
since the buffer hasn't been finalized yet

Change-Id: Ic50acaa8b7b17077dec8750dd2b6382624e8a549
2018-10-25 06:30:58 -04:00
William Wilgus
b5786ded64 Lua cleanup kbd_input, gui_syncyesno_run, do_menu
Removes unneeded functions from kbd_input
Consolidates message filling function for gui_syncyesno_run & do_menu

Change-Id: If3c3cea3cbf37a8dc52983c0db174de6d54b35f8
2018-10-25 12:06:10 +02:00
William Wilgus
e4c5f5d412 lua consolidate playlist_ functions
The way to call the playlist functions has changed
rb.playlist("option", var)
rb.playlist_add(filename) = becomes rb.playlist("add", filename)

added playlist.lua to the includes for conversion to old functions
if your script is broken by this change you simply add `require("playlist")`
to the top for the old functionality

added rb.playlist_tracks(dir, filename) to playlist.lua
this will allow you to add all tracks in a playlist.m3u8
to a lua table

Change-Id: I87fcc56be365d8495d214f069331b6ddbfbef1db
2018-10-25 05:59:42 -04:00
William Wilgus
b670fcd50d lua add audio_play consolidate audio_ functions
audio_play was removed from the rocklib I assume due to inconsistent
behavior I've readded it with a check for audio paused which instead
uses rewind/ff and then resumes audio

the way to call the audio functions has changed as well
rb.audio("option", var)
so rb.audio_play(0, 0) becomes rb.audio("play", 0, 0)
audio_audio_flush_and_reload_tracks becomes
rb.audio("flushandreloadtracks")

all functions except audio("getfilepos") return the previous (or still current)
status

added audio.lua to the includes for conversion to old functions
if your script is broken by this change you simply add `require("audio")`
to the top for the old functionality

Change-Id: I364adf0c85d9c12b98cde29c26fbe5ee05b9d331
2018-10-24 12:37:29 -04:00
William Wilgus
20b98f6fd0 Lua fix create_numbered_filename
I didn't realize that some devices used the *num variable
this fixes that oversight

Change-Id: I2ecd6f475bebdd6ce745b360be3762a069bfc2b1
2018-10-24 11:16:25 -04:00
William Wilgus
df4cb9bafc Lua fix strip_extension and create_numbered_filename
Both of these functions modified the string in the lua stack

per lua manual:
'When a C function receives a string argument from Lua,
there are only two rules that it must observe: Not to pop the string
from the stack while accessing it and never to modify the string'

strip_extension will still work with old parameters
and is thus backwards compatible
strip_extension("filename")

create_numbered_filename has changed slightly and IS NOT backwards compatible

create_numbered_filename(path, prefix, suffix, [number])
(number defaults to -1)

Change-Id: I34cf7e2f6f691f33d5ac2b2e995855a171fb99b3
2018-10-24 06:05:53 +02:00
William Wilgus
948984309a lua move rocklib_img to its own separate loadable module
allows rocklib_img to be excluded if needed

stops rocklib_aux from generating redundant prototypes for
lcd_mono_bitmap[_part]

Change-Id: Ie208ad71ab5f9a7deb026dc01a5b0a0631a0d29c
2018-10-22 14:00:58 -04:00
William Wilgus
07fed9053a lua optimize current_path function
frees up around 500 bytes by using the builtin string functionality

Change-Id: Icd4ec921d3fec339b8a4b7f80c9c63d51d4c101c
2018-10-15 18:24:10 +02:00
William Wilgus
e4b843335b lua rocklib cleanup
removes tslf allocations from do_menu and gui_syncyesno_run in favor of
lua_newuserdata

removes some luaL_opt functions in favor of equivalent lua_to functions

moves some definitions to the rocklib.h file

Change-Id: Iaacc3249b8f1af2c220ce59dead0050c66cb3b04
2018-10-08 23:15:16 +02:00
William Wilgus
dc6f23ec36 lua optimize integer and string consts in rocklib
use a table approach for registering integer / string constants

Change-Id: Idbccae9c2203de1c694f6dd5a7014a7fccedae9b
2018-09-14 01:13:22 +02:00
William Wilgus
733c20d5d3 lua move RLIMAGE to own file
Change-Id: Icd10e4c348deec7729d4a6e2bf1152e1dfc70243
2018-09-14 01:00:35 +02:00
William Wilgus
af35d19916 Rocklua -- Extend / Fix rliImage
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-23 05:13:32 +02:00
William Wilgus
ef210b5fe4 Revert "Rocklua -- Extend / Fix rliImage"
This reverts commit 2daec3d3c3.

Change-Id: I53ea1f491e3c6d6fb759f426f203f927bd26b1e9
2018-07-22 18:43:04 +02:00
William Wilgus
2daec3d3c3 Rocklua -- Extend / Fix rliImage
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
2018-07-22 18:05:02 +02:00