CImage:RowToTable
The RowToTable method copies the pixels of a CImage row into a 1-dimensional array. If the CImage has a numeric pixel type (e.g., "ushort", "float", etc.) then the array has numeric values. If the CImage has an rgb pixel type, then the array has rgb strings as values, for example "255,0,0" for pure red. See Pixel Types. The inverse operation, pasting a row into a CImage, is done using the TableToRow method.
lua_table = CImage:RowToTable(nRow)
lua_table = CImage:RowToTable(nRow, nColMax)
lua_table = CImage:RowToTable(nRow, nColMin, nColMax)
nRow is the row number
nColMin is the minimum column to extract.
nColMax is the maximum column to extract.
lua_table is a 1-dimensional array.
On failure, nil is returned.
The following script creates a 1-dimensional table consisting of image row 212. The number of table elements equals the number of columns in the image:
|
-- create a CImage object |
-- fill the image or open it from a file... |
|
|
-- create a lua_table from row 40 |
The next script creates a 1-dimensional table consisting of image row 40 over columns 200 to 300. The table will have 101 elements:
|
-- create a CImage object |
-- fill the image or open it from a file... |
|
|
-- create a lua_table from row 40, column 200 to 300. |
CImage class, ColToTable, RectToTable, ToTable, arraytoimage, TableToRow, Table and Array Functions
Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.