Fulguro Logo Support This Project

Core


Detailed Description

This module is the main part of the library and define all data types, error codes, and allocating/free functions.
Core module aims to give a common part to all others modules in order to avoid code rewriting, to preserve stability and to give a common interface.
Allocating function are redefine to test if allocations are correctly done.
Macro to display Errors, Warning, Information works as a standard printf but print the calling function name before anything else given by the user. This Macro must used to debug information and in a near future, complete error tracing will be made thanks to POST_ERROR and POST_WARNING


Modules

 Channel manipulation functions
 Compare and replace functions
 Functions to compare FLGR_DataXD or to replace element inside an array.
 Copy functions
 Functions to copy FLGR_Data2D.
 Array Manipulation
 Main functions to allocate and manipulate 2D Array.
 Geometry functions
 Main functions to draw geometric shapes in images.
 Neighborhood extraction
 Functions to manipulate and extract neighborhood in images The extraction of a neighborhood is done for each FLGR_Data2D source pixels. A computation is done and the corresponding pixels in the destination is replace2dd by the result.
 Shear Based Transformation
 Shift functions
 Sliding Window
 Main functions to slide every kernel and every computation over FLGR_Data2D.
If source and destination are the same, "raster" ("anti_raster") functions will modify Neighborhood definition to comply with a recursive raster (resp. anti_raster) scan way.
 Threads
 Threads auto
 Vector manipulations
 Functions to create and manipulate Vector.

Defines

#define POST_ERROR(chaine,...)
 Print an errror in console.
#define POST_INFO(chaine,...)   fprintf(stderr,"INFO: %s: "chaine,__FUNCTION__,##__VA_ARGS__)
 Print an information in console.
#define POST_WARNING(chaine,...)
 Print a warning in console.

Typedefs

typedef fgUINT32 fgBIT
 bit type. Pixels are packed by 32 or 64 depending on the processor type (32 bits or 64 bits)
typedef float fgFLOAT32
 Simple Float.
typedef double fgFLOAT64
 Double Float.
typedef short int fgINT16
 16 bits signed
typedef int fgINT32
 32 bits signed
typedef char fgINT8
 8 bits signed
typedef unsigned short int fgUINT16
 16 bits unsigned
typedef unsigned int fgUINT32
 32 bits unsigned
typedef unsigned char fgUINT8
 8 bits unsigned
typedef void(* FLGR_ComputeArith )(FLGR_Vector *vector_dest, FLGR_Vector *vector_1, FLGR_Vector *vector_2)
 pointer to a function doing arith computation over vectors
typedef void(* FLGR_ComputeNhb1D )(FLGR_Vector *result, FLGR_NhbBox1D *extr)
 pointer to a function doing computation over an extracted neighborhood
typedef void(* FLGR_ComputeNhb2D )(FLGR_Vector *result, FLGR_NhbBox2D *extr)
 pointer to a function doing computation over an extracted neighborhood

Enumerations

enum  FLGR_Connexity { FLGR_4_CONNEX = 4, FLGR_6_CONNEX = 6, FLGR_8_CONNEX = 8, FLGR_NO_CONNEX = 0 }
enum  FLGR_MorphoOptim {
  FLGR_MORPHO_OPTIM_SQUARE, FLGR_MORPHO_OPTIM_CROSS, FLGR_MORPHO_OPTIM_HEXAGON, FLGR_MORPHO_OPTIM_RECTANGLE,
  FLGR_MORPHO_OPTIM_OCTAGON, FLGR_MORPHO_OPTIM_DIAMOND, FLGR_MORPHO_OPTIM_NONE
}
enum  FLGR_Ret {
  FLGR_RET_OK = 0, FLGR_RET_TYPE_UNKNOWN = -1, FLGR_RET_TYPE_DIFFERENT = -2, FLGR_RET_SIZE_ERROR = -3,
  FLGR_RET_ALLOCATION_ERROR = -4, FLGR_RET_CONNEXITY_UNKNOWN = -5, FLGR_RET_PARAM_UNKNOWN = -6, FLGR_RET_NOT_IMPLEMENTED = -7,
  FLGR_RET_UNDEFINED_ERROR = -8
}
enum  FLGR_Shape {
  FLGR_LINE, FLGR_RECT, FLGR_HEX, FLGR_DISC,
  FLGR_ELLIPSE, FLGR_CROSS, FLGR_CROSSX, FLGR_SLASH,
  FLGR_BSLASH, FLGR_DIAMOND, FLGR_OCTAGON, FLGR_USER_SHAPE,
  FLGR_NO_SHAPE
}
enum  FLGR_Sym { FLGR_NHB_SYM = 0, FLGR_NHB_NO_SYM = 1 }
enum  FLGR_Type {
  FLGR_BIT, FLGR_UINT8, FLGR_UINT16, FLGR_UINT32,
  FLGR_UINT64, FLGR_INT8, FLGR_INT16, FLGR_INT32,
  FLGR_INT64, FLGR_FLOAT32, FLGR_FLOAT64
}

Functions

