Fulguro Logo Support This Project

Priority Stack
[Data tools]


Detailed Description

Priority Stack.


Data Structures

struct  FLGR_McStack
struct  FLGR_McStackLink
struct  FLGR_PStack
struct  FLGR_Stack
struct  FLGR_StackLink

Functions

int flgr_pstack_check_stack_priority (FLGR_McStack *stack, FLGR_Vector *priorityLabel)
FLGR_PStackflgr_pstack_create (FLGR_Type type, FLGR_VectorCompare fcompare)
FLGR_McStackflgr_pstack_create_stack (FLGR_PStack *pstack, FLGR_Vector *priorityLabel)
void flgr_pstack_destroy (FLGR_PStack *pstack)
FLGR_McStackflgr_pstack_get_first_no_empty_stack (FLGR_PStack *pstack)
FLGR_McStackflgr_pstack_get_last_no_empty_stack (FLGR_PStack *pstack)
FLGR_McStackflgr_pstack_get_stack (FLGR_PStack *pstack, FLGR_Vector *priorityLabel)
FLGR_Ret flgr_pstack_pop_stack (FLGR_McStack *stack, int *row, int *col)
FLGR_Ret flgr_pstack_push (FLGR_PStack *pstack, FLGR_Vector *priorityLabel, int row, int col)
FLGR_Ret flgr_pstack_push_stack (FLGR_McStack *stack, int row, int col)
FLGR_Ret flgr_pstack_set_stack_priority (FLGR_McStack *stack, FLGR_Vector *priorityLabel)


Function Documentation

EXPORT_LIB int flgr_pstack_check_stack_priority ( FLGR_McStack stack,
FLGR_Vector priorityLabel 
)

Check if a stack correspond to a specific priority label

Parameters:
stack : pointer on a FLGR_McStack structure
priorityLabel : Vector or Scalar priority label
Returns:
FLGR_TRUE or FLGR_FALSE

Definition at line 346 of file flgrDataToolsPStack.c.

EXPORT_LIB FLGR_PStack * flgr_pstack_create ( FLGR_Type  type,
FLGR_VectorCompare  fcompare 
)

Allocate the PriorityStack structure

  //This function is used to insert (odered) Stack in the PStack stack list
  //This compare function example use norm to choose which vector is inferior
  #include <flgrCoreVector.h>
  #include <flgrCoreMeasureVector.h>
  #include <flgrCoreArithVector.h>

  {...}

  int myComparePriorityLabel(FLGR_Vector *priorityLabel1, FLGR_Vector *priorityLabel2) {
    FLGR_Vector vec_float64 = flgr_vector_create(priorityLabel1->spp, FLGR_FLOAT64);
    fgFLOAT64 vol1, vol2;

    flgr_vector_copy(vec_float64, priorityLabel1);
    flgr_vector_square(vec_float64, vec_float64);
    flgr_vector_measure_volume(vec_float64, &vol1);

    flgr_vector_copy(vec_float64, priorityLabel2);
    flgr_vector_square(vec_float64, vec_float64);
    flgr_vector_measure_volume(vec_float64, &vol2);

    flgr_vector_destroy(vec_float64);

    if(vol1>vol2)
      return FLGR_TRUE;
    
    return FLGR_FALSE;
  }
Parameters:
type : data type
fcompare : function to compare two vector (needed to set and ordered relationship)
Returns:
a pointer to FLGR_PStack

Definition at line 79 of file flgrDataToolsPStack.c.

EXPORT_LIB FLGR_McStack * flgr_pstack_create_stack ( FLGR_PStack pstack,
FLGR_Vector priorityLabel 
)

Create a stack for a specific priority label

Parameters:
pstack : pointer on a FLGR_PStack structure
priorityLabel : Vector priority label
Returns:
a pointer to a FLGR_McStack

Definition at line 459 of file flgrDataToolsPStack.c.

EXPORT_LIB void flgr_pstack_destroy ( FLGR_PStack pstack  ) 

Unallocate the PriorityStack structure

Parameters:
pstack : a pointer to FLGR_PStack
Returns:
a pointer

Definition at line 106 of file flgrDataToolsPStack.c.

EXPORT_LIB FLGR_McStack * flgr_pstack_get_first_no_empty_stack ( FLGR_PStack pstack  ) 

Find the first no empty stack in a Priority Stack

Parameters:
pstack : pointer on a FLGR_PStack structure
Returns:
a pointer to a FLGR_McStack

Definition at line 510 of file flgrDataToolsPStack.c.

EXPORT_LIB FLGR_McStack * flgr_pstack_get_last_no_empty_stack ( FLGR_PStack pstack  ) 

Find the last no empty stack in a Priority Stack

Parameters:
pstack : pointer on a FLGR_PStack structure
Returns:
a pointer to a FLGR_McStack

Definition at line 536 of file flgrDataToolsPStack.c.

EXPORT_LIB FLGR_McStack * flgr_pstack_get_stack ( FLGR_PStack pstack,
FLGR_Vector priorityLabel 
)

Find a specific stack in a Priority Stack

Parameters:
pstack : pointer on a FLGR_PStack structure
priorityLabel : a pointer to an integer representing the stack priority label
Returns:
a pointer to a FLGR_McStack

Definition at line 611 of file flgrDataToolsPStack.c.

EXPORT_LIB FLGR_Ret flgr_pstack_pop_stack ( FLGR_McStack stack,
int *  row,
int *  col 
)

Pop pixel coordinates from a stack

Parameters:
stack : pointer on a FLGR_McStack structure
row : integer for coordinates
col : integer for coordinates
Returns:
a pointer

Definition at line 221 of file flgrDataToolsPStack.c.

EXPORT_LIB FLGR_Ret flgr_pstack_push ( FLGR_PStack pstack,
FLGR_Vector priorityLabel,
int  row,
int  col 
)

Push pixel coordinates in the Priority stack. If the corresponding stack for a given priority doesn't exist, the stack will be created and added to the priority stack

Parameters:
pstack : pointer on a FLGR_PStack structure
priorityLabel : a pointer to a integer for label value of the stack to push pixel coordinates
row : integer for coordinates
col : integer for coordinates
Returns:
a pointer

Definition at line 198 of file flgrDataToolsPStack.c.

EXPORT_LIB FLGR_Ret flgr_pstack_push_stack ( FLGR_McStack stack,
int  row,
int  col 
)

Push pixel coordinates in a stack

Parameters:
stack : pointer on a FLGR_McStack structure
row : integer for coordinates
col : integer for coordinates
Returns:
a pointer

Definition at line 256 of file flgrDataToolsPStack.c.

EXPORT_LIB FLGR_Ret flgr_pstack_set_stack_priority ( FLGR_McStack stack,
FLGR_Vector priorityLabel 
)

Set a the priority label field of FLGR_McStack structure

Parameters:
stack : pointer on a FLGR_McStack structure
priorityLabel : Vector or Scalar priority label
Returns:
FLGR_RET_OK, ...

Definition at line 324 of file flgrDataToolsPStack.c.


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