00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include <stdio.h>
00023 #include <stdlib.h>
00024 #include <string.h>
00025
00026 #include <flgrCoreData.h>
00027 #include <flgrCoreIO.h>
00028 #include <flgrCoreNhbManage.h>
00029 #include <flgrCoreDispatch.h>
00030 #include <flgrCoreVector.h>
00031 #include <flgrCoreArithVector.h>
00032 #include "flgrMorphoKerOp.h"
00033
00034
00036
00038 #define cmpPix(dtype) \
00039 dtype x,y; \
00040 x=*((dtype *)a); \
00041 y=*((dtype *)b); \
00042 \
00043 if(x<y) return -1; \
00044 else if(x==y) return 0; \
00045 else return 1
00046
00047 int compar_fgUINT8(const void *a, const void *b) {
00048 cmpPix(fgUINT8);
00049 }
00050
00051 int compar_fgUINT16(const void *a, const void *b) {
00052 cmpPix(fgUINT16);
00053 }
00054
00055 int compar_fgUINT32(const void *a, const void *b) {
00056 cmpPix(fgUINT32);
00057 }
00058
00059 int compar_fgINT8(const void *a, const void *b) {
00060 cmpPix(fgINT8);
00061 }
00062
00063 int compar_fgINT16(const void *a, const void *b) {
00064 cmpPix(fgINT16);
00065 }
00066
00067 int compar_fgINT32(const void *a, const void *b) {
00068 cmpPix(fgINT32);
00069 }
00070
00071 int compar_fgFLOAT32(const void *a, const void *b) {
00072 cmpPix(fgFLOAT32);
00073 }
00074
00075 int compar_fgFLOAT64(const void *a, const void *b) {
00076 cmpPix(fgFLOAT64);
00077 }
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00089
00091 #define flgr1d_get_nhb_min(dtype) \
00092 int i,k; \
00093 int spp = extr->spp; \
00094 dtype *presult = (dtype *) result->array; \
00095 dtype *list_data_val; \
00096 int *size = extr->size; \
00097 dtype mini; \
00098 \
00099 for(k=0 ; k<spp ; k++) { \
00100 list_data_val = (dtype *) extr->list_data_val[k]; \
00101 mini = list_data_val[0]; \
00102 for(i=1 ; i<size[k] ; i++) { \
00103 mini = FLGR_MIN(mini,list_data_val[i]); \
00104 } \
00105 flgr_set_array_##dtype(presult,k,mini); \
00106 } \
00107 \
00108 return
00109
00110
00111 void flgr1d_get_nhb_minimum_fgBIT(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00112 flgr1d_get_nhb_min(fgBIT);
00113 }
00114
00115 void flgr1d_get_nhb_minimum_fgUINT8(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00116 flgr1d_get_nhb_min(fgUINT8);
00117 }
00118
00119 void flgr1d_get_nhb_minimum_fgUINT16(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00120 flgr1d_get_nhb_min(fgUINT16);
00121 }
00122
00123 void flgr1d_get_nhb_minimum_fgUINT32(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00124 flgr1d_get_nhb_min(fgUINT32);
00125 }
00126
00127 void flgr1d_get_nhb_minimum_fgINT8(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00128 flgr1d_get_nhb_min(fgINT8);
00129 }
00130
00131 void flgr1d_get_nhb_minimum_fgINT16(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00132 flgr1d_get_nhb_min(fgINT16);
00133 }
00134
00135 void flgr1d_get_nhb_minimum_fgINT32(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00136 flgr1d_get_nhb_min(fgINT32);
00137 }
00138
00139 void flgr1d_get_nhb_minimum_fgFLOAT32(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00140 flgr1d_get_nhb_min(fgFLOAT32);
00141 }
00142
00143 void flgr1d_get_nhb_minimum_fgFLOAT64(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00144 flgr1d_get_nhb_min(fgFLOAT64);
00145 }
00146
00148
00153
00154 void flgr1d_get_nhb_minimum(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00155 switch(result->type) {
00156 case FLGR_BIT: flgr1d_get_nhb_minimum_fgBIT(result,extr);break;
00157 case FLGR_UINT8: flgr1d_get_nhb_minimum_fgUINT8(result,extr);break;
00158 case FLGR_UINT16: flgr1d_get_nhb_minimum_fgUINT16(result,extr);break;
00159 case FLGR_UINT32: flgr1d_get_nhb_minimum_fgUINT32(result,extr);break;
00160 case FLGR_INT8: flgr1d_get_nhb_minimum_fgINT8(result,extr);break;
00161 case FLGR_INT16: flgr1d_get_nhb_minimum_fgINT16(result,extr);break;
00162 case FLGR_INT32: flgr1d_get_nhb_minimum_fgINT32(result,extr);break;
00163 case FLGR_FLOAT32: flgr1d_get_nhb_minimum_fgFLOAT32(result,extr);break;
00164 case FLGR_FLOAT64: flgr1d_get_nhb_minimum_fgFLOAT64(result,extr);break;
00165 default: return;
00166 }
00167 }
00168
00170
00172 #define flgr1d_get_nhb_max(dtype) \
00173 int i,k; \
00174 int spp = extr->spp; \
00175 dtype *presult = (dtype *) result->array; \
00176 dtype *list_data_val; \
00177 int *size = extr->size; \
00178 dtype maxi; \
00179 \
00180 for(k=0 ; k<spp ; k++) { \
00181 list_data_val = (dtype *) extr->list_data_val[k]; \
00182 maxi = list_data_val[0]; \
00183 for(i=1 ; i<size[k] ; i++){ \
00184 maxi = FLGR_MAX(maxi,list_data_val[i]); \
00185 } \
00186 flgr_set_array_##dtype(presult,k,maxi); \
00187 } \
00188 \
00189 return
00190
00191
00192 void flgr1d_get_nhb_maximum_fgBIT(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00193 flgr1d_get_nhb_max(fgBIT);
00194 }
00195
00196 void flgr1d_get_nhb_maximum_fgUINT8(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00197 flgr1d_get_nhb_max(fgUINT8);
00198 }
00199
00200 void flgr1d_get_nhb_maximum_fgUINT16(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00201 flgr1d_get_nhb_max(fgUINT16);
00202 }
00203
00204 void flgr1d_get_nhb_maximum_fgUINT32(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00205 flgr1d_get_nhb_max(fgUINT32);
00206 }
00207
00208 void flgr1d_get_nhb_maximum_fgINT8(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00209 flgr1d_get_nhb_max(fgINT8);
00210 }
00211
00212 void flgr1d_get_nhb_maximum_fgINT16(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00213 flgr1d_get_nhb_max(fgINT16);
00214 }
00215
00216 void flgr1d_get_nhb_maximum_fgINT32(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00217 flgr1d_get_nhb_max(fgINT32);
00218 }
00219
00220 void flgr1d_get_nhb_maximum_fgFLOAT32(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00221 flgr1d_get_nhb_max(fgFLOAT32);
00222 }
00223
00224 void flgr1d_get_nhb_maximum_fgFLOAT64(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00225 flgr1d_get_nhb_max(fgFLOAT64);
00226 }
00227
00229
00234
00235 void flgr1d_get_nhb_maximum(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00236 switch(result->type) {
00237 case FLGR_BIT: flgr1d_get_nhb_maximum_fgBIT(result,extr);break;
00238 case FLGR_UINT8: flgr1d_get_nhb_maximum_fgUINT8(result,extr);break;
00239 case FLGR_UINT16: flgr1d_get_nhb_maximum_fgUINT16(result,extr);break;
00240 case FLGR_UINT32: flgr1d_get_nhb_maximum_fgUINT32(result,extr);break;
00241 case FLGR_INT8: flgr1d_get_nhb_maximum_fgINT8(result,extr);break;
00242 case FLGR_INT16: flgr1d_get_nhb_maximum_fgINT16(result,extr);break;
00243 case FLGR_INT32: flgr1d_get_nhb_maximum_fgINT32(result,extr);break;
00244 case FLGR_FLOAT32: flgr1d_get_nhb_maximum_fgFLOAT32(result,extr);break;
00245 case FLGR_FLOAT64: flgr1d_get_nhb_maximum_fgFLOAT64(result,extr);break;
00246 default: return;
00247 }
00248 }
00249
00250
00251
00253
00255 #define flgr1d_get_nhb_med(dtype) \
00256 int k; \
00257 int spp = extr->spp; \
00258 dtype *list_data_val; \
00259 dtype *presult = (dtype *) result->array; \
00260 int *size = extr->size; \
00261 \
00262 for(k=0 ; k<spp ; k++) { \
00263 list_data_val = (dtype *) extr->list_data_val[k]; \
00264 qsort(list_data_val, size[k], sizeof(dtype), compar_##dtype); \
00265 flgr_set_array_##dtype(presult,k,list_data_val[size[k]>>1]); \
00266 } \
00267 \
00268 return
00269
00270 void flgr1d_get_nhb_median_fgUINT8(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00271 flgr1d_get_nhb_med(fgUINT8);
00272 }
00273
00274 void flgr1d_get_nhb_median_fgUINT16(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00275 flgr1d_get_nhb_med(fgUINT16);
00276 }
00277
00278 void flgr1d_get_nhb_median_fgUINT32(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00279 flgr1d_get_nhb_med(fgUINT32);
00280 }
00281
00282 void flgr1d_get_nhb_median_fgINT8(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00283 flgr1d_get_nhb_med(fgINT8);
00284 }
00285
00286 void flgr1d_get_nhb_median_fgINT16(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00287 flgr1d_get_nhb_med(fgINT16);
00288 }
00289
00290 void flgr1d_get_nhb_median_fgINT32(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00291 flgr1d_get_nhb_med(fgINT32);
00292 }
00293
00294 void flgr1d_get_nhb_median_fgFLOAT32(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00295 flgr1d_get_nhb_med(fgFLOAT32);
00296 }
00297
00298 void flgr1d_get_nhb_median_fgFLOAT64(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00299 flgr1d_get_nhb_med(fgFLOAT64);
00300 }
00301
00303
00308
00309 void flgr1d_get_nhb_median(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00310 switch(result->type) {
00311 case FLGR_UINT8: flgr1d_get_nhb_median_fgUINT8(result,extr);break;
00312 case FLGR_UINT16: flgr1d_get_nhb_median_fgUINT16(result,extr);break;
00313 case FLGR_UINT32: flgr1d_get_nhb_median_fgUINT32(result,extr);break;
00314 case FLGR_INT8: flgr1d_get_nhb_median_fgINT8(result,extr);break;
00315 case FLGR_INT16: flgr1d_get_nhb_median_fgINT16(result,extr);break;
00316 case FLGR_INT32: flgr1d_get_nhb_median_fgINT32(result,extr);break;
00317 case FLGR_FLOAT32: flgr1d_get_nhb_median_fgFLOAT32(result,extr);break;
00318 case FLGR_FLOAT64: flgr1d_get_nhb_median_fgFLOAT64(result,extr);break;
00319 default: return;
00320 }
00321 }
00322
00324
00326 #define flgr1d_get_nhb_HoM(dtype) \
00327 int i,k; \
00328 int spp = extr->spp; \
00329 dtype *presult = (dtype *) result->array; \
00330 dtype *list_data_val; \
00331 dtype *list_nhb_val; \
00332 int *size = extr->size; \
00333 int stop; \
00334 dtype val; \
00335 \
00336 for(k=0 ; k<spp ; k++) { \
00337 \
00338 list_data_val = (dtype *) extr->list_data_val[k]; \
00339 list_nhb_val = (dtype *) extr->list_nhb_val[k]; \
00340 \
00341 stop = 0; \
00342 for(i=0 ; i<size[k] ; i++){ \
00343 if((list_nhb_val[i]==2) && (list_data_val[i]==0)) { \
00344 stop=1;break; \
00345 } \
00346 if((list_nhb_val[i]==1) && (list_data_val[i]!=0)) { \
00347 stop=1;break; \
00348 } \
00349 } \
00350 \
00351 val = (stop==0) ? MAX_##dtype : 0 ; \
00352 flgr_set_array_##dtype(presult,k,val); \
00353 \
00354 } \
00355 return
00356
00357 void flgr1d_get_nhb_hit_or_miss_fgUINT8( FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00358 flgr1d_get_nhb_HoM(fgUINT8);
00359 }
00360 void flgr1d_get_nhb_hit_or_miss_fgUINT16(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00361 flgr1d_get_nhb_HoM(fgUINT16);
00362 }
00363 void flgr1d_get_nhb_hit_or_miss_fgUINT32(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00364 flgr1d_get_nhb_HoM(fgUINT32);
00365 }
00366 void flgr1d_get_nhb_hit_or_miss_fgINT8(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00367 flgr1d_get_nhb_HoM(fgINT8);
00368 }
00369 void flgr1d_get_nhb_hit_or_miss_fgINT16(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00370 flgr1d_get_nhb_HoM(fgINT16);
00371 }
00372 void flgr1d_get_nhb_hit_or_miss_fgINT32(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00373 flgr1d_get_nhb_HoM(fgINT32);
00374 }
00375 void flgr1d_get_nhb_hit_or_miss_fgFLOAT32(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00376 flgr1d_get_nhb_HoM(fgFLOAT32);
00377 }
00378 void flgr1d_get_nhb_hit_or_miss_fgFLOAT64(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00379 flgr1d_get_nhb_HoM(fgFLOAT64);
00380 }
00381
00383
00388
00389 void flgr1d_get_nhb_hit_or_miss(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00390 switch(result->type) {
00391 case FLGR_UINT8: flgr1d_get_nhb_hit_or_miss_fgUINT8(result,extr);break;
00392 case FLGR_UINT16: flgr1d_get_nhb_hit_or_miss_fgUINT16(result,extr);break;
00393 case FLGR_UINT32: flgr1d_get_nhb_hit_or_miss_fgUINT32(result,extr);break;
00394 case FLGR_INT8: flgr1d_get_nhb_hit_or_miss_fgINT8(result,extr);break;
00395 case FLGR_INT16: flgr1d_get_nhb_hit_or_miss_fgINT16(result,extr);break;
00396 case FLGR_INT32: flgr1d_get_nhb_hit_or_miss_fgINT32(result,extr);break;
00397 case FLGR_FLOAT32: flgr1d_get_nhb_hit_or_miss_fgFLOAT32(result,extr);break;
00398 case FLGR_FLOAT64: flgr1d_get_nhb_hit_or_miss_fgFLOAT64(result,extr);break;
00399 default: return;
00400 }
00401 }
00402
00404
00406 #define flgr1d_get_nhb_Thin(dtype) \
00407 int i,k; \
00408 int spp = extr->spp; \
00409 FLGR_Vector *center_vec = extr->center_data_val; \
00410 dtype *presult = (dtype *) result->array; \
00411 dtype *list_data_val; \
00412 dtype *list_nhb_val; \
00413 int *size = extr->size; \
00414 int stop; \
00415 dtype val; \
00416 \
00417 for(k=0 ; k<spp ; k++) { \
00418 \
00419 list_data_val = (dtype *) extr->list_data_val[k]; \
00420 list_nhb_val = (dtype *) extr->list_nhb_val[k]; \
00421 \
00422 flgr_vector_get_element_##dtype(center_vec, k, &val); \
00423 val = (val != 0) ? MAX_##dtype : 0; \
00424 \
00425 stop = 0; \
00426 for(i=0 ; i<size[k] ; i++){ \
00427 if((list_nhb_val[i]==2) && (list_data_val[i]==0)) { \
00428 stop=1;break; \
00429 } \
00430 if((list_nhb_val[i]==1) && (list_data_val[i]!=0)) { \
00431 stop=1;break; \
00432 } \
00433 } \
00434 val = (stop==0) ? (MAX_##dtype - val) : val ; \
00435 flgr_set_array_##dtype(presult,k,val); \
00436 } \
00437 return
00438
00439
00440 void flgr1d_get_nhb_thinning_fgUINT8(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00441 flgr1d_get_nhb_Thin(fgUINT8);
00442 }
00443 void flgr1d_get_nhb_thinning_fgUINT16(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00444 flgr1d_get_nhb_Thin(fgUINT16);
00445 }
00446 void flgr1d_get_nhb_thinning_fgUINT32(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00447 flgr1d_get_nhb_Thin(fgUINT32);
00448 }
00449 void flgr1d_get_nhb_thinning_fgINT8(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00450 flgr1d_get_nhb_Thin(fgINT8);
00451 }
00452 void flgr1d_get_nhb_thinning_fgINT16(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00453 flgr1d_get_nhb_Thin(fgINT16);
00454 }
00455 void flgr1d_get_nhb_thinning_fgINT32(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00456 flgr1d_get_nhb_Thin(fgINT32);
00457 }
00458 void flgr1d_get_nhb_thinning_fgFLOAT32(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00459 flgr1d_get_nhb_Thin(fgFLOAT32);
00460 }
00461 void flgr1d_get_nhb_thinning_fgFLOAT64(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00462 flgr1d_get_nhb_Thin(fgFLOAT64);
00463 }
00464
00466
00471
00472 void flgr1d_get_nhb_thinning(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00473 switch(result->type) {
00474 case FLGR_UINT8: flgr1d_get_nhb_thinning_fgUINT8(result,extr);break;
00475 case FLGR_UINT16: flgr1d_get_nhb_thinning_fgUINT16(result,extr);break;
00476 case FLGR_UINT32: flgr1d_get_nhb_thinning_fgUINT32(result,extr);break;
00477 case FLGR_INT8: flgr1d_get_nhb_thinning_fgINT8(result,extr);break;
00478 case FLGR_INT16: flgr1d_get_nhb_thinning_fgINT16(result,extr);break;
00479 case FLGR_INT32: flgr1d_get_nhb_thinning_fgINT32(result,extr);break;
00480 case FLGR_FLOAT32: flgr1d_get_nhb_thinning_fgFLOAT32(result,extr);break;
00481 case FLGR_FLOAT64: flgr1d_get_nhb_thinning_fgFLOAT64(result,extr);break;
00482 default: return;
00483 }
00484 }
00485
00486
00487
00488
00490
00492 #define flgr1d_get_nhb_Thick(dtype) \
00493 int i,k; \
00494 int spp = extr->spp; \
00495 FLGR_Vector *center_vec = extr->center_data_val; \
00496 dtype *presult = (dtype *) result->array; \
00497 dtype *list_data_val; \
00498 dtype *list_nhb_val; \
00499 int *size = extr->size; \
00500 int stop; \
00501 dtype val; \
00502 \
00503 for(k=0 ; k<spp ; k++) { \
00504 \
00505 list_data_val = (dtype *) extr->list_data_val[k]; \
00506 list_nhb_val = (dtype *) extr->list_nhb_val[k]; \
00507 \
00508 flgr_vector_get_element_##dtype(center_vec, k, &val); \
00509 val = (val != 0) ? MAX_##dtype : 0; \
00510 \
00511 stop = 0; \
00512 for(i=0 ; i<size[k] ; i++){ \
00513 if((list_nhb_val[i]==2) && (list_data_val[i]==0)) { \
00514 stop=1;break; \
00515 } \
00516 if((list_nhb_val[i]==1) && (list_data_val[i]!=0)) { \
00517 stop=1;break; \
00518 } \
00519 } \
00520 \
00521 val = (stop==0) ? MAX_##dtype : val; \
00522 flgr_set_array_##dtype(presult,k,val); \
00523 \
00524 } \
00525 return
00526
00527 void flgr1d_get_nhb_thickening_fgUINT8(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00528 flgr1d_get_nhb_Thick(fgUINT8);
00529 }
00530 void flgr1d_get_nhb_thickening_fgUINT16(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00531 flgr1d_get_nhb_Thick(fgUINT16);
00532 }
00533 void flgr1d_get_nhb_thickening_fgUINT32(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00534 flgr1d_get_nhb_Thick(fgUINT32);
00535 }
00536 void flgr1d_get_nhb_thickening_fgINT8(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00537 flgr1d_get_nhb_Thick(fgINT8);
00538 }
00539 void flgr1d_get_nhb_thickening_fgINT16(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00540 flgr1d_get_nhb_Thick(fgINT16);
00541 }
00542 void flgr1d_get_nhb_thickening_fgINT32(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00543 flgr1d_get_nhb_Thick(fgINT32);
00544 }
00545 void flgr1d_get_nhb_thickening_fgFLOAT32(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00546 flgr1d_get_nhb_Thick(fgFLOAT32);
00547 }
00548 void flgr1d_get_nhb_thickening_fgFLOAT64(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00549 flgr1d_get_nhb_Thick(fgFLOAT64);
00550 }
00551
00553
00558
00559 void flgr1d_get_nhb_thickening(FLGR_Vector *result, FLGR_NhbBox1D *extr) {
00560 switch(result->type) {
00561 case FLGR_UINT8: flgr1d_get_nhb_thickening_fgUINT8(result,extr);break;
00562 case FLGR_UINT16: flgr1d_get_nhb_thickening_fgUINT16(result,extr);break;
00563 case FLGR_UINT32: flgr1d_get_nhb_thickening_fgUINT32(result,extr);break;
00564 case FLGR_INT8: flgr1d_get_nhb_thickening_fgINT8(result,extr);break;
00565 case FLGR_INT16: flgr1d_get_nhb_thickening_fgINT16(result,extr);break;
00566 case FLGR_INT32: flgr1d_get_nhb_thickening_fgINT32(result,extr);break;
00567 case FLGR_FLOAT32: flgr1d_get_nhb_thickening_fgFLOAT32(result,extr);break;
00568 case FLGR_FLOAT64: flgr1d_get_nhb_thickening_fgFLOAT64(result,extr);break;
00569 default: return;
00570 }
00571 }
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603
00605
00607 #define flgr2d_get_nhb_min(dtype) \
00608 int i,k; \
00609 int spp = extr->spp; \
00610 dtype *presult = (dtype *) result->array; \
00611 dtype *list_data_val; \
00612 int *size = extr->size; \
00613 dtype mini; \
00614 \
00615 for(k=0 ; k<spp ; k++) { \
00616 list_data_val = (dtype *) extr->list_data_val[k]; \
00617 mini = list_data_val[0]; \
00618 for(i=1 ; i<size[k] ; i++){ \
00619 mini = FLGR_MIN(mini,list_data_val[i]); \
00620 } \
00621 flgr_set_array_##dtype(presult,k,mini); \
00622 } \
00623 \
00624 return
00625
00626
00627 void flgr2d_get_nhb_minimum_fgBIT(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00628 flgr2d_get_nhb_min(fgBIT);
00629 }
00630
00631 void flgr2d_get_nhb_minimum_fgUINT8(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00632 flgr2d_get_nhb_min(fgUINT8);
00633 }
00634
00635 void flgr2d_get_nhb_minimum_fgUINT16(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00636 flgr2d_get_nhb_min(fgUINT16);
00637 }
00638
00639 void flgr2d_get_nhb_minimum_fgUINT32(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00640 flgr2d_get_nhb_min(fgUINT32);
00641 }
00642
00643 void flgr2d_get_nhb_minimum_fgINT8(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00644 flgr2d_get_nhb_min(fgINT8);
00645 }
00646
00647 void flgr2d_get_nhb_minimum_fgINT16(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00648 flgr2d_get_nhb_min(fgINT16);
00649 }
00650
00651 void flgr2d_get_nhb_minimum_fgINT32(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00652 flgr2d_get_nhb_min(fgINT32);
00653 }
00654
00655 void flgr2d_get_nhb_minimum_fgFLOAT32(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00656 flgr2d_get_nhb_min(fgFLOAT32);
00657 }
00658
00659 void flgr2d_get_nhb_minimum_fgFLOAT64(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00660 flgr2d_get_nhb_min(fgFLOAT64);
00661 }
00662
00664
00669
00670 void flgr2d_get_nhb_minimum(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00671 switch(result->type) {
00672 case FLGR_BIT: flgr2d_get_nhb_minimum_fgBIT(result,extr);break;
00673 case FLGR_UINT8: flgr2d_get_nhb_minimum_fgUINT8(result,extr);break;
00674 case FLGR_UINT16: flgr2d_get_nhb_minimum_fgUINT16(result,extr);break;
00675 case FLGR_UINT32: flgr2d_get_nhb_minimum_fgUINT32(result,extr);break;
00676 case FLGR_INT8: flgr2d_get_nhb_minimum_fgINT8(result,extr);break;
00677 case FLGR_INT16: flgr2d_get_nhb_minimum_fgINT16(result,extr);break;
00678 case FLGR_INT32: flgr2d_get_nhb_minimum_fgINT32(result,extr);break;
00679 case FLGR_FLOAT32: flgr2d_get_nhb_minimum_fgFLOAT32(result,extr);break;
00680 case FLGR_FLOAT64: flgr2d_get_nhb_minimum_fgFLOAT64(result,extr);break;
00681 default: return;
00682 }
00683 }
00684
00685
00686
00687
00688
00690
00692 #define flgr2d_get_nhb_max(dtype) \
00693 int i,k; \
00694 int spp = extr->spp; \
00695 dtype *presult = (dtype *) result->array; \
00696 dtype *list_data_val; \
00697 int *size = extr->size; \
00698 dtype maxi; \
00699 \
00700 for(k=0 ; k<spp ; k++) { \
00701 list_data_val = (dtype *) extr->list_data_val[k]; \
00702 maxi = list_data_val[0]; \
00703 for(i=1 ; i<size[k] ; i++){ \
00704 maxi = FLGR_MAX(maxi,list_data_val[i]); \
00705 } \
00706 flgr_set_array_##dtype(presult,k,maxi); \
00707 } \
00708 \
00709 return
00710
00711
00712 void flgr2d_get_nhb_maximum_fgBIT(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00713 flgr2d_get_nhb_max(fgBIT);
00714 }
00715
00716 void flgr2d_get_nhb_maximum_fgUINT8(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00717 flgr2d_get_nhb_max(fgUINT8);
00718 }
00719
00720 void flgr2d_get_nhb_maximum_fgUINT16(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00721 flgr2d_get_nhb_max(fgUINT16);
00722 }
00723
00724 void flgr2d_get_nhb_maximum_fgUINT32(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00725 flgr2d_get_nhb_max(fgUINT32);
00726 }
00727
00728 void flgr2d_get_nhb_maximum_fgINT8(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00729 flgr2d_get_nhb_max(fgINT8);
00730 }
00731
00732 void flgr2d_get_nhb_maximum_fgINT16(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00733 flgr2d_get_nhb_max(fgINT16);
00734 }
00735
00736 void flgr2d_get_nhb_maximum_fgINT32(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00737 flgr2d_get_nhb_max(fgINT32);
00738 }
00739
00740 void flgr2d_get_nhb_maximum_fgFLOAT32(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00741 flgr2d_get_nhb_max(fgFLOAT32);
00742 }
00743
00744 void flgr2d_get_nhb_maximum_fgFLOAT64(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00745 flgr2d_get_nhb_max(fgFLOAT64);
00746 }
00747
00749
00754
00755 void flgr2d_get_nhb_maximum(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00756 switch(result->type) {
00757 case FLGR_BIT: flgr2d_get_nhb_maximum_fgBIT(result,extr);break;
00758 case FLGR_UINT8: flgr2d_get_nhb_maximum_fgUINT8(result,extr);break;
00759 case FLGR_UINT16: flgr2d_get_nhb_maximum_fgUINT16(result,extr);break;
00760 case FLGR_UINT32: flgr2d_get_nhb_maximum_fgUINT32(result,extr);break;
00761 case FLGR_INT8: flgr2d_get_nhb_maximum_fgINT8(result,extr);break;
00762 case FLGR_INT16: flgr2d_get_nhb_maximum_fgINT16(result,extr);break;
00763 case FLGR_INT32: flgr2d_get_nhb_maximum_fgINT32(result,extr);break;
00764 case FLGR_FLOAT32: flgr2d_get_nhb_maximum_fgFLOAT32(result,extr);break;
00765 case FLGR_FLOAT64: flgr2d_get_nhb_maximum_fgFLOAT64(result,extr);break;
00766 default: return;
00767 }
00768 }
00769
00770
00771
00772
00773
00775
00777 #define flgr2d_get_nhb_med(dtype) \
00778 int k; \
00779 int spp = extr->spp; \
00780 dtype *list_data_val; \
00781 dtype *presult = (dtype *) result->array; \
00782 int *size = extr->size; \
00783 \
00784 for(k=0 ; k<spp ; k++) { \
00785 list_data_val = (dtype *) extr->list_data_val[k]; \
00786 qsort(list_data_val, size[k], sizeof(dtype), compar_##dtype); \
00787 flgr_set_array_##dtype(presult,k,list_data_val[size[k]>>1]); \
00788 } \
00789 \
00790 return
00791
00792 void flgr2d_get_nhb_median_fgUINT8(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00793 flgr2d_get_nhb_med(fgUINT8);
00794 }
00795
00796 void flgr2d_get_nhb_median_fgUINT16(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00797 flgr2d_get_nhb_med(fgUINT16);
00798 }
00799
00800 void flgr2d_get_nhb_median_fgUINT32(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00801 flgr2d_get_nhb_med(fgUINT32);
00802 }
00803
00804 void flgr2d_get_nhb_median_fgINT8(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00805 flgr2d_get_nhb_med(fgINT8);
00806 }
00807
00808 void flgr2d_get_nhb_median_fgINT16(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00809 flgr2d_get_nhb_med(fgINT16);
00810 }
00811
00812 void flgr2d_get_nhb_median_fgINT32(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00813 flgr2d_get_nhb_med(fgINT32);
00814 }
00815
00816 void flgr2d_get_nhb_median_fgFLOAT32(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00817 flgr2d_get_nhb_med(fgFLOAT32);
00818 }
00819
00820 void flgr2d_get_nhb_median_fgFLOAT64(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00821 flgr2d_get_nhb_med(fgFLOAT64);
00822 }
00823
00825
00830
00831 void flgr2d_get_nhb_median(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00832 switch(result->type) {
00833 case FLGR_UINT8: flgr2d_get_nhb_median_fgUINT8(result,extr);break;
00834 case FLGR_UINT16: flgr2d_get_nhb_median_fgUINT16(result,extr);break;
00835 case FLGR_UINT32: flgr2d_get_nhb_median_fgUINT32(result,extr);break;
00836 case FLGR_INT8: flgr2d_get_nhb_median_fgINT8(result,extr);break;
00837 case FLGR_INT16: flgr2d_get_nhb_median_fgINT16(result,extr);break;
00838 case FLGR_INT32: flgr2d_get_nhb_median_fgINT32(result,extr);break;
00839 case FLGR_FLOAT32: flgr2d_get_nhb_median_fgFLOAT32(result,extr);break;
00840 case FLGR_FLOAT64: flgr2d_get_nhb_median_fgFLOAT64(result,extr);break;
00841 default: return;
00842 }
00843 }
00844
00845
00846
00847
00849
00851 #define flgr2d_get_nhb_HoM(dtype) \
00852 int i,k; \
00853 int spp = extr->spp; \
00854 dtype *presult = (dtype *) result->array; \
00855 dtype *list_data_val; \
00856 dtype *list_nhb_val; \
00857 int *size = extr->size; \
00858 int stop; \
00859 dtype val; \
00860 \
00861 for(k=0 ; k<spp ; k++) { \
00862 \
00863 list_data_val = (dtype *) extr->list_data_val[k]; \
00864 list_nhb_val = (dtype *) extr->list_nhb_val[k]; \
00865 \
00866 stop = 0; \
00867 for(i=0 ; i<size[k] ; i++){ \
00868 if((list_nhb_val[i]==2) && (list_data_val[i]==0)) { \
00869 stop=1;break; \
00870 } \
00871 if((list_nhb_val[i]==1) && (list_data_val[i]!=0)) { \
00872 stop=1;break; \
00873 } \
00874 } \
00875 val = (stop==0) ? MAX_##dtype : 0; \
00876 flgr_set_array_##dtype(presult,k,val); \
00877 \
00878 } \
00879 return
00880
00881 void flgr2d_get_nhb_hit_or_miss_fgUINT8( FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00882 flgr2d_get_nhb_HoM(fgUINT8);
00883 }
00884 void flgr2d_get_nhb_hit_or_miss_fgUINT16(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00885 flgr2d_get_nhb_HoM(fgUINT16);
00886 }
00887 void flgr2d_get_nhb_hit_or_miss_fgUINT32(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00888 flgr2d_get_nhb_HoM(fgUINT32);
00889 }
00890 void flgr2d_get_nhb_hit_or_miss_fgINT8(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00891 flgr2d_get_nhb_HoM(fgINT8);
00892 }
00893 void flgr2d_get_nhb_hit_or_miss_fgINT16(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00894 flgr2d_get_nhb_HoM(fgINT16);
00895 }
00896 void flgr2d_get_nhb_hit_or_miss_fgINT32(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00897 flgr2d_get_nhb_HoM(fgINT32);
00898 }
00899 void flgr2d_get_nhb_hit_or_miss_fgFLOAT32(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00900 flgr2d_get_nhb_HoM(fgFLOAT32);
00901 }
00902 void flgr2d_get_nhb_hit_or_miss_fgFLOAT64(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00903 flgr2d_get_nhb_HoM(fgFLOAT64);
00904 }
00905
00907
00912
00913 void flgr2d_get_nhb_hit_or_miss(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00914 switch(result->type) {
00915 case FLGR_UINT8: flgr2d_get_nhb_hit_or_miss_fgUINT8(result,extr);break;
00916 case FLGR_UINT16: flgr2d_get_nhb_hit_or_miss_fgUINT16(result,extr);break;
00917 case FLGR_UINT32: flgr2d_get_nhb_hit_or_miss_fgUINT32(result,extr);break;
00918 case FLGR_INT8: flgr2d_get_nhb_hit_or_miss_fgINT8(result,extr);break;
00919 case FLGR_INT16: flgr2d_get_nhb_hit_or_miss_fgINT16(result,extr);break;
00920 case FLGR_INT32: flgr2d_get_nhb_hit_or_miss_fgINT32(result,extr);break;
00921 case FLGR_FLOAT32: flgr2d_get_nhb_hit_or_miss_fgFLOAT32(result,extr);break;
00922 case FLGR_FLOAT64: flgr2d_get_nhb_hit_or_miss_fgFLOAT64(result,extr);break;
00923 default: return;
00924 }
00925 }
00926
00927
00928
00929
00930
00931
00933
00935 #define flgr2d_get_nhb_Thin(dtype) \
00936 int i,k; \
00937 int spp = extr->spp; \
00938 FLGR_Vector *center_vec = extr->center_data_val; \
00939 dtype *presult = (dtype *) result->array; \
00940 dtype *list_data_val; \
00941 dtype *list_nhb_val; \
00942 int *size = extr->size; \
00943 int stop; \
00944 dtype val; \
00945 \
00946 for(k=0 ; k<spp ; k++) { \
00947 \
00948 list_data_val = (dtype *) extr->list_data_val[k]; \
00949 list_nhb_val = (dtype *) extr->list_nhb_val[k]; \
00950 \
00951 flgr_vector_get_element_##dtype(center_vec, k, &val); \
00952 val = (val != 0) ? MAX_##dtype : 0; \
00953 \
00954 stop = 0; \
00955 for(i=0 ; i<size[k] ; i++){ \
00956 if((list_nhb_val[i]==2) && (list_data_val[i]==0)) { \
00957 stop=1;break; \
00958 } \
00959 if((list_nhb_val[i]==1) && (list_data_val[i]!=0)) { \
00960 stop=1;break; \
00961 } \
00962 } \
00963 val = (stop==0) ? (MAX_##dtype - val) : val ; \
00964 flgr_set_array_##dtype(presult,k,val); \
00965 \
00966 } \
00967 return
00968
00969
00970 void flgr2d_get_nhb_thinning_fgUINT8(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00971 flgr2d_get_nhb_Thin(fgUINT8);
00972 }
00973 void flgr2d_get_nhb_thinning_fgUINT16(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00974 flgr2d_get_nhb_Thin(fgUINT16);
00975 }
00976 void flgr2d_get_nhb_thinning_fgUINT32(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00977 flgr2d_get_nhb_Thin(fgUINT32);
00978 }
00979 void flgr2d_get_nhb_thinning_fgINT8(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00980 flgr2d_get_nhb_Thin(fgINT8);
00981 }
00982 void flgr2d_get_nhb_thinning_fgINT16(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00983 flgr2d_get_nhb_Thin(fgINT16);
00984 }
00985 void flgr2d_get_nhb_thinning_fgINT32(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00986 flgr2d_get_nhb_Thin(fgINT32);
00987 }
00988 void flgr2d_get_nhb_thinning_fgFLOAT32(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00989 flgr2d_get_nhb_Thin(fgFLOAT32);
00990 }
00991 void flgr2d_get_nhb_thinning_fgFLOAT64(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
00992 flgr2d_get_nhb_Thin(fgFLOAT64);
00993 }
00994
00996
01001
01002 void flgr2d_get_nhb_thinning(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
01003 switch(result->type) {
01004 case FLGR_UINT8: flgr2d_get_nhb_thinning_fgUINT8(result,extr);break;
01005 case FLGR_UINT16: flgr2d_get_nhb_thinning_fgUINT16(result,extr);break;
01006 case FLGR_UINT32: flgr2d_get_nhb_thinning_fgUINT32(result,extr);break;
01007 case FLGR_INT8: flgr2d_get_nhb_thinning_fgINT8(result,extr);break;
01008 case FLGR_INT16: flgr2d_get_nhb_thinning_fgINT16(result,extr);break;
01009 case FLGR_INT32: flgr2d_get_nhb_thinning_fgINT32(result,extr);break;
01010 case FLGR_FLOAT32: flgr2d_get_nhb_thinning_fgFLOAT32(result,extr);break;
01011 case FLGR_FLOAT64: flgr2d_get_nhb_thinning_fgFLOAT64(result,extr);break;
01012 default: return;
01013 }
01014 }
01015
01016
01017
01018
01019
01021
01023 #define flgr2d_get_nhb_Thick(dtype) \
01024 int i,k; \
01025 int spp = extr->spp; \
01026 FLGR_Vector *center_vec = extr->center_data_val; \
01027 dtype *presult = (dtype *) result->array; \
01028 dtype *list_data_val; \
01029 dtype *list_nhb_val; \
01030 int *size = extr->size; \
01031 int stop; \
01032 dtype val; \
01033 \
01034 for(k=0 ; k<spp ; k++) { \
01035 \
01036 list_data_val = (dtype *) extr->list_data_val[k]; \
01037 list_nhb_val = (dtype *) extr->list_nhb_val[k]; \
01038 \
01039 flgr_vector_get_element_##dtype(center_vec, k, &val); \
01040 val = (val != 0) ? MAX_##dtype : 0; \
01041 \
01042 stop = 0; \
01043 for(i=0 ; i<size[k] ; i++){ \
01044 if((list_nhb_val[i]==2) && (list_data_val[i]==0)) { \
01045 stop=1;break; \
01046 } \
01047 if((list_nhb_val[i]==1) && (list_data_val[i]!=0)) { \
01048 stop=1;break; \
01049 } \
01050 } \
01051 val = (stop==0) ? MAX_##dtype : val ; \
01052 flgr_set_array_##dtype(presult,k,val); \
01053 \
01054 } \
01055 return
01056
01057 void flgr2d_get_nhb_thickening_fgUINT8(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
01058 flgr2d_get_nhb_Thick(fgUINT8);
01059 }
01060 void flgr2d_get_nhb_thickening_fgUINT16(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
01061 flgr2d_get_nhb_Thick(fgUINT16);
01062 }
01063 void flgr2d_get_nhb_thickening_fgUINT32(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
01064 flgr2d_get_nhb_Thick(fgUINT32);
01065 }
01066 void flgr2d_get_nhb_thickening_fgINT8(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
01067 flgr2d_get_nhb_Thick(fgINT8);
01068 }
01069 void flgr2d_get_nhb_thickening_fgINT16(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
01070 flgr2d_get_nhb_Thick(fgINT16);
01071 }
01072 void flgr2d_get_nhb_thickening_fgINT32(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
01073 flgr2d_get_nhb_Thick(fgINT32);
01074 }
01075 void flgr2d_get_nhb_thickening_fgFLOAT32(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
01076 flgr2d_get_nhb_Thick(fgFLOAT32);
01077 }
01078 void flgr2d_get_nhb_thickening_fgFLOAT64(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
01079 flgr2d_get_nhb_Thick(fgFLOAT64);
01080 }
01081
01083
01088
01089 void flgr2d_get_nhb_thickening(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
01090 switch(result->type) {
01091 case FLGR_UINT8: flgr2d_get_nhb_thickening_fgUINT8(result,extr);break;
01092 case FLGR_UINT16: flgr2d_get_nhb_thickening_fgUINT16(result,extr);break;
01093 case FLGR_UINT32: flgr2d_get_nhb_thickening_fgUINT32(result,extr);break;
01094 case FLGR_INT8: flgr2d_get_nhb_thickening_fgINT8(result,extr);break;
01095 case FLGR_INT16: flgr2d_get_nhb_thickening_fgINT16(result,extr);break;
01096 case FLGR_INT32: flgr2d_get_nhb_thickening_fgINT32(result,extr);break;
01097 case FLGR_FLOAT32: flgr2d_get_nhb_thickening_fgFLOAT32(result,extr);break;
01098 case FLGR_FLOAT64: flgr2d_get_nhb_thickening_fgFLOAT64(result,extr);break;
01099 default: return;
01100 }
01101 }
01102
01103
01104
01105
01106
01107
01108
01109
01110
01111
01112
01113
01114
01115
01116
01117
01118
01119
01120
01121
01122
01123
01124
01125
01126
01127
01128
01129
01131
01133 #define FLGR_2D_MACRO_GET_NHB_MAX_KEEP_SKIZ(dtype) \
01134 int i,k; \
01135 FLGR_Vector *center = extr->center_data_val; \
01136 dtype *pcenter = (dtype *) center->array; \
01137 dtype *presult = (dtype *) result->array; \
01138 dtype *list_data_val; \
01139 dtype *list_nhb_val; \
01140 int spp=result->spp; \
01141 int *size = extr->size; \
01142 dtype val; \
01143 dtype nhb; \
01144 \
01145 flgr2d_get_nhb_maximum_##dtype(result,extr); \
01146 \
01147 for(k=0 ; k<spp ; k++) { \
01148 list_data_val = (dtype *) extr->list_data_val[k]; \
01149 list_nhb_val = (dtype *) extr->list_nhb_val[k]; \
01150 \
01151 if(pcenter[k] != presult[k]) { \
01152 for(i=0 ; i<size[k] ; i++) { \
01153 val = list_data_val[i]; \
01154 nhb = list_nhb_val[i]; \
01155 if((nhb != 0) && (val != 0) && (val != presult[k])) { \
01156 presult[k]=0;break; \
01157 } \
01158 } \
01159 } \
01160 \
01161 } \
01162 \
01163 return
01164
01165 void flgr2d_get_nhb_max_keep_skiz_fgUINT8(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
01166 FLGR_2D_MACRO_GET_NHB_MAX_KEEP_SKIZ(fgUINT8);
01167 }
01168 void flgr2d_get_nhb_max_keep_skiz_fgUINT16(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
01169 FLGR_2D_MACRO_GET_NHB_MAX_KEEP_SKIZ(fgUINT16);
01170 }
01171 void flgr2d_get_nhb_max_keep_skiz_fgUINT32(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
01172 FLGR_2D_MACRO_GET_NHB_MAX_KEEP_SKIZ(fgUINT32);
01173 }
01174 void flgr2d_get_nhb_max_keep_skiz_fgINT8(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
01175 FLGR_2D_MACRO_GET_NHB_MAX_KEEP_SKIZ(fgINT8);
01176 }
01177 void flgr2d_get_nhb_max_keep_skiz_fgINT16(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
01178 FLGR_2D_MACRO_GET_NHB_MAX_KEEP_SKIZ(fgINT16);
01179 }
01180 void flgr2d_get_nhb_max_keep_skiz_fgINT32(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
01181 FLGR_2D_MACRO_GET_NHB_MAX_KEEP_SKIZ(fgINT32);
01182 }
01183 void flgr2d_get_nhb_max_keep_skiz_fgFLOAT32(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
01184 FLGR_2D_MACRO_GET_NHB_MAX_KEEP_SKIZ(fgFLOAT32);
01185 }
01186 void flgr2d_get_nhb_max_keep_skiz_fgFLOAT64(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
01187 FLGR_2D_MACRO_GET_NHB_MAX_KEEP_SKIZ(fgFLOAT64);
01188 }
01189
01191
01196
01197 void flgr2d_get_nhb_max_keep_skiz(FLGR_Vector *result, FLGR_NhbBox2D *extr) {
01198 switch(result->type) {
01199 case FLGR_UINT8: flgr2d_get_nhb_max_keep_skiz_fgUINT8(result,extr);break;
01200 case FLGR_UINT16: flgr2d_get_nhb_max_keep_skiz_fgUINT16(result,extr);break;
01201 case FLGR_UINT32: flgr2d_get_nhb_max_keep_skiz_fgUINT32(result,extr);break;
01202 case FLGR_INT8: flgr2d_get_nhb_max_keep_skiz_fgINT8(result,extr);break;
01203 case FLGR_INT16: flgr2d_get_nhb_max_keep_skiz_fgINT16(result,extr);break;
01204 case FLGR_INT32: flgr2d_get_nhb_max_keep_skiz_fgINT32(result,extr);break;
01205 case FLGR_FLOAT32: flgr2d_get_nhb_max_keep_skiz_fgFLOAT32(result,extr);break;
01206 case FLGR_FLOAT64: flgr2d_get_nhb_max_keep_skiz_fgFLOAT64(result,extr);break;
01207 default: return;
01208 }
01209 }
01210
01211
01212