00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "flgrCoreMalloc.h"
00022 #include "flgrCoreDispatch.h"
00023 #include "flgrCoreCopy.h"
00024 #include "flgrCoreIO.h"
00025 #include "flgrCoreSlideWindow.h"
00026 #include "flgrCoreNhbFill.h"
00027 #include "flgrCoreNhbManage.h"
00028 #include "flgrCoreDataIO.h"
00029 #include "flgrCoreVector.h"
00030 #include "flgrCoreShear.h"
00031
00089
00090
00092 #define FLGR_MACRO_RASTER_SLIDE_WINDOW_1D(dtype,get_nhb_op) \
00093 FLGR_Vector *result; \
00094 FLGR_Data1D *nhbrs; \
00095 FLGR_NhbBox1D *extr; \
00096 dtype *vector_array; \
00097 dtype *data_array; \
00098 int j,w, spp = datsrc->spp; \
00099 \
00100 \
00101 \
00102 w=datsrc->length; \
00103 \
00104 result = flgr_vector_create(datsrc->spp,datsrc->type); \
00105 \
00106 vector_array = (dtype *) result->array; \
00107 data_array = (dtype *) datdest->array; \
00108 \
00109 extr = flgr1d_create_neighbor_box(nhb); \
00110 \
00111 nhbrs=flgr1d_create_neighborhood_from(nhb); \
00112 \
00113 if(nhb_sym==FLGR_NHB_SYM) \
00114 flgr1d_mirror_##dtype(nhbrs,nhb); \
00115 else \
00116 flgr1d_copy_##dtype##_##dtype(nhbrs,nhb); \
00117 \
00118 if(datdest==datsrc) { \
00119 flgr1d_apply_raster_scan_method_##dtype(nhbrs); \
00120 } \
00121 \
00122 for(j=0 ; j<w ; j++) { \
00123 \
00124 get_nhb_op##_##dtype(extr,datsrc,nhbrs,j); \
00125 \
00126 (*computeNhb)(result,extr); \
00127 \
00128 flgr_set_data_array_vector_##dtype(data_array, \
00129 vector_array, \
00130 spp,j); \
00131 \
00132 } \
00133 \
00134 flgr1d_destroy(nhbrs); \
00135 flgr1d_destroy_neighbor_box(extr); \
00136 flgr_vector_destroy(result); \
00137 \
00138 return
00139
00140
00142
00144 #define FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_1D(dtype,get_nhb_op) \
00145 FLGR_Vector *result; \
00146 FLGR_Data1D *nhbars; \
00147 FLGR_NhbBox1D *extr; \
00148 dtype *vector_array; \
00149 dtype *data_array; \
00150 int j,w, spp = datsrc->spp; \
00151 \
00152 \
00153 \
00154 w=datsrc->length; \
00155 \
00156 result = flgr_vector_create(spp,datsrc->type); \
00157 \
00158 vector_array = (dtype *) result->array; \
00159 data_array = (dtype *) datdest->array; \
00160 \
00161 extr = flgr1d_create_neighbor_box(nhb); \
00162 \
00163 nhbars=flgr1d_create_neighborhood_from(nhb); \
00164 \
00165 if(nhb_sym==FLGR_NHB_SYM) \
00166 flgr1d_mirror_##dtype(nhbars,nhb); \
00167 else \
00168 flgr1d_copy_##dtype##_##dtype(nhbars,nhb); \
00169 \
00170 if(datdest==datsrc) { \
00171 flgr1d_apply_anti_raster_scan_method_##dtype(nhbars); \
00172 } \
00173 \
00174 for(j=w-1 ; j>=0 ; j--) { \
00175 \
00176 get_nhb_op##_##dtype(extr,datsrc,nhbars,j); \
00177 \
00178 (*computeNhb)(result,extr); \
00179 \
00180 flgr_set_data_array_vector_##dtype(data_array, \
00181 vector_array, \
00182 spp,j); \
00183 \
00184 } \
00185 \
00186 flgr1d_destroy(nhbars); \
00187 flgr1d_destroy_neighbor_box(extr); \
00188 flgr_vector_destroy(result); \
00189 \
00190 return
00191
00192
00194
00196 #define FLGR_MACRO_RASTER_SLIDE_WINDOW_1D_BEFORE_OP(dtype) \
00197 FLGR_Vector *result,*vec_arith; \
00198 FLGR_Data1D *nhbrs; \
00199 FLGR_NhbBox1D *extr; \
00200 dtype *vector_array; \
00201 dtype *vector_arith_array; \
00202 dtype *data_array; \
00203 dtype *data_arith_array; \
00204 int j, spp = datsrc->spp; \
00205 \
00206 \
00207 \
00208 result = flgr_vector_create(datsrc->spp,datsrc->type); \
00209 vec_arith = flgr_vector_create(datsrc->spp,datsrc->type); \
00210 \
00211 vector_array = (dtype *) result->array; \
00212 vector_arith_array = (dtype *) vec_arith->array; \
00213 data_array = (dtype *) datdest->array; \
00214 data_arith_array = (dtype *) datarith->array; \
00215 \
00216 extr = flgr1d_create_neighbor_box(nhb); \
00217 \
00218 nhbrs=flgr1d_create_neighborhood_from(nhb); \
00219 \
00220 if(nhb_sym==FLGR_NHB_SYM) \
00221 flgr1d_mirror_##dtype(nhbrs,nhb); \
00222 else \
00223 flgr1d_copy_##dtype##_##dtype(nhbrs,nhb); \
00224 \
00225 if(datdest==datsrc) { \
00226 flgr1d_apply_raster_scan_method_##dtype(nhbrs); \
00227 } \
00228 \
00229 for(j=0 ; j<datsrc->length ; j++) { \
00230 \
00231 flgr1d_get_neighborhood_##dtype(extr,datsrc,nhbrs,j); \
00232 \
00233 (*computeNhb)(result,extr); \
00234 \
00235 flgr_get_data_array_vector_##dtype(vector_arith_array, \
00236 data_arith_array, \
00237 spp,j); \
00238 \
00239 (*computeArith)(result,result,vec_arith); \
00240 \
00241 flgr_set_data_array_vector_##dtype(data_array, \
00242 vector_array, \
00243 spp,j); \
00244 \
00245 } \
00246 \
00247 flgr1d_destroy(nhbrs); \
00248 flgr1d_destroy_neighbor_box(extr); \
00249 flgr_vector_destroy(result); \
00250 flgr_vector_destroy(vec_arith); \
00251 \
00252 return
00253
00255
00257 #define FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_1D_BEFORE_OP(dtype) \
00258 FLGR_Vector *result,*vec_arith; \
00259 FLGR_Data1D *nhbars; \
00260 FLGR_NhbBox1D *extr; \
00261 dtype *vector_array; \
00262 dtype *vector_arith_array; \
00263 dtype *data_array; \
00264 dtype *data_arith_array; \
00265 int j, spp = datsrc->spp; \
00266 \
00267 \
00268 \
00269 result = flgr_vector_create(datsrc->spp,datsrc->type); \
00270 vec_arith = flgr_vector_create(datsrc->spp,datsrc->type); \
00271 \
00272 vector_array = (dtype *) result->array; \
00273 vector_arith_array = (dtype *) vec_arith->array; \
00274 data_array = (dtype *) datdest->array; \
00275 data_arith_array = (dtype *) datarith->array; \
00276 \
00277 extr = flgr1d_create_neighbor_box(nhb); \
00278 \
00279 nhbars=flgr1d_create_neighborhood_from(nhb); \
00280 \
00281 if(nhb_sym==FLGR_NHB_SYM) \
00282 flgr1d_mirror_##dtype(nhbars,nhb); \
00283 else \
00284 flgr1d_copy_##dtype##_##dtype(nhbars,nhb); \
00285 \
00286 if(datdest==datsrc) { \
00287 flgr1d_apply_raster_scan_method_##dtype(nhbars); \
00288 } \
00289 \
00290 for(j=datsrc->length-1 ; j>=0 ; j--) { \
00291 \
00292 flgr1d_get_neighborhood_##dtype(extr,datsrc,nhbars,j); \
00293 \
00294 (*computeNhb)(result,extr); \
00295 \
00296 flgr_get_data_array_vector_##dtype(vector_arith_array, \
00297 data_arith_array, \
00298 spp,j); \
00299 \
00300 (*computeArith)(result,result,vec_arith); \
00301 \
00302 flgr_set_data_array_vector_##dtype(data_array, \
00303 vector_array, \
00304 spp,j); \
00305 \
00306 } \
00307 \
00308 flgr1d_destroy(nhbars); \
00309 flgr1d_destroy_neighbor_box(extr); \
00310 flgr_vector_destroy(result); \
00311 flgr_vector_destroy(vec_arith); \
00312 \
00313 return
00314
00315
00316
00317 void flgr1d_raster_slide_window_fgBIT(FLGR_Data1D *datdest,FLGR_Data1D *datsrc,FLGR_Data1D *nhb,int nhb_sym,
00318 FLGR_ComputeNhb1D computeNhb) {
00319 FLGR_MACRO_RASTER_SLIDE_WINDOW_1D(fgBIT,flgr1d_get_neighborhood);
00320 }
00321 void flgr1d_raster_slide_window_fgUINT8(FLGR_Data1D *datdest,FLGR_Data1D *datsrc,FLGR_Data1D *nhb,int nhb_sym,
00322 FLGR_ComputeNhb1D computeNhb) {
00323 FLGR_MACRO_RASTER_SLIDE_WINDOW_1D(fgUINT8,flgr1d_get_neighborhood);
00324 }
00325 void flgr1d_raster_slide_window_fgUINT16(FLGR_Data1D *datdest,FLGR_Data1D *datsrc,FLGR_Data1D *nhb, int nhb_sym,
00326 FLGR_ComputeNhb1D computeNhb) {
00327 FLGR_MACRO_RASTER_SLIDE_WINDOW_1D(fgUINT16,flgr1d_get_neighborhood);
00328 }
00329 void flgr1d_raster_slide_window_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb, int nhb_sym,
00330 FLGR_ComputeNhb1D computeNhb) {
00331 FLGR_MACRO_RASTER_SLIDE_WINDOW_1D(fgUINT32,flgr1d_get_neighborhood);
00332 }
00333 void flgr1d_raster_slide_window_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb, int nhb_sym,
00334 FLGR_ComputeNhb1D computeNhb){
00335 FLGR_MACRO_RASTER_SLIDE_WINDOW_1D(fgINT8,flgr1d_get_neighborhood);
00336 }
00337 void flgr1d_raster_slide_window_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb, int nhb_sym,
00338 FLGR_ComputeNhb1D computeNhb) {
00339 FLGR_MACRO_RASTER_SLIDE_WINDOW_1D(fgINT16,flgr1d_get_neighborhood);
00340 }
00341 void flgr1d_raster_slide_window_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb, int nhb_sym,
00342 FLGR_ComputeNhb1D computeNhb) {
00343 FLGR_MACRO_RASTER_SLIDE_WINDOW_1D(fgINT32,flgr1d_get_neighborhood);
00344 }
00345 void flgr1d_raster_slide_window_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb, int nhb_sym,
00346 FLGR_ComputeNhb1D computeNhb) {
00347 FLGR_MACRO_RASTER_SLIDE_WINDOW_1D(fgFLOAT32,flgr1d_get_neighborhood);
00348 }
00349 void flgr1d_raster_slide_window_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb, int nhb_sym,
00350 FLGR_ComputeNhb1D computeNhb) {
00351 FLGR_MACRO_RASTER_SLIDE_WINDOW_1D(fgFLOAT64,flgr1d_get_neighborhood);
00352 }
00353
00354
00356
00364
00365 FLGR_Ret flgr1d_raster_slide_window(FLGR_Data1D *datdest,FLGR_Data1D *datsrc,FLGR_Data1D *nhb,int nhb_sym,
00366 FLGR_ComputeNhb1D computeNhb) {
00367 FLGR_Ret ret;
00368
00369
00370
00371 if((datdest==NULL) || (datsrc==NULL) || (nhb==NULL)) {
00372 POST_ERROR("Null objects\n");
00373 return FLGR_RET_NULL_OBJECT;
00374 }
00375
00376 if((ret = flgr1d_is_data_same_attributes(datdest,datsrc,__FUNCTION__)) != FLGR_RET_OK) return ret;
00377
00378 if((ret=flgr1d_is_data_same_type(datdest,nhb))!=FLGR_RET_OK) {
00379 POST_ERROR("data types differents\n");
00380 return ret;
00381 }
00382
00383 if((ret=flgr1d_is_data_same_spp(datdest,nhb))!=FLGR_RET_OK) {
00384 POST_ERROR("spp differents\n");
00385 return ret;
00386 }
00387
00388 FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_raster_slide_window,datdest,datsrc,nhb,nhb_sym,computeNhb);
00389
00390 }
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401 void flgr1d_anti_raster_slide_window_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb, int nhb_sym,
00402 FLGR_ComputeNhb1D computeNhb){
00403 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_1D(fgBIT,flgr1d_get_neighborhood);
00404 }
00405 void flgr1d_anti_raster_slide_window_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb, int nhb_sym,
00406 FLGR_ComputeNhb1D computeNhb){
00407 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_1D(fgUINT8,flgr1d_get_neighborhood);
00408 }
00409 void flgr1d_anti_raster_slide_window_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb, int nhb_sym,
00410 FLGR_ComputeNhb1D computeNhb) {
00411 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_1D(fgUINT16,flgr1d_get_neighborhood);
00412 }
00413 void flgr1d_anti_raster_slide_window_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb, int nhb_sym,
00414 FLGR_ComputeNhb1D computeNhb) {
00415 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_1D(fgUINT32,flgr1d_get_neighborhood);
00416 }
00417 void flgr1d_anti_raster_slide_window_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb, int nhb_sym,
00418 FLGR_ComputeNhb1D computeNhb) {
00419 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_1D(fgINT8,flgr1d_get_neighborhood);
00420 }
00421 void flgr1d_anti_raster_slide_window_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb,int nhb_sym,
00422 FLGR_ComputeNhb1D computeNhb) {
00423 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_1D(fgINT16,flgr1d_get_neighborhood);
00424 }
00425 void flgr1d_anti_raster_slide_window_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb, int nhb_sym,
00426 FLGR_ComputeNhb1D computeNhb) {
00427 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_1D(fgINT32,flgr1d_get_neighborhood);
00428 }
00429 void flgr1d_anti_raster_slide_window_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb,int nhb_sym,
00430 FLGR_ComputeNhb1D computeNhb) {
00431 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_1D(fgFLOAT32,flgr1d_get_neighborhood);
00432 }
00433 void flgr1d_anti_raster_slide_window_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb,int nhb_sym,
00434 FLGR_ComputeNhb1D computeNhb) {
00435 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_1D(fgFLOAT64,flgr1d_get_neighborhood);
00436 }
00437
00438
00440
00448
00449 FLGR_Ret flgr1d_anti_raster_slide_window(FLGR_Data1D *datdest,FLGR_Data1D *datsrc,FLGR_Data1D *nhb,
00450 int nhb_sym, FLGR_ComputeNhb1D computeNhb) {
00451 FLGR_Ret ret;
00452
00453
00454
00455 if((datdest==NULL) || (datsrc==NULL) || (nhb==NULL)) {
00456 POST_ERROR("Null objects\n");
00457 return FLGR_RET_NULL_OBJECT;
00458 }
00459
00460 if((ret = flgr1d_is_data_same_attributes(datdest,datsrc,__FUNCTION__)) != FLGR_RET_OK) return ret;
00461
00462 if((ret=flgr1d_is_data_same_type(datdest,nhb))!=FLGR_RET_OK) {
00463 POST_ERROR("data types differents\n");
00464 return ret;
00465 }
00466
00467 if((ret=flgr1d_is_data_same_spp(datdest,nhb))!=FLGR_RET_OK) {
00468 POST_ERROR("spp differents\n");
00469 return ret;
00470 }
00471
00472 FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_anti_raster_slide_window,datdest,datsrc,nhb,nhb_sym,computeNhb);
00473
00474 }
00475
00476
00477
00478
00479 void flgr1d_raster_slide_window_unfolded_fgBIT(FLGR_Data1D *datdest,FLGR_Data1D *datsrc,FLGR_Data1D *nhb,int nhb_sym,
00480 FLGR_ComputeNhb1D computeNhb) {
00481 FLGR_MACRO_RASTER_SLIDE_WINDOW_1D(fgBIT,flgr1d_get_neighborhood_unfolded);
00482 }
00483 void flgr1d_raster_slide_window_unfolded_fgUINT8(FLGR_Data1D *datdest,FLGR_Data1D *datsrc,FLGR_Data1D *nhb,int nhb_sym,
00484 FLGR_ComputeNhb1D computeNhb) {
00485 FLGR_MACRO_RASTER_SLIDE_WINDOW_1D(fgUINT8,flgr1d_get_neighborhood_unfolded);
00486 }
00487 void flgr1d_raster_slide_window_unfolded_fgUINT16(FLGR_Data1D *datdest,FLGR_Data1D *datsrc,FLGR_Data1D *nhb, int nhb_sym,
00488 FLGR_ComputeNhb1D computeNhb) {
00489 FLGR_MACRO_RASTER_SLIDE_WINDOW_1D(fgUINT16,flgr1d_get_neighborhood_unfolded);
00490 }
00491 void flgr1d_raster_slide_window_unfolded_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb, int nhb_sym,
00492 FLGR_ComputeNhb1D computeNhb) {
00493 FLGR_MACRO_RASTER_SLIDE_WINDOW_1D(fgUINT32,flgr1d_get_neighborhood_unfolded);
00494 }
00495 void flgr1d_raster_slide_window_unfolded_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb, int nhb_sym,
00496 FLGR_ComputeNhb1D computeNhb){
00497 FLGR_MACRO_RASTER_SLIDE_WINDOW_1D(fgINT8,flgr1d_get_neighborhood_unfolded);
00498 }
00499 void flgr1d_raster_slide_window_unfolded_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb, int nhb_sym,
00500 FLGR_ComputeNhb1D computeNhb) {
00501 FLGR_MACRO_RASTER_SLIDE_WINDOW_1D(fgINT16,flgr1d_get_neighborhood_unfolded);
00502 }
00503 void flgr1d_raster_slide_window_unfolded_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb, int nhb_sym,
00504 FLGR_ComputeNhb1D computeNhb) {
00505 FLGR_MACRO_RASTER_SLIDE_WINDOW_1D(fgINT32,flgr1d_get_neighborhood_unfolded);
00506 }
00507 void flgr1d_raster_slide_window_unfolded_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb, int nhb_sym,
00508 FLGR_ComputeNhb1D computeNhb) {
00509 FLGR_MACRO_RASTER_SLIDE_WINDOW_1D(fgFLOAT32,flgr1d_get_neighborhood_unfolded);
00510 }
00511 void flgr1d_raster_slide_window_unfolded_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb, int nhb_sym,
00512 FLGR_ComputeNhb1D computeNhb) {
00513 FLGR_MACRO_RASTER_SLIDE_WINDOW_1D(fgFLOAT64,flgr1d_get_neighborhood_unfolded);
00514 }
00515
00516
00518
00526
00527 FLGR_Ret flgr1d_raster_slide_window_unfolded(FLGR_Data1D *datdest,FLGR_Data1D *datsrc,FLGR_Data1D *nhb,int nhb_sym,
00528 FLGR_ComputeNhb1D computeNhb) {
00529 FLGR_Ret ret;
00530
00531
00532
00533 if((datdest==NULL) || (datsrc==NULL) || (nhb==NULL)) {
00534 POST_ERROR("Null objects\n");
00535 return FLGR_RET_NULL_OBJECT;
00536 }
00537
00538 if((ret = flgr1d_is_data_same_attributes(datdest,datsrc,__FUNCTION__)) != FLGR_RET_OK) return ret;
00539
00540 if((ret=flgr1d_is_data_same_type(datdest,nhb))!=FLGR_RET_OK) {
00541 POST_ERROR("data types differents\n");
00542 return ret;
00543 }
00544
00545 if((ret=flgr1d_is_data_same_spp(datdest,nhb))!=FLGR_RET_OK) {
00546 POST_ERROR("spp differents\n");
00547 return ret;
00548 }
00549
00550 FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_raster_slide_window_unfolded,datdest,datsrc,nhb,nhb_sym,computeNhb);
00551
00552 }
00553
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563 void flgr1d_anti_raster_slide_window_unfolded_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb, int nhb_sym,
00564 FLGR_ComputeNhb1D computeNhb){
00565 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_1D(fgBIT,flgr1d_get_neighborhood_unfolded);
00566 }
00567 void flgr1d_anti_raster_slide_window_unfolded_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb, int nhb_sym,
00568 FLGR_ComputeNhb1D computeNhb){
00569 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_1D(fgUINT8,flgr1d_get_neighborhood_unfolded);
00570 }
00571 void flgr1d_anti_raster_slide_window_unfolded_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb, int nhb_sym,
00572 FLGR_ComputeNhb1D computeNhb) {
00573 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_1D(fgUINT16,flgr1d_get_neighborhood_unfolded);
00574 }
00575 void flgr1d_anti_raster_slide_window_unfolded_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb, int nhb_sym,
00576 FLGR_ComputeNhb1D computeNhb) {
00577 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_1D(fgUINT32,flgr1d_get_neighborhood_unfolded);
00578 }
00579 void flgr1d_anti_raster_slide_window_unfolded_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb, int nhb_sym,
00580 FLGR_ComputeNhb1D computeNhb) {
00581 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_1D(fgINT8,flgr1d_get_neighborhood_unfolded);
00582 }
00583 void flgr1d_anti_raster_slide_window_unfolded_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb,int nhb_sym,
00584 FLGR_ComputeNhb1D computeNhb) {
00585 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_1D(fgINT16,flgr1d_get_neighborhood_unfolded);
00586 }
00587 void flgr1d_anti_raster_slide_window_unfolded_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb, int nhb_sym,
00588 FLGR_ComputeNhb1D computeNhb) {
00589 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_1D(fgINT32,flgr1d_get_neighborhood_unfolded);
00590 }
00591 void flgr1d_anti_raster_slide_window_unfolded_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb,int nhb_sym,
00592 FLGR_ComputeNhb1D computeNhb) {
00593 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_1D(fgFLOAT32,flgr1d_get_neighborhood_unfolded);
00594 }
00595 void flgr1d_anti_raster_slide_window_unfolded_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb,int nhb_sym,
00596 FLGR_ComputeNhb1D computeNhb) {
00597 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_1D(fgFLOAT64,flgr1d_get_neighborhood_unfolded);
00598 }
00599
00600
00602
00610
00611 FLGR_Ret flgr1d_anti_raster_slide_window_unfolded(FLGR_Data1D *datdest,FLGR_Data1D *datsrc,FLGR_Data1D *nhb,
00612 int nhb_sym, FLGR_ComputeNhb1D computeNhb) {
00613 FLGR_Ret ret;
00614
00615
00616
00617 if((datdest==NULL) || (datsrc==NULL) || (nhb==NULL)) {
00618 POST_ERROR("Null objects\n");
00619 return FLGR_RET_NULL_OBJECT;
00620 }
00621
00622 if((ret = flgr1d_is_data_same_attributes(datdest,datsrc,__FUNCTION__)) != FLGR_RET_OK) return ret;
00623
00624 if((ret=flgr1d_is_data_same_type(datdest,nhb))!=FLGR_RET_OK) {
00625 POST_ERROR("data types differents\n");
00626 return ret;
00627 }
00628
00629 if((ret=flgr1d_is_data_same_spp(datdest,nhb))!=FLGR_RET_OK) {
00630 POST_ERROR("spp differents\n");
00631 return ret;
00632 }
00633
00634 FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_anti_raster_slide_window_unfolded,datdest,datsrc,nhb,nhb_sym,computeNhb);
00635
00636 }
00637
00638
00639
00640
00641
00642
00643
00644
00645
00646
00647
00648 void flgr1d_raster_slide_window_before_op_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *datarith, FLGR_Data1D *nhb,
00649 int nhb_sym,
00650 FLGR_ComputeNhb1D computeNhb,
00651 FLGR_ComputeArith computeArith) {
00652 FLGR_MACRO_RASTER_SLIDE_WINDOW_1D_BEFORE_OP(fgBIT);
00653 }
00654
00655 void flgr1d_raster_slide_window_before_op_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *datarith, FLGR_Data1D *nhb,
00656 int nhb_sym,
00657 FLGR_ComputeNhb1D computeNhb,
00658 FLGR_ComputeArith computeArith) {
00659 FLGR_MACRO_RASTER_SLIDE_WINDOW_1D_BEFORE_OP(fgUINT8);
00660 }
00661
00662 void flgr1d_raster_slide_window_before_op_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *datarith, FLGR_Data1D *nhb,
00663 int nhb_sym,
00664 FLGR_ComputeNhb1D computeNhb,
00665 FLGR_ComputeArith computeArith) {
00666 FLGR_MACRO_RASTER_SLIDE_WINDOW_1D_BEFORE_OP(fgUINT16);
00667 }
00668
00669 void flgr1d_raster_slide_window_before_op_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *datarith, FLGR_Data1D *nhb,
00670 int nhb_sym,
00671 FLGR_ComputeNhb1D computeNhb,
00672 FLGR_ComputeArith computeArith) {
00673 FLGR_MACRO_RASTER_SLIDE_WINDOW_1D_BEFORE_OP(fgUINT32);
00674 }
00675
00676 void flgr1d_raster_slide_window_before_op_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *datarith, FLGR_Data1D *nhb,
00677 int nhb_sym,
00678 FLGR_ComputeNhb1D computeNhb,
00679 FLGR_ComputeArith computeArith) {
00680 FLGR_MACRO_RASTER_SLIDE_WINDOW_1D_BEFORE_OP(fgINT8);
00681 }
00682
00683 void flgr1d_raster_slide_window_before_op_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *datarith, FLGR_Data1D *nhb,
00684 int nhb_sym,
00685 FLGR_ComputeNhb1D computeNhb,
00686 FLGR_ComputeArith computeArith) {
00687 FLGR_MACRO_RASTER_SLIDE_WINDOW_1D_BEFORE_OP(fgINT16);
00688 }
00689
00690 void flgr1d_raster_slide_window_before_op_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *datarith, FLGR_Data1D *nhb,
00691 int nhb_sym,
00692 FLGR_ComputeNhb1D computeNhb,
00693 FLGR_ComputeArith computeArith) {
00694 FLGR_MACRO_RASTER_SLIDE_WINDOW_1D_BEFORE_OP(fgINT32);
00695 }
00696
00697 void flgr1d_raster_slide_window_before_op_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *datarith, FLGR_Data1D *nhb,
00698 int nhb_sym,
00699 FLGR_ComputeNhb1D computeNhb,
00700 FLGR_ComputeArith computeArith) {
00701 FLGR_MACRO_RASTER_SLIDE_WINDOW_1D_BEFORE_OP(fgFLOAT32);
00702 }
00703
00704 void flgr1d_raster_slide_window_before_op_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *datarith, FLGR_Data1D *nhb,
00705 int nhb_sym,
00706 FLGR_ComputeNhb1D computeNhb,
00707 FLGR_ComputeArith computeArith) {
00708 FLGR_MACRO_RASTER_SLIDE_WINDOW_1D_BEFORE_OP(fgFLOAT64);
00709 }
00710
00711
00712
00713
00714 void flgr1d_anti_raster_slide_window_before_op_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *datarith, FLGR_Data1D *nhb,
00715 int nhb_sym,
00716 FLGR_ComputeNhb1D computeNhb,
00717 FLGR_ComputeArith computeArith) {
00718 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_1D_BEFORE_OP(fgBIT);
00719 }
00720
00721 void flgr1d_anti_raster_slide_window_before_op_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *datarith, FLGR_Data1D *nhb,
00722 int nhb_sym,
00723 FLGR_ComputeNhb1D computeNhb,
00724 FLGR_ComputeArith computeArith) {
00725 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_1D_BEFORE_OP(fgUINT8);
00726 }
00727
00728 void flgr1d_anti_raster_slide_window_before_op_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *datarith, FLGR_Data1D *nhb,
00729 int nhb_sym,
00730 FLGR_ComputeNhb1D computeNhb,
00731 FLGR_ComputeArith computeArith) {
00732 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_1D_BEFORE_OP(fgUINT16);
00733 }
00734
00735 void flgr1d_anti_raster_slide_window_before_op_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *datarith, FLGR_Data1D *nhb,
00736 int nhb_sym,
00737 FLGR_ComputeNhb1D computeNhb,
00738 FLGR_ComputeArith computeArith) {
00739 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_1D_BEFORE_OP(fgUINT32);
00740 }
00741
00742 void flgr1d_anti_raster_slide_window_before_op_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *datarith, FLGR_Data1D *nhb,
00743 int nhb_sym,
00744 FLGR_ComputeNhb1D computeNhb,
00745 FLGR_ComputeArith computeArith) {
00746 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_1D_BEFORE_OP(fgINT8 );
00747 }
00748
00749 void flgr1d_anti_raster_slide_window_before_op_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *datarith, FLGR_Data1D *nhb,
00750 int nhb_sym,
00751 FLGR_ComputeNhb1D computeNhb,
00752 FLGR_ComputeArith computeArith) {
00753 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_1D_BEFORE_OP(fgINT16);
00754 }
00755
00756 void flgr1d_anti_raster_slide_window_before_op_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *datarith, FLGR_Data1D *nhb,
00757 int nhb_sym,
00758 FLGR_ComputeNhb1D computeNhb,
00759 FLGR_ComputeArith computeArith) {
00760 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_1D_BEFORE_OP(fgINT32);
00761 }
00762
00763 void flgr1d_anti_raster_slide_window_before_op_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *datarith, FLGR_Data1D *nhb,
00764 int nhb_sym,
00765 FLGR_ComputeNhb1D computeNhb,
00766 FLGR_ComputeArith computeArith) {
00767 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_1D_BEFORE_OP(fgFLOAT32);
00768 }
00769
00770 void flgr1d_anti_raster_slide_window_before_op_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *datarith, FLGR_Data1D *nhb,
00771 int nhb_sym,
00772 FLGR_ComputeNhb1D computeNhb,
00773 FLGR_ComputeArith computeArith) {
00774 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_1D_BEFORE_OP(fgFLOAT64);
00775 }
00776
00777
00778
00779
00780
00781
00782
00783
00784
00785
00786
00787
00788
00789
00790
00791
00792
00793
00794
00795
00796
00797
00798
00799
00801
00803 #define FLGR_MACRO_RASTER_SLIDE_WINDOW_2D(dtype,get_nhb_op) \
00804 int i,j,w,h,spp = imgsrc->spp; \
00805 dtype *vector_array; \
00806 dtype *data_array; \
00807 FLGR_Vector *result; \
00808 FLGR_Data2D *nhbEven,*nhbOdd,*nhbrs; \
00809 FLGR_NhbBox2D *extr; \
00810 \
00811 \
00812 \
00813 w=imgsrc->size_x; \
00814 h=imgsrc->size_y; \
00815 \
00816 result = flgr_vector_create(imgsrc->spp,imgsrc->type); \
00817 \
00818 vector_array = (dtype *) result->array; \
00819 \
00820 extr = flgr2d_create_neighbor_box(nhb); \
00821 \
00822 nhbEven=flgr2d_create_neighborhood_from(nhb); \
00823 nhbOdd=flgr2d_create_neighborhood_from(nhb); \
00824 \
00825 flgr2d_fill_nhbs_for_6_connexity(nhbEven,nhbOdd,nhb,nhb_sym); \
00826 \
00827 if(imgdest==imgsrc) { \
00828 flgr2d_apply_raster_scan_method_##dtype(nhbOdd); \
00829 flgr2d_apply_raster_scan_method_##dtype(nhbEven); \
00830 } \
00831 \
00832 for(i=0 ; i<h; i++) { \
00833 \
00834 data_array = (dtype *) (imgdest->array[i]); \
00835 \
00836 for(j=0 ; j<w ; j++) { \
00837 \
00838 nhbrs = (((i%2)==1) ? nhbOdd : nhbEven); \
00839 \
00840 get_nhb_op##_##dtype(extr,imgsrc,nhbrs,i,j); \
00841 \
00842 (*computeNhb)(result,extr); \
00843 \
00844 flgr_set_data_array_vector_##dtype(data_array, \
00845 vector_array, \
00846 spp,j); \
00847 } \
00848 } \
00849 \
00850 flgr2d_destroy(nhbOdd); \
00851 flgr2d_destroy(nhbEven); \
00852 flgr2d_destroy_neighbor_box(extr); \
00853 flgr_vector_destroy(result); \
00854 \
00855 return
00856
00857
00858
00859
00861
00863 #define FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_2D(dtype,get_nhb_op) \
00864 int i,j,w,h,spp = imgsrc->spp; \
00865 dtype *vector_array; \
00866 dtype *data_array; \
00867 FLGR_Vector *result; \
00868 FLGR_Data2D *nhbars; \
00869 FLGR_Data2D *nhbEven,*nhbOdd; \
00870 FLGR_NhbBox2D *extr; \
00871 \
00872 \
00873 \
00874 w=imgsrc->size_x; \
00875 h=imgsrc->size_y; \
00876 \
00877 result = flgr_vector_create(imgsrc->spp,imgsrc->type); \
00878 \
00879 vector_array = (dtype *) result->array; \
00880 \
00881 extr = flgr2d_create_neighbor_box(nhb); \
00882 \
00883 nhbEven=flgr2d_create_neighborhood_from(nhb); \
00884 nhbOdd=flgr2d_create_neighborhood_from(nhb); \
00885 \
00886 flgr2d_fill_nhbs_for_6_connexity(nhbEven,nhbOdd,nhb,nhb_sym); \
00887 \
00888 if(imgdest==imgsrc) { \
00889 flgr2d_apply_anti_raster_scan_method_##dtype(nhbOdd); \
00890 flgr2d_apply_anti_raster_scan_method_##dtype(nhbEven); \
00891 } \
00892 \
00893 for(i=h-1 ; i>=0 ; i--) { \
00894 \
00895 data_array = (dtype *) (imgdest->array[i]); \
00896 \
00897 for(j=w-1 ; j>=0 ; j--) { \
00898 \
00899 nhbars = (((i%2)==1) ? nhbOdd : nhbEven); \
00900 \
00901 get_nhb_op##_##dtype(extr,imgsrc,nhbars,i,j); \
00902 \
00903 (*computeNhb)(result,extr); \
00904 \
00905 flgr_set_data_array_vector_##dtype(data_array, \
00906 vector_array, \
00907 spp,j); \
00908 \
00909 } \
00910 } \
00911 \
00912 flgr2d_destroy(nhbOdd); \
00913 flgr2d_destroy(nhbEven); \
00914 flgr_vector_destroy(result); \
00915 flgr2d_destroy_neighbor_box(extr); \
00916 \
00917 return
00918
00919
00921
00923 #define FLGR_MACRO_RASTER_SLIDE_WINDOW_2D_BEFORE_OP(dtype) \
00924 int i,j; \
00925 FLGR_Vector *result,*vec_arith; \
00926 FLGR_Data2D *nhbrs; \
00927 FLGR_Data2D *nhbEven,*nhbOdd; \
00928 FLGR_NhbBox2D *extr; \
00929 \
00930 \
00931 \
00932 result = flgr_vector_create(imgsrc->spp,imgsrc->type); \
00933 vec_arith = flgr_vector_create(imgsrc->spp,imgsrc->type); \
00934 \
00935 extr = flgr2d_create_neighbor_box(nhb); \
00936 \
00937 nhbEven=flgr2d_create_neighborhood_from(nhb); \
00938 nhbOdd=flgr2d_create_neighborhood_from(nhb); \
00939 \
00940 flgr2d_fill_nhbs_for_6_connexity(nhbEven,nhbOdd,nhb,nhb_sym); \
00941 \
00942 if(imgdest==imgsrc) { \
00943 flgr2d_apply_raster_scan_method_##dtype(nhbOdd); \
00944 flgr2d_apply_raster_scan_method_##dtype(nhbEven); \
00945 } \
00946 \
00947 for(i=0 ; i<imgsrc->size_y ; i++) { \
00948 for(j=0 ; j<imgsrc->size_x ; j++) { \
00949 \
00950 nhbrs = (((i%2)==1) ? nhbOdd : nhbEven); \
00951 \
00952 flgr2d_get_neighborhood_##dtype(extr,imgsrc,nhbrs,i,j); \
00953 \
00954 (*computeNhb)(result,extr); \
00955 \
00956 flgr2d_get_data_vector_##dtype(imgarith,i,j,vec_arith); \
00957 \
00958 (*computeArith)(result,result,vec_arith); \
00959 \
00960 flgr2d_set_data_vector_##dtype(imgdest,i,j,result); \
00961 \
00962 } \
00963 } \
00964 \
00965 flgr2d_destroy(nhbOdd); \
00966 flgr2d_destroy(nhbEven); \
00967 flgr2d_destroy_neighbor_box(extr); \
00968 flgr_vector_destroy(result); \
00969 flgr_vector_destroy(vec_arith); \
00970 \
00971 return
00972
00974
00976 #define FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_2D_BEFORE_OP(dtype) \
00977 int i,j; \
00978 FLGR_Vector *result,*vec_arith; \
00979 FLGR_Data2D *nhbars; \
00980 FLGR_Data2D *nhbEven,*nhbOdd; \
00981 FLGR_NhbBox2D *extr; \
00982 \
00983 \
00984 \
00985 result = flgr_vector_create(imgsrc->spp,imgsrc->type); \
00986 vec_arith = flgr_vector_create(imgsrc->spp,imgsrc->type); \
00987 \
00988 extr = flgr2d_create_neighbor_box(nhb); \
00989 \
00990 nhbEven=flgr2d_create_neighborhood_from(nhb); \
00991 nhbOdd=flgr2d_create_neighborhood_from(nhb); \
00992 \
00993 flgr2d_fill_nhbs_for_6_connexity(nhbEven,nhbOdd,nhb,nhb_sym); \
00994 \
00995 if(imgdest==imgsrc) { \
00996 flgr2d_apply_anti_raster_scan_method_##dtype(nhbOdd); \
00997 flgr2d_apply_anti_raster_scan_method_##dtype(nhbEven); \
00998 } \
00999 \
01000 for(i=imgsrc->size_y-1 ; i>=0 ; i--) { \
01001 for(j=imgsrc->size_x-1 ; j>=0 ; j--) { \
01002 \
01003 nhbars = (((i%2)==1) ? nhbOdd : nhbEven); \
01004 \
01005 flgr2d_get_neighborhood_##dtype(extr,imgsrc,nhbars,i,j); \
01006 \
01007 (*computeNhb)(result,extr); \
01008 \
01009 flgr2d_get_data_vector_##dtype(imgarith,i,j,vec_arith); \
01010 \
01011 (*computeArith)(result,result,vec_arith); \
01012 \
01013 flgr2d_set_data_vector_##dtype(imgdest,i,j,result); \
01014 \
01015 } \
01016 } \
01017 \
01018 flgr2d_destroy(nhbOdd); \
01019 flgr2d_destroy(nhbEven); \
01020 flgr2d_destroy_neighbor_box(extr); \
01021 flgr_vector_destroy(vec_arith); \
01022 flgr_vector_destroy(result); \
01023 \
01024 return
01025
01026
01027
01028
01029
01030 void flgr2d_raster_slide_window_fgBIT(FLGR_Data2D *imgdest,FLGR_Data2D *imgsrc,FLGR_Data2D *nhb,int nhb_sym,
01031 FLGR_ComputeNhb2D computeNhb) {
01032 FLGR_MACRO_RASTER_SLIDE_WINDOW_2D(fgBIT,flgr2d_get_neighborhood);
01033 }
01034 void flgr2d_raster_slide_window_fgUINT8(FLGR_Data2D *imgdest,FLGR_Data2D *imgsrc,FLGR_Data2D *nhb,int nhb_sym,
01035 FLGR_ComputeNhb2D computeNhb) {
01036 FLGR_MACRO_RASTER_SLIDE_WINDOW_2D(fgUINT8,flgr2d_get_neighborhood);
01037 }
01038 void flgr2d_raster_slide_window_fgUINT16(FLGR_Data2D *imgdest,FLGR_Data2D *imgsrc,FLGR_Data2D *nhb, int nhb_sym,
01039 FLGR_ComputeNhb2D computeNhb) {
01040 FLGR_MACRO_RASTER_SLIDE_WINDOW_2D(fgUINT16,flgr2d_get_neighborhood);
01041 }
01042 void flgr2d_raster_slide_window_fgUINT32(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb, int nhb_sym,
01043 FLGR_ComputeNhb2D computeNhb) {
01044 FLGR_MACRO_RASTER_SLIDE_WINDOW_2D(fgUINT32,flgr2d_get_neighborhood);
01045 }
01046 void flgr2d_raster_slide_window_fgINT8(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb, int nhb_sym,
01047 FLGR_ComputeNhb2D computeNhb){
01048 FLGR_MACRO_RASTER_SLIDE_WINDOW_2D(fgINT8,flgr2d_get_neighborhood);
01049 }
01050 void flgr2d_raster_slide_window_fgINT16(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb, int nhb_sym,
01051 FLGR_ComputeNhb2D computeNhb) {
01052 FLGR_MACRO_RASTER_SLIDE_WINDOW_2D(fgINT16,flgr2d_get_neighborhood);
01053 }
01054 void flgr2d_raster_slide_window_fgINT32(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb, int nhb_sym,
01055 FLGR_ComputeNhb2D computeNhb) {
01056 FLGR_MACRO_RASTER_SLIDE_WINDOW_2D(fgINT32,flgr2d_get_neighborhood);
01057 }
01058 void flgr2d_raster_slide_window_fgFLOAT32(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb, int nhb_sym,
01059 FLGR_ComputeNhb2D computeNhb) {
01060 FLGR_MACRO_RASTER_SLIDE_WINDOW_2D(fgFLOAT32,flgr2d_get_neighborhood);
01061 }
01062 void flgr2d_raster_slide_window_fgFLOAT64(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb, int nhb_sym,
01063 FLGR_ComputeNhb2D computeNhb) {
01064 FLGR_MACRO_RASTER_SLIDE_WINDOW_2D(fgFLOAT64,flgr2d_get_neighborhood);
01065 }
01066
01067
01069
01077
01078 FLGR_Ret flgr2d_raster_slide_window(FLGR_Data2D *imgdest,FLGR_Data2D *imgsrc,FLGR_Data2D *nhb,int nhb_sym,
01079 FLGR_ComputeNhb2D computeNhb) {
01080 FLGR_Ret ret;
01081
01082
01083
01084 if((imgdest==NULL) || (imgsrc==NULL) || (nhb==NULL)) {
01085 POST_ERROR("Null objects\n");
01086 return FLGR_RET_NULL_OBJECT;
01087 }
01088
01089 if((ret = flgr2d_is_data_same_attributes(imgdest,imgsrc,__FUNCTION__)) != FLGR_RET_OK) return ret;
01090
01091 if((ret=flgr2d_is_data_same_type(imgdest,nhb))!=FLGR_RET_OK) {
01092 POST_ERROR("data types differents\n");
01093 return ret;
01094 }
01095
01096 if((ret=flgr2d_is_data_same_spp(imgdest,nhb))!=FLGR_RET_OK) {
01097 POST_ERROR("spp differents\n");
01098 return ret;
01099 }
01100
01101 FLGR_DISPATCH_PROCEDURE(imgdest->type,flgr2d_raster_slide_window,imgdest,imgsrc,nhb,nhb_sym,computeNhb);
01102
01103 }
01104
01105
01106
01107
01108
01109
01110
01111
01112
01113
01114 void flgr2d_anti_raster_slide_window_fgBIT(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb, int nhb_sym,
01115 FLGR_ComputeNhb2D computeNhb){
01116 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_2D(fgBIT,flgr2d_get_neighborhood);
01117 }
01118 void flgr2d_anti_raster_slide_window_fgUINT8(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb, int nhb_sym,
01119 FLGR_ComputeNhb2D computeNhb){
01120 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_2D(fgUINT8,flgr2d_get_neighborhood);
01121 }
01122 void flgr2d_anti_raster_slide_window_fgUINT16(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb, int nhb_sym,
01123 FLGR_ComputeNhb2D computeNhb) {
01124 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_2D(fgUINT16,flgr2d_get_neighborhood);
01125 }
01126 void flgr2d_anti_raster_slide_window_fgUINT32(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb, int nhb_sym,
01127 FLGR_ComputeNhb2D computeNhb) {
01128 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_2D(fgUINT32,flgr2d_get_neighborhood);
01129 }
01130 void flgr2d_anti_raster_slide_window_fgINT8(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb, int nhb_sym,
01131 FLGR_ComputeNhb2D computeNhb) {
01132 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_2D(fgINT8,flgr2d_get_neighborhood);
01133 }
01134 void flgr2d_anti_raster_slide_window_fgINT16(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb,int nhb_sym,
01135 FLGR_ComputeNhb2D computeNhb) {
01136 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_2D(fgINT16,flgr2d_get_neighborhood);
01137 }
01138 void flgr2d_anti_raster_slide_window_fgINT32(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb, int nhb_sym,
01139 FLGR_ComputeNhb2D computeNhb) {
01140 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_2D(fgINT32,flgr2d_get_neighborhood);
01141 }
01142 void flgr2d_anti_raster_slide_window_fgFLOAT32(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb,int nhb_sym,
01143 FLGR_ComputeNhb2D computeNhb) {
01144 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_2D(fgFLOAT32,flgr2d_get_neighborhood);
01145 }
01146 void flgr2d_anti_raster_slide_window_fgFLOAT64(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb,int nhb_sym,
01147 FLGR_ComputeNhb2D computeNhb) {
01148 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_2D(fgFLOAT64,flgr2d_get_neighborhood);
01149 }
01150
01151
01153
01161
01162 FLGR_Ret flgr2d_anti_raster_slide_window(FLGR_Data2D *imgdest,FLGR_Data2D *imgsrc,FLGR_Data2D *nhb,
01163 int nhb_sym, FLGR_ComputeNhb2D computeNhb) {
01164 FLGR_Ret ret;
01165
01166
01167
01168 if((imgdest==NULL) || (imgsrc==NULL) || (nhb==NULL)) {
01169 POST_ERROR("Null objects\n");
01170 return FLGR_RET_NULL_OBJECT;
01171 }
01172
01173 if((ret = flgr2d_is_data_same_attributes(imgdest,imgsrc,__FUNCTION__)) != FLGR_RET_OK) return ret;
01174
01175 if((ret=flgr2d_is_data_same_type(imgdest,nhb))!=FLGR_RET_OK) {
01176 POST_ERROR("data types differents\n");
01177 return ret;
01178 }
01179
01180 if((ret=flgr2d_is_data_same_spp(imgdest,nhb))!=FLGR_RET_OK) {
01181 POST_ERROR("spp differents\n");
01182 return ret;
01183 }
01184
01185 FLGR_DISPATCH_PROCEDURE(imgdest->type,flgr2d_anti_raster_slide_window,imgdest,imgsrc,nhb,nhb_sym,computeNhb);
01186
01187 }
01188
01189
01190
01191
01192
01193
01194
01195
01196
01197 void flgr2d_raster_slide_window_unfolded_fgBIT(FLGR_Data2D *imgdest,FLGR_Data2D *imgsrc,FLGR_Data2D *nhb,int nhb_sym,
01198 FLGR_ComputeNhb2D computeNhb) {
01199 FLGR_MACRO_RASTER_SLIDE_WINDOW_2D(fgBIT,flgr2d_get_neighborhood_unfolded);
01200 }
01201 void flgr2d_raster_slide_window_unfolded_fgUINT8(FLGR_Data2D *imgdest,FLGR_Data2D *imgsrc,FLGR_Data2D *nhb,int nhb_sym,
01202 FLGR_ComputeNhb2D computeNhb) {
01203 FLGR_MACRO_RASTER_SLIDE_WINDOW_2D(fgUINT8,flgr2d_get_neighborhood_unfolded);
01204 }
01205 void flgr2d_raster_slide_window_unfolded_fgUINT16(FLGR_Data2D *imgdest,FLGR_Data2D *imgsrc,FLGR_Data2D *nhb, int nhb_sym,
01206 FLGR_ComputeNhb2D computeNhb) {
01207 FLGR_MACRO_RASTER_SLIDE_WINDOW_2D(fgUINT16,flgr2d_get_neighborhood_unfolded);
01208 }
01209 void flgr2d_raster_slide_window_unfolded_fgUINT32(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb, int nhb_sym,
01210 FLGR_ComputeNhb2D computeNhb) {
01211 FLGR_MACRO_RASTER_SLIDE_WINDOW_2D(fgUINT32,flgr2d_get_neighborhood_unfolded);
01212 }
01213 void flgr2d_raster_slide_window_unfolded_fgINT8(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb, int nhb_sym,
01214 FLGR_ComputeNhb2D computeNhb){
01215 FLGR_MACRO_RASTER_SLIDE_WINDOW_2D(fgINT8,flgr2d_get_neighborhood_unfolded);
01216 }
01217 void flgr2d_raster_slide_window_unfolded_fgINT16(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb, int nhb_sym,
01218 FLGR_ComputeNhb2D computeNhb) {
01219 FLGR_MACRO_RASTER_SLIDE_WINDOW_2D(fgINT16,flgr2d_get_neighborhood_unfolded);
01220 }
01221 void flgr2d_raster_slide_window_unfolded_fgINT32(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb, int nhb_sym,
01222 FLGR_ComputeNhb2D computeNhb) {
01223 FLGR_MACRO_RASTER_SLIDE_WINDOW_2D(fgINT32,flgr2d_get_neighborhood_unfolded);
01224 }
01225 void flgr2d_raster_slide_window_unfolded_fgFLOAT32(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb, int nhb_sym,
01226 FLGR_ComputeNhb2D computeNhb) {
01227 FLGR_MACRO_RASTER_SLIDE_WINDOW_2D(fgFLOAT32,flgr2d_get_neighborhood_unfolded);
01228 }
01229 void flgr2d_raster_slide_window_unfolded_fgFLOAT64(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb, int nhb_sym,
01230 FLGR_ComputeNhb2D computeNhb) {
01231 FLGR_MACRO_RASTER_SLIDE_WINDOW_2D(fgFLOAT64,flgr2d_get_neighborhood_unfolded);
01232 }
01233
01234
01236
01244
01245 FLGR_Ret flgr2d_raster_slide_window_unfolded(FLGR_Data2D *imgdest,FLGR_Data2D *imgsrc,FLGR_Data2D *nhb,int nhb_sym,
01246 FLGR_ComputeNhb2D computeNhb) {
01247 FLGR_Ret ret;
01248
01249
01250
01251 if((imgdest==NULL) || (imgsrc==NULL) || (nhb==NULL)) {
01252 POST_ERROR("Null objects\n");
01253 return FLGR_RET_NULL_OBJECT;
01254 }
01255
01256 if((ret = flgr2d_is_data_same_attributes(imgdest,imgsrc,__FUNCTION__)) != FLGR_RET_OK) return ret;
01257
01258 if((ret=flgr2d_is_data_same_type(imgdest,nhb))!=FLGR_RET_OK) {
01259 POST_ERROR("data types differents\n");
01260 return ret;
01261 }
01262
01263 if((ret=flgr2d_is_data_same_spp(imgdest,nhb))!=FLGR_RET_OK) {
01264 POST_ERROR("spp differents\n");
01265 return ret;
01266 }
01267
01268 FLGR_DISPATCH_PROCEDURE(imgdest->type,flgr2d_raster_slide_window_unfolded,imgdest,imgsrc,nhb,nhb_sym,computeNhb);
01269
01270 }
01271
01272
01273
01274
01275
01276
01277
01278
01279
01280
01281 void flgr2d_anti_raster_slide_window_unfolded_fgBIT(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb, int nhb_sym,
01282 FLGR_ComputeNhb2D computeNhb){
01283 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_2D(fgBIT,flgr2d_get_neighborhood_unfolded);
01284 }
01285 void flgr2d_anti_raster_slide_window_unfolded_fgUINT8(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb, int nhb_sym,
01286 FLGR_ComputeNhb2D computeNhb){
01287 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_2D(fgUINT8,flgr2d_get_neighborhood_unfolded);
01288 }
01289 void flgr2d_anti_raster_slide_window_unfolded_fgUINT16(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb, int nhb_sym,
01290 FLGR_ComputeNhb2D computeNhb) {
01291 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_2D(fgUINT16,flgr2d_get_neighborhood_unfolded);
01292 }
01293 void flgr2d_anti_raster_slide_window_unfolded_fgUINT32(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb, int nhb_sym,
01294 FLGR_ComputeNhb2D computeNhb) {
01295 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_2D(fgUINT32,flgr2d_get_neighborhood_unfolded);
01296 }
01297 void flgr2d_anti_raster_slide_window_unfolded_fgINT8(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb, int nhb_sym,
01298 FLGR_ComputeNhb2D computeNhb) {
01299 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_2D(fgINT8,flgr2d_get_neighborhood_unfolded);
01300 }
01301 void flgr2d_anti_raster_slide_window_unfolded_fgINT16(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb,int nhb_sym,
01302 FLGR_ComputeNhb2D computeNhb) {
01303 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_2D(fgINT16,flgr2d_get_neighborhood_unfolded);
01304 }
01305 void flgr2d_anti_raster_slide_window_unfolded_fgINT32(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb, int nhb_sym,
01306 FLGR_ComputeNhb2D computeNhb) {
01307 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_2D(fgINT32,flgr2d_get_neighborhood_unfolded);
01308 }
01309 void flgr2d_anti_raster_slide_window_unfolded_fgFLOAT32(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb,int nhb_sym,
01310 FLGR_ComputeNhb2D computeNhb) {
01311 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_2D(fgFLOAT32,flgr2d_get_neighborhood_unfolded);
01312 }
01313 void flgr2d_anti_raster_slide_window_unfolded_fgFLOAT64(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb,int nhb_sym,
01314 FLGR_ComputeNhb2D computeNhb) {
01315 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_2D(fgFLOAT64,flgr2d_get_neighborhood_unfolded);
01316 }
01317
01318
01320
01328
01329 FLGR_Ret flgr2d_anti_raster_slide_window_unfolded(FLGR_Data2D *imgdest,FLGR_Data2D *imgsrc,FLGR_Data2D *nhb,
01330 int nhb_sym, FLGR_ComputeNhb2D computeNhb) {
01331 FLGR_Ret ret;
01332
01333
01334
01335 if((imgdest==NULL) || (imgsrc==NULL) || (nhb==NULL)) {
01336 POST_ERROR("Null objects\n");
01337 return FLGR_RET_NULL_OBJECT;
01338 }
01339
01340 if((ret = flgr2d_is_data_same_attributes(imgdest,imgsrc,__FUNCTION__)) != FLGR_RET_OK) return ret;
01341
01342 if((ret=flgr2d_is_data_same_type(imgdest,nhb))!=FLGR_RET_OK) {
01343 POST_ERROR("data types differents\n");
01344 return ret;
01345 }
01346
01347 if((ret=flgr2d_is_data_same_spp(imgdest,nhb))!=FLGR_RET_OK) {
01348 POST_ERROR("spp differents\n");
01349 return ret;
01350 }
01351
01352 FLGR_DISPATCH_PROCEDURE(imgdest->type,flgr2d_anti_raster_slide_window_unfolded,imgdest,imgsrc,nhb,nhb_sym,computeNhb);
01353
01354 }
01355
01356
01357
01358
01359
01360
01361
01362
01363
01364
01365
01366
01367
01368 void flgr2d_raster_slide_window_before_op_fgBIT(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *imgarith, FLGR_Data2D *nhb,
01369 int nhb_sym,
01370 FLGR_ComputeNhb2D computeNhb,
01371 FLGR_ComputeArith computeArith) {
01372 FLGR_MACRO_RASTER_SLIDE_WINDOW_2D_BEFORE_OP(fgBIT);
01373 }
01374
01375 void flgr2d_raster_slide_window_before_op_fgUINT8(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *imgarith, FLGR_Data2D *nhb,
01376 int nhb_sym,
01377 FLGR_ComputeNhb2D computeNhb,
01378 FLGR_ComputeArith computeArith) {
01379 FLGR_MACRO_RASTER_SLIDE_WINDOW_2D_BEFORE_OP(fgUINT8);
01380 }
01381
01382 void flgr2d_raster_slide_window_before_op_fgUINT16(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *imgarith, FLGR_Data2D *nhb,
01383 int nhb_sym,
01384 FLGR_ComputeNhb2D computeNhb,
01385 FLGR_ComputeArith computeArith) {
01386 FLGR_MACRO_RASTER_SLIDE_WINDOW_2D_BEFORE_OP(fgUINT16);
01387 }
01388
01389 void flgr2d_raster_slide_window_before_op_fgUINT32(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *imgarith, FLGR_Data2D *nhb,
01390 int nhb_sym,
01391 FLGR_ComputeNhb2D computeNhb,
01392 FLGR_ComputeArith computeArith) {
01393 FLGR_MACRO_RASTER_SLIDE_WINDOW_2D_BEFORE_OP(fgUINT32);
01394 }
01395
01396 void flgr2d_raster_slide_window_before_op_fgINT8(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *imgarith, FLGR_Data2D *nhb,
01397 int nhb_sym,
01398 FLGR_ComputeNhb2D computeNhb,
01399 FLGR_ComputeArith computeArith) {
01400 FLGR_MACRO_RASTER_SLIDE_WINDOW_2D_BEFORE_OP(fgINT8);
01401 }
01402
01403 void flgr2d_raster_slide_window_before_op_fgINT16(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *imgarith, FLGR_Data2D *nhb,
01404 int nhb_sym,
01405 FLGR_ComputeNhb2D computeNhb,
01406 FLGR_ComputeArith computeArith) {
01407 FLGR_MACRO_RASTER_SLIDE_WINDOW_2D_BEFORE_OP(fgINT16);
01408 }
01409
01410 void flgr2d_raster_slide_window_before_op_fgINT32(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *imgarith, FLGR_Data2D *nhb,
01411 int nhb_sym,
01412 FLGR_ComputeNhb2D computeNhb,
01413 FLGR_ComputeArith computeArith) {
01414 FLGR_MACRO_RASTER_SLIDE_WINDOW_2D_BEFORE_OP(fgINT32);
01415 }
01416
01417 void flgr2d_raster_slide_window_before_op_fgFLOAT32(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *imgarith, FLGR_Data2D *nhb,
01418 int nhb_sym,
01419 FLGR_ComputeNhb2D computeNhb,
01420 FLGR_ComputeArith computeArith) {
01421 FLGR_MACRO_RASTER_SLIDE_WINDOW_2D_BEFORE_OP(fgFLOAT32);
01422 }
01423
01424 void flgr2d_raster_slide_window_before_op_fgFLOAT64(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *imgarith, FLGR_Data2D *nhb,
01425 int nhb_sym,
01426 FLGR_ComputeNhb2D computeNhb,
01427 FLGR_ComputeArith computeArith) {
01428 FLGR_MACRO_RASTER_SLIDE_WINDOW_2D_BEFORE_OP(fgFLOAT64);
01429 }
01430
01431
01432
01433
01434 void flgr2d_anti_raster_slide_window_before_op_fgBIT(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *imgarith, FLGR_Data2D *nhb,
01435 int nhb_sym,
01436 FLGR_ComputeNhb2D computeNhb,
01437 FLGR_ComputeArith computeArith) {
01438 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_2D_BEFORE_OP(fgBIT);
01439 }
01440
01441 void flgr2d_anti_raster_slide_window_before_op_fgUINT8(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *imgarith, FLGR_Data2D *nhb,
01442 int nhb_sym,
01443 FLGR_ComputeNhb2D computeNhb,
01444 FLGR_ComputeArith computeArith) {
01445 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_2D_BEFORE_OP(fgUINT8);
01446 }
01447
01448 void flgr2d_anti_raster_slide_window_before_op_fgUINT16(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *imgarith, FLGR_Data2D *nhb,
01449 int nhb_sym,
01450 FLGR_ComputeNhb2D computeNhb,
01451 FLGR_ComputeArith computeArith) {
01452 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_2D_BEFORE_OP(fgUINT16);
01453 }
01454
01455 void flgr2d_anti_raster_slide_window_before_op_fgUINT32(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *imgarith, FLGR_Data2D *nhb,
01456 int nhb_sym,
01457 FLGR_ComputeNhb2D computeNhb,
01458 FLGR_ComputeArith computeArith) {
01459 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_2D_BEFORE_OP(fgUINT32);
01460 }
01461
01462 void flgr2d_anti_raster_slide_window_before_op_fgINT8(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *imgarith, FLGR_Data2D *nhb,
01463 int nhb_sym,
01464 FLGR_ComputeNhb2D computeNhb,
01465 FLGR_ComputeArith computeArith) {
01466 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_2D_BEFORE_OP(fgINT8 );
01467 }
01468
01469 void flgr2d_anti_raster_slide_window_before_op_fgINT16(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *imgarith, FLGR_Data2D *nhb,
01470 int nhb_sym,
01471 FLGR_ComputeNhb2D computeNhb,
01472 FLGR_ComputeArith computeArith) {
01473 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_2D_BEFORE_OP(fgINT16);
01474 }
01475
01476 void flgr2d_anti_raster_slide_window_before_op_fgINT32(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *imgarith, FLGR_Data2D *nhb,
01477 int nhb_sym,
01478 FLGR_ComputeNhb2D computeNhb,
01479 FLGR_ComputeArith computeArith) {
01480 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_2D_BEFORE_OP(fgINT32);
01481 }
01482
01483 void flgr2d_anti_raster_slide_window_before_op_fgFLOAT32(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *imgarith, FLGR_Data2D *nhb,
01484 int nhb_sym,
01485 FLGR_ComputeNhb2D computeNhb,
01486 FLGR_ComputeArith computeArith) {
01487 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_2D_BEFORE_OP(fgFLOAT32);
01488 }
01489
01490 void flgr2d_anti_raster_slide_window_before_op_fgFLOAT64(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *imgarith, FLGR_Data2D *nhb,
01491 int nhb_sym,
01492 FLGR_ComputeNhb2D computeNhb,
01493 FLGR_ComputeArith computeArith) {
01494 FLGR_MACRO_ANTIRASTER_SLIDE_WINDOW_2D_BEFORE_OP(fgFLOAT64);
01495 }
01496
01497
01498
01499
01500
01501
01502
01503
01504
01505
01506 #define FLGR_APPLY_RASTER_SCAN_METHOD(dtype) \
01507 FLGR_Vector *vec = flgr_vector_create(nhb->spp,nhb->type); \
01508 int j; \
01509 int w = nhb->length; \
01510 \
01511 \
01512 \
01513 flgr_vector_populate_from_scalar_##dtype(vec,0); \
01514 \
01515 for(j=(w/2+1);j<w;j++) flgr1d_set_data_vector_##dtype(nhb,j,vec); \
01516 \
01517 flgr_vector_destroy(vec); \
01518 \
01519 return
01520
01521 void flgr1d_apply_raster_scan_method_fgBIT(FLGR_Data1D *nhb) {
01522 FLGR_APPLY_RASTER_SCAN_METHOD(fgBIT);
01523 }
01524 void flgr1d_apply_raster_scan_method_fgUINT8(FLGR_Data1D *nhb) {
01525 FLGR_APPLY_RASTER_SCAN_METHOD(fgUINT8);
01526 }
01527 void flgr1d_apply_raster_scan_method_fgUINT16(FLGR_Data1D *nhb) {
01528 FLGR_APPLY_RASTER_SCAN_METHOD(fgUINT16);
01529 }
01530 void flgr1d_apply_raster_scan_method_fgUINT32(FLGR_Data1D *nhb) {
01531 FLGR_APPLY_RASTER_SCAN_METHOD(fgUINT32);
01532 }
01533 void flgr1d_apply_raster_scan_method_fgINT8(FLGR_Data1D *nhb) {
01534 FLGR_APPLY_RASTER_SCAN_METHOD(fgINT8);
01535 }
01536 void flgr1d_apply_raster_scan_method_fgINT16(FLGR_Data1D *nhb) {
01537 FLGR_APPLY_RASTER_SCAN_METHOD(fgINT16);
01538 }
01539 void flgr1d_apply_raster_scan_method_fgINT32(FLGR_Data1D *nhb) {
01540 FLGR_APPLY_RASTER_SCAN_METHOD(fgINT32);
01541 }
01542 void flgr1d_apply_raster_scan_method_fgFLOAT32(FLGR_Data1D *nhb) {
01543 FLGR_APPLY_RASTER_SCAN_METHOD(fgFLOAT32);
01544 }
01545 void flgr1d_apply_raster_scan_method_fgFLOAT64(FLGR_Data1D *nhb) {
01546 FLGR_APPLY_RASTER_SCAN_METHOD(fgFLOAT64);
01547 }
01548
01550
01555
01556 FLGR_Ret flgr1d_apply_raster_scan_method(FLGR_Data1D *nhb) {
01557
01558
01559 if(nhb==NULL) {
01560 POST_ERROR("Null objects!\n");
01561 return FLGR_RET_NULL_OBJECT;
01562 }
01563
01564 FLGR_DISPATCH_PROCEDURE(nhb->type,flgr1d_apply_raster_scan_method,nhb);
01565 }
01566
01567
01568
01569
01570
01571 #define FLGR_APPLY_ANTIRASTER_SCAN_METHOD_1D(dtype) \
01572 FLGR_Vector *vec = flgr_vector_create(nhb->spp,nhb->type); \
01573 int j; \
01574 int w = nhb->length; \
01575 \
01576 \
01577 \
01578 flgr_vector_populate_from_scalar_##dtype(vec,0); \
01579 \
01580 for(j=0;j<w/2;j++) flgr1d_set_data_vector_##dtype(nhb,j,vec); \
01581 \
01582 flgr_vector_destroy(vec); \
01583 \
01584 return
01585
01586 void flgr1d_apply_anti_raster_scan_method_fgBIT(FLGR_Data1D *nhb) {
01587 FLGR_APPLY_ANTIRASTER_SCAN_METHOD_1D(fgBIT);
01588 }
01589 void flgr1d_apply_anti_raster_scan_method_fgUINT8(FLGR_Data1D *nhb) {
01590 FLGR_APPLY_ANTIRASTER_SCAN_METHOD_1D(fgUINT8);
01591 }
01592 void flgr1d_apply_anti_raster_scan_method_fgUINT16(FLGR_Data1D *nhb) {
01593 FLGR_APPLY_ANTIRASTER_SCAN_METHOD_1D(fgUINT16);
01594 }
01595 void flgr1d_apply_anti_raster_scan_method_fgUINT32(FLGR_Data1D *nhb) {
01596 FLGR_APPLY_ANTIRASTER_SCAN_METHOD_1D(fgUINT32);
01597 }
01598 void flgr1d_apply_anti_raster_scan_method_fgINT8(FLGR_Data1D *nhb) {
01599 FLGR_APPLY_ANTIRASTER_SCAN_METHOD_1D(fgINT8);
01600 }
01601 void flgr1d_apply_anti_raster_scan_method_fgINT16(FLGR_Data1D *nhb) {
01602 FLGR_APPLY_ANTIRASTER_SCAN_METHOD_1D(fgINT16);
01603 }
01604 void flgr1d_apply_anti_raster_scan_method_fgINT32(FLGR_Data1D *nhb) {
01605 FLGR_APPLY_ANTIRASTER_SCAN_METHOD_1D(fgINT32);
01606 }
01607 void flgr1d_apply_anti_raster_scan_method_fgFLOAT32(FLGR_Data1D *nhb) {
01608 FLGR_APPLY_ANTIRASTER_SCAN_METHOD_1D(fgFLOAT32);
01609 }
01610 void flgr1d_apply_anti_raster_scan_method_fgFLOAT64(FLGR_Data1D *nhb) {
01611 FLGR_APPLY_ANTIRASTER_SCAN_METHOD_1D(fgFLOAT64);
01612 }
01613
01615
01620
01621 FLGR_Ret flgr1d_apply_anti_raster_scan_method(FLGR_Data1D *nhb) {
01622
01623
01624 if(nhb==NULL) {
01625 POST_ERROR("Null objects!\n");
01626 return FLGR_RET_NULL_OBJECT;
01627 }
01628
01629 FLGR_DISPATCH_PROCEDURE(nhb->type,flgr1d_apply_anti_raster_scan_method,nhb);
01630 }
01631
01632
01633
01634
01635
01636
01637
01638
01639
01640 #define FLGR_APPLY_RASTER_SCAN_METHOD_2D(dtype) \
01641 FLGR_Vector *vec = flgr_vector_create(nhb->spp,nhb->type); \
01642 int i,j; \
01643 int w = nhb->size_x; \
01644 int h = nhb->size_y; \
01645 \
01646 \
01647 \
01648 flgr_vector_populate_from_scalar_##dtype(vec,0); \
01649 \
01650 for(j=(w/2+1);j<w;j++) flgr2d_set_data_vector_##dtype(nhb,h/2,j,vec); \
01651 \
01652 for(i = (h/2)+1 ; i<h ; i++) { \
01653 for(j=0;j<w;j++) flgr2d_set_data_vector_##dtype(nhb,i,j,vec); \
01654 } \
01655 \
01656 flgr_vector_destroy(vec); \
01657 \
01658 return
01659
01660 void flgr2d_apply_raster_scan_method_fgBIT(FLGR_Data2D *nhb) {
01661 FLGR_APPLY_RASTER_SCAN_METHOD_2D(fgBIT);
01662 }
01663 void flgr2d_apply_raster_scan_method_fgUINT8(FLGR_Data2D *nhb) {
01664 FLGR_APPLY_RASTER_SCAN_METHOD_2D(fgUINT8);
01665 }
01666 void flgr2d_apply_raster_scan_method_fgUINT16(FLGR_Data2D *nhb) {
01667 FLGR_APPLY_RASTER_SCAN_METHOD_2D(fgUINT16);
01668 }
01669 void flgr2d_apply_raster_scan_method_fgUINT32(FLGR_Data2D *nhb) {
01670 FLGR_APPLY_RASTER_SCAN_METHOD_2D(fgUINT32);
01671 }
01672 void flgr2d_apply_raster_scan_method_fgINT8(FLGR_Data2D *nhb) {
01673 FLGR_APPLY_RASTER_SCAN_METHOD_2D(fgINT8);
01674 }
01675 void flgr2d_apply_raster_scan_method_fgINT16(FLGR_Data2D *nhb) {
01676 FLGR_APPLY_RASTER_SCAN_METHOD_2D(fgINT16);
01677 }
01678 void flgr2d_apply_raster_scan_method_fgINT32(FLGR_Data2D *nhb) {
01679 FLGR_APPLY_RASTER_SCAN_METHOD_2D(fgINT32);
01680 }
01681 void flgr2d_apply_raster_scan_method_fgFLOAT32(FLGR_Data2D *nhb) {
01682 FLGR_APPLY_RASTER_SCAN_METHOD_2D(fgFLOAT32);
01683 }
01684 void flgr2d_apply_raster_scan_method_fgFLOAT64(FLGR_Data2D *nhb) {
01685 FLGR_APPLY_RASTER_SCAN_METHOD_2D(fgFLOAT64);
01686 }
01687
01689
01694
01695 FLGR_Ret flgr2d_apply_raster_scan_method(FLGR_Data2D *nhb) {
01696
01697
01698 if(nhb==NULL) {
01699 POST_ERROR("Null objects!\n");
01700 return FLGR_RET_NULL_OBJECT;
01701 }
01702
01703 FLGR_DISPATCH_PROCEDURE(nhb->type,flgr2d_apply_raster_scan_method,nhb);
01704 }
01705
01706
01707
01708
01709
01710 #define FLGR_APPLY_ANTIRASTER_SCAN_METHOD_2D(dtype) \
01711 FLGR_Vector *vec = flgr_vector_create(nhb->spp,nhb->type); \
01712 int i,j; \
01713 int w = nhb->size_x; \
01714 int h = nhb->size_y; \
01715 \
01716 \
01717 \
01718 flgr_vector_populate_from_scalar_##dtype(vec,0); \
01719 \
01720 for(j=0;j<w/2;j++) flgr2d_set_data_vector_##dtype(nhb,h/2,j,vec); \
01721 \
01722 for(i = 0 ; i<h/2 ; i++) { \
01723 for(j=0;j<w;j++) flgr2d_set_data_vector_##dtype(nhb,i,j,vec); \
01724 } \
01725 \
01726 flgr_vector_destroy(vec); \
01727 \
01728 return
01729
01730 void flgr2d_apply_anti_raster_scan_method_fgBIT(FLGR_Data2D *nhb) {
01731 FLGR_APPLY_ANTIRASTER_SCAN_METHOD_2D(fgBIT);
01732 }
01733 void flgr2d_apply_anti_raster_scan_method_fgUINT8(FLGR_Data2D *nhb) {
01734 FLGR_APPLY_ANTIRASTER_SCAN_METHOD_2D(fgUINT8);
01735 }
01736 void flgr2d_apply_anti_raster_scan_method_fgUINT16(FLGR_Data2D *nhb) {
01737 FLGR_APPLY_ANTIRASTER_SCAN_METHOD_2D(fgUINT16);
01738 }
01739 void flgr2d_apply_anti_raster_scan_method_fgUINT32(FLGR_Data2D *nhb) {
01740 FLGR_APPLY_ANTIRASTER_SCAN_METHOD_2D(fgUINT32);
01741 }
01742 void flgr2d_apply_anti_raster_scan_method_fgINT8(FLGR_Data2D *nhb) {
01743 FLGR_APPLY_ANTIRASTER_SCAN_METHOD_2D(fgINT8);
01744 }
01745 void flgr2d_apply_anti_raster_scan_method_fgINT16(FLGR_Data2D *nhb) {
01746 FLGR_APPLY_ANTIRASTER_SCAN_METHOD_2D(fgINT16);
01747 }
01748 void flgr2d_apply_anti_raster_scan_method_fgINT32(FLGR_Data2D *nhb) {
01749 FLGR_APPLY_ANTIRASTER_SCAN_METHOD_2D(fgINT32);
01750 }
01751 void flgr2d_apply_anti_raster_scan_method_fgFLOAT32(FLGR_Data2D *nhb) {
01752 FLGR_APPLY_ANTIRASTER_SCAN_METHOD_2D(fgFLOAT32);
01753 }
01754 void flgr2d_apply_anti_raster_scan_method_fgFLOAT64(FLGR_Data2D *nhb) {
01755 FLGR_APPLY_ANTIRASTER_SCAN_METHOD_2D(fgFLOAT64);
01756 }
01757
01759
01764
01765 FLGR_Ret flgr2d_apply_anti_raster_scan_method(FLGR_Data2D *nhb) {
01766
01767
01768 if(nhb==NULL) {
01769 POST_ERROR("Null objects!\n");
01770 return FLGR_RET_NULL_OBJECT;
01771 }
01772
01773 FLGR_DISPATCH_PROCEDURE(nhb->type,flgr2d_apply_anti_raster_scan_method,nhb);
01774 }
01775
01776
01777
01778
01779
01780
01781
01782
01783
01784
01785
01786
01787
01788
01789
01790
01791
01793
01795 #define FLGR_MACRO_RASTER_SLIDE_STRUCTURING_FUNCTION_1D(dtype,getnhbop) \
01796 int j,w; \
01797 fgINT32 *psemap = (fgINT32 *) semap->array; \
01798 FLGR_Vector *result; \
01799 FLGR_Data1D *nhbrs; \
01800 FLGR_NhbBox1D *extr; \
01801 int dynsew; \
01802 int spp = datsrc->spp; \
01803 int type = datsrc->type; \
01804 \
01805 \
01806 \
01807 w=datsrc->length; \
01808 \
01809 result = flgr_vector_create(datsrc->spp,datsrc->type); \
01810 \
01811 for(j=0 ; j<w ; j++) { \
01812 dynsew = flgr_get_array_fgINT32(psemap, j); \
01813 \
01814 nhbrs = flgr1d_create_neighborhood((int) dynsew,spp,type,shape); \
01815 extr = flgr1d_create_neighbor_box(nhbrs); \
01816 \
01817 getnhbop##_##dtype(extr,datsrc,nhbrs,j); \
01818 (*computeNhb)(result,extr); \
01819 flgr1d_set_data_vector_##dtype(datdest,j,result); \
01820 \
01821 flgr1d_destroy(nhbrs); \
01822 flgr1d_destroy_neighbor_box(extr); \
01823 \
01824 } \
01825 \
01826 flgr_vector_destroy(result); \
01827 \
01828 return
01829
01830
01831
01832 void flgr1d_raster_slide_structuring_function_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *datsrc,
01833 FLGR_Data1D *semap, FLGR_Shape shape, FLGR_ComputeNhb1D computeNhb) {
01834 FLGR_MACRO_RASTER_SLIDE_STRUCTURING_FUNCTION_1D(fgBIT,flgr1d_get_neighborhood);
01835 }
01836 void flgr1d_raster_slide_structuring_function_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *datsrc,
01837 FLGR_Data1D *semap, FLGR_Shape shape, FLGR_ComputeNhb1D computeNhb) {
01838 FLGR_MACRO_RASTER_SLIDE_STRUCTURING_FUNCTION_1D(fgUINT8,flgr1d_get_neighborhood);
01839 }
01840 void flgr1d_raster_slide_structuring_function_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *datsrc,
01841 FLGR_Data1D *semap, FLGR_Shape shape, FLGR_ComputeNhb1D computeNhb) {
01842 FLGR_MACRO_RASTER_SLIDE_STRUCTURING_FUNCTION_1D(fgUINT16,flgr1d_get_neighborhood);
01843 }
01844 void flgr1d_raster_slide_structuring_function_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *datsrc,
01845 FLGR_Data1D *semap, FLGR_Shape shape, FLGR_ComputeNhb1D computeNhb) {
01846 FLGR_MACRO_RASTER_SLIDE_STRUCTURING_FUNCTION_1D(fgUINT32,flgr1d_get_neighborhood);
01847 }
01848 void flgr1d_raster_slide_structuring_function_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *datsrc,
01849 FLGR_Data1D *semap, FLGR_Shape shape, FLGR_ComputeNhb1D computeNhb) {
01850 FLGR_MACRO_RASTER_SLIDE_STRUCTURING_FUNCTION_1D(fgINT8,flgr1d_get_neighborhood);
01851 }
01852 void flgr1d_raster_slide_structuring_function_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *datsrc,
01853 FLGR_Data1D *semap, FLGR_Shape shape, FLGR_ComputeNhb1D computeNhb) {
01854 FLGR_MACRO_RASTER_SLIDE_STRUCTURING_FUNCTION_1D(fgINT16,flgr1d_get_neighborhood);
01855 }
01856 void flgr1d_raster_slide_structuring_function_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *datsrc,
01857 FLGR_Data1D *semap, FLGR_Shape shape, FLGR_ComputeNhb1D computeNhb) {
01858 FLGR_MACRO_RASTER_SLIDE_STRUCTURING_FUNCTION_1D(fgINT32,flgr1d_get_neighborhood);
01859 }
01860 void flgr1d_raster_slide_structuring_function_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *datsrc,
01861 FLGR_Data1D *semap, FLGR_Shape shape, FLGR_ComputeNhb1D computeNhb) {
01862 FLGR_MACRO_RASTER_SLIDE_STRUCTURING_FUNCTION_1D(fgFLOAT32,flgr1d_get_neighborhood);
01863 }
01864 void flgr1d_raster_slide_structuring_function_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *datsrc,
01865 FLGR_Data1D *semap, FLGR_Shape shape, FLGR_ComputeNhb1D computeNhb) {
01866 FLGR_MACRO_RASTER_SLIDE_STRUCTURING_FUNCTION_1D(fgFLOAT64,flgr1d_get_neighborhood);
01867 }
01868
01870
01878
01879 FLGR_Ret flgr1d_raster_slide_structuring_function(FLGR_Data1D *datdest, FLGR_Data1D *datsrc,
01880 FLGR_Data1D *semap, FLGR_Shape shape,
01881 FLGR_ComputeNhb1D computeNhb) {
01882 FLGR_Ret ret;
01883
01884
01885
01886 if((datdest==NULL) || (datsrc==NULL) || (semap==NULL)) {
01887 POST_ERROR("Null objects\n");
01888 return FLGR_RET_NULL_OBJECT;
01889 }
01890
01891 if(semap->type != FLGR_INT32) {
01892 POST_ERROR("semap type must be FLGR_INT32\n");
01893 return FLGR_RET_PARAM_ERROR;
01894 }
01895
01896 if((ret = flgr1d_is_data_same_attributes(datdest,datsrc,__FUNCTION__)) != FLGR_RET_OK) return ret;
01897 if((ret = flgr1d_is_data_same_length(datdest,semap)) != FLGR_RET_OK) {
01898 POST_ERROR("semap size does not correspond to datdest or datsrc size\n");
01899 return ret;
01900 }
01901
01902 FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_raster_slide_structuring_function,datdest,datsrc,
01903 semap,shape,computeNhb);
01904
01905 }
01906
01907
01908
01909
01911
01913 #define FLGR_MACRO_RASTER_SLIDE_FUNCTION_2D(dtype,get_nhb_op) \
01914 int i,j,w,h,spp_map=semap->spp; \
01915 int spp=datsrc->spp; \
01916 int type=datsrc->type; \
01917 fgINT32 *psemap; \
01918 FLGR_Vector *result; \
01919 FLGR_Data2D *nhbtmp,*nhbrs; \
01920 FLGR_NhbBox2D *extr; \
01921 int dynsew, dynseh, dynseteta; \
01922 \
01923 \
01924 \
01925 w=datsrc->size_x; \
01926 h=datsrc->size_y; \
01927 \
01928 result = flgr_vector_create(spp,type); \
01929 \
01930 \
01931 for(i=0 ; i<h; i++) { \
01932 psemap = (fgINT32 *) semap->array[i]; \
01933 \
01934 for(j=0 ; j<w ; j++) { \
01935 \
01936 if(spp_map<=1) { \
01937 dynsew = flgr_get_array_fgINT32(psemap,j); \
01938 dynsew = ((dynsew>>1)<<1)+1; \
01939 nhbrs = flgr2d_create_neighborhood(dynsew,dynsew,spp, \
01940 type,shape,FLGR_8_CONNEX); \
01941 }else if(spp_map<=2) { \
01942 dynsew = flgr_get_array_fgINT32(psemap,j*spp_map); \
01943 dynseh = flgr_get_array_fgINT32(psemap,j*spp_map+1); \
01944 dynsew = ((dynsew>>1)<<1)+1; \
01945 dynseh = ((dynseh>>1)<<1)+1; \
01946 nhbrs = flgr2d_create_neighborhood(dynseh,dynsew,spp, \
01947 type,shape,FLGR_8_CONNEX); \
01948 }else { \
01949 dynsew = flgr_get_array_fgINT32(psemap,j*spp_map); \
01950 dynseh = flgr_get_array_fgINT32(psemap,j*spp_map+1); \
01951 dynseteta = flgr_get_array_fgINT32(psemap,j*spp_map+2); \
01952 dynsew = (dynsew<<1)+1; \
01953 dynseh = (dynseh<<1)+1; \
01954 nhbrs = flgr2d_create_##dtype(dynseh,dynsew,spp, \
01955 shape,FLGR_8_CONNEX); \
01956 nhbtmp = flgr2d_create_##dtype(dynseh,dynsew,spp, \
01957 shape,FLGR_8_CONNEX); \
01958 flgr2d_fill_neighborhood_##dtype(nhbtmp,shape,dynsew,dynseh); \
01959 flgr2d_rotate_center_##dtype(nhbrs,nhbtmp,dynseteta); \
01960 flgr2d_destroy(nhbtmp); \
01961 } \
01962 \
01963 extr = flgr2d_create_neighbor_box(nhbrs); \
01964 \
01965 get_nhb_op##_##dtype(extr,datsrc,nhbrs,i,j); \
01966 \
01967 (*computeNhb)(result,extr); \
01968 \
01969 flgr2d_set_data_vector_##dtype(datdest,i,j,result); \
01970 \
01971 flgr2d_destroy_neighbor_box(extr); \
01972 flgr2d_destroy(nhbrs); \
01973 } \
01974 } \
01975 \
01976 flgr_vector_destroy(result); \
01977 \
01978 return
01979
01980
01981
01982
01983 void flgr2d_raster_slide_structuring_function_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *datsrc,
01984 FLGR_Data2D *semap, FLGR_Shape shape,
01985 FLGR_ComputeNhb2D computeNhb) {
01986 FLGR_MACRO_RASTER_SLIDE_FUNCTION_2D(fgBIT,flgr2d_get_neighborhood);
01987 }
01988 void flgr2d_raster_slide_structuring_function_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *datsrc,
01989 FLGR_Data2D *semap, FLGR_Shape shape,
01990 FLGR_ComputeNhb2D computeNhb) {
01991 FLGR_MACRO_RASTER_SLIDE_FUNCTION_2D(fgUINT8,flgr2d_get_neighborhood);
01992 }
01993 void flgr2d_raster_slide_structuring_function_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *datsrc,
01994 FLGR_Data2D *semap, FLGR_Shape shape,
01995 FLGR_ComputeNhb2D computeNhb) {
01996 FLGR_MACRO_RASTER_SLIDE_FUNCTION_2D(fgUINT16,flgr2d_get_neighborhood);
01997 }
01998 void flgr2d_raster_slide_structuring_function_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *datsrc,
01999 FLGR_Data2D *semap, FLGR_Shape shape,
02000 FLGR_ComputeNhb2D computeNhb) {
02001 FLGR_MACRO_RASTER_SLIDE_FUNCTION_2D(fgUINT32,flgr2d_get_neighborhood);
02002 }
02003 void flgr2d_raster_slide_structuring_function_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *datsrc,
02004 FLGR_Data2D *semap, FLGR_Shape shape,
02005 FLGR_ComputeNhb2D computeNhb) {
02006 FLGR_MACRO_RASTER_SLIDE_FUNCTION_2D(fgINT8,flgr2d_get_neighborhood);
02007 }
02008 void flgr2d_raster_slide_structuring_function_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *datsrc,
02009 FLGR_Data2D *semap, FLGR_Shape shape,
02010 FLGR_ComputeNhb2D computeNhb) {
02011 FLGR_MACRO_RASTER_SLIDE_FUNCTION_2D(fgINT16,flgr2d_get_neighborhood);
02012 }
02013 void flgr2d_raster_slide_structuring_function_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *datsrc,
02014 FLGR_Data2D *semap, FLGR_Shape shape,
02015 FLGR_ComputeNhb2D computeNhb) {
02016 FLGR_MACRO_RASTER_SLIDE_FUNCTION_2D(fgINT32,flgr2d_get_neighborhood);
02017 }
02018 void flgr2d_raster_slide_structuring_function_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *datsrc,
02019 FLGR_Data2D *semap, FLGR_Shape shape,
02020 FLGR_ComputeNhb2D computeNhb) {
02021 FLGR_MACRO_RASTER_SLIDE_FUNCTION_2D(fgFLOAT32,flgr2d_get_neighborhood);
02022 }
02023 void flgr2d_raster_slide_structuring_function_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *datsrc,
02024 FLGR_Data2D *semap, FLGR_Shape shape,
02025 FLGR_ComputeNhb2D computeNhb) {
02026 FLGR_MACRO_RASTER_SLIDE_FUNCTION_2D(fgFLOAT64,flgr2d_get_neighborhood);
02027 }
02028
02030
02053
02054 FLGR_Ret flgr2d_raster_slide_structuring_function(FLGR_Data2D *datdest, FLGR_Data2D *datsrc,
02055 FLGR_Data2D *semap, FLGR_Shape shape,
02056 FLGR_ComputeNhb2D computeNhb) {
02057 FLGR_Ret ret;
02058
02059
02060
02061 if((datdest==NULL) || (datsrc==NULL) || (semap==NULL)) {
02062 POST_ERROR("Null objects\n");
02063 return FLGR_RET_NULL_OBJECT;
02064 }
02065
02066 if(semap->type != FLGR_INT32) {
02067 POST_ERROR("semap type must be FLGR_INT32\n");
02068 return FLGR_RET_PARAM_ERROR;
02069 }
02070
02071 if((ret = flgr2d_is_data_same_attributes(datdest,datsrc,__FUNCTION__)) != FLGR_RET_OK) return ret;
02072 if((ret = flgr2d_is_data_same_size(datdest,semap)) != FLGR_RET_OK) {
02073 POST_ERROR("semap size does not correspond to datdest or datsrc size\n");
02074 return ret;
02075 }
02076
02077
02078 FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_raster_slide_structuring_function,datdest,datsrc,
02079 semap,shape,computeNhb);
02080
02081 }
02082
02083
02084
02085
02086
02087