RidgeRun AEW Library: librraew  1.1
rraew.h File Reference
#include <linux/types.h>

Classes

struct  rraew_colorpattern
 Bayer pattern order. More...
struct  rraew_gain_step
 Range step information. More...
struct  rraew_stat_config
 Statistics hardware module configuration including user-defined windowing. More...
struct  rraew_file_descriptors
 Hardware file descriptors for the capture device, the previewer device and the aew device. More...
struct  rraew_stat
 Per window statistical data: : average, maximum and minimum of each channel component. More...
struct  rraew_sensor
 Sensor characteristics. More...
struct  rraew_interface
 Struct that contains all the required information of the interface. More...
struct  rraew_coordinates
 Center point of the rectangle of interest. More...
struct  rraew_awb_configuration
 Auto white balance configuration settings. More...
struct  rraew_ae_configuration
 Auto exposure configuration settings. More...
struct  rraew_configuration
 General aew library configuration settings. More...

Typedefs

typedef int(* RraewSetGain )(int *fd, char *owner_fd, __u32 q10r_gain, __u32 q10g_gain, __u32 q10b_gain, void *data)
 Function prototype to set RGB gains.
typedef int(* RraewGetGain )(int *fd, char *owner_fd, __u32 *q10r_gain, __u32 *q10g_gain, __u32 *q10b_gain, void *data)
 Function prototype to get RGB gains.
typedef int(* RraewSetExposure )(int *capture_fd, char *owner_capture_fd, __u32 exp_time, void *data)
 Function prototype to set exposure time.
typedef int(* RraewGetExposure )(int *capture_fd, char *owner_capture_fd, __u32 *exp_time, void *data)
 Function prototype to get exposure time.
typedef int(* RraewSetStatParameters )(int *aew_fd, char *owner_aew_fd, int width, int height, struct rraew_stat_config *stat_config, void *data)
 Function prototype to set parameters to the statistical module.
typedef int(* RraewReadStatData )(int *aew_fd, char *owner_aew_fd, struct rraew_stat_config *stat_config, struct rraew_colorpattern colorptn, struct rraew_stat *stats, void *data)
 Function prototype to read statistical data.
typedef int(* RraewReleaseStatData )(int *aew_fd, char *owner_aew_fd, struct rraew_stat_config *stat_config, struct rraew_stat *stats, void *data)
 Function prototype to release statistical data.

Enumerations

enum  rraew_white_balance_algo { AWB_NONE = 0, AWB_GRAY_WORLD, AWB_WHITE_PATCH, AWB_WHITE_PATCH_2 }
 Aauto white balance algorithm to use. More...
enum  rraew_exposure_algo { AE_NONE, AE_EC }
 Auto exposure algorithm to use. More...
enum  rraew_metering_type { METER_PARTIAL_AREA = 0, METER_RECT_WEIGHTED, METER_AVERAGE, METER_SEGMENT }
 Brightness metering system to be used by the auto exposure algorithm. More...
enum  rraew_gain_type { GAIN_SENSOR = 0, GAIN_DIGITAL }
 Gain adjustment applied to the sensor or on the ipipe. More...

Functions

struct rraew * rraew_create (struct rraew_awb_configuration *awb_config, struct rraew_ae_configuration *ae_config, struct rraew_configuration *aew_config, struct rraew_sensor *sensor, struct rraew_interface *interface, struct rraew_file_descriptors *fd)
 Creates an Auto White Balance/ Auto Exposure Algorithm handler This function makes the structure of the aew library(instance), prepares the hardware modules and initialize the auto-exposure and auto-white-balance algorithms.
void rraew_destroy (struct rraew *aew)
 Destroys an Auto White Balance/ Auto Exposure Algorithm.
int rraew_run (struct rraew *aew)
 Executes one iteration of the auto exposure and auto white balance algorithm.
int rraew_get_rectangle_coordinates (struct rraew *aew, unsigned int *right, unsigned int *left, unsigned int *top, unsigned int *bottom)
 Gets the coordinates for the rectangle of interest that is being used for the auto exposure algorithm.

Variables

