Author Topic: Potential Lua API additions  (Read 1097 times)

garry23

  • Contributor
  • Hero Member
  • *****
  • Posts: 2212
Potential Lua API additions
« on: February 07, 2021, 01:06:21 PM »
This is my humble attempt to start a list of user requested API ideas/enhancements/additions to Lua.

I suggest anyone posting here attempt to suggest their idea in a format that mirrors the ML Lua API documentation (see mine in this post).

I suggest this thread is not the place to debate the worth or even practicality of the API suggestion. Let's leave that for another place, once a Lua API 'uplift project' gets going. This thread is about ideas/needs/wants. Having said that, I suggest anyone posting here think about their need or use case, ie let's try and be sensible ;-)

The following are a few of my personal suggestions to get us going (note I have deliberately kept formatting simple, ie not complicating the posts with HTML:

----
lv.spotmeter(x,y[,width=10[,height=10]]])
  Returns the currently spotmeter value at the LV x and y position
  Only works in LiveView.
Parameters:
  - x int LV x position of centre of spotmeter box
  - y int LV y position of centre of spotmeter box
  - width/height int size of spotmeter’s width in LV units. Min = 5, Max = edge of LV_reached (x and y)
Returns:
  Requested spotmeter value, as set in the ML spotmeter menu, eg Ev units etc
----

----
lv.histo(x,y[,from=0)
  Returns the currently histogram % value between the requested x and y values
  Only works in LiveView.
Parameters:
  - x int histogram start (0,255)
  - y int histogram end (0,255)
  - from (0 or 1). 0 full LV, 1 from spotmeter box
Returns:
  Requested histogram % value
----

----
Camera.shutter.[class=raw].ettr
  Gets the current ETTR shutter value, according to the class selected
  Only works in LiveView, controlled by settings in ETTR menu
Parameters:
  - None
Returns:
  The shutter sub-class value according to the class used
----

----
lens.mf(value=0)
  Sets/gets manual focus, ie switches/overrides lens-set AF, ie MF on and off irrespective of lens physical setting
  Only works in LiveView
Parameters:
  - 1 = on, 0 = off
Returns:
  (bool) whether the operation was successful or not
----

----
camera.mlu(value=0)
  Sets/gets whether mirror is up or not
  Works outside of LV
Parameters:
  - 1 = up, 0 = down
Returns:
  MLU state
----