1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-24 00:35:18 +03:00

3djc/document lua bitmaps (#3588)

* Create lua doc for previously added Horus bitmaps functions

* Cosmetic
This commit is contained in:
3djc 2016-06-12 10:52:02 +02:00 committed by Bertrand Songis
parent dd12d09c92
commit ac953cdcc8

View file

@ -317,6 +317,17 @@ static int luaLcdDrawSource(lua_State *L)
} }
#if defined(COLORLCD) #if defined(COLORLCD)
/*luadoc
@function Bitmap.open(name)
Loads a bitmap in memory, for later use with lcd.drawBitmap()
@param name (string) full path to the bitmap on SD card (i.e. /IMAGES/test.bmp)
@notice Only available on color screens
@status current Introduced in 2.2.0
*/
static int luaOpenBitmap(lua_State * L) static int luaOpenBitmap(lua_State * L)
{ {
const char * filename = luaL_checkstring(L, 1); const char * filename = luaL_checkstring(L, 1);
@ -335,6 +346,18 @@ static BitmapBuffer * checkBitmap(lua_State * L, int index)
return *(BitmapBuffer **)luaL_checkudata(L, index, "luaL_Bitmap"); return *(BitmapBuffer **)luaL_checkudata(L, index, "luaL_Bitmap");
} }
/*luadoc
@function Bitmap.getSize(name)
Return width, heigh of a bitmap in memory
@param bitmap (pointer) point to a bitmap previously opened with Bipmap.open()
@notice Only available on color screens
@status current Introduced in 2.2.0
*/
static int luaGetBitmapSize(lua_State * L) static int luaGetBitmapSize(lua_State * L)
{ {
BitmapBuffer * b = checkBitmap(L, 1); BitmapBuffer * b = checkBitmap(L, 1);
@ -371,6 +394,19 @@ void registerBitmapClass(lua_State * L)
lua_setglobal(L, "Bitmap"); lua_setglobal(L, "Bitmap");
} }
/*luadoc
@function lcd.drawBitmap(bitmap, x, y)
Displays a bitmap at (x,y)
@param bitmap (pointer) point to a bitmap previously opened with Bipmap.open()
@param x,y (positive numbers) starting coordinate
@notice Only available on color screens
@status current Introduced in 2.2.0
*/
static int luaLcdDrawBitmap(lua_State *L) static int luaLcdDrawBitmap(lua_State *L)
{ {
if (!luaLcdAllowed) return 0; if (!luaLcdAllowed) return 0;
@ -392,7 +428,7 @@ Draw a bitmap at (x,y)
@param x,y (positive numbers) starting coordinate @param x,y (positive numbers) starting coordinate
@param name (string) full path to the bitmap on SD card (i.e. /BMP/test.bmp) @param name (string) full path to the bitmap on SD card (i.e. /IMAGES/test.bmp)
@notice Only available on monochrome screens @notice Only available on monochrome screens