LLIPS  rev33
Light Library for Image ProcesS
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
llips_functions.c
Go to the documentation of this file.
1 /********************************************/
8 /* ***************************************************************/
9 /* * Includes */
10 /* ***************************************************************/
11 #include "llips_includes.h"
12 
13 /* ***************************************************************/
14 /* * Global variables */
15 /* ***************************************************************/
16 
17 /* ***************************************************************/
18 /* * Functions */
19 /* ***************************************************************/
20 
21 /********************************************/
30 {
31  CPU_INT32U ret=0;
32  if(a >= b)
33  {
34  ret = b;
35  }else
36  {
37  ret = a;
38  }
39  return ret;
40 }
41 
42 
43 /********************************************/
52 {
53  CPU_INT32U ret=0;
54  if(a >= b)
55  {
56  ret = a;
57  }else
58  {
59  ret = b;
60  }
61  return ret;
62 }
63 
64 /********************************************/
73 {
74  CPU_INT16S i;
75  CPU_INT08U **tab1 = (CPU_INT08U **)malloc(sizeof(CPU_INT08U*)*nbLin);
76  CPU_INT08U *tab2 = (CPU_INT08U *)malloc(sizeof(CPU_INT08U)*nbCol*nbLin);
77  for(i = 0 ; i < nbLin ; i++){
78  tab1[i] = &tab2[i*nbCol];
79  }
80  return tab1;
81 }
82 
83 
84 /********************************************/
93 {
94  CPU_INT16S i;
95  CPU_FP64 **tab1 = (CPU_FP64 **)malloc(sizeof(CPU_FP64*)*nbLin);
96  CPU_FP64 *tab2 = (CPU_FP64 *)malloc(sizeof(CPU_FP64)*nbCol*nbLin);
97  for(i = 0 ; i < nbLin ; i++){
98  tab1[i] = &tab2[i*nbCol];
99  }
100 
101  return tab1;
102 }
103 
104 
105 
106 /********************************************/
114 {
115  free(tab[0]);
116  free(tab);
117 }
118 
119 /********************************************/
127 {
128  free(tab[0]);
129  free(tab);
130 }
131 
132 /********************************************/
140 CPU_INT32S compare (const CPU_VOID * a, const CPU_VOID * b)
141 {
142  return ( *(CPU_INT16S*)a - *(CPU_INT16S*)b );
143 }
CPU_VOID freeTableINT08U(CPU_INT08U **tab)
Deallocate memory for a CPU_INT08U 2D table.
void CPU_VOID
Definition: llips_type.h:20
CPU_INT32U maxi(CPU_INT32U a, CPU_INT32U b)
compare two CPU_INT32U to find the biggest
double CPU_FP64
Definition: llips_type.h:30
CPU_INT32S compare(const CPU_VOID *a, const CPU_VOID *b)
Compare function for qsort function.
Global include file for LLIPS.
CPU_VOID freeTableFP64(CPU_FP64 **tab)
Deallocate memory for a CPU_FP64 2D table.
CPU_FP64 ** createTableFP64(CPU_INT16S nbLin, CPU_INT16S nbCol)
Allocate memory for a CPU_FP64 2D table.
CPU_INT08U ** createTableINT08U(CPU_INT16S nbLin, CPU_INT16S nbCol)
Allocate memory for a CPU_INT08U 2D table.
signed short CPU_INT16S
Definition: llips_type.h:26
CPU_INT32U mini(CPU_INT32U a, CPU_INT32U b)
Compare two CPU_INT32U to find the smallest.
unsigned long CPU_INT32U
Definition: llips_type.h:27
unsigned char CPU_INT08U
Definition: llips_type.h:23
signed long CPU_INT32S
Definition: llips_type.h:28