optris::sdk::FrameFocus
Where the lens was when a frame was taken, as the camera wrote it into that frame.
Answered by Imager::GetFrameFocus() and Player::GetFrameFocus() for a frame they delivered. It is the frame's own reading, not one the SDK sampled beside the stream: a program that scores frames while the lens moves (an autofocus search) can place each frame on the travel exactly, however late the frame reached it.
Only some cameras put it in their frames. An Xi 640 ETH on USB does, from firmware revision 4200 on. Over Ethernet it does not: its stream to the SDK carries no lens position, and the SDK does not stand a sampled one in for it, because on that camera every focus read can pause the stream. Every other model reports no position for its frames. Where there is none, Optics::GetFocus() is still the way to read the lens, with your own timestamp.
A frame repeated through a shutter closure (FrameMetadata::is_repeated_frame) carries where the lens was when the repeat was delivered: the lens can move while the shutter is shut, and a repeat's metadata is always its own.
Public attributes
fraction
float fraction = 0.0f
Where the lens was, as a fraction of its travel: 0.0 at the near end of Optics::GetFocusRange(), 1.0 at the far end. The value Optics::GetFocus() would have answered for this frame.
position
uint16_t position = 0
The same position in the motor's own step units, the scale of Optics::GetFocusPosition() and Optics::SetFocusPosition(), so a frame's position can be sent back to the lens unchanged.