FLGR_Ret flgr1d_fill_neighborhood (FLGR_Data1D *nhb, FLGR_Shape shape, int width)
FLGR_Ret flgr2d_fill_neighborhood (FLGR_Data2D *nhb, FLGR_Shape shape, int width, int height)
FLGR_Ret flgr2d_native_dilate_4_connexity (FLGR_Data2D *nhb)
FLGR_Ret flgr2d_native_dilate_6_connexity (FLGR_Data2D *nhb)
FLGR_Ret flgr2d_native_dilate_8_connexity (FLGR_Data2D *nhb)
void flgr_free (void *ptr)
void flgr_free_align (void *ptr)
int flgr_get_bps_from_type (FLGR_Type type)
char * flgr_get_shape_string (FLGR_Shape shape)
int flgr_get_sizeof (FLGR_Type type)
FLGR_Type flgr_get_type_from_string (char *type)
char * flgr_get_type_string (FLGR_Type type)
FLGR_Ret flgr_is_data_type_valid (FLGR_Type type)
FLGR_Ret flgr_is_vector_type_valid (FLGR_Type type)
void * flgr_malloc (size_t size)
void * flgr_malloc_align (size_t size, size_t alignment)


Enumeration Type Documentation

Connexity Mesh flags definition

Enumerator:
FLGR_4_CONNEX  Flag for 4-connex operation (2D)
FLGR_6_CONNEX  Flag for 6-connex operation (2D)
FLGR_8_CONNEX  Flag for 8-connex operation (2D)
FLGR_NO_CONNEX  Flag No Connexity applicable

Definition at line 91 of file flgrCoreTypes.h.

Optimization availables for kernel-based operations

Enumerator:
FLGR_MORPHO_OPTIM_SQUARE  Flag for square kernel optimization (8-connex)
FLGR_MORPHO_OPTIM_CROSS  Flag for cross kernel optimization (4-connex)
FLGR_MORPHO_OPTIM_HEXAGON  Flag for hexagonal kernel optimization (6-connex)
FLGR_MORPHO_OPTIM_RECTANGLE  Flag for rectangle kernel optimization (8-connex)
FLGR_MORPHO_OPTIM_OCTAGON  Flag for octagon kernel optimization (8-connex)
FLGR_MORPHO_OPTIM_DIAMOND  Flag for rhombus kernel optimization (8-connex)
FLGR_MORPHO_OPTIM_NONE  Flag for no specific kernel optimization

Definition at line 141 of file flgrCoreTypes.h.

enum FLGR_Ret

Errors flags definition

Enumerator:
FLGR_RET_OK  Function worked correctly
FLGR_RET_TYPE_UNKNOWN  Data type specified is not recoginzed in the function
FLGR_RET_TYPE_DIFFERENT  Function could not work with images with different data types
FLGR_RET_SIZE_ERROR  Function could not work with images with different sizes
FLGR_RET_ALLOCATION_ERROR  Memory could not be allocated
FLGR_RET_CONNEXITY_UNKNOWN  Connexity specified is not recognized by the function
FLGR_RET_PARAM_UNKNOWN  The parameter is not known
FLGR_RET_NOT_IMPLEMENTED  The function is not implemented
FLGR_RET_UNDEFINED_ERROR  For all others

Definition at line 39 of file flgrCoreTypes.h.

enum FLGR_Shape

Shape flags definition

Enumerator:
FLGR_LINE  1D Shape
FLGR_RECT  2D, Filled Rectangle
FLGR_HEX  2D, Hexagon
FLGR_DISC  2D, Disc
FLGR_ELLIPSE  2D, Filled Ellipse
FLGR_CROSS  2D, Cross +
FLGR_CROSSX  2D, Cross X
FLGR_SLASH  2D, line /
FLGR_BSLASH  2D, line \
FLGR_DIAMOND  2D, Diamond
FLGR_OCTAGON  2D, Octagon
FLGR_USER_SHAPE  User shape
FLGR_NO_SHAPE  Shape not applicable

Definition at line 72 of file flgrCoreTypes.h.

enum FLGR_Sym

Symetrize Neighborhood flags definition

Enumerator:
FLGR_NHB_SYM  Neihborhood Definition Symetrization Flag
FLGR_NHB_NO_SYM  Neihborhood Definition No Symetrization Flag

Definition at line 129 of file flgrCoreTypes.h.

enum FLGR_Type

Data Types flags definition

Enumerator:
FLGR_BIT  Flag for BIT type (one value is stored in one bit)
FLGR_UINT8  Flag for UINT8 type
FLGR_UINT16  Flag for UINT16 type
FLGR_UINT32  Flag for UINT32 type
FLGR_UINT64  Flag for UINT64 type
FLGR_INT8  Flag for INT8 type
FLGR_INT16  Flag for INT16 type
FLGR_INT32  Flag for INT32 type
FLGR_INT64  Flag for INT64 type
FLGR_FLOAT32  Flag for FLOAT32 type
FLGR_FLOAT64  Flag for FLOAT64 type

