SetGains
Top  Previous  Next

Description

Sets the levels for the software gain control. If the LUTMode property is enabled, this operation multiplies the value of each pixel by a given floating point factor thus changing the contrast of the video or its color components.


Syntax


[VB]
objActiveDcam.SetGains fR [, fG, fB, fGb]


[C/C++]
HRESULT SetGains (fR [, fG, fB, fGb])


Data Types
[VB]

fR, fG, fB, fGb: Single


Parameters
[C/C++]

fR [in]  
Gain factor for the red channel. If the rest of arguments are -1 or omitted, this factor will be applied to all color channels in the video.  
fG [in]  
Gain factor for the green channel. If four arguments are used, this factor will be applied to Gr pixels of the raw Bayer image.  
fR [in]  
Gain factor for the blue channel.  
fGb [in]  
Gain factor for the Gb pixels of the raw Bayer image. If -1 or omitted, fGb=fG.  


Return Values


S_OK  
Success  
E_FAIL  
Failure.  

Example

The following VB example uses three sliders to increase the gain for R, G and B channels up to the factor of 10:

Private Sub
 Form_Load()
ActiveBF1.Acquire=
True

HScroll1.Min = 1
HScroll1.Max = 10
HScroll2.Min = 1
HScroll2.Max = 10
HScroll3.Min = 1
HScroll3.Max = 10
ActiveDcam1.LUTMode=
True

End Sub


Private Sub
 HScroll1_Scroll()
L1 = HScroll1.Value
L2 = HScroll2.Value
L3 = HScroll3.Value
ActiveDcam1.SetGains L1, L2, L3
End Sub

Private Sub
 HScroll2_Scroll()
L1 = HScroll1.Value
L2 = HScroll2.Value
L3 = HScroll3.Value
ActiveDcam1.SetGains L1, L2, L3
End Sub


Remarks


The gain adjustment will be applied to the video only when LUTMode is enabled. Otherwise the original pixel values will remain intact.