SB SDK 1.11
Lut

Warped image management. More...

Collaboration diagram for Lut:

Data Structures

struct  sb_t_lut_point
 Struct that defines the coordinates of a point of a lut. More...
 

Macros

#define SB_LUT_POINT_NOT_EXIST   0xFFFF
 Special value to identify coordinates of not existing points. More...
 

Functions

sb_t_err sb_lut_create (SB_HANDLE *phandle, int width, int height)
 Creates the handle of the lut. More...
 
sb_t_err sb_lut_destroy (SB_HANDLE *phandle)
 Destroys the handle of the lut. More...
 
sb_t_err sb_lut_get_ptr (SB_HANDLE phandle, sb_t_lut_point **const ptr)
 Retrieves, in the parameter ptr, the pointer to internal array of the lut. More...
 
sb_t_err sb_lut_get_size (SB_HANDLE phandle, int *const width, int *const height)
 Retrieves the size of the lut. More...
 
sb_t_err sb_lut_save (SB_HANDLE phandle, const char *const file_path)
 Saves the lut in a file. More...
 
sb_t_err sb_lut_load (SB_HANDLE *phandle, const char *const file_path)
 Loads the lut from a file. More...
 
sb_t_err sb_lut_warp_point (SB_HANDLE phandle, const sb_t_point *const src, sb_t_point *const dst)
 Warps the point. More...
 

Detailed Description

Warped image management.

See Lut for more information.

Macro Definition Documentation

◆ SB_LUT_POINT_NOT_EXIST

#define SB_LUT_POINT_NOT_EXIST   0xFFFF

Special value to identify coordinates of not existing points.

See also
sb_t_lut_point

Definition at line 6484 of file sb.h.

Function Documentation

◆ sb_lut_create()

sb_t_err sb_lut_create ( SB_HANDLE phandle,
int  width,
int  height 
)

Creates the handle of the lut.

The size of the lut should be set equal to the size of the corresponding image.

Parameters
[out]phandlePointer to the handle of the lut.
On successful return, this parameter will be updated with the pointer of the handle.
[in]widthWidth, in pixel of the lut.
[in]heightHeight, in pixel of the lut.
Returns
If successful, returns SB_ERR_NONE. Otherwise, it returns an error code sb_t_err.
See also
Lut
sb_lut_destroy

◆ sb_lut_destroy()

sb_t_err sb_lut_destroy ( SB_HANDLE phandle)

Destroys the handle of the lut.

Parameters
[in,out]phandlePointer to the handle. The function sets it to NULL.
Returns
If successful, returns SB_ERR_NONE. Otherwise, it returns an error code sb_t_err.
See also
Lut
sb_lut_create

◆ sb_lut_get_ptr()

sb_t_err sb_lut_get_ptr ( SB_HANDLE  phandle,
sb_t_lut_point **const  ptr 
)

Retrieves, in the parameter ptr, the pointer to internal array of the lut.

The array has a number of elements equal to the image resolution = width * height, where width and height are the parameters passed to the function sb_lut_create.
The user should fill this array with a lut for each pixels of the image.

Attention
The user mustn't to deallocate this pointer.
Parameters
[in]phandleHandle of the lut.
[out]ptrPointer to the lut array.
Returns
If successful, returns SB_ERR_NONE. Otherwise, it returns an error code sb_t_err.
See also
Lut
sb_lut_create

◆ sb_lut_get_size()

sb_t_err sb_lut_get_size ( SB_HANDLE  phandle,
int *const  width,
int *const  height 
)

Retrieves the size of the lut.

Parameters
[in]phandleHandle of the lut.
[out]widthThe parameter will be filled with the width, in pixel, of the lut.
[out]heightThe parameter will be filled with the height, in pixel, of the lut.
Returns
If successful, returns SB_ERR_NONE. Otherwise, it returns an error code sb_t_err.
See also
Lut

◆ sb_lut_load()

sb_t_err sb_lut_load ( SB_HANDLE phandle,
const char *const  file_path 
)

Loads the lut from a file.

Parameters
[in,out]phandleHandle of the lut.
On successful return, this parameter will be updated with the pointer of the handle. The handle must be destroyed with the function sb_lut_destroy.
[in]file_pathString of the file name.
Returns
If successful, returns SB_ERR_NONE. Otherwise, it returns an error code sb_t_err.
See also
Lut
sb_lut_save
sb_lut_destroy

◆ sb_lut_save()

sb_t_err sb_lut_save ( SB_HANDLE  phandle,
const char *const  file_path 
)

Saves the lut in a file.

Parameters
[in]phandleHandle of the lut.
[in]file_pathString of the file name.
Returns
If successful, returns SB_ERR_NONE. Otherwise, it returns an error code sb_t_err.
See also
Lut
sb_lut_load

◆ sb_lut_warp_point()

sb_t_err sb_lut_warp_point ( SB_HANDLE  phandle,
const sb_t_point *const  src,
sb_t_point *const  dst 
)

Warps the point.

Because happens that not all the points of the lut were defined, in order to managed correctly the small holes, the functions searchs for the source point in the neighborhood of a matrix 5x5. This one usually occurs with lut from warped image to the original one. The error code SB_ERR_WARP_POINT_NOT_FOUND is returned if the function doesn't find the point in the lut.

Parameters
[in]phandleHandle of the lut.
[in]srcPointer to the source point.
[out]dstPointer to the destination point.
Returns
If successful, returns SB_ERR_NONE. Otherwise, it returns an error code sb_t_err.
See also
Lut