struct rraew_colorpattern colorptn_GrRBGb
struct rraew_colorpattern colorptn_BGbGrR
struct rraew_colorpattern colorptn_RGrGbB
struct rraew_colorpattern colorptn_GbBRGr
struct rraew_interface dm365_vpfe_interface
 Skeleton of values for DM365 vpfe interface.

Detailed Description


Typedef Documentation

typedef int(* RraewGetExposure)(int *capture_fd, char *owner_capture_fd, __u32 *exp_time, void *data)

Function prototype to get exposure time.

Parameters:
fdcapture device file descriptor
owner_fdflag that tell who is the file descriptor owner
exp_timepointer to get the exposure time in us
typedef int(* RraewGetGain)(int *fd, char *owner_fd, __u32 *q10r_gain, __u32 *q10g_gain, __u32 *q10b_gain, void *data)

Function prototype to get RGB gains.

Parameters:
fdfile descriptor of the device with the gains module
owner_fdflag that tell who is the file descriptor owner
q10r_gainpointer to get the red gain component on fixed-point Q22:10 format
q10g_gainpointer to get the green gain on fixed-point Q22:10 format
q10b_gainpointer to get the blue component on fixed-point Q22:10 format
Returns:
0 if the operation was successful or -1 otherwise
typedef int(* RraewReadStatData)(int *aew_fd, char *owner_aew_fd, struct rraew_stat_config *stat_config, struct rraew_colorpattern colorptn, struct rraew_stat *stats, void *data)

Function prototype to read statistical data.

Parameters:
aew_fd,filedescriptor of the aew device
owner_aew_fdflag that tell who is the file descriptor owner
stat_configpointer to struct that has the configuration required for the statistical module
statsstruct array where this function leaves the statistical data. The array must start in order with the top/left window and end with the bottom/right window
colorptnstruct that contains the color pattern given by the sensor
Returns:
0 if the operation was successful or -1 otherwise
typedef int(* RraewReleaseStatData)(int *aew_fd, char *owner_aew_fd, struct rraew_stat_config *stat_config, struct rraew_stat *stats, void *data)

Function prototype to release statistical data.

Parameters:
aew_fd,filedescriptor of the aew device
owner_aew_fdflag that tell who is the file descriptor owner
stat_configpointer to struct that has the configuration required for the statistical module
statspointer to memory reserved for the statistical data
Returns:
0 if the operation was successful or -1 otherwise
typedef int(* RraewSetExposure)(int *capture_fd, char *owner_capture_fd, __u32 exp_time, void *data)

Function prototype to set exposure time.

Parameters:
fdcapture device file descriptor
owner_fdflag that tell who is the file descriptor owner
exp_timeexposure time in us
typedef int(* RraewSetGain)(int *fd, char *owner_fd, __u32 q10r_gain, __u32 q10g_gain, __u32 q10b_gain, void *data)

Function prototype to set RGB gains.

Parameters:
fdfile descriptor of the device with the gains module
owner_fdflag that tell who is the file descriptor owner
q10r_gaingain value for the red component. The value format is fixed-point Q22:10
q10g_gaingain value for the green component. The value format is fixed-point Q22:10
q10b_gaingain value for the blue component. The value format is fixed-point Q22:10
Returns:
0 if the operation was successful or -1 otherwise
typedef int(* RraewSetStatParameters)(int *aew_fd, char *owner_aew_fd, int width, int height, struct rraew_stat_config *stat_config, void *data)

Function prototype to set parameters to the statistical module.

Parameters:
aew_fd,filedescriptor of the aew device
owner_aew_fdflag that tell who is the file descriptor owner
widthnumber of horizontal pixels in the image
heightnumber of vertical pixels in the image
stat_configpointer to struct that has the configuration required for the statistical module
Returns:
0 if the operation was successful or -1 otherwise

Enumeration Type Documentation

Auto exposure algorithm to use.

Enumerator:
AE_NONE 

No algorithm, disables auto exposure.

AE_EC 

Electronic centric (EC) algorithm adjusts the brightness level to the mid-tone.

Gain adjustment applied to the sensor or on the ipipe.

Enumerator:
GAIN_SENSOR 

Perform gain adjustment before obtaining the statistics.

GAIN_DIGITAL 

