ICameraControl::get_FocalLengths
Microsoft DirectShow 9.0 |
ICameraControl::get_FocalLengths
This topic applies only to Windows XP Service Pack 2 and later.
The get_FocalLengths method returns the focal lengths of the camera lenses.
Syntax
HRESULT get_FocalLengths( long* plOcularFocalLength, long* plObjectiveFocalLengthMin, long* plObjectiveFocalLengthMax );
Parameters
plOcularFocalLength
[out] Receives the ocular focal length.
plObjectiveFocalLengthMin
[out] Receives the minimum objective focal length.
plObjectiveFocalLengthMax
[out] Receives the maximum objective focal length.
Return Values
Returns an HRESULT value.
Remarks
In a two-lens camera, the objective lens is closer to the subject, and the ocular lens is closer to the camera. The ocular focal length is fixed. If the camera has an optical zoom, the objective focal length can vary within a fixed range. Magnification is calculated as the ratio of objective/ocular focal length. Because the magnification is expressed as a ratio, it has no units. Therefore, the units for the focal length are not defined by this interface.
If the camera supports optical zooming, the current zoom level is expressed as integer values between a range Zmin and Zmax. The objective focal length can then be calculated as follows:
Lcur = ( ( (Zcur - Zmin) * (Lmax - Lmin) ) / (Zmax - Zmin) ) + Lmin
where:
- Lcur = Current objective focal length.
- Lmin, Lmax = Minimum and maximum objective focal length.
- Zcur = Current zoom setting. See ICameraControl::get_Zoom.
- Zmin, Zmax = Minimum and maximum zoom setting. See ICameraControl::getRange_Zoom.
From Lcur, you can calculate the magnification.
Requirements
Header: Include Vidcap.h.
Library: Use Strmiids.lib.
See Also