Set Eframing

Eframing allows precise control over the framing of the camera’s view. This operation is performed using the ExecuteEframing() function, which provides an interface to adjust the framing parameters.

CrError ExecuteEframing(CrDeviceHandle deviceHandle, CrEframingInfo* eframingInfo);

The first parameter specifies the device, and the second parameter defines the framing settings to be applied.

The following example demonstrates how to set Eframing parameters.

Example:

// 1. Define the Eframing parameters.
SCRSDK::CrEframingInfo eFramingParam;
eFramingParam.horizontal_denominator = 640 * 1024; // Horizontal denominator
eFramingParam.vertical_denominator = 480 * 1024; // Vertical denominator
eFramingParam.eframingType = SCRSDK::CrEframingType_Auto; // Eframing type
// 2. Set the input area info.
SCRSDK::CrEframingRectangle inputInfo;
inputInfo.x = 1 * 1024;
inputInfo.y = 1 * 1024;
inputInfo.width = 640 * 1024;
inputInfo.height = 480 * 1024;
constexpr int areaNo = 0; // Area number
eFramingParam.addInputInfo(areaNo, inputInfo);
// 3. Set the output area info.
SCRSDK::CrEframingRectangle outputInfo;
outputInfo.x = 0 * 1024;
outputInfo.y = 0 * 1024;
outputInfo.width = 640 * 1024;
outputInfo.height = 480 * 1024;
eFramingParam.addOutputInfo(areaNo, outputInfo);
SCRSDK::ExecuteEframing(handle, eFramingParam);

Update Eframing

Update Eframing allows you to modify the existing framing parameters of the camera’s view dynamically. This operation is performed using the UpdateEframingArea() function, which provides an interface to update the framing settings.

CrError UpdateEframingArea(CrDeviceHandle deviceHandle, CrEframingAreaNumber area, CrEframingAreaGroup group, CrInt16 x, CrInt16 y, CrInt16 width, CrInt16 height);

The first parameter specifies the device, the second and third parameters define the area and group, and the remaining parameters specify the updated framing settings to be applied.

The following example demonstrates how to update Eframing parameters.

Example:

// 1. Define the area and group to update.
constexpr SCRSDK::CrEframingAreaNumber areaNumber = SCRSDK::CrEframingArea1; // Area number
constexpr SCRSDK::CrEframingAreaGroup areaGroup = SCRSDK::CrEframingInputArea; // Area group

// 2. Define the updated framing parameters.
constexpr CrInt16 updatedX = 10 * 1024; // Updated x-coordinate
constexpr CrInt16 updatedY = 10 * 1024; // Updated y-coordinate
constexpr CrInt16 updatedWidth = 320 * 1024; // Updated width
constexpr CrInt16 updatedHeight = 240 * 1024; // Updated height

// 3. Execute the UpdateEframingArea function.
SCRSDK::CrError error = SCRSDK::UpdateEframingArea(handle, areaNumber, areaGroup, updatedX, updatedY, updatedWidth, updatedHeight);