Definition at line 101 of file flgrCoreTypes.h.


Function Documentation

FLGR_Ret flgr1d_fill_neighborhood ( FLGR_Data1D nhb,
FLGR_Shape  shape,
int  width 
)

Fill a neighborhood definition with a shape

Parameters:
nhb : a pointer to a FLGR_Data1D
shape : shape of the structuring element (FLGR_LINE or FLGR_USER_SHAPE)
width : shape width
Returns:
FLGR_RET_OK, ...

Definition at line 341 of file flgrCoreNhbFill.c.

FLGR_Ret flgr2d_fill_neighborhood ( FLGR_Data2D nhb,
FLGR_Shape  shape,
int  width,
int  height 
)

Fill a neighborhood definition with a shape

Parameters:
nhb : a pointer to a FLGR_Data2D
shape : shape of the structuring element
width : shape width
height : shape height
Returns:
FLGR_RET_OK, ...

Definition at line 465 of file flgrCoreNhbFill.c.

FLGR_Ret flgr2d_native_dilate_4_connexity ( FLGR_Data2D nhb  ) 

Native dilatation in 4 connexity (mainly used to fill neighborhoods definitions)

Parameters:
nhb : a pointer to a FLGR_Data2D
Returns:
FLGR_RET_OK, ...

Definition at line 180 of file flgrCoreNhbFill.c.

FLGR_Ret flgr2d_native_dilate_6_connexity ( FLGR_Data2D nhb  ) 

Native dilatation in 4 connexity (mainly used to fill neighborhoods definitions)

Parameters:
nhb : a pointer to a FLGR_Data2D
Returns:
FLGR_RET_OK, ...

Definition at line 226 of file flgrCoreNhbFill.c.

FLGR_Ret flgr2d_native_dilate_8_connexity ( FLGR_Data2D nhb  ) 

Native dilatation in 8 connexity (mainly used to fill neighborhoods definitions)

Parameters:
nhb : a pointer to a FLGR_Data2D
Returns:
FLGR_RET_OK, ...

Definition at line 272 of file flgrCoreNhbFill.c.

void flgr_free ( void *  ptr  ) 

Free allocation

Parameters:
ptr : pointer on the first element of the allocated zone
Returns:
nothing

Definition at line 100 of file flgrCoreMalloc.c.

void flgr_free_align ( void *  ptr  ) 

Free align allocation

Parameters:
ptr : pointer on the first element of the allocated zone
Returns:
nothing

Definition at line 113 of file flgrCoreMalloc.c.

EXPORT_LIB int flgr_get_bps_from_type ( FLGR_Type  type  ) 

Get Number of Bit Per Pixel for a given type

Parameters:
type 
Returns:
bps or FLGR_RET_TYPE_UNKNOWN

Definition at line 102 of file flgrCoreTypes.c.

EXPORT_LIB char * flgr_get_shape_string ( FLGR_Shape  shape  ) 

Get the type flag string

Parameters:
shape 
Returns:
string

Definition at line 181 of file flgrCoreTypes.c.

EXPORT_LIB int flgr_get_sizeof ( FLGR_Type  type  ) 

Get size of type in byte

Parameters:
type 
Returns:
Byte Per Pixel or FLGR_RET_TYPE_UNKNOWN

Definition at line 129 of file flgrCoreTypes.c.

EXPORT_LIB FLGR_Type flgr_get_type_from_string ( char *  type  ) 

Get the type flag string

Parameters:
type 
Returns:
string

Definition at line 208 of file flgrCoreTypes.c.

EXPORT_LIB char * flgr_get_type_string ( FLGR_Type  type  ) 

Get the type flag string

Parameters:
type 
Returns:
string

Definition at line 155 of file flgrCoreTypes.c.

EXPORT_LIB FLGR_Ret flgr_is_data_type_valid ( FLGR_Type  type  ) 

Test if a type defined in a string is Valid

Parameters:
type 
Returns:
FLGR_RET_OK, FLGR_RET_TYPE_UNKNOWN

Definition at line 72 of file flgrCoreTypes.c.

EXPORT_LIB FLGR_Ret flgr_is_vector_type_valid ( FLGR_Type  type  ) 

Test if a type defined in a string is Valid

Parameters:
type 
Returns:
FLGR_RET_OK, FLGR_RET_TYPE_UNKNOWN

Definition at line 38 of file flgrCoreTypes.c.

void* flgr_malloc ( size_t  size  ) 

Allocation function

Parameters:
size : size of the memory part allocated in octets
Returns:
pointer to the start of the allocated zone

Definition at line 57 of file flgrCoreMalloc.c.

void* flgr_malloc_align ( size_t  size,
size_t  alignment 
)

Align allocation function

Parameters:
size : size of the memory part allocated in octets
alignment : alignment constraints in octets
Returns:
pointer to the start of the allocated zone

Definition at line 78 of file flgrCoreMalloc.c.


SourceForge.net Logo
Generated on Tue Nov 11 19:17:28 2008 for Fulguro by doxygen 1.5.6