Get in touch with us today and our team of imaging professionals will be pleased to assist you.
The eSDK API provides the following image and frame handling functions:
EVT_CameraQueueFrame – Place an image buffer into the frame queueEVT_CameraGetFrame – Get a frame from the cameraEVT_FrameConvert – Convert a frame using the provided parametersEVT_AllocateFrameBuffer – Allocate memory for the imageEVT_ReleaseFrameBuffer – Release memory allocated with EVT_AllocateFrameBufferEVT_FrameSave – Save image to file in the selected formatFor information about other types of eSDK API functions, see the eSDK API Functons Overview.
EVT_CameraQueueFrameDescription: Places an image buffer into the frame queue.
Prototype:
EVT_ERROR EVT_CameraQueueFrame(
CEmergentCamera* camera,
CEmergentFrame* frame
);
Parameters:
camera: Camera handle.frame: Camera image frame to queue.Return Values:
EVT_SUCCESSEVT_ERROR_INVALEVT_GENERAL_ERRORUsage Example:
EVT_CameraQueueFrame(camera, &frame);
EVT_CameraGetFrameDescription: Retrieves a frame from the camera. Blocks the calling thread until the frame is received.
Prototype:
EVT_ERROR EVT_CameraGetFrame(
CEmergentCamera* camera,
CEmergentFrame* frame,
int milliseconds
);
Parameters:
camera: Camera handle.frame: Image frame from the camera.milliseconds: Time to wait in milliseconds. Use EVT_INFINITE to block indefinitely.Return Values:
EVT_SUCCESSEVT_ERROR_INVALEVT_ERROR_AGAINEVT_ERROR_INTREVT_ERROR_NOMEMEVT_GENERAL_ERRORUsage Example:
EVT_CameraGetFrame(camera, &frame, EVT_INFINITE);
EVT_FrameConvertDescription: Converts a frame using the provided parameters.
Prototype:
EVT_ERROR EVT_FrameConvert(
CEmergentFrame* frameSrc,
CEmergentFrame* frameDst,
int convertBitDepth,
int convertColor
);
Parameters:
frameSrc: Image frame to convert.frameDst: Image frame result.convertBitDepth: Defines conversion of bits per pixel. Can be one of the following:EVT_CONVERT_NONEEVT_CONVERT_8BITconvertColor: Defines color conversion. Can be one of the following:EVT_COLOR_CONVERT_NONEEVT_COLOR_CONVERT_NEARESTNEIGHBOR_RGBEVT_COLOR_CONVERT_NEARESTNEIGHBOR_BGREVT_COLOR_CONVERT_BILINEAR_RGBEVT_COLOR_CONVERT_BILINEAR_BGREVT_COLOR_CONVERT_TO_RGBEVT_COLOR_CONVERT_TO_BGRReturn Values:
EVT_SUCCESSEVT_GENERAL_ERRORUsage Example:
EVT_FrameConvert(&frameSrc, &frameDst, EVT_CONVERT_8BIT, EVT_COLOR_CONVERT_TO_RGB);
EVT_AllocateFrameBufferDescription: Allocates memory for the image.
Prototype:
EVT_ERROR EVT_AllocateFrameBuffer(
CEmergentCamera* camera,
CEmergentFrame* frame,
int buffer_type
);
Parameters:
camera: Camera handle.frame: Image frame object.buffer_type: Can be one of the following:EVT_FRAME_BUFFER_DEFAULTEVT_FRAME_BUFFER_ZERO_COPYReturn Values:
EVT_SUCCESSEVT_ERROR_NOT_SUPPORTEDEVT_ERROR_INVALEVT_ERROR_NOMEMEVT_GENERAL_ERRORUsage Example:
EVT_AllocateFrameBuffer(camera, &frame, EVT_FRAME_BUFFER_ZERO_COPY);Note: UseEVT_FRAME_BUFFER_ZERO_COPYfor high-efficiency image data transfer. For other operations like frame conversion, useEVT_FRAME_BUFFER_DEFAULT.
EVT_ReleaseFrameBufferDescription: Releases memory previously allocated with EVT_AllocateFrameBuffer.
Prototype:
EVT_ERROR EVT_ReleaseFrameBuffer(
CEmergentCamera* camera,
CEmergentFrame* frame
);
Parameters:
camera: Camera handle.frame: Image frame from the camera.Return Values:
EVT_SUCCESSEVT_GENERAL_ERRORUsage Example:
EVT_ReleaseFrameBuffer(camera, &frame);
EVT_FrameSaveDescription: Saves an image to a file in the selected format.
Prototype:
EVT_ERROR EVT_FrameSave(
CEmergentFrame* frame,
char* filename,
int filetype,
int align
);
Parameters:
frame: Image frame to save to a file.filename: File name for the saved file.filetype: Format to save the image. Can be one of the following:EVT_FILETYPE_RAWEVT_FILETYPE_BMPEVT_FILETYPE_TIFalign: Alignment setting for pixel data (e.g., EVT_ALIGN_LEFT).Return Values:
EVT_SUCCESSEVT_ERROR_INVALEVT_ERROR_IOEVT_GENERAL_ERRORUsage Example:
EVT_FrameSave(&frame, "image.tif", EVT_FILETYPE_TIF, EVT_ALIGN_LEFT);
Get in touch with us today and our team of imaging professionals will be pleased to assist you.