OptrisOptrisDocumentation

Documentation/OTC SDK/OTC SDK — C API referencev12.0

optris_sdk_frame_focus

Where the lens was when a frame was taken, as the frame itself says. Read with optris_sdk_frame_get_focus().

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, and the SDK does not stand a sampled position in for it, because on that camera every focus read can pause the stream. Every other model reports none. optris_sdk_imager_get_focus() is still the way to read the lens then, with your own timestamp.

A frame repeated through a shutter closure carries where the lens was when the repeat was delivered: a repeat's metadata is its own.

Public attributes

struct_size

uint32_t struct_size

Set to sizeof(optris_sdk_frame_focus).

known

uint8_t known

Non-zero when the frame carries its lens position. Zero when the camera's frames carry none, when the camera did not know its focus travel yet, for a frame recorded without one, and for a frame from a session or a still. Every other field is zero then and means nothing: a position of 0 is the near end, never "unknown".

reserved0

uint8_t reserved0[3]

Reserved; always zero. Named so the struct has no implicit padding.

fraction

float fraction

Where the lens was, as a fraction of its travel: 0.0 at the near end of optris_sdk_imager_get_focus_range(), 1.0 at the far end. What optris_sdk_imager_get_focus() would have answered for this frame.

position

uint16_t position

The same position in the motor's own step units, the scale of optris_sdk_imager_get_focus_position(), so it can be sent back to the lens with optris_sdk_imager_set_focus_position() unchanged.

reserved1

uint16_t reserved1

Reserved; always zero.