Perform gain adjustment after obtaining the statistics.

Brightness metering system to be used by the auto exposure algorithm.

Enumerator:
METER_PARTIAL_AREA 

Average the light information coming from a frame portion in a user defined area.

METER_RECT_WEIGHTED 

Average the light information coming from the entire frame with emphasis placed on a user defined area.

METER_AVERAGE 

Average the light information coming from the entire frame without any location based weighting.

METER_SEGMENT 

Divides the frame into six pieces and weights them to avoid backlight washout.

Aauto white balance algorithm to use.

Enumerator:
AWB_NONE 

No algorithm, disables auto white balance.

AWB_GRAY_WORLD 

Gray World algorithm is based on the assumption that given an image with sufficient amount of color variation, the average reflectance of the scene is achromatic (gray).

AWB_WHITE_PATCH 

White Patch algorithm assumes that the maximum response in an image is caused by a perfect reflector, so represents the color of the illumination based on the absolute maximum.

AWB_WHITE_PATCH_2 

White Patch algorithm assumes that the maximum response in an image is caused by a perfect reflector, so represents the color of the illumination based on the average of local maximums.


Function Documentation

struct rraew* rraew_create ( struct rraew_awb_configuration awb_config,
struct rraew_ae_configuration ae_config,
struct rraew_configuration aew_config,
struct rraew_sensor sensor,
struct rraew_interface interface,
struct rraew_file_descriptors fd 
) [read]

Creates an Auto White Balance/ Auto Exposure Algorithm handler This function makes the structure of the aew library(instance), prepares the hardware modules and initialize the auto-exposure and auto-white-balance algorithms.

All the structures are copied so the pointer can be released after the creation of the algorithm.

Parameters:
awb_configauto white balance configuration settings.
ae_configauto exposure configuration settings.
aew_configauto white balance and auto exposure common configuration settings.
sensorstructure that defines the sensor.
interfacestructure that defines the video processing subsystem of this SoC.
fdeach device can be accessed through file descriptors, obtained with the “open” function. librraew interacts with three devices: previewer (from video processing subsystem) , camera sensor and aew statistics engine. This parameter defines the file descriptors for these devices and the owner of each one. The ownership determines if the device has to be open by librraew or you give the file descriptor. When the owner is librraew, you may leave the file descriptor NULL.
Returns:
an aew algorithm handler pointer or NULL on error.

References AE_EC, AE_NONE, AWB_GRAY_WORLD, AWB_NONE, AWB_WHITE_PATCH, and AWB_WHITE_PATCH_2.

void rraew_destroy ( struct rraew *  aew)

Destroys an Auto White Balance/ Auto Exposure Algorithm.

Free the memory used by the algorithm

Parameters:
aewan aew algorithm handler
int rraew_get_rectangle_coordinates ( struct rraew *  aew,
unsigned int *  right,
unsigned int *  left,
unsigned int *  top,
unsigned int *  bottom 
)

Gets the coordinates for the rectangle of interest that is being used for the auto exposure algorithm.

Specifies the coordinates of two points: the top left and bottom right corners of the rectangle. The sides of the rectangle extend from these two points and are parallel to the x-axis and y-axis.

Parameters:
aewan aew algorithm handler
*rightthe coordinate value of the rectangle's right side.
*leftthe coordinate value of the rectangle's left side.
*topthe coordinate value of the rectangle's top side.
*bottomthe coordinate value of the rectangle's bottom side.
Returns:
if the algorithm doesn't use a rectangle of interest, returns -1, otherwise returns 0 and the coordinates values are filled.

References METER_PARTIAL_AREA, and METER_RECT_WEIGHTED.

int rraew_run ( struct rraew *  aew)

Executes one iteration of the auto exposure and auto white balance algorithm.

Parameters:
aewan aew algorithm handler

References AE_NONE, and AWB_NONE.


Variable Documentation

Pattern:
B Gb
Gr R
Pattern:
Gb B
R Gr
Pattern:
Gr R
B Gb
Pattern:
R Gr
Gb B

Skeleton of values for DM365 vpfe interface.

For the DM365 platform the librraew has a filled rraew_interface structure. The librraew implements the required function callbacks.