python_grasp.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include "../input/grasp_input_tile_description.h"
#include "../output/grasp_output_tile_result.h"
#include "../output/grasp_output_segment_result.h"
#include "../controller/grasp_main.h"

Go to the source code of this file.

Functions

int python_sequential (int argc, char **argv, grasp_results_description *python_result, grasp_segment_t *input_segment, sensor_data_t *sdata)
 
int python_read_segment (char *file_name, grasp_segment_t *segment)
 
int python_read_sdata (char *file_name, sensor_data_t *sdata)
 
int python_write_sdata (char *path, sensor_data_t *sdata)
 
int python_get_index (grasp_segment_t *seg, int t, int x, int y)
 
sensor_data_tget_sensor ()
 
void free_ptr (void *ptr)
 
void python_reindex_results (grasp_results_description *results_description)
 
grasp_tile_description_tpython_get_tile_description (int tile_nt, int tile_nx, int tile_ny)
 
grasp_settingspython_read_settings (char *settings_text)
 
int python_debug_settings (int argc, char **argv, char **settings_debug, char **error_string)
 
size_t sanity_check_segment_size ()
 Returns byte of the the segment structure. Useful as a quick sanity check that the constants set loaded by the grasp python library is the same one as the one compiled in the binary. More...
 

Function Documentation

◆ free_ptr()

void free_ptr ( void *  ptr)

◆ get_sensor()

sensor_data_t* get_sensor ( )

◆ python_debug_settings()

int python_debug_settings ( int  argc,
char **  argv,
char **  settings_debug,
char **  error_string 
)
Parameters
argcnumber of arguments as argc
argvarguments first has to be settings in inline format
settings_debuginformation of debug settings into screen
error_stringtext of errors
Returns
0 if everything works, otherwise number of errors

◆ python_get_index()

int python_get_index ( grasp_segment_t seg,
int  t,
int  x,
int  y 
)

Return the memory index of the pixel [t, x, y] /!\ index t, x and y start at 1 return -1 if the pixel doesn't exist

◆ python_get_tile_description()

grasp_tile_description_t* python_get_tile_description ( int  tile_nt,
int  tile_nx,
int  tile_ny 
)

This function return a tile_description structure from the sizes of the tile

Parameters
segment_ntimesNumber of segments it contains in T dimension
segment_ncolsNumber of segments it contains in X dimension
segment_nrowsNumber of segments it contains in Y dimension
tile_ntNumber of pixels it contains in T dimension
tile_nxNumber of pixels it contains in X dimension
tile_nyNumber of pixels it contains in Y dimension
Returns
allocated tile_description structure or NULL in case of error

◆ python_read_sdata()

int python_read_sdata ( char *  file_name,
sensor_data_t sdata 
)

◆ python_read_segment()

int python_read_segment ( char *  file_name,
grasp_segment_t segment 
)

Load the sdata file with the given name from disk. Used by pygrasp.SDATA('file.sdat')

◆ python_read_settings()

grasp_settings* python_read_settings ( char *  settings_text)

Read functions and return the structure.

Parameters
settings_textSettings in 'inline' way
Returns
allocated settins strucuture or NULL in case of error

◆ python_reindex_results()

void python_reindex_results ( grasp_results_description results_description)

This function need to be called if results structure is modified

Parameters
resultsmodified structure
tile_descriptionit defined the dimensions of the results

◆ python_sequential()

int python_sequential ( int  argc,
char **  argv,
grasp_results_description python_result,
grasp_segment_t input_segment,
sensor_data_t sdata 
)

Entry point to GRASP. Used by pygrasp.run(...)

◆ python_write_sdata()

int python_write_sdata ( char *  path,
sensor_data_t sdata 
)

◆ sanity_check_segment_size()

size_t sanity_check_segment_size ( )

Returns byte of the the segment structure. Useful as a quick sanity check that the constants set loaded by the grasp python library is the same one as the one compiled in the binary.

Returns
sizeof(grasp_segment_t)