|
CImage:ColToTable
The ColToTable method copies the pixels of a
CImage column 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 column
into a CImage, is done using the
TableToCol method.
Syntax
lua_table = CImage:ColToTable(nCol)
lua_table = CImage:ColToTable(nCol, nRowMax)
lua_table = CImage:ColToTable(nCol, nRowMin,
nRowMax)
nCol is the column number
nRowMin is the minimum row to extract.
nRowMax is the maximum row to extract.
lua_table is a 1--dimensional array.
On failure,
nil is returned.
Examples
The following script creates a 1-dimensional table
consisting of image column 40. The number of table elements equals
the number of rows in the image:
|
I = new_image()
|
|
|
|
|
|
tbl = I:ColToTable(40)
|
|
The next script creates a 1-dimensional table
consisting of image column 40 over rows 200 to 300. The table will
have 101 elements:
|
I = new_image()
|
|
|
|
|
|
tbl = I:ColToTable(40, 200,
300)
|
|
Related Topics
CImage class
RowToTable
RectToTable
ToTable
arraytoimage
TableToCol
Table and Array Functions
Mira Pro x64 Script User's Guide, v.8.76 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.
|