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 #include <math.h>
00026 #include <flgrCoreDispatch.h>
00027 #include <flgrCoreSlideWindow.h>
00028 #include <flgrCoreNhbManage.h>
00029 #include "flgrLinearKerOp.h"
00030 #include "flgrLinearConvolution.h"
00031
00040 void flgr1d_convolution_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb) {
00041 flgr_no_define_type_function(FLGR_BIT);
00042 }
00043 void flgr1d_convolution_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb) {
00044
00045 flgr1d_raster_slide_window_fgUINT8(datdest, datsrc, nhb, FLGR_NHB_NO_SYM, flgr1d_get_nhb_convolution_fgUINT8);
00046 }
00047 void flgr1d_convolution_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb) {
00048
00049 flgr1d_raster_slide_window_fgUINT16(datdest, datsrc, nhb, FLGR_NHB_NO_SYM, flgr1d_get_nhb_convolution_fgUINT16);
00050 }
00051 void flgr1d_convolution_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb) {
00052
00053 flgr1d_raster_slide_window_fgUINT32(datdest, datsrc, nhb, FLGR_NHB_NO_SYM, flgr1d_get_nhb_convolution_fgUINT32);
00054 }
00055 void flgr1d_convolution_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb) {
00056
00057 flgr1d_raster_slide_window_fgINT8(datdest, datsrc, nhb, FLGR_NHB_NO_SYM, flgr1d_get_nhb_convolution_fgINT8);
00058 }
00059 void flgr1d_convolution_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb) {
00060
00061 flgr1d_raster_slide_window_fgINT16(datdest, datsrc, nhb, FLGR_NHB_NO_SYM, flgr1d_get_nhb_convolution_fgINT16);
00062 }
00063 void flgr1d_convolution_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb) {
00064
00065 flgr1d_raster_slide_window_fgINT32(datdest, datsrc, nhb, FLGR_NHB_NO_SYM, flgr1d_get_nhb_convolution_fgINT32);
00066 }
00067 void flgr1d_convolution_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb) {
00068
00069 flgr1d_raster_slide_window_fgFLOAT32(datdest, datsrc, nhb, FLGR_NHB_NO_SYM, flgr1d_get_nhb_convolution_fgFLOAT32);
00070 }
00071 void flgr1d_convolution_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb) {
00072
00073 flgr1d_raster_slide_window_fgFLOAT64(datdest, datsrc, nhb, FLGR_NHB_NO_SYM, flgr1d_get_nhb_convolution_fgFLOAT64);
00074 }
00075
00076
00077
00079
00085
00086 FLGR_Ret flgr1d_convolution(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb) {
00087 FLGR_Ret ret;
00088
00089
00090
00091 if((datdest==NULL) || (datsrc==NULL) || (nhb==NULL)){
00092 POST_ERROR("Null objects!\n");
00093 return FLGR_RET_NULL_OBJECT;
00094 }
00095
00096 if((ret=flgr1d_is_data_same_attributes(datdest,datsrc,__FUNCTION__)) != FLGR_RET_OK) return ret;
00097
00098 FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_convolution,datdest,datsrc,nhb);
00099
00100 }
00101
00102
00103
00104
00105
00106
00107 void flgr1d_convolution_unfolded_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb) {
00108 flgr_no_define_type_function(FLGR_BIT);
00109 }
00110 void flgr1d_convolution_unfolded_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb) {
00111
00112 flgr1d_raster_slide_window_unfolded_fgUINT8(datdest, datsrc, nhb, FLGR_NHB_NO_SYM,
00113 flgr1d_get_nhb_convolution_fgUINT8);
00114 }
00115 void flgr1d_convolution_unfolded_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb) {
00116
00117 flgr1d_raster_slide_window_unfolded_fgUINT16(datdest, datsrc, nhb, FLGR_NHB_NO_SYM,
00118 flgr1d_get_nhb_convolution_fgUINT16);
00119 }
00120 void flgr1d_convolution_unfolded_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb) {
00121
00122 flgr1d_raster_slide_window_unfolded_fgUINT32(datdest, datsrc, nhb, FLGR_NHB_NO_SYM,
00123 flgr1d_get_nhb_convolution_fgUINT32);
00124 }
00125 void flgr1d_convolution_unfolded_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb) {
00126
00127 flgr1d_raster_slide_window_unfolded_fgINT8(datdest, datsrc, nhb, FLGR_NHB_NO_SYM,
00128 flgr1d_get_nhb_convolution_fgINT8);
00129 }
00130 void flgr1d_convolution_unfolded_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb) {
00131
00132 flgr1d_raster_slide_window_unfolded_fgINT16(datdest, datsrc, nhb, FLGR_NHB_NO_SYM,
00133 flgr1d_get_nhb_convolution_fgINT16);
00134 }
00135 void flgr1d_convolution_unfolded_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb) {
00136
00137 flgr1d_raster_slide_window_unfolded_fgINT32(datdest, datsrc, nhb, FLGR_NHB_NO_SYM,
00138 flgr1d_get_nhb_convolution_fgINT32);
00139 }
00140 void flgr1d_convolution_unfolded_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb) {
00141
00142 flgr1d_raster_slide_window_unfolded_fgFLOAT32(datdest, datsrc, nhb, FLGR_NHB_NO_SYM,
00143 flgr1d_get_nhb_convolution_fgFLOAT32);
00144 }
00145 void flgr1d_convolution_unfolded_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb) {
00146
00147 flgr1d_raster_slide_window_unfolded_fgFLOAT64(datdest, datsrc, nhb, FLGR_NHB_NO_SYM,
00148 flgr1d_get_nhb_convolution_fgFLOAT64);
00149 }
00150
00151
00152
00154
00160
00161 FLGR_Ret flgr1d_convolution_unfolded(FLGR_Data1D *datdest, FLGR_Data1D *datsrc, FLGR_Data1D *nhb) {
00162 FLGR_Ret ret;
00163
00164
00165
00166 if((datdest==NULL) || (datsrc==NULL) || (nhb==NULL)){
00167 POST_ERROR("Null objects!\n");
00168 return FLGR_RET_NULL_OBJECT;
00169 }
00170
00171 if((ret=flgr1d_is_data_same_attributes(datdest,datsrc,__FUNCTION__)) != FLGR_RET_OK) return ret;
00172
00173 FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_convolution_unfolded,datdest,datsrc,nhb);
00174
00175 }
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189 void flgr2d_convolution_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb) {
00190 flgr_no_define_type_function(FLGR_BIT);
00191 }
00192 void flgr2d_convolution_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb) {
00193
00194 flgr2d_raster_slide_window_fgUINT8(datdest, datsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_convolution_fgUINT8);
00195 }
00196 void flgr2d_convolution_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb) {
00197
00198 flgr2d_raster_slide_window_fgUINT16(datdest, datsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_convolution_fgUINT16);
00199 }
00200 void flgr2d_convolution_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb) {
00201
00202 flgr2d_raster_slide_window_fgUINT32(datdest, datsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_convolution_fgUINT32);
00203 }
00204 void flgr2d_convolution_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb) {
00205
00206 flgr2d_raster_slide_window_fgINT8(datdest, datsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_convolution_fgINT8);
00207 }
00208 void flgr2d_convolution_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb) {
00209
00210 flgr2d_raster_slide_window_fgINT16(datdest, datsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_convolution_fgINT16);
00211 }
00212 void flgr2d_convolution_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb) {
00213
00214 flgr2d_raster_slide_window_fgINT32(datdest, datsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_convolution_fgINT32);
00215 }
00216 void flgr2d_convolution_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb) {
00217
00218 flgr2d_raster_slide_window_fgFLOAT32(datdest, datsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_convolution_fgFLOAT32);
00219 }
00220 void flgr2d_convolution_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb) {
00221
00222 flgr2d_raster_slide_window_fgFLOAT64(datdest, datsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_convolution_fgFLOAT64);
00223 }
00224
00225
00226
00228
00234
00235 FLGR_Ret flgr2d_convolution(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb) {
00236 FLGR_Ret ret;
00237
00238
00239
00240 if((datdest==NULL) || (datsrc==NULL) || (nhb==NULL)){
00241 POST_ERROR("Null objects!\n");
00242 return FLGR_RET_NULL_OBJECT;
00243 }
00244
00245 if((ret=flgr2d_is_data_same_attributes(datdest,datsrc,__FUNCTION__)) != FLGR_RET_OK) return ret;
00246
00247 FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_convolution,datdest,datsrc,nhb);
00248
00249 }
00250
00251
00252
00253
00254
00255
00256 void flgr2d_convolution_unfolded_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb) {
00257 flgr_no_define_type_function(FLGR_BIT);
00258 }
00259 void flgr2d_convolution_unfolded_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb) {
00260
00261 flgr2d_raster_slide_window_unfolded_fgUINT8(datdest, datsrc, nhb, FLGR_NHB_NO_SYM,
00262 flgr2d_get_nhb_convolution_fgUINT8);
00263 }
00264 void flgr2d_convolution_unfolded_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb) {
00265
00266 flgr2d_raster_slide_window_unfolded_fgUINT16(datdest, datsrc, nhb, FLGR_NHB_NO_SYM,
00267 flgr2d_get_nhb_convolution_fgUINT16);
00268 }
00269 void flgr2d_convolution_unfolded_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb) {
00270
00271 flgr2d_raster_slide_window_unfolded_fgUINT32(datdest, datsrc, nhb, FLGR_NHB_NO_SYM,
00272 flgr2d_get_nhb_convolution_fgUINT32);
00273 }
00274 void flgr2d_convolution_unfolded_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb) {
00275
00276 flgr2d_raster_slide_window_unfolded_fgINT8(datdest, datsrc, nhb, FLGR_NHB_NO_SYM,
00277 flgr2d_get_nhb_convolution_fgINT8);
00278 }
00279 void flgr2d_convolution_unfolded_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb) {
00280
00281 flgr2d_raster_slide_window_unfolded_fgINT16(datdest, datsrc, nhb, FLGR_NHB_NO_SYM,
00282 flgr2d_get_nhb_convolution_fgINT16);
00283 }
00284 void flgr2d_convolution_unfolded_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb) {
00285
00286 flgr2d_raster_slide_window_unfolded_fgINT32(datdest, datsrc, nhb, FLGR_NHB_NO_SYM,
00287 flgr2d_get_nhb_convolution_fgINT32);
00288 }
00289 void flgr2d_convolution_unfolded_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb) {
00290
00291 flgr2d_raster_slide_window_unfolded_fgFLOAT32(datdest, datsrc, nhb, FLGR_NHB_NO_SYM,
00292 flgr2d_get_nhb_convolution_fgFLOAT32);
00293 }
00294 void flgr2d_convolution_unfolded_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb) {
00295
00296 flgr2d_raster_slide_window_unfolded_fgFLOAT64(datdest, datsrc, nhb, FLGR_NHB_NO_SYM,
00297 flgr2d_get_nhb_convolution_fgFLOAT64);
00298 }
00299
00300
00301
00303
00309
00310 FLGR_Ret flgr2d_convolution_unfolded(FLGR_Data2D *datdest, FLGR_Data2D *datsrc, FLGR_Data2D *nhb) {
00311 FLGR_Ret ret;
00312
00313
00314
00315 if((datdest==NULL) || (datsrc==NULL) || (nhb==NULL)){
00316 POST_ERROR("Null objects!\n");
00317 return FLGR_RET_NULL_OBJECT;
00318 }
00319
00320 if((ret=flgr2d_is_data_same_attributes(datdest,datsrc,__FUNCTION__)) != FLGR_RET_OK) return ret;
00321
00322 FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_convolution_unfolded,datdest,datsrc,nhb);
00323
00324 }
00325
00326