|
CLsqFit:SetNumChannels
The SetNumChannels method specifies the
number of channels to fit. Use this method to set 3 or 4 channels
for fitting to RGB or RGBa data. This method does not need to be
called if fitting numeric data having only 1 channel (the
default).
Syntax
|
CLsqFit:SetNumChannels( nChannels )
|
nChannels is the
number of channels to use, in the range 1 to 4.
Remarks
The SetNumChannels method specifies the
total number of channels in the point values. This method must be
called before the adding any points using
AddPt or
AddPtWt. The number of channels in current use
may be retrieved using
GetNumChannels.
Examples
The following script sets 3 channels, adds data
points, and lists the number of channels in use:
|
L = new_lsqfit()
|
|
|
L:SetNumChannels( 3
)
|
|
|
L:AddPt( 3.5, "5,240.4,140" )
|
|
|
|
|
|
L:Fit()
|
|
|
n = L:GetNumChannels()
|
|
|
Printf( "nChan= %d\n", n )
|
|
The next example does not call
SetNumChannels, so the default number of channels, 1, is
assumed. The script adds data points and then lists the number of
channels in use:
|
L = new_lsqfit()
|
|
|
L:AddPt( 3.5, 12.25 )
|
|
|
|
|
|
L:Fit()
|
|
|
n = L:GetNumChannels()
|
|
|
Printf( "nChan= %d\n", n )
|
|
Related Topics
CLsqFit class
GetNumChannels
Working with RGB Data
Mira Pro x64 Script User's Guide, v.8.76 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.
|